about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.drone.yml20
-rw-r--r--src/docker.go11
-rw-r--r--src/http.go6
3 files changed, 9 insertions, 28 deletions
diff --git a/.drone.yml b/.drone.yml
deleted file mode 100644
index 6bd0759..0000000
--- a/.drone.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-kind: pipeline
-name: default
-
-platform:
-    os: linux
-    arch: amd64
-
-steps:
-- name: docker
-  image: plugins/docker
-  settings:
-      tags:
-        - latest
-      repo: registry.darknebu.la/circus/register
-      registry: registry.darknebu.la
-      username:
-        from_secret: docker_username
-      password:
-        from_secret: docker_password
-
diff --git a/src/docker.go b/src/docker.go
index e3ff19c..adc94fb 100644
--- a/src/docker.go
+++ b/src/docker.go
@@ -20,9 +20,8 @@ const (
 )
 
 var (
-	dockerCtx            context.Context
-	dockerCLI            *client.Client
-	currentVpnRemptePort = 1194
+	dockerCtx context.Context
+	dockerCLI *client.Client
 )
 
 func setupContext() {
@@ -49,9 +48,9 @@ func spawnCompanion(username string, accesscode string) {
 	vpnRemoteAddress := os.Getenv("HOSTNAME")
 
 	// get the vpnRemoteport and increment it
-	vpnRemotePort := currentVpnRemptePort
-	log.Println("vpnRemptePort ", currentVpnRemptePort)
-	currentVpnRemptePort++
+	vpnRemotePort := *currentVpnRemotePort
+	log.Println("vpnRemptePort ", *currentVpnRemotePort)
+	*currentVpnRemotePort++
 
 	log.Println("Generating the container config")
 
diff --git a/src/http.go b/src/http.go
index 2c62eaf..13276f7 100644
--- a/src/http.go
+++ b/src/http.go
@@ -15,8 +15,9 @@ import (
 )
 
 var (
-	port      *int     // port the http server listens on
-	usernames []string // list of usernames
+	port                 *int     // port the http server listens on
+	usernames            []string // list of usernames
+	currentVpnRemotePort *int
 )
 
 // Credentials stores user credentials
@@ -28,6 +29,7 @@ type Credentials struct {
 
 func registerHTTPFlags() {
 	port = flag.Int("port", 8081, "The port the http server should listen on")
+	currentVpnRemotePort = flag.Int("initialVPNPort", 1194, "the initial vpn port")
 }
 
 func setupHTTPServer() http.Server {