Revert to single Caddyfile
This commit is contained in:
parent
75a7bee519
commit
a9259cb33b
@ -1,5 +1,5 @@
|
||||
name: "3DPrinter-OctoPrint"
|
||||
version: "2022.12.01"
|
||||
version: "2022.12.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 @@
|
||||
# Main Caddy configuration file. Config for Ingress/direct will be stored in subfiles.
|
||||
# Temporary file, will be overwritten on launch.
|
||||
{
|
||||
debug
|
||||
log {
|
||||
@ -6,4 +6,3 @@
|
||||
output file /var/log/caddy/caddy.log
|
||||
}
|
||||
}
|
||||
import configs/*.caddy
|
||||
|
||||
@ -12,14 +12,5 @@ bashio::var.json \
|
||||
camera_host "$(bashio::config 'camera_url')" \
|
||||
mode "$(bashio::config 'mode')" \
|
||||
| tempio \
|
||||
-template /usr/share/tempio/caddy/Caddyfile.ingress.gtpl \
|
||||
-out /etc/caddy/configs/ingress.caddy
|
||||
|
||||
# Generate proxy configuration for direct access, if enabled.
|
||||
if bashio::var.has_value "$(bashio::addon.port 5000)"; then
|
||||
bashio::var.json \
|
||||
mode "$(bashio::config 'mode')" \
|
||||
| tempio \
|
||||
-template /usr/share/tempio/caddy/Caddyfile.direct.gtpl \
|
||||
-out /etc/caddy/configs/direct.caddy
|
||||
fi
|
||||
-template /usr/share/tempio/caddy/Caddyfile.gtpl \
|
||||
-out /etc/caddy/Caddyfile
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
# OctoPrint WebUI
|
||||
:5000 {
|
||||
reverse_proxy http://127.0.0.1:80 {
|
||||
header_up X-Scheme {scheme}
|
||||
}
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
:8099 {
|
||||
@ingress {
|
||||
remote_ip 172.30.32.2
|
||||
}
|
||||
uri strip_prefix {{ .ingress_entry }}
|
||||
|
||||
handle_path /camera/* {
|
||||
reverse_proxy @ingress {{ .camera_host }} {
|
||||
}
|
||||
}
|
||||
|
||||
handle {
|
||||
{{ if eq .mode "camera" }}
|
||||
reverse_proxy @ingress {{ .camera_host }} {}
|
||||
{{ else if eq .mode "recovery" }}
|
||||
rewrite / /recovery
|
||||
{{ else if eq .mode "reverse_proxy_test" }}
|
||||
rewrite / /reverse_proxy_test
|
||||
{{ end }}
|
||||
reverse_proxy @ingress 127.0.0.1:80 {
|
||||
header_up X-Script-Name {{ .ingress_entry }}
|
||||
header_up -Origin
|
||||
header_up Origin 172.30.32.2
|
||||
header_up X-Forwarded-For 172.30.32.2
|
||||
header_up X-Scheme {scheme}
|
||||
flush_interval -1
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user