Repository navigation
feat(tailscale): remote access via a Tailscale sidecar - #40
Merged
Merged
Conversation
Fourth access mode for the installer, alongside localhost/SSH, LAN HTTPS and LAN plain HTTP. The tailscale sidecar joins the host's tailnet and serves the web GUI at https://<name>.<tailnet>.ts.net with a real Let's Encrypt certificate - no host ports published, no CA import. - docker-compose.yml: tailscale service (profile: tailscale) with persistent state, healthcheck, /dev/net/tun + NET_ADMIN, and a static serve config (Web -> web-gui:4321 only). RPC ports, Postgres and the indexer stay on the internal network; Funnel is deliberately not wired up. Watchtower does not manage this container: it sits on the trust path (TRUST_PROXY depends on its XFF-overwriting behavior, set via Header.Set in tailscaled's serve), so upgrades are deliberate. - init.sh: access-mode chooser with /dev/net/tun gating (native Linux only; Docker Desktop VMs always provide it), node-name and auth-key prompts (tskey-auth- regex validated - compose would otherwise expand dollar-vars in .env values), post-start join flow that captures the ts.net FQDN and wires WEB_GUI_HOST/PASSKEY_* for WebAuthn, with distinct recovery hints for join-timeout, MagicDNS-disabled and a crash-looping sidecar. TRUST_PROXY=true is written for the shipped proxy modes (caddy gains it too - previously missing, which broke cross-site Origin derivation and per-IP rate limiting behind TLS). - installer hardening found during review: atomic .env rewrite (env_set, O_EXCL temp + fsync + rename), port arithmetic with 10# (leading-zero input used to crash), BITCOIN_CORE_CHAIN follows the Mintlayer network on empty BITCOIN_NETWORK (testnet installs used to get a mainnet Bitcoin node), qrencode/parse fallbacks for older qrencode and macOS hosts (no seq, bash 3.2), password policy shared between RPC and UI secrets (dollar signs, quotes, inline-comment and whitespace hazards rejected before they hit compose dotenv), 1777 seeding window closed via sticky bit, randomized container-side DB name (rename does not follow symlinks) and trap-restore on all signal paths. - tools/test-env-set.sh: regression tests for the .env rewrite helper and the Tailscale status parser. - .env.example + README: Tailscale section, prerequisites, security notes.
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.
Adds a fourth access mode to the installer alongside localhost/SSH, LAN-over-HTTPS and LAN plain HTTP: a Tailscale sidecar joins the stack to your tailnet and serves the web GUI at
https://<name>.<tailnet>.ts.netwith a real Let's Encrypt certificate - no CA import, and nothing published to the LAN or the internet.What it does
docker-compose.yml- newtailscaleservice underprofiles: [tailscale]: official image (pinned to thestablechannel tag), persistent state volume, healthcheck,/dev/net/tun+NET_ADMIN, Watchtower deliberately excluded (it sits on the trust path). The static serve config proxies only the web UI; node RPC (3030), wallet RPC (3034), Postgres and the indexer stay on the internal compose network. Funnel (public internet exposure) is deliberately not wired up.init.sh- fourth access-mode option with/dev/net/tunavailability gating (native Linux without the device hides the option; Docker Desktop VMs always provide it). Prompts for the node name and the join method (interactive login URL by default, or a regex-validated auth key). After first start it captures the assigned ts.net FQDN and wiresWEB_GUI_HOST/PASSKEY_RP_ID/PASSKEY_ORIGINso WebAuthn works remotely, with distinct recovery hints for join-timeout, MagicDNS-disabled and a crash-looping sidecar.Behavior change beyond the feature
init.shnow writesTRUST_PROXY=truefor both shipped TLS-terminating access modes (the existing Caddy gateway gained it too - previously it was never written, which broke cross-site Origin derivation and degraded per-IP login rate limiting behind HTTPS; see the comment incaddy/Caddyfileandapp/src/lib/csrf.ts). Direct/LAN plain-HTTP exposure keeps it unset, as before.Installer hardening (found during review cycles)
.envrewrite (env_set: O_EXCL temp, fsync, rename, 0600) with regression tests intools/test-env-set.sh10#(a leading-zero port input used to abort the installer)BITCOIN_NETWORKnow really follows the Mintlayer network - testnet installs previously provisioned a mainnet Bitcoin node (-chain=main);testnetalso maps to Core'stestchain namePROJECT_DIR_HOSTassigned as a real shell variable - the whitespace guard previously dereferenced an unset variable underset -u, aborting every installseq, bash 3.2, no GNUstat -c); QR display degrades to the URI instead of abortingOut of scope (follow-ups)