From 57cd3999050de198a020451a32cf4c05f414bd4e Mon Sep 17 00:00:00 2001 From: lgromero Date: Thu, 28 Nov 2024 08:44:17 +0100 Subject: [PATCH] refs #1198 adds ogcore port to url and creates log dir in clients --- installer/ogboot_installer.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/installer/ogboot_installer.py b/installer/ogboot_installer.py index 73fcaa0..9b7f55f 100755 --- a/installer/ogboot_installer.py +++ b/installer/ogboot_installer.py @@ -23,7 +23,15 @@ config_file = os.path.join(PROGRAM_DIR, 'config.json') with open(config_file, 'r') as f: config = json.load(f) -OGCORE_IP = config["ogCore_ServerIP"] +#OGCORE_IP = config["ogCore_ServerIP"] + +ogcore_ip_port = config['ogCore_ServerIP'] +if ':' in ogcore_ip_port: + OGCORE_IP, OGCORE_PORT = ogcore_ip_port.split(':') +else: + OGCORE_IP = ogcore_ip_port + OGCORE_PORT = "8443" + #Para el caso de que pasen una ip con puerto separamos la ip y el puerto #Pasamos el puerto para conexiones por http #No pasamos el puerto para conexiones tftp y parámetros del kernel @@ -250,8 +258,8 @@ def og_boot_symfony_install(): shutil.chown(composer_dest, user='opengnsys', group='opengnsys') logger.info(f"Set permissions and owner for {env_dest} and {composer_dest}") - # Añadir la línea OGCORE_API_URL utilizando OGCORE_IP - ogcore_api_url = f'OGCORE_API_URL="https://{OGCORE_IP}"' + # Añadir la línea OGCORE_API_URL utilizando OGCORE_IP y OGCORE_PORT + ogcore_api_url = f'OGCORE_API_URL="https://{OGCORE_IP}:{OGCORE_PORT}"' with open(env_dest, 'a') as env_file: env_file.write(f"\n{ogcore_api_url}\n") logger.info(f"Added OGCORE_API_URL to {env_dest} with IP: {OGCORE_IP}")