feat(daemon): pass CORS/web-dir to install, add a reinstall-safe wizard - #76
Merged
Merged
Conversation
daemon install only ever wrote --host/--port into the unit/plist/task, so serve's --cors-origin and --web-dir had no way in through the daemon. Running install with no flags now walks through a setup wizard instead of falling back to bare defaults, pre-filled from whatever is already installed and gated by a plan-and-confirm step so a reinstall can't silently overwrite a running service's config.
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 this changes
daemon installonly ever wrote--host/--portinto the systemd unit /launchd plist / scheduled task, so
serve's--cors-originand--web-dirhad no way to reach the background service. It now threads those through
(
daemonExecArgs) on all three platforms.Running
daemon installwith none of those flags set in a terminal nowwalks through a setup wizard instead of silently falling back to bare
defaults. On a reinstall it reads the already-installed unit/plist/task back
into a
daemonPresetso the prompts are pre-filled from what's actuallyrunning, then prints the full plan (binary, data dir, host, port, cors,
web-dir) and asks for
y/Nbefore writing anything. Flag-driven runs (CI,scripts) skip the wizard entirely and behave as before.
How it was verified
make test-racepassesNew coverage:
TestDaemonExecArgs,TestQuoteArgWithSpaces,TestShellTokenize,TestParseServeArgs,TestLinuxExistingConfig, plusupdated signatures in the existing
TestLinuxUnit/TestDarwinPlist/TestWindowsTaskAction.Checklist
:=, onevarblock per function in first-use order witherrlast, callees before callers, andmainunconditionally last.gofiles carry the two-line SPDX header (no new files; existing files only)GPL-3.0-only, matching the project