Repository navigation
Conversation
Declare /var/lib/tailscale/tailscaled.state as a manifest backup item so full Dappnode backups keep the node identity and a restored node rejoins the tailnet as the same device without signing in again.
Contributor
|
Dappnode bot has built and pinned the built packages to an IPFS node, for commit: 9a2d255 This is a development version and should only be installed for testing purposes.
Hash: (by dappnodebot/build-action) |
Contributor
🛠️ Package harness hit an infrastructure error
Run overview
Baseline vs candidate
Hard-check reasons
Container comparison
Container inventoryBaseline
Candidate No container snapshot was available. Runtime analysis advisory⚪ Inconclusive — Log analysis was unavailable
✅ No new runtime findings were reported. Analyzer diagnostics
Cleanup and diagnostics
Deterministic checks decide the verdict. Runtime log analysis is advisory. TropiBot publishes bounded summaries and never posts raw logs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The package declares no manifest
backupitems, so Dappnode full backups (DNP_DAPPMANAGER#2511, #2512) mark it as "not covered". A restore reinstalls Tailscale with its settings, includingTS_AUTHKEY, but without its state. The restored Dappnode becomes a new tailnet device. It gets new Tailscale IPs and a new MagicDNS name (often with a-1suffix), its subnet routes and exit node must be approved again, and it needs a new sign-in or a still-valid auth key. The old device stays in the admin console.Approach
Add one
backupitem todappnode_package.json:{ "name": "tailscaled-state", "path": "/var/lib/tailscale/tailscaled.state", "service": "tailscale" }Why this file, based on the Tailscale v1.104.7 source:
TS_STATE_DIR=/var/lib/tailscale. containerboot passes it to tailscaled as--statedir(cmd/containerboot/tailscaled.go), and tailscaled then uses<statedir>/tailscaled.stateas its state file (cmd/tailscaled/tailscaled.go,statePathOrDefault). The file lives in thestatevolume.types/persist)./var/lib/tailscalecan be rebuilt or fetched again: the log buffers andtailscaled.log.conf,derpmap.cached.json,certs/,ssh/host keys,tka-profiles/,profile-data/and Taildropfiles/. Leaving it out keeps the backup a few KB and avoids copying log buffers that are written while the package runs.service: tailscaleis required. Without it, Dappmanager uses the first container, which may bereporter.Live-copy safety: Dappmanager reads the file while the package runs.
FileStore.WriteStatewrites throughatomicfile.WriteFile(temp file, fsync, rename), so the file is never half-written. In steady state, tailscaled rewrites the file only when its state changes, such as a pref change or key rotation.Restore: Dappmanager installs the same version, stops the containers, extracts
tailscaled.stateinto/var/lib/tailscale(other files there stay) and starts the containers. The image usesTS_AUTH_ONCE=true, so containerboot runstailscale uponly when the daemon reportsNeedsLogin. With the restored identity, the daemon reachesRunningand containerboot only reappliesTS_ROUTESandTS_EXTRA_ARGSwithtailscale set.The README has a new "Backup and restore" section. It warns that restoring the file onto a second machine while the old one runs leaves two machines with one node identity. Dappnode's full restore asks the user to keep the old node off. The section also tells users not to separate the copies with
tailscale logout, which signs out the shared device on both. To give a node a new identity, remove the package with its data and sign in again.Adding
backupalso makes Dappmanager show the package's Backup tab.Compatibility with dappmanager versions without full backup
The released Dappmanager only has the per-package Backup tab, and it works with this item as is:
docker cpoftailscaled.statefrom the running container. The file is replaced atomically, so the copy is always one complete version.docker exec ... mkdir -p /var/lib/tailscale,docker cpof the file into the running container, thendocker restart. tailscaled runs as root, so the root-owned0600file is fine. tailscaled does not save its state on shutdown:LocalBackend.shutdownonly logs out ephemeral nodes, andFileStorewrites only fromWriteStatewhen a value changes. The restart therefore keeps the restored file, and tailscaled loads it.TS_AUTHKEY) before the restore, that registration stays as a separate offline device in the admin console and must be removed by hand.No compose, image or version changes; the release workflow bumps the patch version on merge.
Test instructions
Checked locally: the package image (arm64 build) in two containers on
--network none(userspace networking, no login, nothing reached Tailscale). The Backup tab flow was replayed with the exactdocker cp/docker exec mkdir -p/tar/docker restartcommands frombackupGet.ts,backupRestore.tsandpackageRestart.ts, run as root like the Dappmanager. Container A's state was backed up while A ran and restored into running container B, which has its own machine key. After the restart, and after a second restart, B'stailscaled.statestill held A's_machinekey, owned0:0, mode0600, and tailscaled ran normally. A signed-in node could not be tested without a real login.Static checks done:
dappnode_package.jsonvalidates against the Dappmanager manifest schema (packages/schemas/src/schemas/manifest.schema.json) with Ajv.git diff --checkpasses.Not run on a real node. To verify on a test Dappnode:
tailscaled-stateand no warning.172.33.0.0/16and the Dappnode DNS still work from another tailnet device.tailscaled-state. Restoring it there followed by the package restart keeps the same device.Open points:
TS_AUTHKEYis set and still valid, the package can start during the install step before Dappmanager stops it to restore data. It may then register a short-lived extra device with that key. The restored state then takes over, and the extra device has to be removed from the admin console by hand. Installing restored packages stopped would avoid this, but that is a Dappmanager change.TS_AUTHKEY, containerboot does this automatically.