Skip to content

Configuration

The License Server can be configured through a config.yaml file, environment variables, or a combination of both. Environment variables always take precedence over values in config.yaml. All environment variables use the LICENSE_ prefix.


The server binary includes commands to manage configuration:

Terminal window
# Generate a default config.yaml
./license-server config init --output config.yaml
# Display the current effective configuration
./license-server config show
# Validate the configuration file
./license-server config validate
# Get a specific configuration value
./license-server config get jwt.secret

The configuration file is organized into the following sections:

server:
host: 0.0.0.0
http_port: 5656
grpc_port: 50090
mode: production # production | development
license: /path/to/server.lic
database:
driver: sqlite # sqlite | postgres
path: /app/data/license.db # SQLite path
host: postgres # PostgreSQL host
port: 5432
name: license_server
user: license
password: ""
ssl_mode: disable
jwt:
secret: "" # Required -- generate with: openssl rand -base64 32
ssl:
enabled: false
cert_file: ""
key_file: ""
ca_file: "" # For mTLS
ldap:
enabled: false
host: ""
bind_password: ""
smtp:
host: ""
port: 587
username: ""
password: ""
from_address: ""
backup:
enabled: true
path: /app/backups
encryption_key: "" # AES-256 encryption key
logging:
level: info # debug | info | warn | error
format: json # json | console
notifications:
# Notification channel configuration

All configuration values can be set via environment variables. The naming convention is LICENSE_ followed by the section and key in uppercase, separated by underscores. For example, database.ssl_mode becomes LICENSE_DATABASE_SSL_MODE.

VariableDescription
LICENSE_JWT_SECRETJWT signing secret (generate with openssl rand -base64 32)
VariableDefaultDescription
LICENSE_SERVER_HOST0.0.0.0Bind address
LICENSE_SERVER_HTTP_PORT5656HTTP port
LICENSE_SERVER_GRPC_PORT50090gRPC port
LICENSE_SERVER_MODEproductionServer mode (production, development)
LICENSE_SERVER_LICENSEPath to server license file
VariableDefaultDescription
LICENSE_DATABASE_DRIVERsqliteDatabase driver (sqlite, postgres)
LICENSE_DATABASE_PATH/app/data/license.dbSQLite database path
LICENSE_DATABASE_HOSTpostgresPostgreSQL host
LICENSE_DATABASE_PORT5432PostgreSQL port
LICENSE_DATABASE_NAMElicense_serverPostgreSQL database name
LICENSE_DATABASE_USERlicensePostgreSQL user
LICENSE_DATABASE_PASSWORDPostgreSQL password
LICENSE_DATABASE_SSL_MODEdisablePostgreSQL SSL mode
VariableDefaultDescription
LICENSE_SSL_ENABLEDfalseEnable TLS
LICENSE_SSL_CERT_FILEServer certificate file
LICENSE_SSL_KEY_FILEServer key file
LICENSE_SSL_CA_FILECA certificate file
LICENSE_GRACE_TOKEN_SECRETGrace period token signing secret
VariableDefaultDescription
LICENSE_LDAP_ENABLEDfalseEnable LDAP authentication
LICENSE_LDAP_HOSTLDAP server host
LICENSE_LDAP_BIND_PASSWORDLDAP bind password
VariableDefaultDescription
LICENSE_SMTP_HOSTSMTP server host
LICENSE_SMTP_PORT587SMTP port
LICENSE_SMTP_USERNAMESMTP username
LICENSE_SMTP_PASSWORDSMTP password
LICENSE_SMTP_FROM_ADDRESSSender email address
VariableDefaultDescription
LICENSE_BACKUP_ENABLEDtrueEnable automatic backups
LICENSE_BACKUP_PATH/app/backupsBackup storage path
LICENSE_BACKUP_ENCRYPTION_KEYBackup encryption key (AES-256)
VariableDefaultDescription
LICENSE_LOGGING_LEVELinfoLog level (debug, info, warn, error)
LICENSE_LOGGING_FORMATjsonLog format (json, console)

Overriding Config with Environment Variables

Section titled “Overriding Config with Environment Variables”

Environment variables always override values in config.yaml. This makes it straightforward to use a base configuration file and customize per environment:

Terminal window
# Use config.yaml as a base, but override the database driver and log level
LICENSE_DATABASE_DRIVER=postgres \
LICENSE_LOGGING_LEVEL=debug \
./license-server serve

In Docker Compose, set overrides in the .env file or directly in the environment block:

services:
license-server:
image: git.prd.embidio.de/hive/license-server:v1.0.0
environment:
LICENSE_JWT_SECRET: ${LICENSE_JWT_SECRET}
LICENSE_DATABASE_DRIVER: postgres
LICENSE_DATABASE_HOST: postgres
LICENSE_DATABASE_PASSWORD: ${LICENSE_DATABASE_PASSWORD}
volumes:
- ./config.yaml:/app/configs/config.yaml:ro