static-auth-rocket

Running under Windows Service subsystem
Login

Running under Windows Service subsystem

Begin by building/installing the static-auth-rocket.exe executable by your preferred means. This guide assumes that a release version was built. If it is run on a different system than it was built on, make sure to either build it with a static CRT or install vcredist on the system that will be running the service. For purposes of this guide, it is assumed that the executable is installed as C:\Temp\bin\static-auth-rocket.exe.

Create a run-time directory for static-auth-rocket. This is the directory that will hold the Rocket.toml file. For purposes of illustration, we'll use C:\Temp\myservice in this guide.

In a terminal, create Rocket.toml in the run-time directory:

PS> mkdir C:\Temp\myservice
PS> cd C:\Temp\myservice
PS> & C:\Temp\bin\static-auth-rocket.exe make-config

This should have created a Rocket.toml file in C:\Temp\myservice

Create a directory to act as the root directory for the http server. We'll use C:\Temp\myservice\htdocs:

PS> mkdir C:\Temp\myservice\htdocs

Edit the earlier generated Rocket.toml file and under the [release] section change the htdocs value to "C:\Temp\myservice\htdocs". Change the database value to "C:\Temp\myservice\auth.sqlite".

Register the service, using an elevated command prompt, by running:

PS> cd C:\Temp\myservice
PS> C:\Temp\bin\static-auth-rocket.exe register-service --auto-start

Registering the service will not start the service, though it is configured to auto-start on boot.

Uninstallation

To uninstall the service use the deregister-service subcommand in an elevated command prompt:

PS> & C:\Temp\bin\static-auth-rocket.exe deregister-service