diff --git a/Dockerfile b/Dockerfile
index dfe85ee..a5d6b8d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -28,4 +28,4 @@ COPY --from=builder /opt/converge/bin/agent \
/opt/converge/static/
COPY --from=builder /opt/converge/static/ /opt/converge/static/
-ENTRYPOINT ["/opt/converge/bin/converge", "-d", "/opt/converge/static" ]
+ENTRYPOINT ["/opt/converge/bin/converge", "-s", "/opt/converge/static", "-d", "/opt/converge/static" ]
diff --git a/cmd/converge/converge.go b/cmd/converge/converge.go
index 5c4edf4..7076b5a 100644
--- a/cmd/converge/converge.go
+++ b/cmd/converge/converge.go
@@ -48,14 +48,16 @@ func printHelp(msg string) {
"an embedded SSH server to provide interactive access to the end-user. This works\n" +
"both on linux and on windows.\n" +
"\n" +
- "-d
Using available existing tools such as + breakpoint in combination + with a websocket tunneling tool such as + wstunnel a similar solution can be + obtained. There are however some problems with these solutions that converge is + trying to address: +
+ ++
wsproxy
, an SSH proxy command that also talk to the server
+ to tell the user if a connection is accepted and if not why not. +
+ + ++ The steps involved are as follows: +
The setup is such that the connection from client (end-user) to server (agent on CI job) is end-to-end encrypted. The Converge server itself is no more than a bitpipe which pumps data between client and agent.
+Currently converge server still supports password based login but this will be disabled. + Image two people configuring an agent with the same id where one of the agents actually + gets it and other gets a new id. Now, with a password each user can access each other's + agents. This is of course highly confusing and undesirable. Converge server already support + authorized keys but this is not yet mandatory. I is made extremely easy through the + usage page to configure this, so the additional complexity should + not be an issue. +
+ +Both ssh and sftp are supported. Multiple shells are also allowed.
+There is a timeout mechanism in the agent such that jobs do not hang indefinitely waiting for a connection. This mechanism is useful to make sure build agents do not keep build agents occupied for a long time. By default, the agent exits with status 0 when - the first client exits after logging in. This behavior as well as general expiry can be - controlled from within a shell session by touching a .hold file. After logging in, the - user can control expiry of the session as instructed by messages in the ssh session. - When the timeout of a session is near the user is informed about this with messages - in the shell. + the first client exits after logging in.
- -end-to-end encryoption
-ssh keys
-agent options
-client access
- -
- wsproxy
is a command that can be used as a proxy command for SSH which performs the connection to the
- remote server. This command needs to be downloaded only once (see downloads). It does not depend on
- the converge implementation but only on the websocket standards. Other tools that
- provide a mapping of stdio to a websocket can also be used instead of wsproxy.
+
When the user touches a .hold file, the agent keeps waiting for connections even + after the last client logs out, taking into account the timeout.
+The sessions have an inactivity timeout. Any keypress on the keyboard by a user + is interpreted as activity.
-- This option is less convenient than the proxy command because it requires two separate - commands to execute. -
- -- Local clients can connect using regular ssh and sftp commands through a tunnel that - translates a local TCP port to a websocket connection in converge. See - the downloads section. - This runs a local client that allows SSH to port 10000 and connects to converge using - a websocket connection. -
{` - `}curl http{access.Secure}://{access.HostPort}/static/agent > agent{` +{addSshKeys(BASH, usageInputs.SshKeys)} + curl --fail-with-body http{access.Secure}://{access.HostPort}/downloads/agent > agent{` chmod 755 agent `}./agent --id {usageInputs.Id} ws{access.Secure}://{access.HostPort}{` rm -f agent `}} - if shells[CMD] || shells[POWERSHELL] { -{` - `}curl http{access.Secure}://{access.HostPort}/static/agent.exe > agent.exe{` + if shells[CMD] { +{addSshKeys(CMD, usageInputs.SshKeys)} + curl --fail-with-body http{access.Secure}://{access.HostPort}/downloads/agent.exe > agent.exe{` + `}agent --id {usageInputs.Id} ws{access.Secure}://{access.HostPort}{` + del agent.exe + `}+ } + if shells[POWERSHELL] { +{addSshKeys(POWERSHELL, usageInputs.SshKeys)} + curl --fail-with-body http{access.Secure}://{access.HostPort}/downloads/agent.exe > agent.exe{` `}agent --id {usageInputs.Id} ws{access.Secure}://{access.HostPort}{` del agent.exe `}@@ -41,11 +48,41 @@ templ AgentUsage(access models.ConvergeAccess, shells map[string]bool, usageInpuConnecting to the agent
+The embedded ssh server in the agent supports both ssh and sftp. The user name is fixed + at
+{ access.Username }
. This is the user used to connect to the embedded + SSH server, after logging in however you will be running in a shell that is started + by the same user that started the agent. +{` `}ssh -oServerAliveInterval=10 -oProxyCommand="wsproxy ws{access.Secure}://{access.HostPort}/client/{usageInputs.Id}" { access.Username }{"@localhost"} {` `}sftp -oServerAliveInterval=10 -oProxyCommand="wsproxy ws{access.Secure}://{access.HostPort}/client/{usageInputs.Id}" { access.Username }{"@localhost"} {` `}+This requires the
+ +wsproxy
utility which is available in the + downloads section. This utility must be downloaded + only once since it is quite generic. It will warn you when it a newer version must + be downloaded. +For other ssh clients that do not support the openssh ProxyCommand option, there is another + way to connect. In this method, a local port forwarder is started that forwards a local port + to the webserver. Then you can start an ssh client that connects to the local tcp port. +
+{` + `}ssh -oServerAliveInterval=10 -p 10000 { access.Username }{"@localhost"} {` + `}sftp -oServerAliveInterval=10 -p 10000 { access.Username }{"@localhost"} {` + `}+ +This requires the
+tcptows
utility which is available in the + downloads section. The utility must be started beforehand + using: +{` + `}tcptows ws{access.Secure}://{access.HostPort}/client/{usageInputs.Id} {` + `}tcptows ws{access.Secure}://{access.HostPort}/client/{usageInputs.Id} {` + `}+Working with the agent
if shells[BASH] { @@ -90,25 +127,11 @@ templ AgentUsage(access models.ConvergeAccess, shells map[string]bool, usageInpu } -templ LocalShellUsage(access models.ConvergeAccess, shells map[string]bool, usageInput UsageInputs) { -- if shells[BASH] { --} templ ShellUsage(access models.ConvergeAccess, usageInputs UsageInputs) {bash
- } - if shells[CMD] { -cmd
- } - if shells[POWERSHELL] { -powershell
- } -@AgentUsage(access, usageInputs.RemoteShells, usageInputs)- @LocalShellUsage(access, usageInputs.LocalShells, usageInputs) } @@ -163,25 +186,6 @@ templ Usage(access models.ConvergeAccess) {- - - - - -{` - `}# linux {` - `}echo "ssh-rsa dkddkdkkk a@b.c" > .authorized_keys {` - `}echo "ssh-rsa adfadjfdf d@e.f" >> .authorized_keys {` - `} {` - `}# windows {` - `}echo ssh-rsa dkddkdkkk a@b.c > .authorized_keys {` - `}echo ssh-rsa adfadjfdf d@e.f >> .authorized_keys --- Note that on windows you should not used quotes. -
- -