Skip to main content

Configuring FMD Server

You can configure FMD Server via a config file, environment variables, and CLI flags.

Via config file

The config.example.yml contains the available options to configure FMD Server. Copy this file to config.yml and edit it to your liking.

By default, FMD Server will look for the config.yml at /etc/fmd-server/config.yml and in the current working directory. You can pass a custom location with --config.

Config file and packaging

When /etc/fmd-server/config.yml is present and used, FMD Server also reads in /etc/fmd-server/local.yml. Values in local.yml override their counterpart in config.yml.

This is similar to how fail2ban uses jail.conf and jail.local: it allows packagers to define and maintain config.yml while enabling admins to override their settings in local.yml. Thus admins don't have to edit the packager's config.yml (which would cause conflicts if a package update changes the config.yml).

Via environment variables

All values that can be set in the config file can also be set via environment variables. Simply set FMD_CONFIGFIELDNAME, e.g. FMD_PORTINSECURE.

services:
fmd:
environment:
FMD_PORTINSECURE: 8888
# other lines omitted

Via CLI flags

Some values can also be set via CLI flags. See fmd-server serve --help for details.

Precedence

FMD Server uses Viper, which has the following precedence rules (from highest to lowest):

CLI flag > env var > config file value > default value

Web static files

The static files for the website are included in the Go binary using go:embed. This is the recommended way to use FMD Server.

If you want to manually provide the web/ directory (for example, for custom styling), you can provide a custom path with the --web-dir option. This disables the embedded static files and instead reads all static files from the provided path.