mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +00:00
settings: Add option to set remote postgres port.
This commit is contained in:
@@ -73,6 +73,8 @@ try:
|
||||
from django.conf import settings
|
||||
if settings.REMOTE_POSTGRES_HOST != '':
|
||||
pg_args['host'] = settings.REMOTE_POSTGRES_HOST
|
||||
if settings.REMOTE_POSTGRES_PORT != '':
|
||||
pg_args['port'] = settings.REMOTE_POSTGRES_PORT
|
||||
USING_PGROONGA = settings.USING_PGROONGA
|
||||
except ImportError:
|
||||
# process_fts_updates also supports running locally on a remote
|
||||
|
||||
@@ -113,6 +113,7 @@ RABBITMQ_USERNAME = 'zulip'
|
||||
REDIS_HOST = '127.0.0.1'
|
||||
REDIS_PORT = 6379
|
||||
REMOTE_POSTGRES_HOST = ''
|
||||
REMOTE_POSTGRES_PORT = ''
|
||||
REMOTE_POSTGRES_SSLMODE = ''
|
||||
THUMBOR_URL = ''
|
||||
THUMBOR_SERVES_CAMO = False
|
||||
|
||||
@@ -393,12 +393,13 @@ ENABLE_GRAVATAR = True
|
||||
#DEFAULT_AVATAR_URI = '/local-static/default-avatar.png'
|
||||
|
||||
# To access an external postgres database you should define the host name in
|
||||
# REMOTE_POSTGRES_HOST, you can define the password in the secrets file in the
|
||||
# REMOTE_POSTGRES_HOST, port in REMOTE_POSTGRES_PORT, password in the secrets file in the
|
||||
# property postgres_password, and the SSL connection mode in REMOTE_POSTGRES_SSLMODE
|
||||
# Valid values for REMOTE_POSTGRES_SSLMODE are documented in the
|
||||
# "SSL Mode Descriptions" table in
|
||||
# https://www.postgresql.org/docs/9.5/static/libpq-ssl.html
|
||||
#REMOTE_POSTGRES_HOST = 'dbserver.example.com'
|
||||
#REMOTE_POSTGRES_PORT = '5432'
|
||||
#REMOTE_POSTGRES_SSLMODE = 'require'
|
||||
|
||||
# If you want to set a Terms of Service for your server, set the path
|
||||
|
||||
@@ -282,6 +282,7 @@ if DEVELOPMENT:
|
||||
elif REMOTE_POSTGRES_HOST != '':
|
||||
DATABASES['default'].update({
|
||||
'HOST': REMOTE_POSTGRES_HOST,
|
||||
'PORT': REMOTE_POSTGRES_PORT
|
||||
})
|
||||
if get_secret("postgres_password") is not None:
|
||||
DATABASES['default'].update({
|
||||
|
||||
Reference in New Issue
Block a user