From 88e298b03db24ce0b424a3e0f56fb3c549459803 Mon Sep 17 00:00:00 2001 From: Mika Bomm Date: Sun, 4 Aug 2024 13:39:48 +0200 Subject: [PATCH] offload caddyfiles and configure reverse proxy for homeassistant --- .gitignore | 2 ++ caddy/Caddyfile | 20 ------------------- caddy/services/ddns-updater.caddy | 6 ++++++ caddy/services/doozle.caddy | 6 ++++++ caddy/services/homeassistant.caddy | 6 ++++++ caddy/services/stirling-pdf.caddy | 7 ++++++- caddy/services/vscode-server.caddy | 6 ++++++ .../homeassistant/config/configuration.yaml | 19 ++++++++++++++++++ 8 files changed, 51 insertions(+), 21 deletions(-) create mode 100644 caddy/services/ddns-updater.caddy create mode 100644 caddy/services/doozle.caddy create mode 100644 caddy/services/homeassistant.caddy create mode 100644 caddy/services/vscode-server.caddy create mode 100644 homeassistant/homeassistant/config/configuration.yaml diff --git a/.gitignore b/.gitignore index 967e4db..0447067 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ !**/data/config.json +# Homeassistant +!**/homeassistant/config/configuration.yaml \ No newline at end of file diff --git a/caddy/Caddyfile b/caddy/Caddyfile index 3ecb6de..b206f74 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -30,26 +30,6 @@ # Import service-specific Caddyfiles import /etc/caddy/services/*.caddy -code-server.mini1.docker.local { - import logging - reverse_proxy 192.168.178.230:8443 -} - -ddns.mini1.docker.local { - import logging - reverse_proxy 192.168.178.230:55555 -} - -doozle.mini1.docker.local { - import logging - reverse_proxy 192.168.178.230:60345 -} - -ha.mini1.docker.local { - import logging - reverse_proxy 192.168.178.230:8123 -} - mini1.docker.local { reverse_proxy 192.168.178.230:55556 } diff --git a/caddy/services/ddns-updater.caddy b/caddy/services/ddns-updater.caddy new file mode 100644 index 0000000..17d8185 --- /dev/null +++ b/caddy/services/ddns-updater.caddy @@ -0,0 +1,6 @@ +# External + +# Internal +ddns.mini1.docker.local { + reverse_proxy 192.168.178.230:55555 +} \ No newline at end of file diff --git a/caddy/services/doozle.caddy b/caddy/services/doozle.caddy new file mode 100644 index 0000000..052a392 --- /dev/null +++ b/caddy/services/doozle.caddy @@ -0,0 +1,6 @@ +# External + +# Internal +doozle.mini1.docker.local { + reverse_proxy 192.168.178.230:60345 +} \ No newline at end of file diff --git a/caddy/services/homeassistant.caddy b/caddy/services/homeassistant.caddy new file mode 100644 index 0000000..2cce51b --- /dev/null +++ b/caddy/services/homeassistant.caddy @@ -0,0 +1,6 @@ +# External + +# Internal +ha.mini1.docker.local { + reverse_proxy 192.168.178.230:8123 +} \ No newline at end of file diff --git a/caddy/services/stirling-pdf.caddy b/caddy/services/stirling-pdf.caddy index c7ef2fa..ed14865 100644 --- a/caddy/services/stirling-pdf.caddy +++ b/caddy/services/stirling-pdf.caddy @@ -1,3 +1,8 @@ pdf2.mixel.cloud { reverse_proxy 192.168.178.230:55556 -} \ No newline at end of file +} + +pdf.mini1.docker.local { + reverse_proxy 192.168.178.230:55556 +} + diff --git a/caddy/services/vscode-server.caddy b/caddy/services/vscode-server.caddy new file mode 100644 index 0000000..83c5f22 --- /dev/null +++ b/caddy/services/vscode-server.caddy @@ -0,0 +1,6 @@ +# External + +# Internal +code-server.mini1.docker.local { + reverse_proxy 192.168.178.230:8443 +} \ No newline at end of file diff --git a/homeassistant/homeassistant/config/configuration.yaml b/homeassistant/homeassistant/config/configuration.yaml new file mode 100644 index 0000000..6672fd1 --- /dev/null +++ b/homeassistant/homeassistant/config/configuration.yaml @@ -0,0 +1,19 @@ + +# Loads default set of integrations. Do not remove. +default_config: + +# Load frontend themes from the themes folder +frontend: + themes: !include_dir_merge_named themes + +automation: !include automations.yaml +script: !include scripts.yaml +scene: !include scenes.yaml + + +# Reverse proxy configuration +http: + use_x_forwarded_for: true + trusted_proxies: + - 192.168.178.0/24 # Local IP + - 172.27.0.0/24 # Docker Network IP Subnet