Merge branch 'pull/803' into development

# Conflicts:
#	docker-entrypoint.sh
This commit is contained in:
Tomas Bures 2020-01-12 09:13:55 +01:00
commit ddd84656b8
2 changed files with 63 additions and 46 deletions

View file

@ -224,6 +224,26 @@ The instructions above use an automatically built Docker image on DockerHub (htt
| LDAP_UIDTAG | LDAP UID tag (e.g. uid/cn/username) |
| POOL_NAME | sets builtin Zone-MTA pool name (default: os.hostname()) |
If you are using docker-compose to run Mailtrain in production and need to pass your own overrides of these env-vars in a custom override like `docker-compose.override.yml`:
```
version: '3'
services:
mailtrain:
environment:
- URL_BASE_TRUSTED
- URL_BASE_SANDBOX
- URL_BASE_PUBLIC
```
You can now override URL_BASE_TRUSTED, URL_BASE_SANDBOX and URL_BASE_PUBLIC in an `.env` file and run this command to build or run it
`docker-compose -f docker-compose.yml -f docker-compose.override.yml build (or up)`
or you can pass this env-vars in the shell-command like this
`URL_BASE_TRUSTED=https://mailtrain.domain.com (and more env-vars..) docker-compose -f docker-compose.yml -f docker-compose.override.yml build (or up)`
## License
**GPL-V3.0**

View file

@ -43,62 +43,59 @@ else
echo 'Info: Generating application/production.yaml'
# Basic configuration
cat > server/config/production.yaml <<EOT
www:
host: 0.0.0.0
proxy: $WWW_PROXY
secret: "`pwgen -1`"
trustedUrlBase: $URL_BASE_TRUSTED
sandboxUrlBase: $URL_BASE_SANDBOX
publicUrlBase: $URL_BASE_PUBLIC
cat >> server/config/production.yaml <<EOT
www:
host: 0.0.0.0
proxy: $WWW_PROXY
secret: "`pwgen -1`"
trustedUrlBase: $URL_BASE_TRUSTED
sandboxUrlBase: $URL_BASE_SANDBOX
publicUrlBase: $URL_BASE_PUBLIC
mysql:
host: $MYSQL_HOST
database: $MYSQL_DATABASE
user: $MYSQL_USER
password: $MYSQL_PASSWORD
mysql:
host: $MYSQL_HOST
database: $MYSQL_DATABASE
user: $MYSQL_USER
password: $MYSQL_PASSWORD
redis:
enabled: true
host: $REDIS_HOST
redis:
enabled: true
host: $REDIS_HOST
log:
level: info
builtinZoneMTA:
log:
level: warn
mongo: mongodb://${MONGO_HOST}:27017/zone-mta
redis: redis://${REDIS_HOST}:6379/2
poolName: $POOL_NAME
builtinZoneMTA:
log:
level: warn
mongo: mongodb://${MONGO_HOST}:27017/zone-mta
redis: redis://${REDIS_HOST}:6379/2
poolName: $POOL_NAME
queue:
processes: 5
queue:
processes: 5
EOT
# Manage LDAP if enabled
if [ "$WITH_LDAP" = "true" ]; then
echo 'Info: LDAP enabled'
cat >> server/config/production.yaml <<EOT
ldap:
enabled: true
host: $LDAP_HOST
port: $LDAP_PORT
secure: $LDAP_SECURE
bindUser: $LDAP_BIND_USER
bindPassword: $LDAP_BIND_PASS
filter: $LDAP_FILTER
baseDN: $LDAP_BASEDN
uidTag: $LDAP_UIDTAG
mailTag: $LDAP_MAILTAG
nameTag: $LDAP_NAMETAG
method: $LDAP_METHOD
ldap:
enabled: true
host: $LDAP_HOST
port: $LDAP_PORT
secure: $LDAP_SECURE
bindUser: $LDAP_BIND_USER
bindPassword: $LDAP_BIND_PASS
filter: $LDAP_FILTER
baseDN: $LDAP_BASEDN
uidTag: $LDAP_UIDTAG
mailTag: $LDAP_MAILTAG
nameTag: $LDAP_NAMETAG
method: $LDAP_METHOD
EOT
else
echo 'Info: LDAP not enabled'
cat >> server/config/production.yaml <<EOT
ldap:
enabled: false
ldap:
enabled: false
EOT
fi
@ -109,10 +106,10 @@ if [ -f server/services/workers/reports/config/production.yaml ]; then
else
echo 'Info: Generating server/production.yaml'
cat > server/services/workers/reports/config/production.yaml <<EOT
mysql:
host: $MYSQL_HOST
log:
level: warn
mysql:
host: $MYSQL_HOST
log:
level: warn
EOT
fi