Compare commits

...

3 Commits

1 changed files with 13 additions and 3 deletions

View File

@ -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}")
@ -479,6 +487,8 @@ def copyClientFiles():
logger.info("Configuration file ogAdmClient.cfg created successfully.")
# Creamos el directorio de images para el samba de ogrepository
os.makedirs(os.path.join(INSTALL_OGBOOT_TARGET, "client/images"), mode=0o775, exist_ok=True)
# Creamos el directorio de logs para el samba de oglog
os.makedirs(os.path.join(INSTALL_OGBOOT_TARGET, "client/log"), mode=0o775, exist_ok=True)
# Change ownership of INSTALL_OGBOOT_TARGET/client/ and its contents
subprocess.run(f"chown -R opengnsys:opengnsys {INSTALL_OGBOOT_TARGET}/client/", shell=True, text=True, capture_output=True)