[debian-edu-commits] [Git][debian-edu/debian-edu-config][master] 2 commits: Set up database for icingaweb2

Mike Gabriel (@sunweaver) gitlab at salsa.debian.org
Thu Jun 29 09:17:43 BST 2023



Mike Gabriel pushed to branch master at Debian Edu / debian-edu-config


Commits:
ebbbd1b6 by Guido Berhoerster at 2023-06-26T16:05:01+02:00
Set up database for icingaweb2

Starting with version 2.11 user preferences must be stored in the DB.

- - - - -
4657dfca by Guido Berhoerster at 2023-06-29T09:31:27+02:00
Fix permissions issue preventing icingaweb2 from reading the backend config

The /etc/icingaweb2/modules directory ends up with "drwxrwSrwx" permissions,
missing the "x" bit preventing icingaweb2 from reading the monitoring backend
configuration in /etc/icingaweb2/modules/monitoring/. Instead of adjusting
single files and directories, enforce sensible permissions on all directories
and configuration files. Closes: #1039475.

- - - - -


1 changed file:

- share/debian-edu-config/tools/edu-icinga-setup


Changes:

=====================================
share/debian-edu-config/tools/edu-icinga-setup
=====================================
@@ -69,6 +69,18 @@ setup_icinga() {
 	# Enable ido-mysql feature
 	icinga2 feature enable ido-mysql
 
+	# Create Icinga Web 2 database
+	mysql <<< "
+	CREATE DATABASE icingaweb2;
+	GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE
+	ON icingaweb2.*
+	TO 'icingaweb2'@'localhost'
+	IDENTIFIED BY 'v64nhbe27dfBjR3T';
+	FLUSH PRIVILEGES;
+	"
+	# Install the MySQL schema required for the Icinga Web 2 database
+	mysql icingaweb2 < /usr/share/icingaweb2/schema/mysql.schema.sql
+
 	# Add icinga2 configuration files (content gathered from manual setup procedure)
 	#
 	# authentication.ini
@@ -82,12 +94,13 @@ setup_icinga() {
 	domain = ""
 	resource = "icingaweb_ldap"
 	EOF
+
 	# config.ini
 	cat <<- EOF > /etc/icingaweb2/config.ini
 	[global]
 	show_stacktraces = "1"
 	show_application_state_messages = "1"
-	config_backend = "ini"
+	config_resource = "icingaweb_db"
 
 	[logging]
 	log = "file"
@@ -127,6 +140,17 @@ setup_icinga() {
 	bind_pw = ""
 	timeout = "5"
 
+	[icingaweb_db]
+	type = "db"
+	db = "mysql"
+	host = "localhost"
+	port = ""
+	dbname = "icingaweb2"
+	username = "icingaweb2"
+	password = "v64nhbe27dfBjR3T"
+	charset = ""
+	use_ssl = "0"
+
 	[icinga_ido]
 	type = "db"
 	db = "mysql"
@@ -165,11 +189,8 @@ setup_icinga() {
 	EOF
 
 	# Adjusts rights to get the web interface working
-	chmod 660 /etc/icingaweb2/*.ini
-	chmod g+rwx /etc/icingaweb2/enabledModules/
-	chmod g+rwx /etc/icingaweb2/modules/monitoring/
-	chmod o+x /etc/icingaweb2/modules/monitoring/
-	chmod 660 /etc/icingaweb2/modules/monitoring/*.ini
+	find /etc/icingaweb2/ -type f -name '*.ini' -exec chmod 660 {} +
+	find /etc/icingaweb2/ -type d -exec chmod 775 {} +
 
 	# Create icingaweb2 log directory
 	mkdir -p /var/log/icingaweb2/



View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/compare/05a4ec8b419d1d83242026599d92d9f5b8fec368...4657dfca7d2c966bf07040ac8b9b30060b5b057a

-- 
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/compare/05a4ec8b419d1d83242026599d92d9f5b8fec368...4657dfca7d2c966bf07040ac8b9b30060b5b057a
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-commits/attachments/20230629/fc9e4785/attachment-0001.htm>


More information about the debian-edu-commits mailing list