]> review.fuel-infra Code Review - openstack-build/horizon-build.git/commitdiff
* Rewrote Apache vhost, diables apache "default" vhost by default, (probably
authorThomas Goirand <thomas@goirand.fr>
Wed, 31 Oct 2012 19:42:09 +0000 (19:42 +0000)
committerThomas Goirand <thomas@goirand.fr>
Wed, 31 Oct 2012 19:58:47 +0000 (19:58 +0000)
  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

trusty/debian/changelog
trusty/debian/openstack-dashboard-apache.conf
trusty/debian/openstack-dashboard-apache.postinst
trusty/debian/openstack-dashboard.dirs
trusty/debian/openstack-dashboard.links
trusty/debian/openstack-dashboard.postinst
trusty/debian/openstack-dashboard.postrm
trusty/debian/rules

index ce80f63c87e39692e133d98cd2ef4f47594c3643..fac399560496d8a3f8aa87c6829f0d5e50ff2b44 100644 (file)
@@ -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 <sileht@sileht.net>  Sat, 29 Sep 2012 09:38:19 +0200
 
index fcb7a9d361ce63762d58e510f8ae8e52c0d32da3..ebc5794592d95ca50be851258a8ef894485ef0e2 100644 (file)
@@ -1,29 +1,35 @@
-<VirtualHost *:8080>
-    WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
-    WSGIDaemonProcess openstack-dashboard user=horizon group=horizon
-    WSGIProcessGroup openstack-dashboard
+<VirtualHost *:80>
+       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
 
-    <Directory />
-        AllowOverride None
-    </Directory>
+       DocumentRoot /var/www
 
-    <Directory /usr/share/openstack-dashboard/openstack_dashboard/wsgi/>
-        Order allow,deny
-        Allow from all
-    </Directory>
+       <Directory />
+               AllowOverride None
+       </Directory>
 
-    Alias /static/horizon /usr/share/pyshared/horizon/static/horizon
+       <Directory /usr/share/openstack-dashboard/openstack_dashboard/wsgi/>
+               Order allow,deny
+               Allow from all
+       </Directory>
 
-    <Directory /usr/share/pyshared/horizon/static/horizon>
-        Order allow,deny
-        Allow from all
-    </Directory>
+       Alias /static/horizon /usr/share/pyshared/horizon/static/horizon
 
-    Alias /static /usr/share/openstack-dashboard/openstack_dashboard/static
+       <Directory /usr/share/pyshared/horizon/static/horizon>
+               Order allow,deny
+               Allow from all
+       </Directory>
 
-    <Directory /usr/share/openstack-dashboard/openstack_dashboard/static/>
-       Order allow,deny
-       Allow from all
-    </Directory>
+       #Alias /static /usr/share/openstack-dashboard/openstack_dashboard/static
 
+       <Directory /usr/share/openstack-dashboard/openstack_dashboard/static/>
+               Order allow,deny
+               Allow from all
+       </Directory>
+       ErrorLog ${APACHE_LOG_DIR}/error.log
+       LogLevel warn
+       CustomLog ${APACHE_LOG_DIR}/access.log combined
 </VirtualHost>
index 8633b45d80757e6a2bfb017e6aa1d0fe463087e8..85f3c897207550c9b7d6e8a9cfe407ab18ae8b18 100644 (file)
@@ -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
index 9e80ebf0ec27dba75925843e8be0502e593b692c..f0b5d7f0ce02764475a138df807a45e887b91dc2 100644 (file)
@@ -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
 
index 52c92a14847023ea5796f4f4f38e57a4929020c2..d6df9acbeeafce3564e2023ea2ba5bdf72af3d7b 100644 (file)
@@ -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
index 3b50e1399e44919ece4faa952593ecf20b591326..eae51e55b1b36a99f5e8c386fec37a20299e78dc 100644 (file)
@@ -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
index 8526cf6716fec0fadc6c0300b564d985ec995c30..447c904d7a602bfa9ee2c2d4862546c28e9c3fe3 100644 (file)
@@ -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
index 5eb0814affc127c480c25a93a17617e7b41385ff..f94ee5ba09a0879ea9726d65241665967cc7f71f 100755 (executable)
@@ -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