mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-04-10 16:40:01 +02:00
28 lines
781 B
Bash
28 lines
781 B
Bash
#!/usr/bin/with-contenv bashio
|
|
|
|
#################
|
|
# NGINX SETTING #
|
|
#################
|
|
|
|
declare admin_port
|
|
declare portainer_protocol=http
|
|
|
|
# Generate Ingress configuration
|
|
if bashio::config.true 'ssl'; then
|
|
portainer_protocol=https
|
|
sed -i "s|9000|9443|g" /etc/nginx/includes/upstream.conf
|
|
sed -i '/listen/a listen {{ .interface }}:9000 default_server;' /etc/nginx/templates/ingress.gtpl
|
|
fi
|
|
|
|
bashio::var.json \
|
|
interface "$(bashio::addon.ip_address)" \
|
|
port "^$(bashio::addon.ingress_port)" \
|
|
protocol "${portainer_protocol}" \
|
|
certfile "$(bashio::config 'certfile')" \
|
|
keyfile "$(bashio::config 'keyfile')" \
|
|
ssl "^$(bashio::config 'ssl')" \
|
|
| tempio \
|
|
-template /etc/nginx/templates/ingress.gtpl \
|
|
-out /etc/nginx/servers/ingress.conf
|
|
|