Use list for mode; cleanup
This commit is contained in:
parent
52daae2816
commit
301b49b79b
@ -1,5 +1,5 @@
|
|||||||
name: "3DPrinter-OctoPrint"
|
name: "3DPrinter-OctoPrint"
|
||||||
version: "2022.11.01"
|
version: "2022.11.02"
|
||||||
slug: "3dprinter-octoprint"
|
slug: "3dprinter-octoprint"
|
||||||
description: "OctoPrint as an addon, no additional bells and whistles."
|
description: "OctoPrint as an addon, no additional bells and whistles."
|
||||||
url: "https://github.com/fredrikbaberg/home-assistant-addons/tree/main/3dprinter-octoprint"
|
url: "https://github.com/fredrikbaberg/home-assistant-addons/tree/main/3dprinter-octoprint"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# This file is a placeholder and will be replaced on
|
# This file is a placeholder and will be replaced on launch.
|
||||||
{
|
{
|
||||||
debug
|
debug
|
||||||
log {
|
log {
|
||||||
|
|||||||
@ -8,10 +8,10 @@
|
|||||||
bashio::var.json \
|
bashio::var.json \
|
||||||
interface "$(bashio::addon.ip_address)" \
|
interface "$(bashio::addon.ip_address)" \
|
||||||
port "^$(bashio::addon.ingress_port)" \
|
port "^$(bashio::addon.ingress_port)" \
|
||||||
|
port "^$(bashio::addon.port 5000)" \
|
||||||
ingress_entry "$(bashio::addon.ingress_entry)" \
|
ingress_entry "$(bashio::addon.ingress_entry)" \
|
||||||
camera_host "$(bashio::config 'camera_url')" \
|
camera_host "$(bashio::config 'camera_url')" \
|
||||||
recovery "$(bashio::config 'recovery')" \
|
mode "$(bashio::config 'mode')" \
|
||||||
reverse_proxy_test "$(bashio::config 'reverse_proxy_test')" \
|
|
||||||
| tempio \
|
| tempio \
|
||||||
-template /usr/share/tempio/Caddyfile.gtpl \
|
-template /usr/share/tempio/Caddyfile.gtpl \
|
||||||
-out /etc/caddy/Caddyfile
|
-out /etc/caddy/Caddyfile
|
||||||
|
|||||||
@ -12,12 +12,11 @@
|
|||||||
}
|
}
|
||||||
uri strip_prefix {{ .ingress_entry }}
|
uri strip_prefix {{ .ingress_entry }}
|
||||||
handle {
|
handle {
|
||||||
# {{ if .recovery }}
|
{{ if eq .mode "recovery" }}
|
||||||
# rewrite / /recovery
|
rewrite / /recovery
|
||||||
# {{ end }}
|
{{ else if eq .mode "reverse_proxy_test" }}
|
||||||
# {{ if .reverse_proxy_test }}
|
rewrite / /reverse_proxy_test
|
||||||
# rewrite / /reverse_proxy_test
|
{{ else }}
|
||||||
# {{ end }}
|
|
||||||
reverse_proxy @ingress 127.0.0.1:80 {
|
reverse_proxy @ingress 127.0.0.1:80 {
|
||||||
header_up X-Script-Name {{ .ingress_entry }}
|
header_up X-Script-Name {{ .ingress_entry }}
|
||||||
header_up -Origin
|
header_up -Origin
|
||||||
@ -26,12 +25,15 @@
|
|||||||
header_up X-Scheme {scheme}
|
header_up X-Scheme {scheme}
|
||||||
flush_interval -1
|
flush_interval -1
|
||||||
}
|
}
|
||||||
|
{{ end }}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{{ if .external_port }}
|
||||||
# OctoPrint WebUI
|
# OctoPrint WebUI
|
||||||
:5000 {
|
:5000 {
|
||||||
reverse_proxy http://127.0.0.1:80 {
|
reverse_proxy http://127.0.0.1:80 {
|
||||||
header_up X-Scheme {scheme}
|
header_up X-Scheme {scheme}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
{{ end }}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user