From c0d38f42f16b827486ca4008ca537977d905af52 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sat, 7 May 2016 22:43:45 -0700 Subject: [PATCH] supervisor: Use 127.0.0.1 rather than localhost for tornado. In theory these should be the same, but in misconfigured environments (such at Travis CI) where /etc/hosts has multiple entries for "localhost", 127.0.0.1 is safer than "localhost". --- puppet/zulip/files/supervisor/conf.d/zulip.conf | 2 +- zproject/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/puppet/zulip/files/supervisor/conf.d/zulip.conf b/puppet/zulip/files/supervisor/conf.d/zulip.conf index 890d657197..2d90e90307 100644 --- a/puppet/zulip/files/supervisor/conf.d/zulip.conf +++ b/puppet/zulip/files/supervisor/conf.d/zulip.conf @@ -43,7 +43,7 @@ socket_owner=zulip:zulip socket_mode=0700 [program:zulip-tornado] -command=python2.7 /home/zulip/deployments/current/manage.py runtornado localhost:9993 +command=python2.7 /home/zulip/deployments/current/manage.py runtornado 127.0.0.1:9993 priority=200 ; the relative start priority (default 999) autostart=true ; start at supervisord start (default: true) autorestart=true ; whether/when to restart (default: unexpected) diff --git a/zproject/settings.py b/zproject/settings.py index 37eb6627e2..45871e402c 100644 --- a/zproject/settings.py +++ b/zproject/settings.py @@ -303,7 +303,7 @@ INSTALLED_APPS = [ # Base URL of the Tornado server # We set it to None when running backend tests or populate_db. # We override the port number when running frontend tests. -TORNADO_SERVER = 'http://localhost:9993' +TORNADO_SERVER = 'http://127.0.0.1:9993' RUNNING_INSIDE_TORNADO = False ########################################################################