[Pkg-nagios-changes] [pkg-icinga2] 02/02: Move icinga2-classicui to its own configuration directory.
Alexander Wirt
formorer at debian.org
Thu Nov 20 20:45:33 UTC 2014
This is an automated email from the git hooks/post-receive script.
formorer pushed a commit to branch master
in repository pkg-icinga2.
commit 27bc54b82469c22fa7b2fb33d8e55f6c39ced048
Author: Alexander Wirt <formorer at debian.org>
Date: Thu Nov 20 21:44:36 2014 +0100
Move icinga2-classicui to its own configuration directory.
/etc/icinga2 may contain sensitive information like passwords or
the salt hash for the ticket generator. Therefore we decided to
remove read permissions for non-nagios users. That means that the
classic-ui can't read its configuration files anymore.
We moved those files into its own directory /etc/icinga2-classicui.
So if you are looking for classicui related configurations, this is
the place too look
---
debian/icinga2-classicui.NEWS | 7 +++++++
debian/icinga2-classicui.dirs | 1 +
debian/icinga2-classicui.install | 4 ++--
debian/icinga2-classicui.links | 4 ++--
debian/icinga2-classicui.postinst | 24 ++++++++++++++++++++++--
debian/icinga2-classicui.postrm | 8 +++++++-
debian/icinga2-classicui.preinst | 38 ++++++++++++++++++++++++++++++++++++++
7 files changed, 79 insertions(+), 7 deletions(-)
diff --git a/debian/icinga2-classicui.NEWS b/debian/icinga2-classicui.NEWS
new file mode 100644
index 0000000..1a40b55
--- /dev/null
+++ b/debian/icinga2-classicui.NEWS
@@ -0,0 +1,7 @@
+icinga2 (2.2.0-1) unstable; urgency=medium
+
+ To protect sensitive configuration files of icinga2
+ the configuration files for classicui were moved to
+ /etc/icinga2-classicui.
+
+ -- Alexander Wirt <formorer at debian.org> Thu, 20 Nov 2014 21:41:55 +0100
diff --git a/debian/icinga2-classicui.dirs b/debian/icinga2-classicui.dirs
index 557d253..4936234 100644
--- a/debian/icinga2-classicui.dirs
+++ b/debian/icinga2-classicui.dirs
@@ -1 +1,2 @@
usr/share/icinga2/classicui
+etc/icinga2-classicui
diff --git a/debian/icinga2-classicui.install b/debian/icinga2-classicui.install
index 06fde5e..b2f8ee4 100644
--- a/debian/icinga2-classicui.install
+++ b/debian/icinga2-classicui.install
@@ -1,4 +1,4 @@
debian/classicui/*.html usr/share/icinga2/classicui
debian/classicui/*.js usr/share/icinga2/classicui
-debian/classicui/apache2.conf etc/icinga2/classicui
-debian/classicui/cgi.cfg etc/icinga2/classicui
+debian/classicui/apache2.conf etc/icinga2-classicui
+debian/classicui/cgi.cfg etc/icinga2-classicui
diff --git a/debian/icinga2-classicui.links b/debian/icinga2-classicui.links
index d211d0b..17d32c6 100644
--- a/debian/icinga2-classicui.links
+++ b/debian/icinga2-classicui.links
@@ -1,5 +1,5 @@
-etc/icinga/stylesheets etc/icinga2/classicui/stylesheets
-etc/icinga2/classicui/apache2.conf etc/apache2/conf-available/icinga2-classicui.conf
+etc/icinga/stylesheets etc/icinga2-classicui/stylesheets
+etc/icinga2-classicui/apache2.conf etc/apache2/conf-available/icinga2-classicui.conf
usr/lib/cgi-bin/icinga usr/lib/cgi-bin/icinga2-classicui
#usr/share/icinga/htdocs/docs usr/share/icinga2/classicui/docs
usr/share/icinga/htdocs/images usr/share/icinga2/classicui/images
diff --git a/debian/icinga2-classicui.postinst b/debian/icinga2-classicui.postinst
index e01f1dc..de7c2b0 100644
--- a/debian/icinga2-classicui.postinst
+++ b/debian/icinga2-classicui.postinst
@@ -6,7 +6,7 @@ set -e
. /usr/share/debconf/confmodule
# shorthand
-en="/etc/icinga2/classicui"
+en="/etc/icinga2-classicui"
# location of the default apache configuration for icinga
apacheconf=$en/apache2.conf
@@ -49,6 +49,21 @@ case "$1" in
configure)
enable_features_for_classic $@
+ dpkg-maintscript-helper mv_conffile \
+ /etc/icinga2/classicui/apache2.conf \
+ /etc/icinga2-classicui/apache2.conf 2.2.0-1~ icinga2-classicui -- "$@"
+
+ dpkg-maintscript-helper mv_conffile /etc/icinga2/classicui/cgi.cfg \
+ /etc/icinga2-classicui/cgi.cfg 2.2.0-1~ icinga2-classicui -- "$@"
+
+ if [ -f '/etc/icinga2/classicui/htpasswd.users' ] && [ ! -f '/etc/icinga2-classicui/htpasswd.users' ];
+ then
+ echo "Move classicui password file to new location"
+ mv -f /etc/icinga2/classicui/htpasswd.users \
+ /etc/icinga2-classicui/htpasswd.users
+ rmdir /etc/icinga2/classicui || true
+ fi
+
echo "enabling Apache2 config..."
COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)
@@ -63,12 +78,15 @@ case "$1" in
elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
a2enmod cgi
# create symlink if not existing
- [ -f /etc/apache2/conf.d/icinga2-classicui.conf ] || ln -vs ../../icinga2/classicui/apache2.conf /etc/apache2/conf.d/icinga2-classicui.conf
+ [ -f /etc/apache2/conf.d/icinga2-classicui.conf ] || ln -vs $en/apache2.conf /etc/apache2/conf.d/icinga2-classicui.conf
# reload webserver
[ -x $(which invoke-rc.d) ] && invoke-rc.d apache2 reload
fi
+ # check for an old symlink to the stylesheets
+ test -L /etc/icinga2/classicui/stylesheets && rm \
+ /etc/icinga2/classicui/stylesheets && rmdir /etc/icinga2/classicui || true
###
# Admin password
###
@@ -84,8 +102,10 @@ case "$1" in
if [ -n "$admpass" ]; then
#unfortunatly that method only works with 2.4
if htpasswd 2>&1 | grep -q ' -i'; then
+ echo "$admpass to $htpw"
echo "$admpass" | htpasswd -i "$htpw" icingaadmin
else
+ echo "$admpass to $htpw"
htpasswd -b "$htpw" icingaadmin "$admpass"
fi
fi
diff --git a/debian/icinga2-classicui.postrm b/debian/icinga2-classicui.postrm
index b3a2558..84ad27a 100644
--- a/debian/icinga2-classicui.postrm
+++ b/debian/icinga2-classicui.postrm
@@ -4,7 +4,7 @@
set -e
# shorthand
-en="/etc/icinga2/classicui"
+en="/etc/icinga2-classicui"
. /usr/share/debconf/confmodule
@@ -31,6 +31,12 @@ case "$1" in
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
disable_apache2 "$@"
+ dpkg-maintscript-helper mv_conffile \
+ /etc/icinga2/classicui/apache2.conf \
+ /etc/icinga2-classicui/apache2.conf 2.2.0-1~ icinga2-classicui -- "$@"
+
+ dpkg-maintscript-helper mv_conffile /etc/icinga2/classicui/cgi.cfg \
+ /etc/icinga2-classicui/cgi.cfg 2.2.0-1~ icinga2-classicui -- "$@"
;;
diff --git a/debian/icinga2-classicui.preinst b/debian/icinga2-classicui.preinst
new file mode 100644
index 0000000..41ddeb6
--- /dev/null
+++ b/debian/icinga2-classicui.preinst
@@ -0,0 +1,38 @@
+#!/bin/sh
+set -e
+### see: dh_installdeb(1)
+### http://www.debian.org/doc/manuals/maint-guide/dother.en.html#maintscripts
+### summary of how this script can be called:
+### * <new-preinst> `install'
+### * <new-preinst> `install' <old-version>
+### * <new-preinst> `upgrade' <old-version>
+### * <old-preinst> `abort-upgrade' <new-version>
+### for details, see http://www.debian.org/doc/debian-policy/ or
+### the debian-policy package
+
+case "$1" in
+ install|upgrade)
+ dpkg-maintscript-helper mv_conffile \
+ /etc/icinga2/classicui/apache2.conf \
+ /etc/icinga2-classicui/apache2.conf 2.2.0-1~ icinga2-classicui -- "$@"
+
+ dpkg-maintscript-helper mv_conffile /etc/icinga2/classicui/cgi.cfg \
+ /etc/icinga2-classicui/cgi.cfg 2.2.0-1~ icinga2-classicui -- "$@"
+
+ ;;
+
+ abort-upgrade)
+ ;;
+
+ *)
+ echo "preinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+### dh_installdeb will replace this with shell code automatically
+### generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-icinga2.git
More information about the Pkg-nagios-changes
mailing list