Configuration

BYCEPS can be configured with a configuration file. Some values can also be set as environment variables.

Supported Configuration Values

DEBUG

Enable debug mode.

Default: False

Handled by Flask.

Debug mode can also be enabled by appending the --debug option to the flask command.

DEBUG_TOOLBAR_ENABLED

Enable the debug toolbar (provided by Flask-DebugToolbar).

Default: False

JOBS_ASYNC

Makes jobs run asynchronously.

Can be disabled to run jobs synchronously, but that is likely only useful for (and actually used for) testing.

Default: True

LOCALE

Specifies the default locale.

Default: de (This will likely be changed to en at some point in the future.)

MAIL_HOST

The host of the SMTP server.

Default: 'localhost'

MAIL_PASSWORD

The password to authenticate with against the SMTP server.

Default: None

MAIL_PORT

The port of the SMTP server.

Default: 25

MAIL_STARTTLS

Put the SMTP connection in TLS (Transport Layer Security) mode.

Default: False

MAIL_SUPPRESS_SEND

Suppress sending of emails.

Default: False

MAIL_USE_SSL

Use SSL for the connection to the SMTP server.

Default: False

MAIL_USERNAME

The username to authenticate with against the SMTP server.

Default: None

METRICS_ENABLED

Enable the Prometheus-compatible metrics endpoint at /metrics/.

Only available on admin application.

Default: False

PATH_DATA

Filesystem path for static files (including uploads).

Default: './data' (relative to the BYCEPS root path)

PROPAGATE_EXCEPTIONS

Reraise exceptions instead of letting BYCEPS handle them.

This is useful if an external service like Sentry should handle exceptions.

Default: None

If not set, this is implicitly true if DEBUG or TESTING is enabled.

Handled by Flask.

REDIS_URL

The URL used to connect to Redis.

The format can be one of these:

  • redis://[[username]:[password]]@localhost:6379/0 (TCP socket)

  • rediss://[[username]:[password]]@localhost:6379/0 (SSL-wrapped TCP socket)

  • unix://[[username]:[password]]@/path/to/socket.sock?db=0 (Unix domain socket)

To use the first database of a Redis instance running on localhost on its default port: redis://127.0.0.1:6379/0

The documentation for Redis.from_url provides details on supported URL schemes and examples.

SECRET_KEY

A secret key that will be for security features such as signing session cookies.

Should be a long, random string.

BYCEPS provides a command-line tool to securely generate a secret key.

Only send cookies marked as secure when an HTTPS connection is available.

Logging in will fail if this is set to true and BYCEPS is accessed without TLS.

This behavior can be disabled for development purposes without a TLS-terminating frontend to the BYCEPS application.

Default: True (set by BYCEPS; Flask’s default is False)

SHOP_ORDER_EXPORT_TIMEZONE

The timezone used for shop order exports.

Default: 'Europe/Berlin'

SQLALCHEMY_DATABASE_URI

The URL used to connect to the relational database (i.e. PostgreSQL).

Format:

postgresql+psycopg://USERNAME:PASSWORD@HOST/DATABASE

Example (use user byceps with password hunter2 to connect to database byceps on the local host):

postgresql+psycopg://byceps:hunter2@127.0.0.1/byceps

Since BYCEPS uses psycopg by default, the scheme has to be postgresql+psycopg.

For more info, see Flask-SQLAlchemy’s documentation on SQLALCHEMY_DATABASE_URI.

SQLALCHEMY_ECHO

Enable echoing of issued SQL queries. Useful for development and debugging.

Default: False

STYLE_GUIDE_ENABLED

Enable BYCEPS’ style guide, available at /style_guide/ both in admin mode and site mode.

TESTING

Enable testing mode.

Only relevant when executing tests.

Default: False

Handled by Flask.