Skip to main content

Configuration

CastKeeper is configured using a YAML config file (castkeeper.yml), environment variables, or a mixture of both.

Config files

Config files are loaded by the CastKeeper server when it starts - either from a path specified when starting the server, or from the default CastKeeper config path. Only the first config file found is loaded, following this order:

  1. The path specified as an argument when running the CastKeeper server, e.g. castkeeper serve --config /path/to/my/castkeeper.yml
  2. ./castkeeper.yml - in the current working directory where the CastKeeper server was started.
  3. /etc/castkeeper/castkeeper.yml

Example config file

EnvName: prod
LogLevel: warn
BaseURL: https://castkeeper.example.com
DataPath: /app/data

WebServer:
Port: 8080

ObjectStorage:
Driver: awss3
S3Bucket: my-castkeeper-bucket
S3Prefix: podcasts/

Environment variables

Every CastKeeper config option can alternatively be specified as an environment variable.

The names of environment variables follow a convention:

  • the config file option EnvName would become CASTKEEPER_ENVNAME.
  • the nested config file option WebServer.Port would become CASTKEEPER_WEBSERVER_PORT

See the reference table below for the full list of environment variables.

Config reference

Config optionEnvironment variableDescription
LogLevelCASTKEEPER_LOGLEVELLog verbosity. Allowed values: debug,info, warn, error. Default value: info.
EnvNameCASTKEEPER_ENVNAMEThe name of the environment, used in logs. Default value: unknown.
BaseURLCASTKEEPER_BASEURLThe URL that CastKeeper is hosted at, e.g. https://ck.example.com. Required.
DataPathCASTKEEPER_DATAPATHThe path to the directory that CastKeeper uses to store its data, e.g. /app/data. Required.
WebServer.PortCASTKEEPER_WEBSERVER_PORTThe port the web server should listen to. Default value: 8080.
ObjectStorage.DriverCASTKEEPER_OBJECTSTORAGE_DRIVERThe object storage provider to use. Allowed values: local, awss3. Required.
ObjectStorage.S3BucketCASTKEEPER_OBJECTSTORAGE_S3BUCKETThe S3 bucket to use for file storage when using the awss3 provider. Required when Driver is awss3.
ObjectStorage.S3PrefixCASTKEEPER_OBJECTSTORAGE_S3PREFIXOptional prefix for files when using the awss3 provider.
ObjectStorage.S3ForcePathStyleCASTKEEPER_OBJECTSTORAGE_S3FORCEPATHSTYLEBoolean value. Usually false, may need to be set to true for some S3 compatible storage services. Default value: false.