mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-13 16:34:22 +01:00
26 lines
813 B
Bash
Executable File
26 lines
813 B
Bash
Executable File
#!/usr/bin/with-contenv bashio
|
|
# shellcheck shell=bash
|
|
set -e
|
|
|
|
#################
|
|
# NGINX SETTING #
|
|
#################
|
|
|
|
declare ingress_interface
|
|
declare ingress_port
|
|
declare ingress_entry
|
|
|
|
echo "Adapting for ingress"
|
|
|
|
# Remove backend api url to use the base path
|
|
sed -i "s|'/server'|''|g" /app/back/app.conf
|
|
sed -i "s|(\$is_trusted != \"TRUSTED\")|(\$is_trusted = \"AAA\")|g" /services/config/nginx/netalertx.conf.template
|
|
|
|
# Adapt nginx configuration
|
|
ingress_port=$(bashio::addon.ingress_port)
|
|
ingress_interface=$(bashio::addon.ip_address)
|
|
ingress_entry=$(bashio::addon.ingress_entry)
|
|
sed -i "s|%%port%%|${ingress_port}|g" /etc/nginx/http.d/ingress.conf
|
|
sed -i "s|%%interface%%|${ingress_interface}|g" /etc/nginx/http.d/ingress.conf
|
|
sed -i "s|%%ingress_entry%%|${ingress_entry}|g" /etc/nginx/http.d/ingress.conf
|