diff options
author | Michael Dürre <michael.duerre@highstreet-technologies.com> | 2023-04-20 08:50:54 +0200 |
---|---|---|
committer | Michael Dürre <michael.duerre@highstreet-technologies.com> | 2023-04-20 08:50:54 +0200 |
commit | 35bc08cfc2792d1fa1ce5d4cf8cf940251163711 (patch) | |
tree | 566f2618ec427da608935785412608925ad29e0a /installation/sdnc-web/src/main/scripts | |
parent | a4a4c3111e505ea6026542737125497a69521fa8 (diff) |
fix sdnr ws port configs
fix websocket ports for sdnc and sdnc-web
Issue-ID: SDNC-1795
Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com>
Change-Id: I97c617ede967eb716c2dc8d0707e3de0c8c1ac0c
Former-commit-id: f6d5ac391a828fa2d9f011c602bdeae2e515d9be
Diffstat (limited to 'installation/sdnc-web/src/main/scripts')
-rw-r--r-- | installation/sdnc-web/src/main/scripts/core.py | 15 | ||||
-rw-r--r-- | installation/sdnc-web/src/main/scripts/run.sh | 26 |
2 files changed, 28 insertions, 13 deletions
diff --git a/installation/sdnc-web/src/main/scripts/core.py b/installation/sdnc-web/src/main/scripts/core.py index feb57348..6bdd4b59 100644 --- a/installation/sdnc-web/src/main/scripts/core.py +++ b/installation/sdnc-web/src/main/scripts/core.py @@ -76,14 +76,22 @@ def add_application(name, index, file=None): def initial_load(): files = os.listdir(INIT_FOLDER) regex = r"([0-9]+)([a-zA-Z]+)\.(jar|zip)" + regexUrl = r"([0-9]+)([a-zA-Z]+)\.(url)" for file in files: matches = re.finditer(regex,file) match = next(matches, None) + matchesUrl = re.finditer(regexUrl,file) + matchUrl = next(matchesUrl, None) if match is not None: print("installing {}".format(file)) index = int(match.group(1)) name = match.group(2) add_application(name,index,INIT_FOLDER+'/'+file) + elif matchUrl is not None: + print("installing {}".format(file)) + index = int(match.group(1)) + name = match.group(2) + add_application(name,index,INIT_FOLDER+'/'+file) else: print("no index naming format found. try to autodetect") infos = autoDetectInfosFromJar(file) @@ -269,8 +277,14 @@ def update_nginx_site_conf(): WEBPROTOCOL=getEnv('WEBPROTOCOL') WEBPORT=getEnv('WEBPORT') SDNRPROTOCOL=getEnv('SDNRPROTOCOL') + SDNCWEBHOST=getEnv('HOSTNAME') SDNRHOST=getEnv('SDNRHOST') + if SDNRHOST == "sdnc.onap": + # Request is from K8s + SDNCWEBHOSTINDEX=SDNCWEBHOST[SDNCWEBHOST.rindex("-")+1:] + SDNRHOST = "sdnc-" + SDNCWEBHOSTINDEX + ".onap" SDNRPORT=getEnv('SDNRPORT') + SDNRWEBSOCKETPORT=getEnv('SDNRWEBSOCKETPORT',SDNRPORT) DNS_RESOLVER=getEnv('DNS_RESOLVER') DNS_INTERNAL_RESOLVER=getEnv('DNS_INTERNAL_RESOLVER') if FN is None: @@ -286,6 +300,7 @@ def update_nginx_site_conf(): sedInFile('SDNRPROTOCOL',SDNRPROTOCOL,FN) sedInFile('SDNRHOST',SDNRHOST ,FN) sedInFile('SDNRPORT',SDNRPORT,FN) + sedInFile('SDNRWEBSOCKETPORT',SDNRWEBSOCKETPORT, FN) sedInFile('DNS_RESOLVER',DNS_RESOLVER ,FN) sedInFile('DNS_INTERNAL_RESOLVER',DNS_INTERNAL_RESOLVER ,FN) diff --git a/installation/sdnc-web/src/main/scripts/run.sh b/installation/sdnc-web/src/main/scripts/run.sh index 3343faf4..630a3e36 100644 --- a/installation/sdnc-web/src/main/scripts/run.sh +++ b/installation/sdnc-web/src/main/scripts/run.sh @@ -25,19 +25,19 @@ python3 /opt/bitnami/nginx/sbin/configure.py echo "starting sdnc-web" echo "=======================" -echo " WEBPROTOCOL : $WEBPROTOCOL" -echo " WEBPORT : $WEBPORT" -echo " SDNRPROTOCOL : $SDNRPROTOCOL" -echo " SDNRHOST : $SDNRHOST" -echo " SDNRPORT : $SDNRPORT" -echo " DNS_RESOLVER : $DNS_RESOLVER" -echo " DNS_INTERNAL_RESOLVER : $DNS_INTERNAL_RESOLVER" -echo " TRPCEURL : $TRPCEURL" -echo " TRPCEGUIURL : $TRPCEGUIURL" -echo " TOPOURL : $TOPOURL" -echo " TILEURL : $TILEURL" -echo " SITEDOCURL : $SITEDOCURL" -echo " TERRAINURL : $TERRAINURL" +echo " WEBPROTOCOL : $WEBPROTOCOL" +echo " WEBPORT : $WEBPORT" +echo " SDNRPROTOCOL : $SDNRPROTOCOL" +echo " SDNRHOST : $SDNRHOST" +echo " SDNRPORT : $SDNRPORT" +echo " SDNRWSPORT : $SDNRWEBSOCKETPORT" +echo " DNS_RESOLVER : $DNS_RESOLVER" +echo " DNS_INTERNAL_RESOLVER : $DNS_INTERNAL_RESOLVER" +echo " TRPCEURL : $TRPCEURL" +echo " TRPCEGUIURL : $TRPCEGUIURL" +echo " TOPOURL : $TOPOURL" +echo " TILEURL : $TILEURL" +echo " SITEDOCURL : $SITEDOCURL" echo "=======================" if [ "$WEBPROTOCOL" == "HTTPS" ]; then echo " SSL_CERT_DIR : $SSL_CERT_DIR" |