diff options
author | Emile <hanemile@protonmail.com> | 2019-10-08 19:51:21 +0200 |
---|---|---|
committer | Emile <hanemile@protonmail.com> | 2019-10-08 19:51:21 +0200 |
commit | 3110acd75a21c2794f802f0bb94b18dab89f0f6e (patch) | |
tree | 869494b058d9b451936101398ddadeed02683418 | |
parent | 3cf0c5db38d0568400859f3bffd34ae07bdf28fe (diff) |
vpnRemoteAddress increase
-rw-r--r-- | src/docker.go | 13 |
1 files 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{}{}, }, |