Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Backend configuration

The static configuration for the backend is loaded from a valid YAML file and from environment variables.

Configuration file

A valid YAML file for the backend (most/all values populated with the defaults) would look like the following:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Backend server configuration
backend:
  # Turn on/off metrics page and API on /metrics
  metrics: true
  # Port on which to serve the API
  port: 8080
  # List of users as 'username: password' pairs for basic auth on the HTTP API endpoints
  users:
    openrfsense: openrfsense

# Collector service configuration
collector:
  # Port on which to wait for TCP packets
  port: 2022

# PostgreSQL database configuration
postgres:
  host: localhost
  port: 5432
  username: postgres
  password: postgres
  dbname: postgres
  # Extra connection parameters, see PostgreSQL documentation
  params:
    - sslmode=disable

# NATS server configuration
nats:
  # Protocol for NATS connection, see NATS docs
  protocol: "tcp"
  # Port for the NATS server
  port: 4222
  # Token for NATS connection encryption
  token: nats-token

Environment variables

Any value in the configuration file can be overridden by defining an environment variable with the format ORFS_SECTION_KEY=value.

Simple strings or integers are simply copied to the configuration object. ORFS_NATS_TOKEN=custom-token becomes:


1
2
nats:
  token: "custom-token"

Slices/arrays are just strings separated by space. ORFS_DATABASE_PARAMS="sslmode=disable pooling=true" becomes:


1
2
3
4
database:
  params:
    - "sslmode=disable"
    - "pooling=true"