From d4f0aed18dc41285f88f21b8dcd4979f13c18ce6 Mon Sep 17 00:00:00 2001 From: Nicolas Arenas Date: Thu, 13 Mar 2025 13:46:06 +0100 Subject: [PATCH] Add mercure to old installer --- .../component-installer/provision_oggui.sh | 25 ++++--------------- .../python-installer/oginstaller-v2.py | 2 +- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/non_graf_installer/component-installer/provision_oggui.sh b/non_graf_installer/component-installer/provision_oggui.sh index 7648afb..f95fa8e 100644 --- a/non_graf_installer/component-installer/provision_oggui.sh +++ b/non_graf_installer/component-installer/provision_oggui.sh @@ -14,29 +14,14 @@ if [ -f /opt/opengnsys/ogGui/installer/.deployed ]; then fi # Sacar la IP del ogCore de la configuración -ogcore_ip=$(jq -r '.ogcore_ip' /opt/opengnsys/ogGui/installer/config.json) -export OGCORE_IP="$ogcore_ip" - -# Si no se ha configurado la IP del ogCore, se intenta obtener de la interfaz de red -if [ -z "$ogcore_ip" ]; then - # Obtiene el nombre del interfaz asociado a la ruta por defecto - interface=$(ip route | grep default | awk '{print $5}') - - # Si se encuentra el interfaz, obtiene su dirección IP - if [ -n "$interface" ]; then - ip_address=$(ip -o -4 addr show "$interface" | awk '{print $4}' | cut -d'/' -f1) - ogcore_ip=$ip_address - # Si no se ha configurado la IP del ogCore, se escribe en el fichero .env - echo "NG_APP_BASE_API_URL=https://$ogcore_ip:8443" > $ENV_FILE - exit 0 - else - echo "No se pudo determinar el interfaz asociado a la ruta por defecto." - exit 1 - fi -fi +ogcore_url=$(jq -r '.ogcore_ip' /opt/opengnsys/ogGui/installer/config.json) +mercure_ip=$(jq -r '.meercure_ip' /opt/opengnsys/ogGui/installer/config.json) +export OGCORE_URL="$ogcore_url" +export MERCURE_URL="$mercure_url" # Si se ha configurado la IP del ogCore, se escribe en el fichero .env echo "NG_APP_BASE_API_URL=$OGCORE_IP" > $ENV_FILE +echo "NG_APP_OGCORE_MERCURE_BASE_URL=http://$mercure_ip:3000/.well-known/mercure" >> $ENV_FILE touch /opt/opengnsys/ogGui/installer/.deployed diff --git a/non_graf_installer/python-installer/oginstaller-v2.py b/non_graf_installer/python-installer/oginstaller-v2.py index 5a00643..8ed0b46 100644 --- a/non_graf_installer/python-installer/oginstaller-v2.py +++ b/non_graf_installer/python-installer/oginstaller-v2.py @@ -143,7 +143,7 @@ class OgGuiForm(ComponentForm): def configure_fields(self): self.fields["ogcore_ip"] = {"widget": self.add(npyscreen.TitleText, name="URL Api OgCore (https://127.0.0.1:8443):", value="https://127.0.0.1:8443")} - + self.fields["mercure_ip"] = {"widget": self.add(npyscreen.TitleText, name="Mercue IP (127.0.0.1):", value="127.0.0.1")} class OgDhcpForm(ComponentForm): component_name = "ogDhcp"