2.7 KiB
Running the service
To fully function, the service needs to run two main components:
- An HTTP server
- A background worker
By default, the mas-cli server command will start both components.
It is possible to only run the HTTP server by setting the --no-worker option, and run a background worker with the mas-cli worker command.
Both components are stateless, and can be scaled horizontally by running multiple instances of each.
Runtime requirements
Other than the binary, the service needs a few files to run:
- The templates, referenced by the
templates.pathconfiguration option - The compiled policy, referenced by the
policy.pathconfiguration option - The frontend assets, referenced by the
pathoption of theassetsresource in thehttp.listenersconfiguration section - The frontend manifest file, referenced by tge
templates.assets_manifestconfiguration option
Be sure to check the installation instructions for more information on how to get these files, and make sure the configuration file is updated accordingly.
Configure the HTTP server
The service can be configured to have multiple HTTP listeners, serving different resources.
See the http.listeners configuration section for more information.
The service needs to be aware of the public URL it is served on, regardless of the HTTP listeners configuration.
This is done using the http.public_base configuration option.
By default, the OIDC issuer advertised by the /.well-known/openid-configuration endpoint will be the same as the public_base URL, but can be configured to be different.
Tweak the remaining configuration
A few configuration sections might still require some tweaking, including:
telemetry: to setup metrics, tracing and Sentry crash reportingemail: to setup email sendingpassword: to enable/disable password authenticationupstream_oauth: to configure upstream OAuth providers
Run the service
Once the configuration is done, the service can be started with the mas-cli server command:
mas-cli server
It is advised to run the service as a non-root user, using a tool like systemd to manage the service lifecycle.