Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom database user and name. #301

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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