Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

dyndo-server is configured by layering three sources, each overriding the one before it:

  1. built-in defaults,
  2. a config.yaml file, then
  3. DYNDO_-prefixed environment variables.

There are no command-line flags. Configuration is deserialized directly into OpenDAL’s backend config structs, so backend settings are exactly OpenDAL’s own.

Configuration file

The file is ./config.yaml in the working directory by default. Set DYNDO_CONFIG to load a different path:

VariableDescription
DYNDO_CONFIGPath to the YAML config file. If set, the file must exist or the server exits. If unset, a missing config.yaml is ignored (defaults + env are used).

Schema

KeyTypeDescriptionDefault
storefs | s3Which storage backend serves assets.fs
server.hoststringListen address.0.0.0.0
server.portintegerListen port.8080
fstableLocal-filesystem backend settings (OpenDAL Fs). Required when store: fs.(none)
s3tableS3 backend settings (OpenDAL S3). Required when store: s3.(none)

Neither backend section is defaulted: whichever backend store selects must be supplied (via file or environment) with the fields OpenDAL needs, or the server fails to build its storage operator at startup.

fs backend

KeyDescription
fs.rootRoot directory that descriptors and media are read from. Required for store: fs.
store: fs
fs:
  root: ./assets

s3 backend

The s3 table is OpenDAL’s S3 configuration. The commonly used keys:

KeyDescription
s3.bucketBucket name. Required for store: s3.
s3.regionAWS region.
s3.endpointService endpoint URL.
s3.rootKey prefix prepended to every object path.
s3.access_key_idAccess key ID (or supply via AWS_ACCESS_KEY_ID).
s3.secret_access_keySecret access key (or supply via AWS_SECRET_ACCESS_KEY).
store: s3
s3:
  bucket: my-assets
  region: eu-west-1
  endpoint: https://s3.eu-west-1.amazonaws.com
  root: /

Credentials may be omitted from the file and supplied through the standard AWS_* environment variables, which OpenDAL’s S3 backend reads.

Environment variables

Every setting maps to a DYNDO_-prefixed variable. Nested keys are separated by a double underscore (__); single underscores within a field name are preserved.

VariableSets
DYNDO_STOREstore
DYNDO_SERVER__HOSTserver.host
DYNDO_SERVER__PORTserver.port
DYNDO_FS__ROOTfs.root
DYNDO_S3__BUCKETs3.bucket
DYNDO_S3__REGIONs3.region
DYNDO_S3__ACCESS_KEY_IDs3.access_key_id
DYNDO_S3__SECRET_ACCESS_KEYs3.secret_access_key

The double-underscore rule is what keeps a name like access_key_id intact — DYNDO_S3__ACCESS_KEY_ID nests as s3.access_key_id, not s3.access.key.id.

Precedence

Later layers win field by field (a deep merge), so you can commit a config.yaml and override only what changes per environment:

# config.yaml sets port 8080 and fs.root ./assets;
# these env vars override just those two fields.
DYNDO_SERVER__PORT=9000 DYNDO_FS__ROOT=/srv/media dyndo-server

Startup errors

Configuration problems are reported at startup, not per request:

ConditionResult
DYNDO_CONFIG names a missing fileExit: “DYNDO_CONFIG points to a missing file”.
YAML/env cannot be merged or deserialized into the schemaExit: “failed to load configuration”.
Selected backend rejected (e.g. s3 with no bucket, fs with no root)Exit: “failed to build storage operator”.