From daa92011c956555eef8862e0850b30573bf436ff Mon Sep 17 00:00:00 2001 From: Ananth Bhaskararaman Date: Sat, 31 May 2025 19:49:59 +0530 Subject: [PATCH 01/12] feat: Taildrive shares Share homeassistant directories to your Tailnet using Taildrive. --- tailscale/DOCS.md | 1 + tailscale/config.yaml | 9 ++++ .../taildrive/dependencies.d/post-tailscaled | 0 .../etc/s6-overlay/s6-rc.d/taildrive/run | 46 +++++++++++++++++++ .../etc/s6-overlay/s6-rc.d/taildrive/type | 1 + .../etc/s6-overlay/s6-rc.d/taildrive/up | 1 + tailscale/translations/en.yaml | 6 +++ 7 files changed, 64 insertions(+) create mode 100644 tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/dependencies.d/post-tailscaled create mode 100755 tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run create mode 100644 tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/type create mode 100644 tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/up diff --git a/tailscale/DOCS.md b/tailscale/DOCS.md index b214eecee..43d637536 100644 --- a/tailscale/DOCS.md +++ b/tailscale/DOCS.md @@ -535,6 +535,7 @@ SOFTWARE. [tailscale_info_site_to_site]: https://tailscale.com/kb/1214/site-to-site [tailscale_info_subnets]: https://tailscale.com/kb/1019/subnets [tailscale_info_tags]: https://tailscale.com/kb/1068/tags +[tailscale_info_taildrive]: https://tailscale.com/kb/1369/taildrive [tailscale_info_taildrop]: https://tailscale.com/kb/1106/taildrop [tailscale_info_userspace_networking]: https://tailscale.com/kb/1112/userspace-networking [tailscale_machines]: https://login.tailscale.com/admin/machines diff --git a/tailscale/config.yaml b/tailscale/config.yaml index 5c018a4fe..3b320d5d3 100644 --- a/tailscale/config.yaml +++ b/tailscale/config.yaml @@ -23,7 +23,14 @@ privileged: devices: - /dev/net/tun map: + - homeassistant_config:rw + - addon_config:rw + - ssl:rw + - addons:rw + - backup:rw - share:rw + - media:rw + - all_addon_configs:rw ports: 41641/udp: null options: @@ -61,4 +68,6 @@ schema: tags: - "match(^tag:[a-zA-Z][a-zA-Z0-9-]*$)" taildrop: bool + taildrive: + - "match(^(?i:(homeassistant_config|addon_config|ssl|addons|backup|share|media))$)" userspace_networking: bool diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/dependencies.d/post-tailscaled b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/dependencies.d/post-tailscaled new file mode 100644 index 000000000..e69de29bb diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run new file mode 100755 index 000000000..47b809771 --- /dev/null +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run @@ -0,0 +1,46 @@ +#!/command/with-contenv bashio +# shellcheck shell=bash +# ============================================================================== +# Home Assistant Community Add-on: Tailscale +# Exposes Home Assistant directories over Taildrive +# ============================================================================== + +# Read configured directories from the add-on configuration. +if ! mapfile -t configured_share_names < <(bashio::config "taildrive"); then + bashio::exit.nok "Error reading configured directories from add-on configuration." +fi + +# Read currently shared directories into an array from tailscale drive list. +# The output of which looks like: +# name path as +# ---- ---- -- +# config /config config +if ! mapfile -t active_share_names < <(/opt/tailscale drive list | tail -n +3 | awk '{print $1}'); then + bashio::exit.nok "Error reading shared directories from Tailscale." +fi + +# If a directory is configured but not shared, share it. +for share_name in "${configured_share_names[@]}"; do + if ! printf '%s\0' "${active_share_names[@]}" | grep -Fxqz -- "${share_name}"; then + # Rewrite homeasstant_config to config + if [[ "${share_name}" == "homeassistant_config" ]]; then + share_name="config" + fi + + # Share the directory + /opt/tailscale drive share "${share_name}" "/${share_name}" + fi +done + +# If a directory is shared but not configured, unshare it. +for share_name in "${active_share_names[@]}"; do + if ! printf '%s\0' "${configured_share_names[@]}" | grep -Fxqz -- "${share_name}"; then + # Rewrite homeasstant_config to config + if [[ "${share_name}" == "homeassistant_config" ]]; then + share_name="config" + fi + + # Unshare the directory + /opt/taildrive drive unshare "${share_name}" + fi +done \ No newline at end of file diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/type b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/type new file mode 100644 index 000000000..bdd22a185 --- /dev/null +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/type @@ -0,0 +1 @@ +oneshot diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/up b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/up new file mode 100644 index 000000000..5f15bb532 --- /dev/null +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/taildrive/run \ No newline at end of file diff --git a/tailscale/translations/en.yaml b/tailscale/translations/en.yaml index d7bbffc5c..5ec014c1d 100644 --- a/tailscale/translations/en.yaml +++ b/tailscale/translations/en.yaml @@ -100,6 +100,12 @@ configuration: This option allows you to enable Taildrop, a file sharing service that allows you to share files with other Tailscale nodes. This option is enabled by default. + taildrive: + name: Taildrive Shares + description: >- + This option allows you to specify which Home Assistant directories you + want to share with other Tailscale nodes using Taildrive. + The listed values are the only allowed values. userspace_networking: name: Userspace networking mode description: >- From 8774247b449a74c19d8cf7a17bfc4b4f8e28c341 Mon Sep 17 00:00:00 2001 From: Laszlo Magyar Date: Tue, 10 Jun 2025 16:11:38 +0300 Subject: [PATCH 02/12] Several fixes (#1) Fix parsing Tailscale drive data. Fix homeassistant share config. --- tailscale/DOCS.md | 17 +++++ tailscale/config.yaml | 27 +++++-- .../etc/s6-overlay/s6-rc.d/taildrive/run | 72 +++++++++++-------- .../s6-rc.d/user/contents.d/taildrive | 0 tailscale/translations/en.yaml | 12 ++-- 5 files changed, 86 insertions(+), 42 deletions(-) create mode 100644 tailscale/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/taildrive diff --git a/tailscale/DOCS.md b/tailscale/DOCS.md index 43d637536..d91027e8c 100644 --- a/tailscale/DOCS.md +++ b/tailscale/DOCS.md @@ -83,6 +83,14 @@ stateful_filtering: false tags: - tag:example - tag:homeassistant +taildrive: + addons: false + addon_configs: false + backup: false + config: false + media: false + share: false + ssl: false taildrop: true userspace_networking: true ``` @@ -348,6 +356,15 @@ They need to start with `tag:`. More information: [Tags][tailscale_info_tags] +### Option: `taildrive` + +This option allows you to specify which Home Assistant directories you want to +share with other Tailscale nodes using Taildrive. + +Only the listed directories are available. + +More information: [Taildrive][tailscale_info_taildrive] + ### Option: `taildrop` This app supports [Tailscale's Taildrop][tailscale_info_taildrop] feature, diff --git a/tailscale/config.yaml b/tailscale/config.yaml index 3b320d5d3..bb970552c 100644 --- a/tailscale/config.yaml +++ b/tailscale/config.yaml @@ -23,14 +23,13 @@ privileged: devices: - /dev/net/tun map: - - homeassistant_config:rw - - addon_config:rw - - ssl:rw - addons:rw + - all_addon_configs:rw - backup:rw - - share:rw + - homeassistant_config:rw - media:rw - - all_addon_configs:rw + - share:rw + - ssl:rw ports: 41641/udp: null options: @@ -48,6 +47,14 @@ options: snat_subnet_routes: true stateful_filtering: false tags: [] + taildrive: + addons: false + addon_configs: false + backup: false + config: false + media: false + share: false + ssl: false taildrop: true userspace_networking: true schema: @@ -67,7 +74,13 @@ schema: stateful_filtering: bool tags: - "match(^tag:[a-zA-Z][a-zA-Z0-9-]*$)" - taildrop: bool taildrive: - - "match(^(?i:(homeassistant_config|addon_config|ssl|addons|backup|share|media))$)" + addons: bool + addon_configs: bool + backup: bool + config: bool + media: bool + share: bool + ssl: bool + taildrop: bool userspace_networking: bool diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run index 47b809771..c6b29f43c 100755 --- a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run @@ -5,42 +5,56 @@ # Exposes Home Assistant directories over Taildrive # ============================================================================== -# Read configured directories from the add-on configuration. -if ! mapfile -t configured_share_names < <(bashio::config "taildrive"); then - bashio::exit.nok "Error reading configured directories from add-on configuration." +# These are not arrays, but newline separated lists (single strings) +declare all_share_names +declare configured_share_names +declare active_share_names + +declare share_name + +# Check if Taildrive is available +if ! /opt/tailscale status --self=true --peers=false --json \ + | jq -rce '.Self.CapMap | has("drive:share")' > /dev/null; +then + bashio::exit.nok "Tailscale's Taildrive is disabled" +fi + +# Read all possible and configured directories from the add-on configuration. +if ! all_share_names=$(bashio::config 'taildrive' | jq -rc 'keys_unsorted[]') || \ + ! configured_share_names=$(bashio::config 'taildrive' | jq -rc 'to_entries[] | select(.value) | .key') +then + bashio::exit.nok "Error reading configured Taildrive directories from add-on configuration." fi # Read currently shared directories into an array from tailscale drive list. # The output of which looks like: -# name path as -# ---- ---- -- -# config /config config -if ! mapfile -t active_share_names < <(/opt/tailscale drive list | tail -n +3 | awk '{print $1}'); then - bashio::exit.nok "Error reading shared directories from Tailscale." +# name path as +# ------ ------- ---- +# config /config root +if ! active_share_names=$(/opt/tailscale drive list | tail -n +3 | awk '{print $1}'); then + bashio::exit.nok "Error reading shared Taildrive directories from Tailscale." fi +ln -s "/homeassistant" "/config" + # If a directory is configured but not shared, share it. -for share_name in "${configured_share_names[@]}"; do - if ! printf '%s\0' "${active_share_names[@]}" | grep -Fxqz -- "${share_name}"; then - # Rewrite homeasstant_config to config - if [[ "${share_name}" == "homeassistant_config" ]]; then - share_name="config" - fi - - # Share the directory - /opt/tailscale drive share "${share_name}" "/${share_name}" - fi +for share_name in ${configured_share_names}; do + if ! grep -Fxq -- "${share_name}" <<< "${active_share_names}"; then + bashio::log.info "Taildrive: sharing /${share_name}" + /opt/tailscale drive share "${share_name}" "/${share_name}" + else + bashio::log.info "Taildrive: /${share_name} is already shared" + fi done -# If a directory is shared but not configured, unshare it. -for share_name in "${active_share_names[@]}"; do - if ! printf '%s\0' "${configured_share_names[@]}" | grep -Fxqz -- "${share_name}"; then - # Rewrite homeasstant_config to config - if [[ "${share_name}" == "homeassistant_config" ]]; then - share_name="config" - fi - - # Unshare the directory - /opt/taildrive drive unshare "${share_name}" +# If a directory is shared but not configured, and managed by this add-on, unshare it. +for share_name in ${active_share_names}; do + if ! grep -Fxq -- "${share_name}" <<< "${configured_share_names}"; then + if grep -Fxq -- "${share_name}" <<< "${all_share_names}"; then + bashio::log.info "Taildrive: unsharing /${share_name}" + /opt/tailscale drive unshare "${share_name}" + else + bashio::log.info "Taildrive: skipping to unshare '${share_name}'" fi -done \ No newline at end of file + fi +done diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/taildrive b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/taildrive new file mode 100644 index 000000000..e69de29bb diff --git a/tailscale/translations/en.yaml b/tailscale/translations/en.yaml index 5ec014c1d..550db0484 100644 --- a/tailscale/translations/en.yaml +++ b/tailscale/translations/en.yaml @@ -94,18 +94,18 @@ configuration: description: >- This option allows you to specify specific ACL tags for this Tailscale instance. They need to start with `tag:`. + taildrive: + name: Taildrive shares + description: >- + This option allows you to specify which Home Assistant directories you want to + share with other Tailscale nodes using Taildrive. + Only the listed directories are available. taildrop: name: Taildrop description: >- This option allows you to enable Taildrop, a file sharing service that allows you to share files with other Tailscale nodes. This option is enabled by default. - taildrive: - name: Taildrive Shares - description: >- - This option allows you to specify which Home Assistant directories you - want to share with other Tailscale nodes using Taildrive. - The listed values are the only allowed values. userspace_networking: name: Userspace networking mode description: >- From 23755a4b8c63b639c689c115ea4157e02d954b9b Mon Sep 17 00:00:00 2001 From: Laszlo Magyar Date: Mon, 28 Jul 2025 12:04:15 +0200 Subject: [PATCH 03/12] Fix Taildrive breaking startup (#2) --- .../etc/s6-overlay/s6-rc.d/taildrive/run | 73 ++++++++++--------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run index c6b29f43c..6f819dce5 100755 --- a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run @@ -12,13 +12,6 @@ declare active_share_names declare share_name -# Check if Taildrive is available -if ! /opt/tailscale status --self=true --peers=false --json \ - | jq -rce '.Self.CapMap | has("drive:share")' > /dev/null; -then - bashio::exit.nok "Tailscale's Taildrive is disabled" -fi - # Read all possible and configured directories from the add-on configuration. if ! all_share_names=$(bashio::config 'taildrive' | jq -rc 'keys_unsorted[]') || \ ! configured_share_names=$(bashio::config 'taildrive' | jq -rc 'to_entries[] | select(.value) | .key') @@ -26,35 +19,45 @@ then bashio::exit.nok "Error reading configured Taildrive directories from add-on configuration." fi -# Read currently shared directories into an array from tailscale drive list. -# The output of which looks like: -# name path as -# ------ ------- ---- -# config /config root -if ! active_share_names=$(/opt/tailscale drive list | tail -n +3 | awk '{print $1}'); then - bashio::exit.nok "Error reading shared Taildrive directories from Tailscale." -fi - -ln -s "/homeassistant" "/config" - -# If a directory is configured but not shared, share it. -for share_name in ${configured_share_names}; do - if ! grep -Fxq -- "${share_name}" <<< "${active_share_names}"; then - bashio::log.info "Taildrive: sharing /${share_name}" - /opt/tailscale drive share "${share_name}" "/${share_name}" - else - bashio::log.info "Taildrive: /${share_name} is already shared" +# Check if Taildrive is available +if ! /opt/tailscale status --self=true --peers=false --json \ + | jq -rce '.Self.CapMap | has("drive:share")' > /dev/null; +then + # If Taildrive is not available but any share is configured, that is an error + if (( 0 < $(wc -w <<< ${configured_share_names}) )); then + bashio::exit.nok "Tailscale's Taildrive is disabled but directories are configured for sharing" + fi +else + # Read currently shared directories into an array from tailscale drive list. + # The output of which looks like: + # name path as + # ------ ------- ---- + # config /config root + if ! active_share_names=$(/opt/tailscale drive list | tail -n +3 | awk '{print $1}'); then + bashio::exit.nok "Error reading shared Taildrive directories from Tailscale." fi -done -# If a directory is shared but not configured, and managed by this add-on, unshare it. -for share_name in ${active_share_names}; do - if ! grep -Fxq -- "${share_name}" <<< "${configured_share_names}"; then - if grep -Fxq -- "${share_name}" <<< "${all_share_names}"; then - bashio::log.info "Taildrive: unsharing /${share_name}" - /opt/tailscale drive unshare "${share_name}" + ln -s "/homeassistant" "/config" + + # If a directory is configured but not shared, share it. + for share_name in ${configured_share_names}; do + if ! grep -Fxq -- "${share_name}" <<< "${active_share_names}"; then + bashio::log.info "Taildrive: sharing /${share_name}" + /opt/tailscale drive share "${share_name}" "/${share_name}" else - bashio::log.info "Taildrive: skipping to unshare '${share_name}'" + bashio::log.info "Taildrive: /${share_name} is already shared" fi - fi -done + done + + # If a directory is shared but not configured, and managed by this add-on, unshare it. + for share_name in ${active_share_names}; do + if ! grep -Fxq -- "${share_name}" <<< "${configured_share_names}"; then + if grep -Fxq -- "${share_name}" <<< "${all_share_names}"; then + bashio::log.info "Taildrive: unsharing /${share_name}" + /opt/tailscale drive unshare "${share_name}" + else + bashio::log.info "Taildrive: skipping to unshare '${share_name}'" + fi + fi + done +fi From 5047ed6e238c36449cb73f7c90d5b048753348d8 Mon Sep 17 00:00:00 2001 From: Laszlo Magyar Date: Wed, 5 Nov 2025 21:47:44 +0100 Subject: [PATCH 04/12] add export LOG_FD to each script (taildrive) --- tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run | 1 + 1 file changed, 1 insertion(+) diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run index 6f819dce5..c7bc40fa2 100755 --- a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run @@ -1,5 +1,6 @@ #!/command/with-contenv bashio # shellcheck shell=bash +export LOG_FD # ============================================================================== # Home Assistant Community Add-on: Tailscale # Exposes Home Assistant directories over Taildrive From 3e5c2ce19dc75fea73890339e6a322f89d823af9 Mon Sep 17 00:00:00 2001 From: Laszlo Magyar Date: Thu, 6 Nov 2025 12:23:44 +0100 Subject: [PATCH 05/12] improve error handling based on bunny's suggestions I went with exit.nok, let it fail as taildrop fails on startup. --- tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run index c7bc40fa2..54f416d89 100755 --- a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run @@ -44,7 +44,9 @@ else for share_name in ${configured_share_names}; do if ! grep -Fxq -- "${share_name}" <<< "${active_share_names}"; then bashio::log.info "Taildrive: sharing /${share_name}" - /opt/tailscale drive share "${share_name}" "/${share_name}" + if ! /opt/tailscale drive share "${share_name}" "/${share_name}"; then + bashio::exit.nok "Failed to share /${share_name}" + fi else bashio::log.info "Taildrive: /${share_name} is already shared" fi @@ -55,7 +57,9 @@ else if ! grep -Fxq -- "${share_name}" <<< "${configured_share_names}"; then if grep -Fxq -- "${share_name}" <<< "${all_share_names}"; then bashio::log.info "Taildrive: unsharing /${share_name}" - /opt/tailscale drive unshare "${share_name}" + if ! /opt/tailscale drive unshare "${share_name}"; then + bashio::exit.nok "Failed to unshare /${share_name}" + fi else bashio::log.info "Taildrive: skipping to unshare '${share_name}'" fi From cb5f67073e7287df64c9f20e997e36ae24e41dc3 Mon Sep 17 00:00:00 2001 From: Laszlo Magyar Date: Sun, 23 Nov 2025 16:09:56 +0100 Subject: [PATCH 06/12] fix typos in taildrive --- tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run index 54f416d89..460a550c6 100755 --- a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run @@ -25,7 +25,7 @@ if ! /opt/tailscale status --self=true --peers=false --json \ | jq -rce '.Self.CapMap | has("drive:share")' > /dev/null; then # If Taildrive is not available but any share is configured, that is an error - if (( 0 < $(wc -w <<< ${configured_share_names}) )); then + if (( 0 < $(wc -w <<< "${configured_share_names}") )); then bashio::exit.nok "Tailscale's Taildrive is disabled but directories are configured for sharing" fi else @@ -41,7 +41,7 @@ else ln -s "/homeassistant" "/config" # If a directory is configured but not shared, share it. - for share_name in ${configured_share_names}; do + for share_name in "${configured_share_names}"; do if ! grep -Fxq -- "${share_name}" <<< "${active_share_names}"; then bashio::log.info "Taildrive: sharing /${share_name}" if ! /opt/tailscale drive share "${share_name}" "/${share_name}"; then @@ -53,7 +53,7 @@ else done # If a directory is shared but not configured, and managed by this add-on, unshare it. - for share_name in ${active_share_names}; do + for share_name in "${active_share_names}"; do if ! grep -Fxq -- "${share_name}" <<< "${configured_share_names}"; then if grep -Fxq -- "${share_name}" <<< "${all_share_names}"; then bashio::log.info "Taildrive: unsharing /${share_name}" From ae9425f5dc65eea4045c1d117feef1ebd2b85e75 Mon Sep 17 00:00:00 2001 From: Laszlo Magyar Date: Sun, 11 Jan 2026 14:49:30 +0100 Subject: [PATCH 07/12] minor fix in docs --- tailscale/DOCS.md | 2 ++ tailscale/translations/en.yaml | 1 + 2 files changed, 3 insertions(+) diff --git a/tailscale/DOCS.md b/tailscale/DOCS.md index d91027e8c..a3aa01718 100644 --- a/tailscale/DOCS.md +++ b/tailscale/DOCS.md @@ -363,6 +363,8 @@ share with other Tailscale nodes using Taildrive. Only the listed directories are available. +These options are disabled by default. + More information: [Taildrive][tailscale_info_taildrive] ### Option: `taildrop` diff --git a/tailscale/translations/en.yaml b/tailscale/translations/en.yaml index 550db0484..ee6e14bd8 100644 --- a/tailscale/translations/en.yaml +++ b/tailscale/translations/en.yaml @@ -100,6 +100,7 @@ configuration: This option allows you to specify which Home Assistant directories you want to share with other Tailscale nodes using Taildrive. Only the listed directories are available. + These options are disabled by default. taildrop: name: Taildrop description: >- From 42ab1444eb4e3fd27086268d4a6ca8e81be3d25d Mon Sep 17 00:00:00 2001 From: Laszlo Magyar Date: Wed, 14 Jan 2026 14:49:02 +0100 Subject: [PATCH 08/12] Bugfix for Taildrive (prevent logging anything when no share is configured) --- tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run index 460a550c6..5c050e508 100755 --- a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run @@ -41,7 +41,9 @@ else ln -s "/homeassistant" "/config" # If a directory is configured but not shared, share it. - for share_name in "${configured_share_names}"; do + # Note: do not quote configured_share_names in the for loop, + # as we want to iterate over words (lines), this is not an array + for share_name in ${configured_share_names}; do if ! grep -Fxq -- "${share_name}" <<< "${active_share_names}"; then bashio::log.info "Taildrive: sharing /${share_name}" if ! /opt/tailscale drive share "${share_name}" "/${share_name}"; then @@ -53,7 +55,9 @@ else done # If a directory is shared but not configured, and managed by this add-on, unshare it. - for share_name in "${active_share_names}"; do + # Note: do not quote active_share_names in the for loop, + # as we want to iterate over words (lines), this is not an array + for share_name in ${active_share_names}; do if ! grep -Fxq -- "${share_name}" <<< "${configured_share_names}"; then if grep -Fxq -- "${share_name}" <<< "${all_share_names}"; then bashio::log.info "Taildrive: unsharing /${share_name}" From 9f3b35cc24470889f2f796cd1e96ddd8f80b39fc Mon Sep 17 00:00:00 2001 From: Laszlo Magyar Date: Fri, 30 Jan 2026 22:08:25 +0100 Subject: [PATCH 09/12] rename add-on to app --- tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run index 5c050e508..f24b3220c 100755 --- a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run @@ -2,7 +2,7 @@ # shellcheck shell=bash export LOG_FD # ============================================================================== -# Home Assistant Community Add-on: Tailscale +# Home Assistant Community App: Tailscale # Exposes Home Assistant directories over Taildrive # ============================================================================== @@ -13,11 +13,11 @@ declare active_share_names declare share_name -# Read all possible and configured directories from the add-on configuration. +# Read all possible and configured directories from the app configuration. if ! all_share_names=$(bashio::config 'taildrive' | jq -rc 'keys_unsorted[]') || \ ! configured_share_names=$(bashio::config 'taildrive' | jq -rc 'to_entries[] | select(.value) | .key') then - bashio::exit.nok "Error reading configured Taildrive directories from add-on configuration." + bashio::exit.nok "Error reading configured Taildrive directories from app configuration." fi # Check if Taildrive is available @@ -54,7 +54,7 @@ else fi done - # If a directory is shared but not configured, and managed by this add-on, unshare it. + # If a directory is shared but not configured, and managed by this app, unshare it. # Note: do not quote active_share_names in the for loop, # as we want to iterate over words (lines), this is not an array for share_name in ${active_share_names}; do From 2783c82acd1061f45d2d954f7986a97cb6007a5f Mon Sep 17 00:00:00 2001 From: Laszlo Magyar Date: Sat, 31 Jan 2026 00:42:28 +0100 Subject: [PATCH 10/12] fix log messages (taildrive) suggested by copilot --- tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run index f24b3220c..7acb09725 100755 --- a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run @@ -26,7 +26,9 @@ if ! /opt/tailscale status --self=true --peers=false --json \ then # If Taildrive is not available but any share is configured, that is an error if (( 0 < $(wc -w <<< "${configured_share_names}") )); then - bashio::exit.nok "Tailscale's Taildrive is disabled but directories are configured for sharing" + bashio::exit.nok \ + "Tailscale's Taildrive feature is not available, but directories are configured" \ + "for sharing. Please check your Tailscale plan and ACL settings." fi else # Read currently shared directories into an array from tailscale drive list. @@ -65,7 +67,7 @@ else bashio::exit.nok "Failed to unshare /${share_name}" fi else - bashio::log.info "Taildrive: skipping to unshare '${share_name}'" + bashio::log.info "Taildrive: skipping unshare of '${share_name}' (not managed by this app)" fi fi done From 241b1027854a7d8b05e8ce3ad0c3ee996566b9d0 Mon Sep 17 00:00:00 2001 From: Laszlo Magyar Date: Thu, 5 Feb 2026 22:56:10 +0100 Subject: [PATCH 11/12] fix taildrive map config --- tailscale/config.yaml | 4 +++- tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tailscale/config.yaml b/tailscale/config.yaml index bb970552c..da6763817 100644 --- a/tailscale/config.yaml +++ b/tailscale/config.yaml @@ -26,7 +26,9 @@ map: - addons:rw - all_addon_configs:rw - backup:rw - - homeassistant_config:rw + - type: homeassistant_config + path: /config + read_only: false - media:rw - share:rw - ssl:rw diff --git a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run index 7acb09725..78b2398d3 100755 --- a/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run +++ b/tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run @@ -40,8 +40,6 @@ else bashio::exit.nok "Error reading shared Taildrive directories from Tailscale." fi - ln -s "/homeassistant" "/config" - # If a directory is configured but not shared, share it. # Note: do not quote configured_share_names in the for loop, # as we want to iterate over words (lines), this is not an array From 7c9d0d6b945c7e61a8dc5752ead8e7970288a841 Mon Sep 17 00:00:00 2001 From: Laszlo Magyar Date: Fri, 6 Feb 2026 00:42:18 +0100 Subject: [PATCH 12/12] make the linter happy --- tailscale/config.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tailscale/config.yaml b/tailscale/config.yaml index da6763817..885de6ef1 100644 --- a/tailscale/config.yaml +++ b/tailscale/config.yaml @@ -23,15 +23,21 @@ privileged: devices: - /dev/net/tun map: - - addons:rw - - all_addon_configs:rw - - backup:rw + - type: addons + read_only: false + - type: all_addon_configs + read_only: false + - type: backup + read_only: false - type: homeassistant_config + read_only: false path: /config + - type: media + read_only: false + - type: share + read_only: false + - type: ssl read_only: false - - media:rw - - share:rw - - ssl:rw ports: 41641/udp: null options: