Skip to content

feat(daemon): pass CORS/web-dir to install, add a reinstall-safe wizard - #76

Merged
devproje merged 1 commit into
masterfrom
feat/daemon-install-wizard
Sep 22, 2026
Merged

devproje merged 1 commit into
masterfrom
feat/daemon-install-wizard

Conversation

@devproje

Copy link
Copy Markdown
Owner

What this changes

daemon install only ever wrote --host/--port into the systemd unit /
launchd plist / scheduled task, so serve's --cors-origin and --web-dir
had no way to reach the background service. It now threads those through
(daemonExecArgs) on all three platforms.

Running daemon install with none of those flags set in a terminal now
walks 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 daemonPreset so the prompts are pre-filled from what's actually
running, then prints the full plan (binary, data dir, host, port, cors,
web-dir) and asks for y/N before writing anything. Flag-driven runs (CI,
scripts) skip the wizard entirely and behave as before.

How it was verified

  • make test-race passes
  • New behaviour has a test, or there is nothing to test

New coverage: TestDaemonExecArgs, TestQuoteArgWithSpaces,
TestShellTokenize, TestParseServeArgs, TestLinuxExistingConfig, plus
updated signatures in the existing TestLinuxUnit/TestDarwinPlist/
TestWindowsTaskAction.

Checklist

  • Follows docs/CONVENTION.md: no comments, no :=, one var block per function in first-use order with err last, callees before callers, and main unconditionally last
  • New .go files carry the two-line SPDX header (no new files; existing files only)
  • Documentation updated if behaviour a user can see has changed (README.md, docs/ARCHITECTURE.md)
  • My contribution is licensed GPL-3.0-only, matching the project

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.
@devproje
devproje merged commit 28d8570 into master Sep 22, 2026
3 checks passed
@devproje
devproje deleted the feat/daemon-install-wizard branch September 22, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant