--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: buster-pu: package openstack-dashboard-apache/3:14.0.2-3
- From: Michal Arbet <michal.arbet@ultimum.io>
- Date: Wed, 27 Nov 2019 15:57:39 +0100
- Message-id: <157486665973.29157.11681292667389757306.reportbug@debian-sid-builder.novalocal>
Package: release.debian.org
Severity: normal
Tags: buster
User: release.debian.org@packages.debian.org
Usertags: pu
Hi,
Openstack-dashboard-apache package is used to configure apache2 to provide
openstack-dashboard (horizon) and also configure openstack-dashboard's webroot.
As upstream moved WEBROOT variable from local_settings.py to defaults.py, it has
to been overriden in /etc/openstack-dashboard/local_settings.d and openstack-dashboard-apache
has to configure this variable and rebuild static files if needed.
This is now achieved by openstack-dashboard-apache which is calling trigger of openstack-dashboard
when needed.
-- System Information:
Debian Release: 9.5
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'oldstable-updates'), (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.9.0-8-amd64 (SMP w/32 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -Nru horizon-14.0.2/debian/changelog horizon-14.0.2/debian/changelog
--- horizon-14.0.2/debian/changelog 2019-03-25 21:44:52.000000000 +0100
+++ horizon-14.0.2/debian/changelog 2019-11-27 15:32:02.000000000 +0100
@@ -1,3 +1,9 @@
+horizon (3:14.0.2-3+deb10u1) buster; urgency=medium
+
+ * Fix change od WEBROOT in horizon
+
+ -- Michal Arbet <michal.arbet@ultimum.io> Wed, 27 Nov 2019 15:32:02 +0100
+
horizon (3:14.0.2-3) unstable; urgency=medium
* openstack-dashboard: Add Breaks against obsolete packages from Stretch:
diff -Nru horizon-14.0.2/debian/local_settings.d/_0005_debian_webroot.py horizon-14.0.2/debian/local_settings.d/_0005_debian_webroot.py
--- horizon-14.0.2/debian/local_settings.d/_0005_debian_webroot.py 1970-01-01 01:00:00.000000000 +0100
+++ horizon-14.0.2/debian/local_settings.d/_0005_debian_webroot.py 2019-11-27 15:31:56.000000000 +0100
@@ -0,0 +1,2 @@
+# To specify path for webroot, set WEBROOT = "/webroot"
+WEBROOT = "/"
diff -Nru horizon-14.0.2/debian/openstack-dashboard-apache.postinst horizon-14.0.2/debian/openstack-dashboard-apache.postinst
--- horizon-14.0.2/debian/openstack-dashboard-apache.postinst 2019-03-25 21:44:52.000000000 +0100
+++ horizon-14.0.2/debian/openstack-dashboard-apache.postinst 2019-11-27 15:31:56.000000000 +0100
@@ -2,6 +2,32 @@
set -e
+OS_WEBROOT_CONF_PATH="/etc/openstack-dashboard/local_settings.d/_0005_debian_webroot.py"
+
+# We need to check if WEBROOT config will be changed
+# If yes, we need to exec compress,collect_static.
+# If no, it isn't needed.
+
+change_webroot (){
+ WEBROOT=$1
+ # If WEBROOT config exist, compare it
+ if [ -e ${OS_WEBROOT_CONF_PATH} ]; then
+
+ CURRENT_WEBROOT=$(cat ${OS_WEBROOT_CONF_PATH} | grep ^WEBROOT | sed -e 's/"*'\''*\ *//g' | awk -F '=' '{print $2}')
+
+ if [ "${CURRENT_WEBROOT}" = "${WEBROOT}" ]; then
+ echo "===> openstack-dashboard-apache: Webroot already set."
+ echo "===> openstack-dashboard-apache: Rebuild static not needed."
+ else
+ sed -i "s|^[ \t]*WEBROOT[ \t]=.*|WEBROOT = \"${WEBROOT}\"|" ${OS_WEBROOT_CONF_PATH}
+ echo "===> openstack-dashboard-apache: Setting Horizon's webroot to ${WEBROOT}"
+ echo "===> openstack-dashboard-apache: Horizon's webroot was changed, rebuild static is needed."
+ dpkg-trigger --no-await rebuild-static
+ fi
+ fi
+
+}
+
dpkg-maintscript-helper dir_to_symlink \
/usr/share/openstack-dashboard/static /var/lib/openstack-dashboard/static 2:9.0.0~rc1-2 openstack-dashboard-apache -- "$@"
@@ -26,9 +52,11 @@
db_get horizon/activate_vhost
if [ "${RET}" = "true" ] && [ -x /etc/init.d/apache2 ] ; then
sed -i 's#[ \t]*HORIZON_ACTIVATE_VHOSTS=.*#HORIZON_ACTIVATE_VHOSTS=yes#' /etc/default/openstack-dashboard-apache
+ # Set webroot to / in openstack-dashboard settings
+ change_webroot "/"
a2dissite 000-default.conf || true
a2dissite default-ssl.conf || true
- sed -i "s|^[ \t]*WEBROOT[ \t]=.*|WEBROOT = '/'|" /etc/openstack-dashboard/local_settings.py
+
db_get horizon/use_ssl
if [ "${RET}" = "true" ] ; then
sed -i 's#[ \t]*HORIZON_USE_SSL=.*#HORIZON_USE_SSL=yes#' /etc/default/openstack-dashboard-apache
@@ -52,44 +80,17 @@
else
ln -fs /var/lib/openstack-dashboard/static /usr/share/openstack-dashboard/static
fi
- # Not needed in openstack-dashboard-apache
- # This is done in openstack-dashboard
- #if [ -f /usr/share/openstack-dashboard/manage.py ]; then
- # /usr/share/openstack-dashboard/manage.py collectstatic --clear --noinput
- # /usr/share/openstack-dashboard/manage.py compress --force
- #fi
- #if [ -f '/var/lib/openstack-dashboard/secret-key/.secret_key_store' ]; then
- # rm -f /var/lib/openstack-dashboard/secret-key/.secret_key_store
- #fi
- #if [ -d /var/lib/openstack-dashboard/secret-key ]; then
- # chown -R www-data /var/lib/openstack-dashboard/secret-key
- #fi
- #if [ -d /var/lib/openstack-dashboard/static ]; then
- # chown -R www-data /var/lib/openstack-dashboard/static
- #fi
invoke-rc.d --quiet apache2 reload || true
else
sed -i 's#[ \t]*HORIZON_ACTIVATE_VHOSTS=.*#HORIZON_ACTIVATE_VHOSTS=no#' /etc/default/openstack-dashboard-apache
+ # Set webroot to /horizon in openstack-dashboard settings
+ change_webroot "/horizon"
a2ensite 000-default.conf || true
a2ensite default-ssl.conf || true
- sed -i "s|^[ \t]*WEBROOT[ \t]=.*|WEBROOT = '/horizon'|" /etc/openstack-dashboard/local_settings.py
a2dissite openstack-dashboard.conf || true
a2dissite openstack-dashboard-ssl-redirect.conf || true
a2dissite openstack-dashboard-ssl.conf || true
a2ensite openstack-dashboard-alias-only.conf || true
- #if [ -f /usr/share/openstack-dashboard/manage.py ]; then
- # /usr/share/openstack-dashboard/manage.py collectstatic --clear --noinput
- # /usr/share/openstack-dashboard/manage.py compress --force
- #fi
- #if [ -f /var/lib/openstack-dashboard/secret-key/.secret_key_store ]; then
- # rm -f /var/lib/openstack-dashboard/secret-key/.secret_key_store
- #fi
- #if [ -d /var/lib/openstack-dashboard/secret-key ]; then
- # chown -R www-data /var/lib/openstack-dashboard/secret-key
- #fi
- #if [ -d /var/lib/openstack-dashboard/static ]; then
- # chown -R www-data /var/lib/openstack-dashboard/static
- #fi
invoke-rc.d --quiet apache2 reload || true
fi
db_stop
diff -Nru horizon-14.0.2/debian/openstack-dashboard.triggers horizon-14.0.2/debian/openstack-dashboard.triggers
--- horizon-14.0.2/debian/openstack-dashboard.triggers 2019-03-25 21:44:52.000000000 +0100
+++ horizon-14.0.2/debian/openstack-dashboard.triggers 2019-11-27 15:31:56.000000000 +0100
@@ -36,3 +36,5 @@
interest-noawait /usr/lib/python3/dist-packages/horizon
interest-noawait /usr/lib/python3/dist-packages/openstack_dashboard
interest-noawait /usr/lib/python3/dist-packages/openstack_auth
+# Named trigger which should be called from openstack-dashboard-apache
+interest-noawait rebuild-static
--- End Message ---
--- Begin Message ---
- To: Thomas Goirand <zigo@debian.org>, 945592-done@bugs.debian.org
- Subject: Re: Bug#945592: New debdiff
- From: "Adam D. Barratt" <adam@adam-barratt.org.uk>
- Date: Mon, 28 Dec 2020 13:29:18 +0000
- Message-id: <a5ed751544c8139805f54b329d54d97b44304de9.camel@adam-barratt.org.uk>
- In-reply-to: <1136b79f-a016-6892-b49d-e5da91d2d244@debian.org>
- References: <157486665973.29157.11681292667389757306.reportbug@debian-sid-builder.novalocal> <1136b79f-a016-6892-b49d-e5da91d2d244@debian.org>
On Tue, 2019-12-31 at 17:35 +0100, Thomas Goirand wrote:
> Hi,
>
> Please find the new debdiff for this change, which is already in
> Sid/Testing. We still need to test this, I hope Kevko will be able to
> the upgrade tests.
Those changes were incorporated into the upload for DSA 4820; closing.
Regards,
Adam
--- End Message ---