make more options accessible via env vars

* correct the yaml synctax for the docker file
* create an extra env file for the optional config stuff
* modify the default config to respect the set env vars

Signed-off-by: Christian Heusel <christian@heusel.eu>
This commit is contained in:
Christian Heusel 2020-10-12 01:42:43 +02:00 committed by msquare
parent b5e0a46dbd
commit 47617f6284
3 changed files with 36 additions and 9 deletions

View File

@ -85,10 +85,10 @@ return [
// Redirect to this site after logging in or when pressing the top-left button // Redirect to this site after logging in or when pressing the top-left button
// Must be one of news, meetings, user_shifts, angeltypes, user_questions // Must be one of news, meetings, user_shifts, angeltypes, user_questions
'home_site' => 'news', 'home_site' => env('HOME_SITE', 'news'),
// Number of News shown on one site // Number of News shown on one site
'display_news' => 10, 'display_news' => env('DISPLAY_NEWS', 10),
// Users are able to sign up // Users are able to sign up
'registration_enabled' => (bool)env('REGISTRATION_ENABLED', true), 'registration_enabled' => (bool)env('REGISTRATION_ENABLED', true),
@ -97,7 +97,7 @@ return [
'signup_requires_arrival' => false, 'signup_requires_arrival' => false,
// Whether newly-registered user should automatically be marked as arrived // Whether newly-registered user should automatically be marked as arrived
'autoarrive' => false, 'autoarrive' => (bool)env('ANGEL_AUTOARRIVE', false),
// Only allow shift signup this number of hours in advance // Only allow shift signup this number of hours in advance
// Setting this to 0 disables the feature // Setting this to 0 disables the feature
@ -115,22 +115,22 @@ return [
'password_algorithm' => PASSWORD_DEFAULT, 'password_algorithm' => PASSWORD_DEFAULT,
// The minimum length for passwords // The minimum length for passwords
'min_password_length' => 8, 'min_password_length' => env('PASSWORD_MINIMUM_LENGTH', 8),
// Whether the DECT field should be enabled // Whether the DECT field should be enabled
'enable_dect' => true, 'enable_dect' => (bool)env('REGISTRATION_ENABLE_DECT', true),
// Enables prename and lastname // Enables prename and lastname
'enable_user_name' => false, 'enable_user_name' => (bool)env('REGISTRATION_ENABLE_USERNAME', false),
// Enable displaying the pronoun fields // Enable displaying the pronoun fields
'enable_pronoun' => false, 'enable_pronoun' => (bool)env('REGISTRATION_ENABLE_DECT', false),
// Enables the planned arrival/leave date // Enables the planned arrival/leave date
'enable_planned_arrival' => true, 'enable_planned_arrival' => (bool)env('REGISTRATION_ENABLE_PLANNED_ARRIVAL', true),
// Enables the T-Shirt configuration on signup and profile // Enables the T-Shirt configuration on signup and profile
'enable_tshirt_size' => true, 'enable_tshirt_size' => (bool)env('REGISTRATION_ENABLE_TSHIRT', true),
// Number of shifts to freeload until angel is locked for shift signup. // Number of shifts to freeload until angel is locked for shift signup.
'max_freeloadable_shifts' => 2, 'max_freeloadable_shifts' => 2,

23
docker/deployment.env Normal file
View File

@ -0,0 +1,23 @@
# MAINTENANCE=false
# APP_NAME="Engelsystem"
# ENVIRONMENT= 'production'
# APP_URL=null
# FAQ_URL='https://events.ccc.de/congress/2013/wiki/Static:Volunteers'
# MAIL_DRIVER='mail'
# MAIL_FROM_ADDRESS='noreply@engelsystem.de'
# MAIL_FROM_NAME=Engelsystem
# MAIL_HOST='localhost'
# MAIL_PORT=587
# THEME=1
# HOME_SITE='news'
# DISPLAY_NEWS=10
# REGISTRATION_ENABLED=true
# PASSWORD_MINIMUM_LENGTH=8
# REGISTRATION_ENABLE_DECT=true
# REGISTRATION_ENABLE_USERNAME=false
# REGISTRATION_ENABLE_DECT=false
# REGISTRATION_ENABLE_PLANNED_ARRIVAL=true
# REGISTRATION_ENABLE_TSHIRT=true
# TIMEZONE='Europe/Berlin'
# DEFAULT_LOCALE='en_US'
# ADD_HEADERS=true

View File

@ -1,3 +1,4 @@
---
version: "3.6" version: "3.6"
services: services:
es_nginx: es_nginx:
@ -22,6 +23,9 @@ services:
MYSQL_USER: engelsystem MYSQL_USER: engelsystem
MYSQL_PASSWORD: engelsystem MYSQL_PASSWORD: engelsystem
MYSQL_DATABASE: engelsystem MYSQL_DATABASE: engelsystem
# some optional env vars and their defaults can be seen in the env file
# for exact information have a look at config/config.default.php
env_file: deployment.env
networks: networks:
- database - database
- fpm - fpm