From 9ee92da5e3d52fe11415193a9391eee3ad541c72 Mon Sep 17 00:00:00 2001 From: maride Date: Sat, 8 Sep 2018 01:29:22 +0200 Subject: Avoid collision by adding the hashed username to networks --- src/access.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/access.go') 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 -- cgit 1.4.1