tools: Update run-dev.py to output right subdomain if on Zulip droplet.

I have updated `tools/run-dev.py` to output the correct subdomain such as
`http://zulip.username.zulipdev.org` so that the user knows the correct
subdomain to access the Zulip Dev realm on.
This commit is contained in:
Adam Birds 2021-04-16 02:37:09 +00:00 committed by Tim Abbott
parent 0cf3e0c226
commit 5f0211285e
1 changed files with 4 additions and 1 deletions

View File

@ -370,7 +370,10 @@ def print_listeners() -> None:
# EXTERNAL_HOST logic from dev_settings.py.
IS_DEV_DROPLET = pwd.getpwuid(os.getuid()).pw_name == "zulipdev"
if IS_DEV_DROPLET:
default_hostname = os.uname()[1].lower()
# Technically, the `zulip.` is a subdomain of the server, so
# this is kinda misleading, but 99% of development is done on
# the default/zulip subdomain.
default_hostname = "zulip." + os.uname()[1].lower()
else:
default_hostname = "localhost"
external_host = os.getenv("EXTERNAL_HOST", f"{default_hostname}:{proxy_port}")