Separate internal and external access, again.
This commit is contained in:
parent
dcc46a98f2
commit
55a0d03a93
@ -1,5 +1,5 @@
|
|||||||
name: "3DPrinter-OctoPrint"
|
name: "3DPrinter-OctoPrint"
|
||||||
version: "2023.01.01"
|
version: "2023.01.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"
|
||||||
@ -23,13 +23,13 @@ ports:
|
|||||||
5000/tcp: null
|
5000/tcp: null
|
||||||
ports_description:
|
ports_description:
|
||||||
5000/tcp: Web-based interface
|
5000/tcp: Web-based interface
|
||||||
# options:
|
options:
|
||||||
# camera_url: "http://b7aa59c4-camera-mjpg-streamer"
|
trusted_proxies: ""
|
||||||
# mode: normal
|
# camera_url: "http://b7aa59c4-camera-mjpg-streamer"
|
||||||
# trusted_proxies: ""
|
# mode: normal
|
||||||
# schema:
|
schema:
|
||||||
# camera_url: "url?"
|
trusted_proxies: "str?"
|
||||||
# mode: "list(normal|recovery|reverse_proxy_test|camera)?"
|
# camera_url: "url?"
|
||||||
# trusted_proxies: "str?"
|
# mode: "list(normal|recovery|reverse_proxy_test|camera)?"
|
||||||
tmpfs: true
|
tmpfs: true
|
||||||
image: ghcr.io/fredrikbaberg/ha-addon-3dprinter-octoprint-{arch}
|
image: ghcr.io/fredrikbaberg/ha-addon-3dprinter-octoprint-{arch}
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
# OctoPrint WebUI through any access (external or internal)
|
|
||||||
:5000 {
|
|
||||||
reverse_proxy http://127.0.0.1:80 {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -4,6 +4,21 @@
|
|||||||
# Configures proxy
|
# Configures proxy
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|
||||||
|
# Generate proxy configuration for internal 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
|
||||||
|
|
||||||
# Generate proxy configuration for access by Ingress
|
# Generate proxy configuration for access by Ingress
|
||||||
# bashio::var.json \
|
# bashio::var.json \
|
||||||
# addon_hostname "$(bashio::addon.hostname)" \
|
# addon_hostname "$(bashio::addon.hostname)" \
|
||||||
@ -19,17 +34,6 @@
|
|||||||
# -template /usr/share/tempio/caddy/Caddyfile.ingress.gtpl \
|
# -template /usr/share/tempio/caddy/Caddyfile.ingress.gtpl \
|
||||||
# -out /etc/caddy/sites-enabled/ingress.caddy
|
# -out /etc/caddy/sites-enabled/ingress.caddy
|
||||||
|
|
||||||
# Generate proxy configuration for any access
|
|
||||||
# tempio \
|
|
||||||
# -template /usr/share/tempio/caddy/Caddyfile.any.gtpl \
|
|
||||||
# -out /etc/caddy/sites-enabled/any.caddy
|
|
||||||
|
|
||||||
# # Generate proxy configuration for internal access
|
# Make sure config is correctly formatted.
|
||||||
# bashio::var.json \
|
caddy fmt --overwrite /etc/caddy/Caddyfile
|
||||||
# addon_hostname "$(bashio::addon.hostname)" \
|
|
||||||
# | tempio \
|
|
||||||
# -template /usr/share/tempio/caddy/Caddyfile.internal.gtpl \
|
|
||||||
# -out /etc/caddy/sites-enabled/internal.caddy
|
|
||||||
|
|
||||||
# Make sure file is correctly formatted.
|
|
||||||
# caddy fmt --overwrite /etc/caddy/Caddyfile
|
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
# OctoPrint WebUI through external access
|
||||||
|
:5000 {
|
||||||
|
reverse_proxy http://127.0.0.1:80 {
|
||||||
|
trusted_proxies {{ .trusted_proxies }}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
# WebUI through internal hostname
|
# Internal access, e.g. for Home-Assistant OctoPrint integration.
|
||||||
{{ .addon_hostname }}:5000 {
|
:5000 {
|
||||||
|
bind {{ .addon_ip }}
|
||||||
reverse_proxy http://127.0.0.1:80 {
|
reverse_proxy http://127.0.0.1:80 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user