Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

#410

Run the forge as a Windows service

merged · by keenan 2d ago · merged into main at 9cbfa891 by keenan 2d ago

keenan opened this 2d ago

Second half of the Windows port after #404/#406: the server runs under the service manager instead of a scheduled task, and installs itself.

Service mode. serve detects the SCM and dispatches through golang.org/x/sys/windows/svc before opening anything, so a slow start is a pending state the manager can see rather than a dispatcher timeout. Stop and Shutdown cancel the same context an interrupt does, so the drain still runs; the service keeps moving the StopPending checkpoint while it drains. Start/stop failures are written to the Application event log, because there is no stderr.

vole service install|uninstall|start|stop|status. The registration is done by the binary, so an MSI can call the same commands and there is no NSSM/WinSW layer. Install creates Vole as NT SERVICE\Vole with a restricted SID, delayed auto start, a description, and restart recovery; it fails clearly when not elevated, when already installed, when data_dir is relative, and when ssh_listen = "socket" (still unix-only). Uninstall stops and deletes the service and leaves the data and configuration in place.

Access lists for an account that is not the current process. internal/secure.HardenFor writes a protected DACL for an explicit principal list. Install uses it to rewrite the data directory, every file already in it, the log directory, and read access to the configuration for the service account — which is what makes an instance initialized by a person usable by the service, not only a fresh one.

serve --log-file is the sink a service needs: opened through internal/secure, so it is restricted like every other instance file; the console keeps stderr.

Off Windows the command exists and says services are the platform’s business, so docs/cli.md is platform-independent and the unix serve path is unchanged.

Verified on the Server Core 2022 guest: install/start/status/stop/uninstall; ACLs on the data directory, instance.db, and log name only NT SERVICE\Vole, SYSTEM, and Administrators; HTTP 200 through the forwarded port; admin CLI and git push over Vole’s SSH listener; a reboot restored the forge with no login; reinstalling over an existing instance re-hardened it and started; a second install is refused. Windows-only unit tests pass there; vole workflow run verify passes locally (including the windows cross-compile and the race suite).

Adds docs/deploy/windows.md and the nav entry, and points docs/deploy/index.md and docs/install.md at it. Packaging (WiX MSI, install.ps1, Authenticode later, winget later) stays on 01M8SE6GWX1DGYPY6H9YC142C2.

Discussion (0)

No discussion yet.