mirror of
https://github.com/hassio-addons/addon-motioneye.git
synced 2025-05-05 03:31:22 +00:00
26 lines
1,011 B
Bash
26 lines
1,011 B
Bash
#!/usr/bin/with-contenv bashio
|
|
# ==============================================================================
|
|
# Home Assistant Community Add-on: motionEye
|
|
# Configures NGINX for use with motionEye
|
|
# ==============================================================================
|
|
|
|
# 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')" \
|
|
port "^$(bashio::addon.port 80)" \
|
|
ssl "^$(bashio::config 'ssl')" \
|
|
| tempio \
|
|
-template /etc/nginx/templates/direct.gtpl \
|
|
-out /etc/nginx/servers/direct.conf
|
|
fi
|