diff options
author | Emile <hanemile@protonmail.com> | 2019-10-07 12:25:49 +0200 |
---|---|---|
committer | Emile <hanemile@protonmail.com> | 2019-10-07 12:25:49 +0200 |
commit | cc4b04a7011316a334884dd10747d6f40928543f (patch) | |
tree | bff3fb2a40698482cc39d002cabe6ad96b67452b /src | |
parent | fc1f7cce72af419629e46cf6b6083b356910a6a5 (diff) |
generating a session salt
current unix time in nanoseconds
Diffstat (limited to 'src')
-rw-r--r-- | src/docker.go | 7 |
1 files changed, 7 insertions, 0 deletions
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()) +} |