From 868a6631721219bac4042eca88e290c278589e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Tr=C4=99bski?= Date: Mon, 14 Nov 2016 09:10:57 +0100 Subject: [PATCH] Always set ALLOWED_HOSTS=['*'] for horizon If devstack is deployed in the VM with defined public IP address (like 192.168.10.6) it is not possible to access the Horizon from the browser. This is because DEBUG=True means that ALLOWED_HOSTS, if not set, is equal to ['localhost', '127.0.0.1', '[::1]'] according to Django's documentation. Change-Id: I0ab2b57e459dbfa3b01b3e9388bbcefac076a142 Co-Authored-By: David Lyle Closes-Bug: #1643050 --- lib/horizon | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/horizon b/lib/horizon index 78cbe8b58d..f5e9c7e0a7 100644 --- a/lib/horizon +++ b/lib/horizon @@ -97,6 +97,11 @@ function configure_horizon { _horizon_config_set $local_settings "" OPENSTACK_API_VERSIONS {\"identity\":3} _horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_URL "\"${KEYSTONE_SERVICE_URI}/v3\"" + # note(trebskit): if HOST_IP points at non-localhost ip address, horizon cannot be accessed + # from outside the virtual machine. This fixes is meant primarily for local development + # purpose + _horizon_config_set $local_settings "" ALLOWED_HOSTS [\"*\"] + if [ -f $SSL_BUNDLE_FILE ]; then _horizon_config_set $local_settings "" OPENSTACK_SSL_CACERT \"${SSL_BUNDLE_FILE}\" fi