From 75594805e53b70ec206db7419638566578b9be69 Mon Sep 17 00:00:00 2001 From: mini-pc-01 Date: Sun, 8 Feb 2026 21:09:34 +0100 Subject: [PATCH] home assistant --- .gitignore | 4 +++ Containers/HomeAssistant/compose.yaml | 34 +++++++++++++++++++ .../HomeAssistant/config/configuration.yaml | 18 ++++++++++ .../serveconfig/serve-config.json | 19 +++++++++++ 4 files changed, 75 insertions(+) create mode 100644 Containers/HomeAssistant/compose.yaml create mode 100644 Containers/HomeAssistant/config/configuration.yaml create mode 100644 Containers/HomeAssistant/serveconfig/serve-config.json diff --git a/.gitignore b/.gitignore index 87e61b2..022e77e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,10 @@ /Containers/Navidrome/data/* !/Containers/Navidrome/data/navidrome.toml +!/Containers/HomeAssistant/config/ +/Containers/HomeAssistant/config/* +!/Containers/HomeAssistant/config/configuration.yaml + # Scripts !/Scripts/* diff --git a/Containers/HomeAssistant/compose.yaml b/Containers/HomeAssistant/compose.yaml new file mode 100644 index 0000000..e629a7d --- /dev/null +++ b/Containers/HomeAssistant/compose.yaml @@ -0,0 +1,34 @@ +services: + home-assistant-ts: + image: tailscale/tailscale + container_name: home-assistant-ts + cap_add: + - net_admin + devices: + - /dev/net/tun:/dev/net/tun + volumes: + - ./tailscale/state:/var/lib/tailscale + - ./serveconfig:/config + environment: + - TS_AUTHKEY=${TS_AUTHKEY} + - TS_EXTRA_ARGS=--advertise-tags=tag:home-assistant --reset + - TS_STATE_DIR=/var/lib/tailscale + - TS_SERVE_CONFIG=/config/serve-config.json + - TS_USERSPACE=false + hostname: home + restart: unless-stopped + + home-assistant: + container_name: home-assistant + image: "ghcr.io/home-assistant/home-assistant:stable" + volumes: + - ./config:/config + - /etc/localtime:/etc/localtime:ro + - /run/dbus:/run/dbus:ro + devices: + - /dev/ttyUSB0:/dev/ttyUSB0 + restart: unless-stopped + network_mode: service:home-assistant-ts + environment: + TZ: Europe/France + diff --git a/Containers/HomeAssistant/config/configuration.yaml b/Containers/HomeAssistant/config/configuration.yaml new file mode 100644 index 0000000..2615661 --- /dev/null +++ b/Containers/HomeAssistant/config/configuration.yaml @@ -0,0 +1,18 @@ + +# 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 + +http: + use_x_forwarded_for: true + trusted_proxies: + - 127.0.0.1 + - 100.64.0.0/10 + diff --git a/Containers/HomeAssistant/serveconfig/serve-config.json b/Containers/HomeAssistant/serveconfig/serve-config.json new file mode 100644 index 0000000..8661448 --- /dev/null +++ b/Containers/HomeAssistant/serveconfig/serve-config.json @@ -0,0 +1,19 @@ +{ + "TCP": { + "443": { + "HTTPS": true + } + }, + "Web": { + "${TS_CERT_DOMAIN}:443": { + "Handlers": { + "/": { + "Proxy": "http://127.0.0.1:8123" + } + } + } + }, + "AllowFunnel": { + "${TS_CERT_DOMAIN}:443": false + } +}