ingress_disabled

This commit is contained in:
Alexandre
2023-02-07 11:25:36 +01:00
committed by GitHub
parent fdc4d84562
commit 94db1a3bf5
10 changed files with 56 additions and 21 deletions

View File

@@ -2,13 +2,14 @@
# shellcheck shell=bash
# ==============================================================================
# Wait for transmission to become available
bashio::net.wait_for 7878 localhost 900
# Set variables
slug=radarr
port=7878
CONFIG_LOCATION=/config/addons_config/"$slug"/config.xml
# Wait for transmission to become available
bashio::net.wait_for "$port" localhost 900
if bashio::config.has_value 'CONFIG_LOCATION'; then
CONFIG_LOCATION="$(bashio::config 'CONFIG_LOCATION')"
# Modify if it is a base directory

View File

@@ -1,3 +1,4 @@
- Add ingress_disabled option
- Ingress addition
- Base url set to "readarr"

View File

@@ -66,7 +66,7 @@ RUN if [ -d /etc/cont-init.d ]; then chmod -R 755 /etc/cont-init.d; fi && \
if [ -f /entrypoint.sh ]; then chmod 755 /entrypoint.sh; fi
# Modules
ARG MODULES="00-banner.sh 01-custom_script.sh 92-local_mounts.sh 92-smb_mounts.sh"
ARG MODULES="00-banner.sh 01-custom_script.sh 90-disable_ingress.sh 92-local_mounts.sh 92-smb_mounts.sh"
# Automatic modules download
RUN if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \

View File

@@ -78,10 +78,11 @@
"TZ": "str?",
"cifspassword": "str?",
"cifsusername": "str?",
"ingress_disabled": "bool?",
"localdisks": "str?",
"networkdisks": "str?"
},
"slug": "readarr_nas",
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/readarr",
"version": "nightly-0.1.2.1558-ls159-9"
"version": "nightly-0.1.2.1558-ls159-10"
}

View File

@@ -2,12 +2,13 @@
# shellcheck shell=bash
# ==============================================================================
# Set variables
slug=readarr
port=8787
CONFIG_LOCATION=/config/addons_config/"$slug"/config.xml
# Wait for transmission to become available
bashio::net.wait_for 8787 localhost 900
# Set base url
CONFIG_LOCATION=/config/addons_config/readarr/config.xml
bashio::net.wait_for "$port" localhost 900
if bashio::config.has_value 'CONFIG_LOCATION'; then
CONFIG_LOCATION="$(bashio::config 'CONFIG_LOCATION')"
@@ -16,12 +17,25 @@ if bashio::config.has_value 'CONFIG_LOCATION'; then
CONFIG_LOCATION="$CONFIG_LOCATION"/config.xml
fi
if ! grep -q "<UrlBase>/readarr</UrlBase>" "$CONFIG_LOCATION"; then
# Set UrlBase
if ! grep -q "<UrlBase>/$slug</UrlBase>" "$CONFIG_LOCATION" && ! bashio::config.true "ingress_disabled"; then; then
bashio::log.warning "BaseUrl not set properly, restarting"
sed -i "/UrlBase/d" "$CONFIG_LOCATION"
sed -i "/<Config>/a <UrlBase>\/readarr<\/UrlBase>" "$CONFIG_LOCATION"
sed -i "/<Config>/a <UrlBase>\/$slug<\/UrlBase>" "$CONFIG_LOCATION"
bashio::addon.restart
fi
# Disable Ingress
if bashio::config.true "ingress_disabled"; then
bashio::log.info "Ingress is disabled, removing base url"
# Remove BaseUrl
if grep -q "$slug" "$CONFIG_LOCATION"; then
bashio::log.warning "BaseUrl removed, restarting"
sed -i "/$slug/d" "$CONFIG_LOCATION"
bashio::addon.restart
fi
fi
bashio::log.info "Starting NGinx..."
exec nginx

View File

@@ -1,3 +1,4 @@
- Add ingress_disabled option
- Ingress addition
- BaseUrl definition to "sonarr"
- WARNING : update to supervisor 2022.11 before installing

View File

@@ -66,7 +66,7 @@ RUN if [ -d /etc/cont-init.d ]; then chmod -R 755 /etc/cont-init.d; fi && \
if [ -f /entrypoint.sh ]; then chmod 755 /entrypoint.sh; fi
# Modules
ARG MODULES="00-banner.sh 01-custom_script.sh 92-local_mounts.sh 92-smb_mounts.sh"
ARG MODULES="00-banner.sh 01-custom_script.sh 90-disable_ingress.sh 92-local_mounts.sh 92-smb_mounts.sh"
# Automatic modules download
RUN if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \

View File

@@ -77,11 +77,12 @@
"TZ": "str?",
"cifspassword": "str?",
"cifsusername": "str?",
"ingress_disabled": "bool?",
"localdisks": "str?",
"networkdisks": "str?",
"smbv1": "bool?"
},
"slug": "sonarr_nas",
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/sonarr",
"version": "3.0.9.1549-7"
"version": "3.0.9.1549-8"
}

View File

@@ -2,11 +2,14 @@
# shellcheck shell=bash
# ==============================================================================
# Wait for transmission to become available
bashio::net.wait_for 8989 localhost 900
# Set variables
slug=sonarr
port=8989
CONFIG_LOCATION=/config/addons_config/"$slug"/config.xml
# Wait for transmission to become available
bashio::net.wait_for "$port" localhost 900
# Set base url
CONFIG_LOCATION=/config/addons_config/sonarr/config.xml
if bashio::config.has_value 'CONFIG_LOCATION'; then
CONFIG_LOCATION="$(bashio::config 'CONFIG_LOCATION')"
# Modify if it is a base directory
@@ -14,12 +17,25 @@ if bashio::config.has_value 'CONFIG_LOCATION'; then
CONFIG_LOCATION="$CONFIG_LOCATION"/config.xml
fi
if ! grep -q "<UrlBase>/sonarr</UrlBase>" "$CONFIG_LOCATION"; then
# Set UrlBase
if ! grep -q "<UrlBase>/$slug</UrlBase>" "$CONFIG_LOCATION" && ! bashio::config.true "ingress_disabled"; then; then
bashio::log.warning "BaseUrl not set properly, restarting"
sed -i "/UrlBase/d" "$CONFIG_LOCATION"
sed -i "/<Config>/a <UrlBase>\/sonarr<\/UrlBase>" "$CONFIG_LOCATION"
sed -i "/<Config>/a <UrlBase>\/$slug<\/UrlBase>" "$CONFIG_LOCATION"
bashio::addon.restart
fi
# Disable Ingress
if bashio::config.true "ingress_disabled"; then
bashio::log.info "Ingress is disabled, removing base url"
# Remove BaseUrl
if grep -q "$slug" "$CONFIG_LOCATION"; then
bashio::log.warning "BaseUrl removed, restarting"
sed -i "/$slug/d" "$CONFIG_LOCATION"
bashio::addon.restart
fi
fi
bashio::log.info "Starting NGinx..."
exec nginx

View File

@@ -242,7 +242,7 @@ configuration:
description: See upstream app documentation
ingress_disabled:
name: ingress_disabled
description: See upstream app documentation
description: Remove baseurl and disable ingress
ingress_user:
name: ingress_user
description: See upstream app documentation