From 21f50a400531d4240ccffd968cac7879a6921ae0 Mon Sep 17 00:00:00 2001 From: Erik Brakkee Date: Sun, 21 Jul 2024 19:00:01 +0200 Subject: [PATCH] updated docs for new proxycommand. --- Dockerfile | 4 +-- cmd/{convergeproxy => wsproxy}/proxy.go | 0 static/index.html | 35 ++++++++++++++++++------- 3 files changed, 28 insertions(+), 11 deletions(-) rename cmd/{convergeproxy => wsproxy}/proxy.go (100%) diff --git a/Dockerfile b/Dockerfile index b777fdd..9b99222 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.20.0 as builder RUN apk update && apk add go RUN mkdir -p /opt/converge/bin -COPY . /opt/converge/ +COPY cmd pkg static go.mod go.sum /opt/converge/ WORKDIR /opt/converge RUN go mod download COPY . /opt/converge/ @@ -11,7 +11,7 @@ RUN go build -ldflags "-linkmode 'external' -extldflags '-static'" -o bin ./cmd/ FROM scratch COPY --from=builder /opt/converge/bin/converge /opt/converge/bin/ -COPY --from=builder /opt/converge/bin/agent /opt/converge/bin/tcptows /opt/converge/bin/convergeproxy /opt/converge/docs/ +COPY --from=builder /opt/converge/bin/agent /opt/converge/bin/tcptows /opt/converge/bin/wsproxy /opt/converge/docs/ COPY --from=builder /opt/converge/static/ /opt/converge/docs/ ENTRYPOINT ["/opt/converge/bin/converge", "/opt/converge/docs" ] diff --git a/cmd/convergeproxy/proxy.go b/cmd/wsproxy/proxy.go similarity index 100% rename from cmd/convergeproxy/proxy.go rename to cmd/wsproxy/proxy.go diff --git a/static/index.html b/static/index.html index 7c51013..b479d3a 100644 --- a/static/index.html +++ b/static/index.html @@ -22,16 +22,10 @@ In a continous integration job, download the agent, chmod it and run it.

-    # for HTTP hosted server
-    curl http://HOSTPORT/docs/agent > agent
-     ./agent ws://HOST:PORT/agent/ID
-    chmod 755 agent
-
-    # for HTTPS hosted server
      curl https://HOSTPORT/docs/agent > agent
      ./agent wss://HOST:PORT/agent/ID
     chmod 755 agent
-
+

Above, HOST:PORT is the hostname:port of the converge server and ID is a unique id for the job. This should not conflict with other ids. @@ -40,6 +34,29 @@ to establish a connection to the CI job through converge.

+

Local clients: using ssh proxy command

+ +
+    curl https://HOST:PORT/docs/wsproxy > wsproxy
+    chmod 755 wsproxy
+    
+ +

This is a command that can be used as a proxy command for SSH which performs the connection to the remote + server.

+ +

+ Next step is to run a local SSH of SFTP client: +

+ +
+    ssh -oProxyCommand="wsproxy https://HOST:PORT/client/ID" -p 10000 abc@localhost
+    sftp -oProxyCommand="wsproxy https://HOST:PORT/client/ID" -oPort 10000 abc@localhost
+    
+ +

+ abc is a fixed user defined by converge. It has a very exciting password. +

+

Local clients: with a local TCP forwarding proxy

This option is less convenient than the proxy command because it requires two separate @@ -62,7 +79,7 @@ curl https://HOST:PORT/docs/tcptows > tcptows chmod 755 tcptows ./tcptows 10000 wss://HOST:PORT/client/ID - +

This runs a local client that allows SSH to port 10000 and connects to converge using @@ -89,7 +106,7 @@

  • tcptows: TCP to WS tunnel for allowing regular SSH and SFTP clients to connect to converge.
  • -
  • convergeproxy: SSH proxy command that can be directly used by ssh +
  • wsproxy: SSH proxy command that can be directly used by ssh