From 3bfd2eb33e3ecfae8c8ccc7b14863c7379ef829a Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 14 May 2021 10:13:06 +0200 Subject: [PATCH] Revert last working --- joal/rootfs/run.sh | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/joal/rootfs/run.sh b/joal/rootfs/run.sh index b284b8615..c7ec76238 100644 --- a/joal/rootfs/run.sh +++ b/joal/rootfs/run.sh @@ -33,12 +33,27 @@ if bashio::supervisor.ping; then ' Please, share the above information when looking for help' bashio::log.blue \ ' or support in, e.g., GitHub, forums or the Discord chat.' - bashio::log.blue \ - ' https://github.com/alexbelgium/hassio-addons' bashio::log.blue \ '-----------------------------------------------------------' fi +################# +# NGINX SETTING # +################# + +declare port +declare certfile +declare ingress_interface +declare ingress_port +declare keyfile + +port=$(bashio::addon.port 80) +ingress_port=$(bashio::addon.ingress_port) +ingress_interface=$(bashio::addon.ip_address) +sed -i "s/%%port%%/${ingress_port}/g" /etc/nginx/servers/ingress.conf +sed -i "s/%%interface%%/${ingress_interface}/g" /etc/nginx/servers/ingress.conf +mkdir -p /var/log/nginx && touch /var/log/nginx/error.log + ################ # JOAL SETTING # ################ @@ -70,36 +85,16 @@ rm /data/joal/jack-of* bashio::log.info "Joal updated" mv -f /config.json /data/joal/ || true -################# -# NGINX SETTING # -################# - -declare port -declare certfile -declare ingress_interface -declare ingress_port -declare keyfile - -PATH=$(bashio::config 'ui_path') -port=$(bashio::addon.port 80) - -ingress_port=$(bashio::addon.ingress_port) -ingress_interface=$(bashio::addon.ip_address) -sed -i "s/%%port%%/${ingress_port}/g" /etc/nginx/servers/ingress.conf -sed -i "s/%%interface%%/${ingress_interface}/g" /etc/nginx/servers/ingress.conf -sed -i "s/%%path%%/${PATH}/g" /etc/nginx/servers/ingress.conf -mkdir -p /var/log/nginx && touch /var/log/nginx/error.log - ############### # LAUNCH APPS # ############### if [ $VERBOSE = true ]; then - nohup java -jar /joal/joal.jar --joal-conf=/data/joal --spring.main.web-environment=true --server.port="8081" --joal.ui.path.prefix=$PATH --joal.ui.secret-token=$TOKEN + nohup java -jar /joal/joal.jar --joal-conf=/data/joal --spring.main.web-environment=true --server.port="8081" --joal.ui.path.prefix="joal" --joal.ui.secret-token=$TOKEN else - nohup java -jar /joal/joal.jar --joal-conf=/data/joal --spring.main.web-environment=true --server.port="8081" --joal.ui.path.prefix=$PATH --joal.ui.secret-token=$TOKEN >/dev/null + nohup java -jar /joal/joal.jar --joal-conf=/data/joal --spring.main.web-environment=true --server.port="8081" --joal.ui.path.prefix="joal" --joal.ui.secret-token=$TOKEN >/dev/null fi \ -& bashio::log.info "Joal started with path $PATH and secret token $TOKEN" +& bashio::log.info "Joal started with secret token $TOKEN" # Wait for transmission to become available bashio::net.wait_for 8081 localhost 900 || true bashio::log.info "Nginx started for Ingress"