Configuration#
BYCEPS can be configured with a configuration file. Some values can also be set as environment variables.
Supported Configuration Values#
- API_ENABLED#
Enable the REST API.
Default:
True
- DEBUG#
Enable debug mode.
Default:
False
Handled by Flask.
Debug mode can also be enabled by appending the
--debug
option to theflask
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 toen
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
orTESTING
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 rediss://[[username]:[password]]@localhost:6379/0 unix://[[username]:[password]]@/path/to/socket.sock?db=0
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.
- SESSION_COOKIE_SECURE#
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 isFalse
)
- 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+psycopg2://USERNAME:PASSWORD@HOST/DATABASE
Example (user
byceps
with passwordhunter2
wants to connect to databasebyceps
on the local host):postgresql+psycopg2://byceps:hunter2@127.0.0.1/byceps
Since BYCEPS uses psycopg2 by default, the scheme has to be postgresql+psycopg2.
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.