summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-05-20 14:36:24 (GMT)
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-05-20 14:45:24 (GMT)
commitf25de53057d2e6fba0a64a3e24b35101ae2b331b (patch)
treee7d7fa12c6548e82622f2eb3a1ee56006d2d8b3c
parent8e6921b91ab6ac81325e898308d24c504ee54ea2 (diff)
downloaddefinitions-baserock/pedroalvarez/os-kilo-horizon.tar.gz
Horizon: Install dashboard in /varbaserock/pedroalvarez/os-kilo-horizon
-rw-r--r--openstack/etc/horizon/apache-horizon.conf8
-rw-r--r--strata/openstack-services/horizon.morph38
2 files changed, 15 insertions, 31 deletions
diff --git a/openstack/etc/horizon/apache-horizon.conf b/openstack/etc/horizon/apache-horizon.conf
index ea88897..b6104bd 100644
--- a/openstack/etc/horizon/apache-horizon.conf
+++ b/openstack/etc/horizon/apache-horizon.conf
@@ -1,5 +1,5 @@
<VirtualHost *:80>
- WSGIScriptAlias /horizon /var/lib/horizon/openstack_dashboard/django.wsgi
+ WSGIScriptAlias /horizon /var/lib/horizon/openstack_dashboard/wsgi/django.wsgi
WSGIDaemonProcess horizon user=horizon group=horizon processes=3 threads=10 home=/var/lib/horizon display-name=horizon
WSGIApplicationGroup %{GLOBAL}
@@ -10,7 +10,11 @@
WSGIProcessGroup horizon
DocumentRoot /var/lib/horizon/.blackhole
- Alias /static /var/lib/horizon/openstack_dashboard/static
+ Alias /static /var/lib/horizon/static
+
+ <Directory /var/lib/horizon/static>
+ Require all granted
+ </Directory>
<Directory /var/lib/horizon/openstack_dashboard >
Options Indexes FollowSymLinks MultiViews
diff --git a/strata/openstack-services/horizon.morph b/strata/openstack-services/horizon.morph
index ae6399b..3ebe5c7 100644
--- a/strata/openstack-services/horizon.morph
+++ b/strata/openstack-services/horizon.morph
@@ -4,16 +4,12 @@ configure-commands:
# Remove unnecessary .mo files they will be generated
# later during package build.
- find . -name "django*.mo" -exec rm -f '{}' \;
-# Set COMPRESS_OFFLINE=True
-- |
- sed -i 's:COMPRESS_OFFLINE.=.False:COMPRESS_OFFLINE = True:' \
- openstack_dashboard/settings.py
build-commands:
# Compile message strings
- cd horizon && django-admin.py compilemessages && cd ..
- cd openstack_dashboard && django-admin.py compilemessages && cd ..
- python setup.py build
-post-build-commands:
+
# Use the local_settings.py example to compile and compress the css, js, etc files.
# This is a hack to make SECRET_KEY work.
- |
@@ -24,36 +20,20 @@ post-build-commands:
- python manage.py compress --force
install-commands:
# Undo hack
-- |
- cp openstack_dashboard/local/local_settings.py.example \
- openstack_dashboard/local/local_settings.py
+- rm openstack_dashboard/local/local_settings.py
# Install horizon
-- python setup.py install -O1 --skip-build --prefix "$PREFIX" --root "$DESTDIR"
-post-install-commands:
+- mkdir -p "$DESTDIR"/var/lib/horizon
+- cp -a openstack_dashboard "$DESTDIR"/var/lib/horizon/
+
# Remove unnecessary .po files
- find "$DESTDIR" -name django.po -exec rm '{}' \;
- find "$DESTDIR" -name djangojs.po -exec rm '{}' \;
-# Link Openstack local_settings where openstack_dashboard is installed.
-- mkdir -p "$DESTDIR"/var/lib/horizon/openstack_dashboard/local
-- |
- ln -sf /etc/horizon/openstack_dashboard/local_settings.py \
- "$DESTDIR$PREFIX"/lib/python2.7/site-packages/openstack_dashboard/local/local_settings.py
+
# Create the static directory (STATIC_ROOT) used in local_settings.py to keep
# the static objects like css files.
-- mkdir -p "$DESTDIR"/var/lib/horizon/openstack_dashboard/static
+- mkdir -p "$DESTDIR"/var/lib/horizon/static
# Copy the compressed static files to horizon.
-- cp -a openstack_dashboard/static/* "$DESTDIR"/var/lib/horizon/openstack_dashboard/static
-- cp -a horizon/static/* "$DESTDIR"/var/lib/horizon/openstack_dashboard/static
-- cp -a static/* "$DESTDIR"/var/lib/horizon/openstack_dashboard/static
-# Work around to make django.wsgi working with horizon
-# See: https://bugs.launchpad.net/osprofiler/+bug/1361235
-# and: https://git.openstack.org/cgit/openstack/tripleo-image-elements/commit/?id=41c9a1dfad23f8aee366afb6a0b20a6c57ec8f79
-- |
- sed -i "s|'../..'|os.path.realpath('../..')|" \
- "$DESTDIR$PREFIX"/lib/python2.7/site-packages/openstack_dashboard/wsgi/django.wsgi
-# And link this django.wsgi file to the horizon home directory
-- |
- ln -sf "$PREFIX"/lib/python2.7/site-packages/openstack_dashboard/wsgi/django.wsgi \
- "$DESTDIR"/var/lib/horizon/openstack_dashboard/django.wsgi
+- cp -a static/* "$DESTDIR"/var/lib/horizon/static
+
# Create the horizon document root for apache configuration
- mkdir -p "$DESTDIR"/var/lib/horizon/.blackhole