droplets: Set EXTERNAL_HOST to username.zulipdev.org:9991.

This commit is contained in:
Vishnu Ks 2017-11-10 22:44:00 +00:00 committed by Tim Abbott
parent f44b60a150
commit 4a102b248a
1 changed files with 10 additions and 1 deletions

View File

@ -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