From 5114a0e002afbad16ea567ffea6cdc2346ea0ff5 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 6 Feb 2023 22:17:05 +0100 Subject: [PATCH] Create 90-disable_ingress.sh --- .templates/90-disable_ingress.sh | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .templates/90-disable_ingress.sh diff --git a/.templates/90-disable_ingress.sh b/.templates/90-disable_ingress.sh new file mode 100644 index 000000000..cc852d1b1 --- /dev/null +++ b/.templates/90-disable_ingress.sh @@ -0,0 +1,33 @@ +#!/usr/bin/with-contenv bashio +# shellcheck shell=bash + +# Disables ingress and sets a default index + +# Disable Ingress +if bashio::config.true "ingress_disabled"; then + bashio::log.warning "Ingress is disabled. You'll need to connect using ip:port" + + # Adapt ingress.conf + sed -i "/proxy_pass/i root /etc;" /etc/nginx/servers/ingress.conf + sed -i "/proxy_pass/i try_files '' /ingress.html =404;" /etc/nginx/servers/ingress.conf + sed -i "/proxy_pass/d" /etc/nginx/servers/ingress.conf + + # Create index.html + touch /etc/ingress.html + cat > /etc/ingress.html << EOF + + +
++ Ingress was disabled by the user. Please connect using ip:port or + re-enable in the addons options. +
+ + + +EOF +fi