diff --git a/.env.common b/.env.common index 6554fd7..77cc33d 100644 --- a/.env.common +++ b/.env.common @@ -16,7 +16,7 @@ REDIS_VERSION=7.2.0-v6 MINIO_VERSION=RELEASE.2024-01-16T16-07-38Z EXTERNAL_LISTEN_HOST="127.0.0.1" -#EXTERNAL_LISTEN_HOSTS="192.168.1.2 +#EXTERNAL_LISTEN_HOSTS="192.168.1.2" ANY_SYNC_NODE_1_HOST=any-sync-node-1 ANY_SYNC_NODE_1_PORT=1001 diff --git a/docker-generateconfig/setListenIp.py b/docker-generateconfig/setListenIp.py index 3f1fc84..d973a9a 100755 --- a/docker-generateconfig/setListenIp.py +++ b/docker-generateconfig/setListenIp.py @@ -27,9 +27,16 @@ inputYamlFile = sys.argv[1] outputYamlFile = sys.argv[2] -listenHosts = envVars['EXTERNAL_LISTEN_HOSTS'].split() -if 'EXTERNAL_LISTEN_HOST' in envVars: - listenHosts.append(envVars['EXTERNAL_LISTEN_HOST']) +externalListenHosts = envVars.get('EXTERNAL_LISTEN_HOSTS', '127.0.0.1').split() +externalListenHost = envVars.get('EXTERNAL_LISTEN_HOST', None) +print(f"DEBUG: externalListenHosts={externalListenHosts}") +print(f"DEBUG: externalListenHost={externalListenHost}") +listenHosts = list() +for externalListenHost in externalListenHosts: + if externalListenHost not in listenHosts: + listenHosts.append(externalListenHost) +if externalListenHost not in listenHosts: + listenHosts.append(externalListenHost) print(f"DEBUG: listenHosts={listenHosts}") @@ -49,6 +56,9 @@ # add "quic" listen address for name,value in envVars.items(): if re.match(r"^(ANY_SYNC_.*_PORT)$", name) and value == listenPort: + if re.match(r"^(ANY_SYNC_.*_QUIC_PORT)$", name): + # skip port, if PORT == QUIC_PORT + continue quicPortKey = name.replace('_PORT', '_QUIC_PORT') quicPortValue = envVars[quicPortKey] quicListenAddress = 'quic://'+ nodeListenHost +':'+ str(quicPortValue)