addon-glances/glances/rootfs/etc/cont-init.d/nginx.sh
Franck Nijhof da9bd0032e
⬆️ Upgrades add-on base image to 12.0.0 (#264)
* ⬆️ Upgrades add-on base image to 12.0.0

* Shellcheck actually caught a bug! :D

* Init true is the default
2022-06-11 13:17:26 +02:00

27 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bashio
# ==============================================================================
# Home Assistant Community Add-on: SSH & Web Terminal
# Configures NGINX for use with ttyd
# ==============================================================================
# Generate Ingress configuration
bashio::var.json \
interface "$(bashio::addon.ip_address)" \
port "^$(bashio::addon.ingress_port)" \
| tempio \
-template /etc/nginx/templates/ingress.gtpl \
-out /etc/nginx/servers/ingress.conf
# Generate direct access configuration, if enabled.
if bashio::var.has_value "$(bashio::addon.port 80)"; then
bashio::config.require.ssl
bashio::var.json \
certfile "$(bashio::config 'certfile')" \
keyfile "$(bashio::config 'keyfile')" \
leave_front_door_open "^$(bashio::config 'leave_front_door_open')" \
port "^$(bashio::addon.port 80)" \
ssl "^$(bashio::config 'ssl')" \
| tempio \
-template /etc/nginx/templates/direct.gtpl \
-out /etc/nginx/servers/direct.conf
fi