settings: use toml configuration files
We replace the current environment variable based configuration approach by reading all local configuration from a `settings.toml` configuration file. The docker test, development and production setups have been updated to use the new setup. The configuration folder also allows overriding every template in a `config/templates` directory. We use this in a follow-up to move all local specific templates, e.g. the registration form, into this config directory.toml-configuration-with-templates
parent
8a9cdc22d1
commit
6ffa2376b8
@ -0,0 +1,67 @@
|
||||
[section]
|
||||
name = "Town"
|
||||
street = "Street 12"
|
||||
town = "12345 Town"
|
||||
telephone = "123456789"
|
||||
telefax = "987654321"
|
||||
contact_mail = "contact@jdav-town.de"
|
||||
board_mail = "board@jdav-town.de"
|
||||
crisis_intervention_mail = "crisis@jdav-town.de"
|
||||
iban = "DE42 4242 4242 4242 4242 42"
|
||||
account_holder = "DAV Town"
|
||||
responsible_mail = "responsible@jdav-town.de"
|
||||
digital_mail = "digital@jdav-town.de"
|
||||
admins = [['Admin', 'admin@jdav-town.de']]
|
||||
|
||||
[LJP]
|
||||
v32_head_organisation = """
|
||||
LJP application recipient header
|
||||
"""
|
||||
|
||||
[misc]
|
||||
allowed_email_domains_for_invite_as_user = ['alpenverein-town.de']
|
||||
send_from_association_email = true
|
||||
domain = 'jdav-town.de'
|
||||
|
||||
[finance]
|
||||
allowance_per_day = 22
|
||||
max_night_cost = 11
|
||||
|
||||
[links]
|
||||
cloud = "https://nextcloud.com"
|
||||
dav_360 = "https://dav360.de"
|
||||
wiki = "https://wikipedia.org"
|
||||
docs = "https://jdav-hd.de/static/docs"
|
||||
registration_form = "download-me"
|
||||
|
||||
[startpage]
|
||||
redirect_url = ''
|
||||
root_section = 'root section'
|
||||
recent_section = 'aktuelles'
|
||||
reports_section = 'berichte'
|
||||
|
||||
[django]
|
||||
deployed = true
|
||||
debug = true
|
||||
secret_key = '6_ew6l1r9_4(8=p8quv(e8b+z+k+*wm7&zxx%mcnnec99a!lpw'
|
||||
allowed_hosts = ['*']
|
||||
protocol = 'http'
|
||||
base_url = 'localhost:8000'
|
||||
host = ''
|
||||
static_root = '/var/www/jdav_web/assets'
|
||||
broker_url = 'redis://redis:6379/0'
|
||||
memcached_url = 'cache:11211'
|
||||
|
||||
[mail]
|
||||
host = 'jdav-town.de'
|
||||
user = 'user@jdav-town.de'
|
||||
password = 'password'
|
||||
default_sending_address = 'info@jdav-town.de'
|
||||
default_sending_name = 'JDAV Town'
|
||||
|
||||
[database]
|
||||
host = 'db'
|
||||
port = 3306
|
||||
database = 'kompass'
|
||||
user = 'kompass'
|
||||
password = 'foobar'
|
||||
@ -0,0 +1,31 @@
|
||||
[testing]
|
||||
mail = "test@localhost"
|
||||
|
||||
[django]
|
||||
deployed = true
|
||||
debug = true
|
||||
secret_key = '6_ew6l1r9_4(8=p8quv(e8b+z+k+*wm7&zxx%mcnnec99a!lpw'
|
||||
allowed_hosts = ['*']
|
||||
protocol = 'http'
|
||||
base_url = 'localhost:8000'
|
||||
host = 'localhost'
|
||||
static_root = '/var/www/jdav_web/assets'
|
||||
broker_url = 'redis://redis:6379/0'
|
||||
memcached_url = 'cache:11211'
|
||||
|
||||
[mail]
|
||||
host = 'localhost'
|
||||
user = 'test'
|
||||
password = 'password'
|
||||
default_sending_address = 'test@localhost'
|
||||
|
||||
[database]
|
||||
host = 'db'
|
||||
port = 3306
|
||||
database = 'kompass'
|
||||
user = 'kompass'
|
||||
password = 'password'
|
||||
|
||||
[startpage]
|
||||
recent_section = 'aktuelles'
|
||||
reports_section = 'berichte'
|
||||
@ -1,75 +1,74 @@
|
||||
# contact data
|
||||
|
||||
SEKTION = "Heidelberg"
|
||||
SEKTION_STREET = "Harbigweg 20"
|
||||
SEKTION_TOWN = "69124 Heidelberg"
|
||||
SEKTION_TELEPHONE = "06221 284076"
|
||||
SEKTION_TELEFAX = "06221 437338"
|
||||
SEKTION_CONTACT_MAIL = "geschaeftsstelle@alpenverein-heidelberg.de"
|
||||
SEKTION_BOARD_MAIL = "vorstand@alpenverein-heidelberg.de"
|
||||
SEKTION_CRISIS_INTERVENTION_MAIL = "krisenmanagement@alpenverein-heidelberg.de"
|
||||
SEKTION_IBAN = "DE22 6729 0000 0000 1019 40"
|
||||
SEKTION_ACCOUNT_HOLDER = "Deutscher Alpenverein Sektion Heidelberg 1869"
|
||||
|
||||
RESPONSIBLE_MAIL = "jugendreferat@jdav-hd.de"
|
||||
DIGITAL_MAIL = "digitales@jdav-hd.de"
|
||||
SEKTION = get_var('section', 'name', default='Heyo')
|
||||
SEKTION_STREET = get_var('section', 'street', default='Street')
|
||||
SEKTION_TOWN = get_var('section', 'town', default='12345 Town')
|
||||
SEKTION_TELEPHONE = get_var('section', 'telephone', default='0123456789')
|
||||
SEKTION_TELEFAX = get_var('section', 'telefax', default=SEKTION_TELEPHONE)
|
||||
SEKTION_CONTACT_MAIL = get_var('section', 'contact_mail', default='info@example.org')
|
||||
SEKTION_BOARD_MAIL = get_var('section', 'board_mail', default=SEKTION_CONTACT_MAIL)
|
||||
SEKTION_CRISIS_INTERVENTION_MAIL = get_var('section', 'crisis_intervention_mail',
|
||||
default=SEKTION_BOARD_MAIL)
|
||||
SEKTION_IBAN = get_var('section', 'iban', default='Foo 123')
|
||||
SEKTION_ACCOUNT_HOLDER = get_var('section', 'account_holder',
|
||||
default='Foo')
|
||||
|
||||
RESPONSIBLE_MAIL = get_var('section', 'responsible_mail', default='foo@example.org')
|
||||
DIGITAL_MAIL = get_var('section', 'digital_mail', default='bar@example.org')
|
||||
|
||||
# LJP
|
||||
|
||||
V32_HEAD_ORGANISATION = """JDAV Baden-Württemberg
|
||||
Rotebühlstraße 59A
|
||||
70178 Stuttgart
|
||||
|
||||
info@jdav-bw.de
|
||||
0711 - 49 09 46 00"""
|
||||
|
||||
LJP_CONTRIBUTION_PER_DAY = 25
|
||||
V32_HEAD_ORGANISATION = get_var('LJP', 'v32_head_organisation', default='not configured')
|
||||
LJP_CONTRIBUTION_PER_DAY = get_var('LJP', 'contribution_per_day', default=25)
|
||||
|
||||
# echo
|
||||
|
||||
ECHO_PASSWORD_BIRTHDATE_FORMAT = '%d.%m.%Y'
|
||||
ECHO_GRACE_PERIOD = 30
|
||||
# used to generate the personalized echo password
|
||||
ECHO_PASSWORD_BIRTHDATE_FORMAT = get_var('echo', 'password_birthdate_format', default='%d.%m.%Y')
|
||||
# grace period in days after which echo keys expire
|
||||
ECHO_GRACE_PERIOD = get_var('echo', 'grace_period', default=30)
|
||||
|
||||
# misc
|
||||
# Waiting list configuration parameters, all numbers are in days
|
||||
|
||||
CONGRATULATE_MEMBERS_MAX = 10
|
||||
MAX_AGE_GOOD_CONDUCT_CERTIFICATE_MONTHS = 24
|
||||
ALLOWED_EMAIL_DOMAINS_FOR_INVITE_AS_USER = ('alpenverein-heidelberg.de', )
|
||||
GRACE_PERIOD_WAITING_CONFIRMATION = get_var('waitinglist', 'grace_period_confirmation', default=30)
|
||||
WAITING_CONFIRMATION_FREQUENCY = get_var('waitinglist', 'confirmation_frequency', default=90)
|
||||
CONFIRMATION_REMINDER_FREQUENCY = get_var('waitinglist', 'confirmation_reminder_frequency', default=30)
|
||||
MAX_REMINDER_COUNT = get_var('waitinglist', 'max_reminder_count', default=3)
|
||||
|
||||
# mail mode
|
||||
# misc
|
||||
|
||||
SEND_FROM_ASSOCIATION_EMAIL = os.environ.get('SEND_FROM_ASSOCIATION_EMAIL', '0') == '1'
|
||||
# the maximal number of members that get sent congratulations for highest activity on aprils fools day
|
||||
CONGRATULATE_MEMBERS_MAX = get_var('misc', 'congratulate_members_max', default=10)
|
||||
# expiry duration of a good conduct certificate in months
|
||||
MAX_AGE_GOOD_CONDUCT_CERTIFICATE_MONTHS = get_var('misc', 'max_age_good_conduct_certificate_months', default=24)
|
||||
# accepted email domains for inviting users
|
||||
ALLOWED_EMAIL_DOMAINS_FOR_INVITE_AS_USER = get_var('misc', 'allowed_email_domains_for_invite_as_user',
|
||||
default=['example.org'])
|
||||
# send all mails from the assocation's contact mail or from personal association mails
|
||||
SEND_FROM_ASSOCIATION_EMAIL = get_var('misc', 'send_from_association_email', default=False)
|
||||
# domain for association email and generated urls
|
||||
DOMAIN = get_var('misc', 'domain', default='example.org')
|
||||
|
||||
# finance
|
||||
|
||||
ALLOWANCE_PER_DAY = 22
|
||||
MAX_NIGHT_COST = 11
|
||||
ALLOWANCE_PER_DAY = get_var('finance', 'allowance_per_day', default=22)
|
||||
MAX_NIGHT_COST = get_var('finance', 'max_night_cost', default=11)
|
||||
|
||||
CLOUD_LINK = os.environ.get('CLOUD_LINK', 'https://startpage.com')
|
||||
DAV_360_LINK = os.environ.get('DAV_360_LINK', 'https://dav360.de')
|
||||
WIKI_LINK = os.environ.get('WIKI_LINK', 'https://wikipedia.org')
|
||||
DOCS_LINK = os.environ.get('DOCS_LINK', 'https://jdav-hd.de/static/docs/')
|
||||
# links
|
||||
|
||||
# Admin setup
|
||||
CLOUD_LINK = get_var('links', 'cloud', default='https://startpage.com')
|
||||
DAV_360_LINK = get_var('links', 'dav_360', default='https://dav360.de')
|
||||
WIKI_LINK = get_var('links', 'wiki', default='https://wikipedia.org')
|
||||
DOCS_LINK = get_var('links', 'docs', default='https://github.com/chrisflav/kompass')
|
||||
REGISTRATION_FORM_DOWNLOAD_LINK = get_var('links', 'registration_form', default='https://startpage.com')
|
||||
|
||||
ADMINS = (('admin', 'christian@merten-moser.de'),)
|
||||
# startpage
|
||||
|
||||
# Waiting list configuration parameters, all numbers are in days
|
||||
|
||||
GRACE_PERIOD_WAITING_CONFIRMATION = 30
|
||||
WAITING_CONFIRMATION_FREQUENCY = 90
|
||||
CONFIRMATION_REMINDER_FREQUENCY = 30
|
||||
MAX_REMINDER_COUNT = 3
|
||||
STARTPAGE_REDIRECT_URL = get_var('startpage', 'redirect_url', default='')
|
||||
ROOT_SECTION = get_var('startpage', 'root_section', default='about')
|
||||
RECENT_SECTION = get_var('startpage', 'recent_section', default='recent')
|
||||
REPORTS_SECTION = get_var('startpage', 'reports_section', default='reports')
|
||||
|
||||
# testing
|
||||
|
||||
TEST_MAIL = "post@flavigny.de"
|
||||
|
||||
REGISTRATION_FORM_DOWNLOAD_LINK = os.environ.get('REGISTRATION_FORM_DOWNLOAD_LINK', 'https://startpage.com')
|
||||
|
||||
DOMAIN = os.environ.get('DOMAIN', 'example.com')
|
||||
|
||||
STARTPAGE_REDIRECT_URL = 'https://jdav-hd.de'
|
||||
ROOT_SECTION = os.environ.get('ROOT_SECTION', 'wir')
|
||||
RECENT_SECTION = 'aktuelles'
|
||||
REPORTS_SECTION = 'berichte'
|
||||
TEST_MAIL = get_var('testing', 'mail', default='test@localhost')
|
||||
|
||||
Loading…
Reference in New Issue