Add support for Taildrive - #617
Conversation
WalkthroughAdds 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
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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.
Share homeassistant directories to your Tailnet using Taildrive.
Fix parsing Tailscale drive data. Fix homeassistant share config.
I went with exit.nok, let it fail as taildrop fails on startup.
2098c06 to
2783c82
Compare
There was a problem hiding this comment.
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.
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
Documentation