Add mercure to old installer
oginstaller/pipeline/head There was a failure building this commit
Details
oginstaller/pipeline/head There was a failure building this commit
Details
parent
9151520b93
commit
d4f0aed18d
|
@ -14,29 +14,14 @@ if [ -f /opt/opengnsys/ogGui/installer/.deployed ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Sacar la IP del ogCore de la configuración
|
# Sacar la IP del ogCore de la configuración
|
||||||
ogcore_ip=$(jq -r '.ogcore_ip' /opt/opengnsys/ogGui/installer/config.json)
|
ogcore_url=$(jq -r '.ogcore_ip' /opt/opengnsys/ogGui/installer/config.json)
|
||||||
export OGCORE_IP="$ogcore_ip"
|
mercure_ip=$(jq -r '.meercure_ip' /opt/opengnsys/ogGui/installer/config.json)
|
||||||
|
export OGCORE_URL="$ogcore_url"
|
||||||
# Si no se ha configurado la IP del ogCore, se intenta obtener de la interfaz de red
|
export MERCURE_URL="$mercure_url"
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
# Si se ha configurado la IP del ogCore, se escribe en el fichero .env
|
# 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_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
|
touch /opt/opengnsys/ogGui/installer/.deployed
|
||||||
|
|
|
@ -143,7 +143,7 @@ class OgGuiForm(ComponentForm):
|
||||||
|
|
||||||
def configure_fields(self):
|
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["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):
|
class OgDhcpForm(ComponentForm):
|
||||||
component_name = "ogDhcp"
|
component_name = "ogDhcp"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue