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.

Run the forge as a Windows service

9cbfa891425adaa3e2769d1b3f88d5f211190dc6 · Keenan Nemetz · 2d ago · parent 33cbbc9d

Run the forge as a Windows service

The Windows server ran from a scheduled task because a process started from an
SSH session dies with it, and nothing told the service manager what state the
forge was in. This makes `serve` a real service and gives it the commands to
install itself.

The binary now speaks the SCM: `svc.IsWindowsService` decides, `svc.Run` is
entered before any work so a slow instance is a pending state rather than a
dispatcher timeout, and a Stop or Shutdown cancels the same context an interrupt
cancels, which is what lets the drain finish. The service reports running before
the listeners are up, so a bind failure arrives as a nonzero exit and the
recovery actions installed with it restart the forge; start and stop failures
also go to the Application event log, because a service has no stderr.

`vole service install|uninstall|start|stop|status` manages the registration with
no wrapper and no second definition: auto start with the standard delay, a
description, three restarts as recovery, and the virtual account
`NT SERVICE\Vole` with a restricted SID. Install also prepares what that account
needs — the data directory and everything already in it, the log directory, and
read access to the configuration — through `secure.HardenFor`, a new Windows-only
helper that writes a protected access list for principals the running process is
not. An instance initialized by a person is readable by the service afterwards,
which is the upgrade case, not only the fresh one.

`serve --log-file` is the file sink the service needs, opened through the secret
store so it is not readable by everyone; the console keeps stderr.

The command exists off Windows too and answers that services are the platform's
business, so the generated reference is the same everywhere.

Verified on the Server Core 2022 guest (full record on the issue): install,
start, status, stop, uninstall; the data directory, database, key, and log
granted only to the service account, SYSTEM, and Administrators; HTTP 200
through the forwarded port; admin CLI and git push over Vole's SSH listener; a
reboot brought the forge back with no login; and a second install refuses with a
clear message. The Windows-only unit tests (`stateName`, `lookupSID`) pass there
too, and `vole workflow run verify` passes locally.

Part of 01M8SE6PR5N7M3X48SMAGA8Z18. Packaging, Authenticode, and winget are
01M8SE6GWX1DGYPY6H9YC142C2.

docs/deploy/index.md +2−1

@@ -1,6 +1,7 @@
1 1 # Deploy a server
2 2
3 Deploy Vole on one Ubuntu 24.04 or Debian 13 machine. The cloud-init procedure
3 Deploy Vole on one Ubuntu 24.04 or Debian 13 machine. For Windows, see
4 [Deploy on Windows](windows.md); for a Mac, see [Deploy on macOS](macos.md). The cloud-init procedure
4 5 installs the package, writes the public configuration, creates the first instance
5 6 admin, and starts the service. Use the
6 7 [existing-machine procedure](#use-an-existing-machine) when the server is already