From cc4b04a7011316a334884dd10747d6f40928543f Mon Sep 17 00:00:00 2001 From: Emile Date: Mon, 7 Oct 2019 12:25:49 +0200 Subject: generating a session salt current unix time in nanoseconds --- src/docker.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/docker.go b/src/docker.go index 4046146..df89e52 100644 --- a/src/docker.go +++ b/src/docker.go @@ -5,6 +5,7 @@ import ( "fmt" "log" "os" + "time" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/mount" @@ -41,6 +42,8 @@ func spawnCompanion(username string, accesscode string) string { setupContext() setupDockerCLI() + sessionSalt := generateSessionSalt() + Config := &container.Config{ Image: "circus-companion:latest", Cmd: []string{fmt.Sprintf("-username %s -accesscode %s -sessionSalt %s -vpnRemoteAddress %s -vpnRemotePort %s", username, accesscode, sessionSalt, vpnRemoteAddress, vpnRemotePort)}, @@ -74,3 +77,7 @@ func spawnCompanion(username string, accesscode string) string { return accesscode } + +func generateSessionSalt() string { + return fmt.Sprintf("%d", time.Now().UnixNano()) +} -- cgit 1.4.1