From c186819ebf98120ba8f07a93045c3dd63d056437 Mon Sep 17 00:00:00 2001
From: "Alexander A. Klimov"
Date: Thu, 25 Jun 2020 16:53:06 +0200
Subject: [PATCH] icingaweb2.patch: tune setup wizard for Docker
---
icingaweb2.patch | 54 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/icingaweb2.patch b/icingaweb2.patch
index dda100f..6992063 100644
--- a/icingaweb2.patch
+++ b/icingaweb2.patch
@@ -1,3 +1,57 @@
+--- application/forms/Config/General/LoggingConfigForm.php
++++ application/forms/Config/General/LoggingConfigForm.php
+@@ -39,8 +39,8 @@ class LoggingConfigForm extends Form
+ 'label' => $this->translate('Logging Type'),
+ 'description' => $this->translate('The type of logging to utilize.'),
+ 'multiOptions' => array(
+- 'syslog' => 'Syslog',
+ 'php' => $this->translate('Webserver Log', 'app.config.logging.type'),
++ 'syslog' => 'Syslog',
+ 'file' => $this->translate('File', 'app.config.logging.type'),
+ 'none' => $this->translate('None', 'app.config.logging.type')
+ )
+@@ -94,7 +94,7 @@ class LoggingConfigForm extends Form
+ )
+ );
+
+- if (! isset($formData['logging_log']) || $formData['logging_log'] === 'syslog') {
++ if (isset($formData['logging_log']) && $formData['logging_log'] === 'syslog') {
+ if (Platform::isWindows()) {
+ /* @see https://secure.php.net/manual/en/function.openlog.php */
+ $this->addElement(
+--- modules/setup/application/views/scripts/form/setup-welcome.phtml
++++ modules/setup/application/views/scripts/form/setup-welcome.phtml
+@@ -79,30 +79,9 @@ if (! (false === ($distro = Platform::getLinuxDistro(1)) || $distro === 'linux')
+ 'To run this wizard a user needs to authenticate using a token which is usually'
+ . ' provided to him by an administrator who\'d followed the instructions below.'
+ ); ?>
+- = $this->translate('In any case, make sure that all of the following applies to your environment:'); ?>
+-
+- - = $this->translate('A system group called "icingaweb2" exists'); ?>
+-
+- - = sprintf($this->translate('The user "%s" is a member of the system group "icingaweb2"'), $phpUser); ?>
+-
+- - = $this->translate('Your webserver\'s user is a member of the system group "icingaweb2"'); ?>
+-
+-
+-
+
+- = $this->escape($groupadd . ';') ?>
+- = $this->escape(sprintf($usermod, $phpUser ?: $webSrvUser) . ';') ?>
+-
+-
+- = $this->translate('If you\'ve got the IcingaCLI installed you can do the following:'); ?>
+-
+- = $cliPath ? $cliPath : 'icingacli'; ?> setup config directory --group icingaweb2= $configDir !== '/etc/icingaweb2' ? ' --config ' . $configDir : ''; ?>;
+ = $cliPath ? $cliPath : 'icingacli'; ?> setup token create;
+
+- = $this->translate('In case the IcingaCLI is missing you can create the token manually:'); ?>
+-
+- su = $phpUser ?: $this->translate(''); ?> -s /bin/sh -c "mkdir -m 2770 = dirname($setupTokenPath); ?>; chgrp icingaweb2 = dirname($setupTokenPath); ?>; head -c 12 /dev/urandom | base64 | tee = $setupTokenPath; ?>; chmod 0660 = $setupTokenPath; ?>;";
+-
+ = sprintf(
+ $this->translate('Please see the %s for an extensive description on how to access and use this wizard.'),
+ '' . $this->translate('Icinga Web 2 documentation') . '' // TODO: Add link to iw2 docs which points to the installation topic
--- packages/files/apache/icingaweb2.conf
+++ packages/files/apache/icingaweb2.conf
@@ -1,4 +1,4 @@