Skip to content

Commit 8b57e39

Browse files
hackerkidtimabbott
authored andcommitted
settings: Add option to set remote postgres port.
1 parent f3c2240 commit 8b57e39

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

puppet/zulip/files/postgresql/process_fts_updates

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ try:
7373
from django.conf import settings
7474
if settings.REMOTE_POSTGRES_HOST != '':
7575
pg_args['host'] = settings.REMOTE_POSTGRES_HOST
76+
if settings.REMOTE_POSTGRES_PORT != '':
77+
pg_args['port'] = settings.REMOTE_POSTGRES_PORT
7678
USING_PGROONGA = settings.USING_PGROONGA
7779
except ImportError:
7880
# process_fts_updates also supports running locally on a remote

zproject/default_settings.py

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
REDIS_HOST = '127.0.0.1'
114114
REDIS_PORT = 6379
115115
REMOTE_POSTGRES_HOST = ''
116+
REMOTE_POSTGRES_PORT = ''
116117
REMOTE_POSTGRES_SSLMODE = ''
117118
THUMBOR_URL = ''
118119
THUMBOR_SERVES_CAMO = False

zproject/prod_settings_template.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,13 @@
393393
#DEFAULT_AVATAR_URI = '/local-static/default-avatar.png'
394394

395395
# To access an external postgres database you should define the host name in
396-
# REMOTE_POSTGRES_HOST, you can define the password in the secrets file in the
396+
# REMOTE_POSTGRES_HOST, port in REMOTE_POSTGRES_PORT, password in the secrets file in the
397397
# property postgres_password, and the SSL connection mode in REMOTE_POSTGRES_SSLMODE
398398
# Valid values for REMOTE_POSTGRES_SSLMODE are documented in the
399399
# "SSL Mode Descriptions" table in
400400
# https://www.postgresql.org/docs/9.5/static/libpq-ssl.html
401401
#REMOTE_POSTGRES_HOST = 'dbserver.example.com'
402+
#REMOTE_POSTGRES_PORT = '5432'
402403
#REMOTE_POSTGRES_SSLMODE = 'require'
403404

404405
# If you want to set a Terms of Service for your server, set the path

zproject/settings.py

+1
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ def get_dirs(self) -> List[str]:
282282
elif REMOTE_POSTGRES_HOST != '':
283283
DATABASES['default'].update({
284284
'HOST': REMOTE_POSTGRES_HOST,
285+
'PORT': REMOTE_POSTGRES_PORT
285286
})
286287
if get_secret("postgres_password") is not None:
287288
DATABASES['default'].update({

0 commit comments

Comments
 (0)