Skip to content

Add support for Taildrive - #617

Merged
frenck merged 12 commits into
hassio-addons:mainfrom
lmagyar:pr-ananthb-taildrive
Feb 6, 2026
Merged

Add support for Taildrive#617
frenck merged 12 commits into
hassio-addons:mainfrom
lmagyar:pr-ananthb-taildrive

Conversation

@lmagyar

@lmagyar lmagyar commented Feb 3, 2026

Copy link
Copy Markdown
Collaborator

Proposed Changes

Note: This is the equivalent of #509, GH started to refuse my updates to that PR, I continue here.

Share homeassistant directories to your Tailnet using Taildrive.

Related Issues

Summary by CodeRabbit

  • New Features

    • Added Taildrive directory sharing support: enable sharing of select Home Assistant directories (addons, addon configs, backups, config, media, share, ssl). App now ensures configured shares are activated and removes unmanaged shares.
  • Documentation

    • Added configuration docs and UI labels explaining which directories are shared and that all Taildrive options are disabled by default.

@lmagyar lmagyar added new-feature New features or options. no-stale This issue or PR is exempted from the stable bot. labels Feb 3, 2026
@coderabbitai

coderabbitai Bot commented Feb 3, 2026

Copy link
Copy Markdown

Walkthrough

Adds Taildrive support: documentation and English translation, config schema/options for taildrive shares, and an s6 oneshot service with a bash run script that synchronizes configured Taildrive shares via the Tailscale CLI.

Changes

Cohort / File(s) Summary
Docs & Translation
tailscale/DOCS.md, tailscale/translations/en.yaml
Add taildrive documentation and an English translation entry describing Taildrive share options and defaults (disabled by default).
Config Schema & Defaults
tailscale/config.yaml
Introduce options.taildrive boolean fields: addons, addon_configs, backup, config, media, share, ssl and corresponding schema/default entries; expand mount entries to explicit named mounts.
s6 Service Files
tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/type, tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/up
Add oneshot service type and an up script that invokes the run script.
Service Implementation
tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run
New bash script: reads configured shares via bashio/jq, checks Taildrive availability (/opt/tailscale status), lists active shares (/opt/tailscale drive list), creates missing shares, unshares unmanaged shares, logs actions and exits on failure.

Sequence Diagram

sequenceDiagram
    participant S as Taildrive service (s6/run)
    participant C as Config (bashio + jq)
    participant T as Tailscale CLI (/opt/tailscale)
    participant F as File system

    S->>C: Read configured shares
    alt config read fails
        S->>S: Exit error
    end

    S->>T: Check Taildrive availability (/opt/tailscale status)
    alt Taildrive unavailable & shares configured
        S->>S: Exit error
    end

    S->>T: List active shares (/opt/tailscale drive list)
    alt list fails
        S->>S: Exit error
    end

    loop Ensure configured shares are active
        alt share missing
            S->>T: /opt/tailscale drive share <path>
            S->>S: Log share action
        end
    end

    S->>F: Ensure expected symlinks/paths exist (e.g., /config -> /homeassistant)
    
    loop Cleanup unmanaged shares
        alt active share unmanaged
            S->>T: /opt/tailscale drive unshare <name>
            S->>S: Log unshare action
        end
    end

    S->>S: Complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I nudge the tail and wake the drive,
I hop through configs, keeping shares alive,
I bind the paths and tidy the rest,
Small rabbit hands make syncs their quest,
Hooray — your Taildrive's trimmed and dressed!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add support for Taildrive' directly and clearly summarizes the main change: introducing Taildrive support. It matches the PR objectives, file changes, and feature additions across documentation, config, scripts, and translations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lmagyar lmagyar mentioned this pull request Feb 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run`:
- Line 43: The symlink creation line ln -s "/homeassistant" "/config" will fail
if /config already exists; replace it with a robust approach such as forcing the
symlink (use ln with force/replace flags) or first checking/removing an existing
/config before creating the symlink so the script never errors when /config is
present.

Comment thread tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrive/run Outdated
@lmagyar
lmagyar force-pushed the pr-ananthb-taildrive branch from 2098c06 to 2783c82 Compare February 5, 2026 20:15
Comment thread tailscale/config.yaml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@tailscale/config.yaml`:
- Around line 26-40: The map type name "all_addon_configs" does not match the
taildrive option "addon_configs", causing the run script (which builds share
paths with /${share_name}) to try to share /addon_configs while the mount is
/all_addon_configs; fix this by renaming the map type "all_addon_configs" to
"addon_configs" (or alternatively rename the option to "all_addon_configs" or
add explicit mapping in the run script), and ensure the names referenced in the
run script, the config map type (all_addon_configs), and the taildrive option
(addon_configs) are identical so that the share path generation (/${share_name})
points to the actual mounted path.

Comment thread tailscale/config.yaml

@frenck frenck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @lmagyar 👍

../Frenck

                       

Blogging my personal ramblings at frenck.dev

@frenck
frenck merged commit e04518d into hassio-addons:main Feb 6, 2026
13 checks passed
@lmagyar
lmagyar deleted the pr-ananthb-taildrive branch February 6, 2026 20:28
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

new-feature New features or options. no-stale This issue or PR is exempted from the stable bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants