-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* compose tunnel agent: add docker API - passthrough API to docker on port 3001 - websocket impl for exec and logs * add option to show preevy_proxy url * tunnel-server: fix error handling * tunnel-server: fix ws auth
- Loading branch information
Roy Razon
authored
Aug 1, 2023
1 parent
85b9743
commit 9fbb7f5
Showing
32 changed files
with
989 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM node:18-alpine as development | ||
WORKDIR /app | ||
CMD [ "yarn", "-s", "dev" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import url from 'node:url' | ||
import { Logger } from '@preevy/common' | ||
import { SshState } from '../ssh' | ||
import { NotFoundError, respondAccordingToAccept, respondJson, tryHandler } from './http-server-helpers' | ||
|
||
const createApiServerHandler = ({ log, currentSshState }: { | ||
log: Logger | ||
currentSshState: ()=> Promise<SshState> | ||
}) => tryHandler({ log }, async (req, res) => { | ||
const { pathname: path } = url.parse(req.url || '') | ||
|
||
if (path === '/tunnels') { | ||
respondJson(res, await currentSshState()) | ||
return | ||
} | ||
|
||
if (path === '/healthz') { | ||
respondAccordingToAccept(req, res, 'OK') | ||
return | ||
} | ||
|
||
throw new NotFoundError() | ||
}) | ||
|
||
export default createApiServerHandler |
Oops, something went wrong.