Skip to content

Commit

Permalink
Add support for custom database name and user.
Browse files Browse the repository at this point in the history
Fixes zulip#289.
  • Loading branch information
adambirds committed May 26, 2021
1 parent b2add60 commit 695ceb0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ services:
environment:
DB_HOST: 'database'
DB_HOST_PORT: '5432'
DB_NAME: 'zulip'
DB_USER: 'zulip'
SSL_CERTIFICATE_GENERATION: 'self-signed'
SETTING_MEMCACHED_LOCATION: 'memcached:11211'
Expand All @@ -75,6 +76,8 @@ services:
SECRETS_memcached_password: 'REPLACE_WITH_SECURE_MEMCACHED_PASSWORD'
SECRETS_redis_password: 'REPLACE_WITH_SECURE_REDIS_PASSWORD'
SECRETS_secret_key: 'REPLACE_WITH_SECURE_SECRET_KEY'
# Set this if you are setting a custom database user in DB_USER
# SECRETS_postgres_password: 'REPLACE_WITH_SECURE_POSTGRES_PASSWORD'
SETTING_EXTERNAL_HOST: 'localhost.localdomain'
SETTING_ZULIP_ADMINISTRATOR: '[email protected]'
SETTING_EMAIL_HOST: '' # e.g. smtp.example.com
Expand Down
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ setConfigurationValue() {
echo "$VALUE" >> "$FILE"
echo "Setting key \"$KEY\", type \"$TYPE\" in file \"$FILE\"."
}
zulipConfConfiguration () {
crudini --set /etc/zulip/zulip.conf postgresql database_name DB_NAME
crudini --set /etc/zulip/zulip.conf postgresql database_user DB_USER
}
nginxConfiguration() {
echo "Executing nginx configuration ..."
if [ "$DISABLE_HTTPS" == "True" ] || [ "$DISABLE_HTTPS" == "true" ]; then
Expand Down Expand Up @@ -309,6 +313,7 @@ autoBackupConfiguration() {
initialConfiguration() {
echo "=== Begin Initial Configuration Phase ==="
prepareDirectories
zulipConfConfiguration
nginxConfiguration
configureCerts
additionalPuppetConfiguration
Expand Down

0 comments on commit 695ceb0

Please sign in to comment.