From: Thomas Goirand Date: Wed, 31 Oct 2012 19:42:09 +0000 (+0000) Subject: * Rewrote Apache vhost, diables apache "default" vhost by default, (probably X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3fd42156e80ccd5fbd04949bb68e8b7beaa1f447;p=openstack-build%2Fhorizon-build.git * Rewrote Apache vhost, diables apache "default" vhost by default, (probably we should ask for permission to do that using debconf). * Now writing css and js script in /var, plus we aren't doing chown www-data of all the static, but only css + js in /var. Rewritten-From: a61fb33ca8c140ffc631c448deeb47b388350250 --- diff --git a/trusty/debian/changelog b/trusty/debian/changelog index ce80f63..fac3995 100644 --- a/trusty/debian/changelog +++ b/trusty/debian/changelog @@ -5,6 +5,10 @@ horizon (2012.2-1) experimental; urgency=low [ Thomas Goirand ] * Recommends: memcached and use it as default on localhost. + * Rewrote Apache vhost, diables apache "default" vhost by default, (probably + we should ask for permission to do that using debconf). + * Now writing css and js script in /var, plus we aren't doing chown www-data + of all the static, but only css + js in /var. -- Mehdi Abaakouk Sat, 29 Sep 2012 09:38:19 +0200 diff --git a/trusty/debian/openstack-dashboard-apache.conf b/trusty/debian/openstack-dashboard-apache.conf index fcb7a9d..ebc5794 100644 --- a/trusty/debian/openstack-dashboard-apache.conf +++ b/trusty/debian/openstack-dashboard-apache.conf @@ -1,29 +1,35 @@ - - WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi - WSGIDaemonProcess openstack-dashboard user=horizon group=horizon - WSGIProcessGroup openstack-dashboard + + ServerAdmin webmaster@localhost + WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi + WSGIDaemonProcess horizon user=www-data group=www-data + #WSGIProcessGroup openstack-dashboard + Alias /static /usr/share/openstack-dashboard/openstack_dashboard/static - - AllowOverride None - + DocumentRoot /var/www - - Order allow,deny - Allow from all - + + AllowOverride None + - Alias /static/horizon /usr/share/pyshared/horizon/static/horizon + + Order allow,deny + Allow from all + - - Order allow,deny - Allow from all - + Alias /static/horizon /usr/share/pyshared/horizon/static/horizon - Alias /static /usr/share/openstack-dashboard/openstack_dashboard/static + + Order allow,deny + Allow from all + - - Order allow,deny - Allow from all - + #Alias /static /usr/share/openstack-dashboard/openstack_dashboard/static + + Order allow,deny + Allow from all + + ErrorLog ${APACHE_LOG_DIR}/error.log + LogLevel warn + CustomLog ${APACHE_LOG_DIR}/access.log combined diff --git a/trusty/debian/openstack-dashboard-apache.postinst b/trusty/debian/openstack-dashboard-apache.postinst index 8633b45..85f3c89 100644 --- a/trusty/debian/openstack-dashboard-apache.postinst +++ b/trusty/debian/openstack-dashboard-apache.postinst @@ -2,11 +2,14 @@ set -e -if [ "$1" = "configure" ]; then - if [ -x /etc/init.d/apache2 ]; then - a2ensite openstack-dashboard - invoke-rc.d --quiet apache2 reload - fi +if [ "$1" = "configure" ] ; then + if [ -x /etc/init.d/apache2 ]; then + a2dissite default + a2ensite openstack-dashboard + invoke-rc.d --quiet apache2 reload + fi fi -#DEBHELPER# \ No newline at end of file +#DEBHELPER# + +exit 0 diff --git a/trusty/debian/openstack-dashboard.dirs b/trusty/debian/openstack-dashboard.dirs index 9e80ebf..f0b5d7f 100644 --- a/trusty/debian/openstack-dashboard.dirs +++ b/trusty/debian/openstack-dashboard.dirs @@ -1,4 +1,2 @@ /usr/share/openstack-dashboard/bin/less/ -/usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/js -/usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/css diff --git a/trusty/debian/openstack-dashboard.links b/trusty/debian/openstack-dashboard.links index 52c92a1..d6df9ac 100644 --- a/trusty/debian/openstack-dashboard.links +++ b/trusty/debian/openstack-dashboard.links @@ -1,4 +1,4 @@ -/usr/share/pyshared/horizon/static/horizon /usr/share/openstack-dashboard/openstack_dashboard/static/horizon -/usr/share/openstack-dashboard/openstack_dashboard/static /usr/share/openstack-dashboard/static -/usr/bin/lessc /usr/share/openstack-dashboard/bin/less/lessc +/usr/bin/lessc /usr/share/openstack-dashboard/bin/less/lessc +/usr/share/openstack-dashboard/openstack_dashboard/static /usr/share/openstack-dashboard/static +/usr/share/pyshared/horizon/static/horizon /usr/share/openstack-dashboard/openstack_dashboard/static/horizon diff --git a/trusty/debian/openstack-dashboard.postinst b/trusty/debian/openstack-dashboard.postinst index 3b50e13..eae51e5 100644 --- a/trusty/debian/openstack-dashboard.postinst +++ b/trusty/debian/openstack-dashboard.postinst @@ -1,18 +1,23 @@ #!/bin/sh set -e -if [ "$1" = "configure" ] -then - adduser --system \ - --home /var/lib/horizon \ - --quiet \ - --disabled-password \ - --group horizon +if [ "$1" = "configure" ] ; then + adduser --system \ + --home /var/lib/horizon \ + --quiet \ + --disabled-password \ + --group horizon - if [ -e /usr/share/openstack-dashboard/openstack_dashboard/static ] ; then - chown -R www-data:www-data \ - /usr/share/openstack-dashboard/openstack_dashboard/static - fi + mkdir -p /var/lib/openstack-dashboard/static/js + mkdir -p /var/lib/openstack-dashboard/static/css + chown -R www-data:www-data /var/lib/openstack-dashboard/static + + #if [ -e /usr/share/openstack-dashboard/openstack_dashboard/static ] ; then + # chown -R www-data:www-data \ + # /usr/share/openstack-dashboard/openstack_dashboard/static + #fi fi #DEBHELPER# + +exit 0 diff --git a/trusty/debian/openstack-dashboard.postrm b/trusty/debian/openstack-dashboard.postrm index 8526cf6..447c904 100644 --- a/trusty/debian/openstack-dashboard.postrm +++ b/trusty/debian/openstack-dashboard.postrm @@ -2,11 +2,10 @@ set -e -case $1 in - purge) - userdel -r horizon || true - groupdel horizon || true - ;; -esac +if [ "${1}" = "purge" ] ; then + rm -rf /var/lib/openstack-dashboard +fi #DEBHELPER# + +exit 0 diff --git a/trusty/debian/rules b/trusty/debian/rules index 5eb0814..f94ee5b 100755 --- a/trusty/debian/rules +++ b/trusty/debian/rules @@ -22,7 +22,9 @@ override_dh_auto_install: # Sets memcached by default in local_settings.py cp $(CURDIR)/openstack_dashboard/local/local_settings.py.example \ $(CURDIR)/debian/tmp/etc/openstack-dashboard/local_settings.py - sed -i -e 's|^[ \t#]*CACHE_BACKEND[ \t#]*=.*|CACHE_BACKEND = memcached://127.0.0.1:11211/|' \ + sed -i -e 's|^[ \t#]*CACHE_BACKEND[ \t#]*=.*|CACHE_BACKEND = "memcached://127.0.0.1:11211/"|' \ + $(CURDIR)/debian/tmp/etc/openstack-dashboard/local_settings.py + sed -i -e 's|^[ \t#]*COMPRESS_OFFLINE[ \t#]*=.*|COMPRESS_OFFLINE = False|' \ $(CURDIR)/debian/tmp/etc/openstack-dashboard/local_settings.py cp $(CURDIR)/manage.py \ @@ -40,8 +42,14 @@ override_dh_auto_install: chmod 644 $(CURDIR)/debian/tmp/usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/manifest.json # openstack-dashboard-apache - install -d -m 755 $(CURDIR)/debian/tmp/etc/apache2/sites-available/ - cp -a $(CURDIR)/debian/openstack-dashboard-apache.conf $(CURDIR)/debian/tmp/etc/apache2/sites-available/openstack-dashboard + install -D -m 0644 $(CURDIR)/debian/openstack-dashboard-apache.conf $(CURDIR)/debian/tmp/etc/apache2/sites-available/openstack-dashboard + +override_dh_install: + dh_install + rm -r $(CURDIR)/debian/openstack-dashboard/usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/js + rm -r $(CURDIR)/debian/openstack-dashboard/usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/css + ln -s /var/lib/openstack-dashboard/static/js $(CURDIR)/debian/openstack-dashboard/usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/js + ln -s /var/lib/openstack-dashboard/static/css $(CURDIR)/debian/openstack-dashboard/usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/css override_dh_builddeb: dh_builddeb -- -Zxz -z9