Repository navigation
refactor: simplify Dappnode WireGuard and refresh CA trust - #39
Merged
Merged
Conversation
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.
What type of PR is this?
Other — runtime refactor and security fix
What does this PR do? Why is it needed?
Replace the inherited LinuxServer runtime with a Dappnode-specific kernel WireGuard server. One Alpine Dockerfile serves AMD64 and ARM64, using upstream
wg-quick, a small configuration renderer andtini. Remove s6, CoreDNS, resolver rewriting, module installation/loading,SYS_MODULEand the host/lib/modulesmount. DNS goes directly to the configured Dappnode BIND servers. The native AMD64 VPN image decreases from approximately 119 MB to 21 MB.Keep the API in strict TypeScript. Node built-ins and native
qrencodereplace the production npm dependency tree; the final application has no production npm dependencies or applicationnode_modules. Preserve remote/local/QR credentials, CORS, the credential CLI andshow-peer. Mount API configuration read-only, validate peer paths and active membership, and prevent credential caching and stack disclosure.Preserve service names, network aliases, the config volume, keys, PSKs, peer addresses and existing client profiles. Keep older numeric
PEERScounts andpeer1directories, alongside named peers and the old config location. Peer removal revokes tunnel and API access; re-add restores the same identity. Stage and kernel-validate generated configuration before publishing it. Existing client listen ports are retained. Never execute persisted shell state or log generated credentials.Remove the remaining LinuxServer template fixtures/matching, custom route and keepalive overrides, UID/GID knobs and tools-version build override. Saved templates/CoreDNS files are inert; validation examines the actual VPN profiles. Files retain Dappnode's
1000:1000ownership. Keep only sanitized rollback metadata for the currently installed Dappnode image.Retain the RHSB-2026-012 fixes: patched Node 24.22.1 LTS, pinned base images and Alpine CA bundles >=20261020-r0. Verify distrust in both system bundles and Node's bundled roots.
Validation:
PEERScounts, upgrade, resize, API/CLI and rollback without changing keys, profiles or addresses.dappnode-pablo. Installed service image IDs and start times remain unchanged. Disposable test containers publish no ports and are removed afterward.To reproduce locally:
yarn --cwd api install --frozen-lockfile yarn --cwd api format:check docker build -t wireguard-refactor:test . docker build -t wireguard-api-refactor:test api node tests/integration.cjsThe README documents native remote testing, release-baseline images and the historical-template fixture.
Other notes for review
The host must already support kernel WireGuard and netfilter. Client mode, extra tunnel files, custom profile options/firewall hooks, symlinks, CoreDNS-dependent clients and removed override variables require explicit migration; detected unsupported configuration fails before publication. Saved shell templates and CoreDNS files no longer control generation. Keep the previous image and a volume backup for rollback. LinuxServer Mods, cron and arbitrary initialization scripts are no longer part of the runtime.
No installed service was upgraded or restarted. An external user device/public endpoint was not exercised. Merge, release and deployment remain pending.