26 lines
977 B
Bash
26 lines
977 B
Bash
#!/usr/bin/with-contenv bashio
|
|
# ==============================================================================
|
|
# Add-on: 3dprinter-octoprint
|
|
# Configures proxy
|
|
# ==============================================================================
|
|
|
|
# Generate Ingress configuration
|
|
bashio::var.json \
|
|
interface "$(bashio::addon.ip_address)" \
|
|
port "^$(bashio::addon.ingress_port)" \
|
|
ingress_entry "$(bashio::addon.ingress_entry)" \
|
|
camera_host "$(bashio::config 'camera_url')" \
|
|
| tempio \
|
|
-template /usr/share/tempio/Caddyfile.ingress.gtpl \
|
|
-out /etc/caddy/sites-enabled/ingress
|
|
|
|
# Generate direct access configuration, if enabled.
|
|
if bashio::var.has_value "$(bashio::addon.port 5000)"; then
|
|
bashio::var.json \
|
|
interface "$(bashio::addon.ip_address)" \
|
|
port "^$(bashio::addon.port 5000)" \
|
|
| tempio \
|
|
-template /usr/share/tempio/Caddyfile.direct.gtpl \
|
|
-out /etc/caddy/sites-enabled/direct
|
|
fi
|