Skip to content

Add Linux --setup wizard, service generation, and release workflow#10

Merged
matveynator merged 2 commits into
mainfrom
tvey/add-setup-flag-for-linux-version
Mar 12, 2026
Merged

Add Linux --setup wizard, service generation, and release workflow#10
matveynator merged 2 commits into
mainfrom
tvey/add-setup-flag-for-linux-version

Conversation

@matveynator
Copy link
Copy Markdown
Owner

Motivation

  • Provide a simple interactive installer for Linux hosts to configure the proxy (ask whether to use HTTPS, which domain, and where to forward requests).
  • Make it easy to install and run the proxy as a service by auto-generating either systemd unit files or a SysV init.d script depending on the host.
  • Improve operator discovery by writing runbook/service commands to /etc/info and provide a documented workflow.

Description

  • Added a Linux-only pkg/setup package (build-tagged) exposing RegisterFlag() and RunInteractive() which implements an interactive setup that prompts for HTTPS usage, domain, and target URL and validates the target URL with url.Parse.
  • The setup flow detects the init system with detectInitSystem() and writes either a systemd unit at /etc/systemd/system/chicha-http-proxy.service or an init.d script at /etc/init.d/chicha-http-proxy, and appends a timestamped runbook block to /etc/info with start/stop/status/log commands.
  • Wired the CLI to register the Linux-only --setup flag and invoke setup.RunInteractive() early in main (in chicha-http-proxy.go) so invocation --setup runs the interactive installer and exits.
  • Added a non-Linux stub pkg/setup/setup_stub.go so the --setup flag is not exposed on other platforms, and added docs/setup.md describing the flow.
  • Added a GitHub Actions workflow at .github/workflows/release.yml to produce cross-platform artifacts when a commit message contains stable release.

Testing

  • Ran go test ./... which completed successfully (packages report no test files and no failures).
  • Ensured formatting with gofmt -w on modified files and ran go mod tidy to refresh module metadata (succeeded).

Codex Task

@matveynator matveynator merged commit 8cbe064 into main Mar 12, 2026
4 checks passed
@matveynator matveynator deleted the tvey/add-setup-flag-for-linux-version branch March 12, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant