diff options
author | maride <maride@darknebu.la> | 2018-09-08 01:29:22 +0200 |
---|---|---|
committer | maride <maride@darknebu.la> | 2018-09-08 01:29:22 +0200 |
commit | 9ee92da5e3d52fe11415193a9391eee3ad541c72 (patch) | |
tree | 221c8c4eb84750a843e1735c7c7cae26bb53ebea /src/access.go | |
parent | 0554bfa9a1ee2a7c9d3ff24749317fd9b3202ca2 (diff) |
Avoid collision by adding the hashed username to networks
Diffstat (limited to 'src/access.go')
-rw-r--r-- | src/access.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/access.go b/src/access.go index 6f0d848..1292489 100644 --- a/src/access.go +++ b/src/access.go @@ -40,7 +40,7 @@ func startVPN() (err error) { // Set up VPN host network if vpnHostNetworkID == "" { - id, err := setupNetwork(vpnHostNetworkName, false) + id, err := setupNetwork(getVPNNetworkName(), false) if (err != nil) { return err } @@ -49,7 +49,7 @@ func startVPN() (err error) { // Set up container network if containerNetworkID == "" { - id, err := setupNetwork(containerNetworkName, true) + id, err := setupNetwork(getChallengeNetworkName(), true) if (err != nil) { return err } @@ -155,9 +155,9 @@ func getCertificate() (string, error) { // retry for 10 seconds to dial to the VPN container for i := 0; i < 10; i++ { // Check if the VPN container is already part of our challenge container network - if inspectJSON.NetworkSettings.Networks[vpnHostNetworkName] != nil { + if inspectJSON.NetworkSettings.Networks[getVPNNetworkName()] != nil { // it is - get the IP address and dial to it - certResponse, err = http.Get(fmt.Sprintf("http://%s:9999/", inspectJSON.NetworkSettings.Networks[vpnHostNetworkName].IPAddress)) + certResponse, err = http.Get(fmt.Sprintf("http://%s:9999/", inspectJSON.NetworkSettings.Networks[getVPNNetworkName()].IPAddress)) if err == nil { break |