Merge branch 'pull/803' into development
# Conflicts: # docker-entrypoint.sh
This commit is contained in:
commit
ddd84656b8
2 changed files with 63 additions and 46 deletions
20
README.md
20
README.md
|
@ -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) |
|
| LDAP_UIDTAG | LDAP UID tag (e.g. uid/cn/username) |
|
||||||
| POOL_NAME | sets builtin Zone-MTA pool name (default: os.hostname()) |
|
| 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
|
## License
|
||||||
|
|
||||||
**GPL-V3.0**
|
**GPL-V3.0**
|
||||||
|
|
|
@ -43,62 +43,59 @@ else
|
||||||
echo 'Info: Generating application/production.yaml'
|
echo 'Info: Generating application/production.yaml'
|
||||||
|
|
||||||
# Basic configuration
|
# Basic configuration
|
||||||
cat > server/config/production.yaml <<EOT
|
cat >> server/config/production.yaml <<EOT
|
||||||
www:
|
www:
|
||||||
host: 0.0.0.0
|
host: 0.0.0.0
|
||||||
proxy: $WWW_PROXY
|
proxy: $WWW_PROXY
|
||||||
secret: "`pwgen -1`"
|
secret: "`pwgen -1`"
|
||||||
trustedUrlBase: $URL_BASE_TRUSTED
|
trustedUrlBase: $URL_BASE_TRUSTED
|
||||||
sandboxUrlBase: $URL_BASE_SANDBOX
|
sandboxUrlBase: $URL_BASE_SANDBOX
|
||||||
publicUrlBase: $URL_BASE_PUBLIC
|
publicUrlBase: $URL_BASE_PUBLIC
|
||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
host: $MYSQL_HOST
|
host: $MYSQL_HOST
|
||||||
database: $MYSQL_DATABASE
|
database: $MYSQL_DATABASE
|
||||||
user: $MYSQL_USER
|
user: $MYSQL_USER
|
||||||
password: $MYSQL_PASSWORD
|
password: $MYSQL_PASSWORD
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
enabled: true
|
enabled: true
|
||||||
host: $REDIS_HOST
|
host: $REDIS_HOST
|
||||||
|
|
||||||
log:
|
builtinZoneMTA:
|
||||||
level: info
|
log:
|
||||||
|
level: warn
|
||||||
|
mongo: mongodb://${MONGO_HOST}:27017/zone-mta
|
||||||
|
redis: redis://${REDIS_HOST}:6379/2
|
||||||
|
poolName: $POOL_NAME
|
||||||
|
|
||||||
builtinZoneMTA:
|
queue:
|
||||||
log:
|
processes: 5
|
||||||
level: warn
|
|
||||||
mongo: mongodb://${MONGO_HOST}:27017/zone-mta
|
|
||||||
redis: redis://${REDIS_HOST}:6379/2
|
|
||||||
poolName: $POOL_NAME
|
|
||||||
|
|
||||||
queue:
|
|
||||||
processes: 5
|
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
# Manage LDAP if enabled
|
# Manage LDAP if enabled
|
||||||
if [ "$WITH_LDAP" = "true" ]; then
|
if [ "$WITH_LDAP" = "true" ]; then
|
||||||
echo 'Info: LDAP enabled'
|
echo 'Info: LDAP enabled'
|
||||||
cat >> server/config/production.yaml <<EOT
|
cat >> server/config/production.yaml <<EOT
|
||||||
ldap:
|
ldap:
|
||||||
enabled: true
|
enabled: true
|
||||||
host: $LDAP_HOST
|
host: $LDAP_HOST
|
||||||
port: $LDAP_PORT
|
port: $LDAP_PORT
|
||||||
secure: $LDAP_SECURE
|
secure: $LDAP_SECURE
|
||||||
bindUser: $LDAP_BIND_USER
|
bindUser: $LDAP_BIND_USER
|
||||||
bindPassword: $LDAP_BIND_PASS
|
bindPassword: $LDAP_BIND_PASS
|
||||||
filter: $LDAP_FILTER
|
filter: $LDAP_FILTER
|
||||||
baseDN: $LDAP_BASEDN
|
baseDN: $LDAP_BASEDN
|
||||||
uidTag: $LDAP_UIDTAG
|
uidTag: $LDAP_UIDTAG
|
||||||
mailTag: $LDAP_MAILTAG
|
mailTag: $LDAP_MAILTAG
|
||||||
nameTag: $LDAP_NAMETAG
|
nameTag: $LDAP_NAMETAG
|
||||||
method: $LDAP_METHOD
|
method: $LDAP_METHOD
|
||||||
EOT
|
EOT
|
||||||
else
|
else
|
||||||
echo 'Info: LDAP not enabled'
|
echo 'Info: LDAP not enabled'
|
||||||
cat >> server/config/production.yaml <<EOT
|
cat >> server/config/production.yaml <<EOT
|
||||||
ldap:
|
ldap:
|
||||||
enabled: false
|
enabled: false
|
||||||
EOT
|
EOT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -109,10 +106,10 @@ if [ -f server/services/workers/reports/config/production.yaml ]; then
|
||||||
else
|
else
|
||||||
echo 'Info: Generating server/production.yaml'
|
echo 'Info: Generating server/production.yaml'
|
||||||
cat > server/services/workers/reports/config/production.yaml <<EOT
|
cat > server/services/workers/reports/config/production.yaml <<EOT
|
||||||
mysql:
|
mysql:
|
||||||
host: $MYSQL_HOST
|
host: $MYSQL_HOST
|
||||||
log:
|
log:
|
||||||
level: warn
|
level: warn
|
||||||
EOT
|
EOT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue