aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorHarm Weites <harm@weites.com>2015-05-09 21:44:24 +0200
committerHarm Weites <harm@weites.com>2015-05-09 21:56:52 +0200
commit861ece743ec9a070e49de19914169a4a67e8e47d (patch)
tree3ef7ee7eeab69c2c8ac768901de646abbbba86e0 /docker
parent56e72a6bcf1f06081d5513c79080436001c2afcc (diff)
downloadkolla-861ece743ec9a070e49de19914169a4a67e8e47d.tar.gz
kolla-861ece743ec9a070e49de19914169a4a67e8e47d.zip
Move Horizon to / and make it work in the first place.
Having the dasboard in /dashboard doesn't feel right, especially since there is no automatic redirect when people browse to the ip or hostname. Which would be a natural first try. Moving to / now to make the process behave in a simpler fashion. Because of a packaging error the js/css wouldn't load properly, next to that there is an issue with a supposed missing 'manage.py compress' run. This is handled through Kolla now as well (for the time being). There is another supposed bug in packaging that makes webfont.ttf return a 404. This is because of a missing alias for /static stuff, and with moving the whole thing to / this gets adressed as well. Change-Id: I64cd7c9effad6cf9ec7c6a41f34e1184640c8adc
Diffstat (limited to 'docker')
-rw-r--r--docker/horizon/Dockerfile11
-rwxr-xr-xdocker/horizon/start.sh13
2 files changed, 22 insertions, 2 deletions
diff --git a/docker/horizon/Dockerfile b/docker/horizon/Dockerfile
index ce925baf2..2c34ee03a 100644
--- a/docker/horizon/Dockerfile
+++ b/docker/horizon/Dockerfile
@@ -1,8 +1,15 @@
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
-RUN yum -y install openstack-dashboard \
- httpd httpd-mod-wsgi && yum clean all
+RUN yum -y install \
+ openstack-dashboard \
+ httpd \
+ httpd-mod-wsgi \
+ && yum clean all \
+ && chown -R apache:apache /usr/share/openstack-dashboard/static
+
+# The chown is required because of this packaging bug:
+# https://bugzilla.redhat.com/show_bug.cgi?id=1219006
ADD ./start.sh /start.sh
diff --git a/docker/horizon/start.sh b/docker/horizon/start.sh
index f087a429e..4e720bb87 100755
--- a/docker/horizon/start.sh
+++ b/docker/horizon/start.sh
@@ -13,6 +13,7 @@ export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
cfg=/etc/openstack-dashboard/local_settings
+httpdcfg=/etc/httpd/conf.d/openstack-dashboard.conf
sed -ri 's/ALLOWED_HOSTS = \['\''horizon.example.com'\'', '\''localhost'\''\]/ALLOWED_HOSTS = \['\''*'\'', \]/' /etc/openstack-dashboard/local_settings
@@ -20,4 +21,16 @@ sed -ri 's/OPENSTACK_KEYSTONE_URL = \"http:\/\/%s:5000\/v2.0\" % OPENSTACK_HOST/
sed -ri 's/OPENSTACK_HOST = \"127.0.0.1\"/OPENSTACK_HOST = \"'"$KEYSTONE_PUBLIC_SERVICE_HOST"'\" /' /etc/openstack-dashboard/local_settings
+# Make sure we launch horizon using the default value for WEBROOT, which is
+# '/'.
+sed -ri '/^WEBROOT =.+/d' $cfg
+sed -ri 's,^(WSGIScriptAlias) /dashboard (/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi),\1 / \2,' $httpdcfg
+sed -ri 's,^(Alias /dashboard)(/static /usr/share/openstack-dashboard/static),Alias \2,' $httpdcfg
+
+# This step is required because of:
+# https://bugzilla.redhat.com/show_bug.cgi?id=1220070
+# Running this in the Dockerfile didn't fix the HTTP/500 as a result of the
+# missing compress action.
+python /usr/share/openstack-dashboard/manage.py compress
+
/usr/sbin/httpd -DFOREGROUND