From 4a102b248ac528ae92b91b9be7fc74f6668d65a8 Mon Sep 17 00:00:00 2001 From: Vishnu Ks Date: Fri, 10 Nov 2017 22:44:00 +0000 Subject: [PATCH] droplets: Set EXTERNAL_HOST to username.zulipdev.org:9991. --- zproject/dev_settings.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/zproject/dev_settings.py b/zproject/dev_settings.py index a09e3a4a12..90e54e71d7 100644 --- a/zproject/dev_settings.py +++ b/zproject/dev_settings.py @@ -3,6 +3,7 @@ # sample prod_settings.py file, with a few exceptions. from .prod_settings_template import * import os +import pwd from typing import Set LOCAL_UPLOADS_DIR = 'var/uploads' @@ -10,7 +11,15 @@ EMAIL_LOG_DIR = "/var/log/zulip/email.log" # Check if test_settings.py set EXTERNAL_HOST. EXTERNAL_HOST = os.getenv('EXTERNAL_HOST') if EXTERNAL_HOST is None: - EXTERNAL_HOST = 'zulipdev.com:9991' + user_id = os.getuid() + user_name = pwd.getpwuid(user_id).pw_name + if user_name == "zulipdev": + # For our droplets, we use the external hostname by default. + EXTERNAL_HOST = os.uname()[1] + ":9991" + else: + # For local development environments, we use localhost by + # default, via the "zulipdev.com" hostname. + EXTERNAL_HOST = 'zulipdev.com:9991' ALLOWED_HOSTS = ['*'] # Uncomment extra backends if you want to test with them. Note that