]> review.fuel-infra Code Review - openstack-build/horizon-build.git/commitdiff
Now using debconf to ask for activating apache vhost, disabling default apache vhost...
authorThomas Goirand <thomas@goirand.fr>
Thu, 1 Nov 2012 07:50:39 +0000 (07:50 +0000)
committerThomas Goirand <thomas@goirand.fr>
Thu, 1 Nov 2012 08:02:21 +0000 (08:02 +0000)
Rewritten-From: 239b0fc2466f79166a9828251f2340eeb38572c1

xenial/debian/changelog
xenial/debian/openstack-dashboard-apache-ssl.conf [new file with mode: 0644]
xenial/debian/openstack-dashboard-apache.config [new file with mode: 0644]
xenial/debian/openstack-dashboard-apache.postinst
xenial/debian/openstack-dashboard-apache.templates [new file with mode: 0644]
xenial/debian/po/POTFILES.in [new file with mode: 0644]
xenial/debian/po/templates.pot [new file with mode: 0644]
xenial/debian/rules

index fac399560496d8a3f8aa87c6829f0d5e50ff2b44..fd6e5e0ba4f35900d986754c01c77ecc8d5d2582 100644 (file)
@@ -9,6 +9,8 @@ horizon (2012.2-1) experimental; urgency=low
   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.
+  * Now asking using debconf if we should disable the default apache vhost,
+  and activate the Dasboard, and if we should use SSL or not.
 
  -- Mehdi Abaakouk <sileht@sileht.net>  Sat, 29 Sep 2012 09:38:19 +0200
 
diff --git a/xenial/debian/openstack-dashboard-apache-ssl.conf b/xenial/debian/openstack-dashboard-apache-ssl.conf
new file mode 100644 (file)
index 0000000..c9927ce
--- /dev/null
@@ -0,0 +1,40 @@
+<VirtualHost *:443>
+       ServerAdmin webmaster@localhost
+       SSLEngine on
+       SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
+       SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
+       BrowserMatch "MSIE [2-6]" \
+               nokeepalive ssl-unclean-shutdown \
+               downgrade-1.0 force-response-1.0
+       BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
+
+       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
+
+       DocumentRoot /var/www
+
+       <Directory />
+               AllowOverride None
+       </Directory>
+
+       <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>
+
+       <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>
diff --git a/xenial/debian/openstack-dashboard-apache.config b/xenial/debian/openstack-dashboard-apache.config
new file mode 100644 (file)
index 0000000..76b4bb2
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+db_input high horizon/activate_vhost || true
+db_go || true
+
+db_get horizon/activate_vhost
+if [ "${RET}" = "true" ] ; then
+       db_input high horizon/use_ssl || true
+       db_go || true
+fi
+
+exit 0
index 85f3c897207550c9b7d6e8a9cfe407ab18ae8b18..a8594bb3a55c42daab5765eda98b1a4d463e11e5 100644 (file)
@@ -3,9 +3,19 @@
 set -e
 
 if [ "$1" = "configure" ] ; then
-       if [ -x /etc/init.d/apache2 ]; then
+        . /usr/share/debconf/confmodule
+        db_get horizon/activate_vhost
+        if [ "${RET}" = "true" ] && [ -x /etc/init.d/apache2 ] ; then
                a2dissite default
-               a2ensite openstack-dashboard
+               db_get horizon/use_ssl
+               if [ "${RET}" = "true" ] ; then
+                       a2enmod ssl
+                       a2ensite openstack-dashboard-ssl
+                       a2dissite openstack-dashboard
+               else
+                       a2ensite openstack-dashboard
+                       a2dissite openstack-dashboard-ssl
+               fi
                invoke-rc.d --quiet apache2 reload
        fi
 fi
diff --git a/xenial/debian/openstack-dashboard-apache.templates b/xenial/debian/openstack-dashboard-apache.templates
new file mode 100644 (file)
index 0000000..bdaa2e2
--- /dev/null
@@ -0,0 +1,21 @@
+# These templates have been reviewed by the debian-l10n-english
+# team
+#
+# If modifications/additions/rewording are needed, please ask
+# debian-l10n-english@lists.debian.org for advice.
+#
+# Even minor modifications require translation updates and such
+# changes should be coordinated with translators and reviewers.
+
+Template: horizon/activate_vhost
+Type: boolean
+Default: false
+_Description: Activate Dashboard and disable default VirtualHost?
+ In Debian, Apache comes with a default website and a default page, configured
+ in /etc/apache2/sites-available/default. Should this configuration be disabled
+ and shall the Openstack Dashboard replace it?
+
+Template: horizon/use_ssl
+Type: boolean
+Default: true
+_Description: Should the Dashboard be installed on HTTPS?
diff --git a/xenial/debian/po/POTFILES.in b/xenial/debian/po/POTFILES.in
new file mode 100644 (file)
index 0000000..e2d3c4d
--- /dev/null
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] openstack-dashboard-apache.templates
diff --git a/xenial/debian/po/templates.pot b/xenial/debian/po/templates.pot
new file mode 100644 (file)
index 0000000..72351be
--- /dev/null
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: horizon\n"
+"Report-Msgid-Bugs-To: horizon@packages.debian.org\n"
+"POT-Creation-Date: 2012-11-01 07:34+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../openstack-dashboard-apache.templates:2001
+msgid "Activate Dashboard and disable default VirtualHost?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../openstack-dashboard-apache.templates:2001
+msgid ""
+"In Debian, Apache comes with a default website and a default page, "
+"configured in /etc/apache2/sites-available/default. Should this "
+"configuration be disabled and shall the Openstack Dashboard replace it?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../openstack-dashboard-apache.templates:3001
+msgid "Should the Dashboard be installed on HTTPS?"
+msgstr ""
index f94ee5ba09a0879ea9726d65241665967cc7f71f..32d48152f73c6900a01043b9298a584aba948590 100755 (executable)
@@ -43,6 +43,7 @@ override_dh_auto_install:
        
        # openstack-dashboard-apache
        install -D -m 0644 $(CURDIR)/debian/openstack-dashboard-apache.conf $(CURDIR)/debian/tmp/etc/apache2/sites-available/openstack-dashboard
+       install -D -m 0644 $(CURDIR)/debian/openstack-dashboard-apache-ssl.conf $(CURDIR)/debian/tmp/etc/apache2/sites-available/openstack-dashboard-ssl
 
 override_dh_install:
        dh_install