Use list for mode; cleanup
This commit is contained in:
parent
52daae2816
commit
301b49b79b
@ -1,5 +1,5 @@
|
||||
name: "3DPrinter-OctoPrint"
|
||||
version: "2022.11.01"
|
||||
version: "2022.11.02"
|
||||
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"
|
||||
|
||||
@ -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
|
||||
log {
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
bashio::var.json \
|
||||
interface "$(bashio::addon.ip_address)" \
|
||||
port "^$(bashio::addon.ingress_port)" \
|
||||
port "^$(bashio::addon.port 5000)" \
|
||||
ingress_entry "$(bashio::addon.ingress_entry)" \
|
||||
camera_host "$(bashio::config 'camera_url')" \
|
||||
recovery "$(bashio::config 'recovery')" \
|
||||
reverse_proxy_test "$(bashio::config 'reverse_proxy_test')" \
|
||||
mode "$(bashio::config 'mode')" \
|
||||
| tempio \
|
||||
-template /usr/share/tempio/Caddyfile.gtpl \
|
||||
-out /etc/caddy/Caddyfile
|
||||
|
||||
@ -12,12 +12,11 @@
|
||||
}
|
||||
uri strip_prefix {{ .ingress_entry }}
|
||||
handle {
|
||||
# {{ if .recovery }}
|
||||
# rewrite / /recovery
|
||||
# {{ end }}
|
||||
# {{ if .reverse_proxy_test }}
|
||||
# rewrite / /reverse_proxy_test
|
||||
# {{ end }}
|
||||
{{ if eq .mode "recovery" }}
|
||||
rewrite / /recovery
|
||||
{{ else if eq .mode "reverse_proxy_test" }}
|
||||
rewrite / /reverse_proxy_test
|
||||
{{ else }}
|
||||
reverse_proxy @ingress 127.0.0.1:80 {
|
||||
header_up X-Script-Name {{ .ingress_entry }}
|
||||
header_up -Origin
|
||||
@ -26,12 +25,15 @@
|
||||
header_up X-Scheme {scheme}
|
||||
flush_interval -1
|
||||
}
|
||||
{{ end }}
|
||||
}
|
||||
}
|
||||
|
||||
{{ if .external_port }}
|
||||
# OctoPrint WebUI
|
||||
:5000 {
|
||||
reverse_proxy http://127.0.0.1:80 {
|
||||
header_up X-Scheme {scheme}
|
||||
}
|
||||
}
|
||||
{{ end }}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user