Repository navigation
Punchd: self-registering gateways and an installer that takes your config files - #53
Merged
Merged
Conversation
The gateway MSI installed the service and then told you to copy both config files into ProgramData yourself, so a fresh install always needed a second, manual step before the gateway could do anything. Adds a configuration page to the wizard with a Browse button for each file. Both stay optional — an admin who has not generated them yet can install now and add them later — and each is checked for the fields that distinguish it, so picking the wrong file of the two is caught rather than silently installed. The same paths can be passed on the command line for unattended installs. Custom actions follow the existing VPN installer's pattern, and the CA build uses the same vswhere lookup as the VPN MSI job.
A gateway that registers with a signal server was live and usable but invisible in Punchd → Gateways, which listed only hand-created records. To manage one you had to retype what the gateway already knew. Gateways now report their own editable settings at registration, the console lists live gateways alongside stored ones marked "self-registered", and a record is created the first time one is edited. Reporting the settings is what makes adoption safe. Seeded from signal server data alone, ports and TLS would be unknown, and the first save would push those blanks over a working config. The gateway reports exactly the fields the console may push back — a test asserts that set matches PROTECTED_FIELDS — and never api_secret, turn_secret or the TideCloak config. Adoption also merges the edit over the reported values, so untouched settings keep the gateway's real ones, and it re-checks for an existing record in case two admins adopt the same gateway at once.
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.
Two changes to how a Punchd gateway gets set up and managed. Both attack the same friction: a gateway you stand up is not manageable until you hand-carry config to it, or hand-retype config about it.
1. Self-registered gateways appear in the console
A gateway that registers with a signal server is live and usable, but
Punchd → Gatewayslisted only hand-created records — soproliant,Proliant2022andSasha-Gatewayare running and invisible there. To manage one you had to retype what the gateway already knew.Now live gateways are listed alongside stored ones, marked Self-registered, showing the settings they report. Editing one adopts it — creating the record — so there's no separate "add" step.
The part that needed care
Seeding a record from signal server data alone would leave ports, TLS and server URL unknown, because the signal server never sees them. The first save would then push those blanks over a working gateway's config.
So the gateway reports its own editable settings at registration, and adoption seeds from that:
PROTECTED_FIELDS, so the console can't show a setting a push would silently refuse.api_secret,turn_secretor the TideCloak config. Those aren't pushable, and the signal server relaying this has no business holding them. Tested by asserting the serialized payload contains none of the secret values.adoptionRecordomits anything the gateway didn't report rather than defaulting it, so adoption can't invent a value a later push writes back.Discovered gateways are filtered by issuer like the dashboard, so they only show on their own tenant's console.
2. Installer wizard takes gateway.toml and tidecloak.json
The MSI installed the service and then told you to copy both files in yourself — the old exit page read "Copy your gateway.toml and tidecloak.json to C:\ProgramData\punchd-gateway then restart the service." Every fresh install needed a manual second step.
A Configuration files page now sits between Welcome and Install, with a Browse button for each:
gateway_id;realm+auth-server-url), so picking the JSON in the TOML slot is caught with a pointer to where the right one comes from.msiexec /i PunchdGateway.msi /qn GATEWAY_TOML_FILE="..." TIDECLOAK_JSON_FILE="...".InstallFinalize, so the service's first start sees its config.Custom actions follow the existing VPN installer's pattern; the CA compile step reuses the
vswherelookup rather than a hardcoded Visual Studio path.Testing
315 TypeScript tests (21 new on discovery/adoption) and 59 Rust tests (5 new on reported config) pass.
tsc --noEmitshows only the errors already on main.The MSI is not verified. WiX only runs on Windows — on Linux it prints
The WiX Toolset only supports Windows... All behavior after this point is undefinedand fails on path separators. I confirmed the XML parses and every cross-reference resolves (custom action IDs,DoActiontargets, dialog navigation), and that the workflow YAML sequences the new MSVC step beforeBuild MSI. The C custom actions have never been compiled. Worth a careful first install on a throwaway box.Depends on #52
build-gateway-windowscurrently fails on the vendored OpenSSL build before reaching any of this, so #52 has to merge first or the job still produces no MSI.