12-factorize application a little

snikket_web can now be fully configured via the environment alone,
no extra files needed. It is still supported to inject a python
file to generate environment variables though, which may be
useful for generating and reloading a secret key.
This commit is contained in:
Jonas Schäfer
2021-01-17 11:00:42 +01:00
parent fadbdaf204
commit e0cfcc6aaa
12 changed files with 115 additions and 98 deletions

11
example.env.py Normal file
View File

@@ -0,0 +1,11 @@
# Please see example.env for a detailed list of supported environment
# variables as well as their semantics.
# NOTE: this file is not meant for production use. Due to the non-constant
# secret key, each server restart will log out all users from the web portal.
import secrets
SNIKKET_WEB_SECRET_KEY = secrets.token_urlsafe(nbytes=32)
SNIKKET_WEB_PROSODY_ENDPOINT = "http://localhost:5280"
SNIKKET_WEB_DOMAIN = "localhost"
# SNIKKET_WEB_AVATAR_CACHE_TTL = 1800