Skip to content

Commit

Permalink
fixed docker-generateconfig/setListenIp.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fb929 committed May 17, 2024
1 parent 249adb5 commit be138fa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.common
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 13 additions & 3 deletions docker-generateconfig/setListenIp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand All @@ -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)
Expand Down

0 comments on commit be138fa

Please sign in to comment.