Single file for internal and external Caddyfile
This commit is contained in:
parent
86d4a5030d
commit
1dde43aa22
@ -1,5 +1,5 @@
|
||||
name: "3DPrinter-OctoPrint"
|
||||
version: "2023.01.03"
|
||||
version: "2023.01.04"
|
||||
slug: "3dprinter-octoprint"
|
||||
description: "OctoPrint as an addon, no additional bells and whistles."
|
||||
url: "https://github.com/fredrikbaberg/home-assistant-addons/tree/main/3dprinter-octoprint"
|
||||
|
||||
@ -4,20 +4,14 @@
|
||||
# Configures proxy
|
||||
# ==============================================================================
|
||||
|
||||
# Generate proxy configuration for internal access
|
||||
# Generate proxy configuration for internal and external access
|
||||
bashio::var.json \
|
||||
addon_hostname "$(bashio::addon.hostname)" \
|
||||
addon_ip "$(bashio::addon.ip_address)" \
|
||||
| tempio \
|
||||
-template /usr/share/tempio/caddy/Caddyfile.internal.gtpl \
|
||||
-out /etc/caddy/sites-enabled/internal.caddy
|
||||
|
||||
# Generate proxy configuration for external access
|
||||
bashio::var.json \
|
||||
trusted_proxies "$(bashio::config 'trusted_proxies')" \
|
||||
| tempio \
|
||||
-template /usr/share/tempio/caddy/Caddyfile.external.gtpl \
|
||||
-out /etc/caddy/sites-enabled/external.caddy
|
||||
-template /usr/share/tempio/caddy/Caddyfile.internal_external.gtpl \
|
||||
-out /etc/caddy/sites-enabled/internal_external.caddy
|
||||
|
||||
# Generate proxy configuration for access by Ingress
|
||||
# bashio::var.json \
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
# OctoPrint WebUI through external access
|
||||
:5000 {
|
||||
reverse_proxy http://127.0.0.1:80 {
|
||||
trusted_proxies {{ .trusted_proxies }}
|
||||
}
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
# Internal access, e.g. for Home-Assistant OctoPrint integration.
|
||||
:5000 {
|
||||
bind {{ .addon_ip }}
|
||||
reverse_proxy http://127.0.0.1:80 {
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
# Internal and external access. Used for:
|
||||
# * Home-Assistant OctoPrint integration.
|
||||
# * Accessing OctoPrint WebUI through external port.
|
||||
:5000 {
|
||||
reverse_proxy http://127.0.0.1:80 {
|
||||
trusted_proxies {{ .trusted_proxies }}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user