From 3110acd75a21c2794f802f0bb94b18dab89f0f6e Mon Sep 17 00:00:00 2001 From: Emile Date: Tue, 8 Oct 2019 19:51:21 +0200 Subject: vpnRemoteAddress increase --- src/docker.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/docker.go b/src/docker.go index c949815..76c90e9 100644 --- a/src/docker.go +++ b/src/docker.go @@ -20,8 +20,9 @@ const ( ) var ( - dockerCtx context.Context - dockerCLI *client.Client + dockerCtx context.Context + dockerCLI *client.Client + currentVpnRemptePort = 1194 ) func setupContext() { @@ -46,13 +47,17 @@ func spawnCompanion(username string, accesscode string) { sessionSalt := generateSessionSalt() vpnRemoteAddress := "127.0.0.1" - vpnRemotePort := "1194" + + // get the vpnRemoteport and increment it + vpnRemotePort := currentVpnRemptePort + log.Println("vpnRemptePort ", currentVpnRemptePort) + currentVpnRemptePort++ log.Println("Generating the container config") Config := &container.Config{ Image: "circus-companion:latest", - Cmd: []string{"-username", username, "-accessCode", accesscode, "-sessionSalt", sessionSalt, "-vpnRemoteAddress", vpnRemoteAddress, "-vpnRemotePort", vpnRemotePort}, + Cmd: []string{"-username", username, "-accessCode", accesscode, "-sessionSalt", sessionSalt, "-vpnRemoteAddress", vpnRemoteAddress, "-vpnRemotePort", fmt.Sprintf("%d", vpnRemotePort)}, ExposedPorts: nat.PortSet{ "8080/tcp": struct{}{}, }, -- cgit 1.4.1