From cffcdb00adc3728127127e1015f9ec91855f0d73 Mon Sep 17 00:00:00 2001
From: "Alexander A. Klimov"
Date: Tue, 24 Jan 2023 11:25:41 +0100
Subject: [PATCH 1/2] Tell Icinga Web 2 it's running in our official image
---
Dockerfile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Dockerfile b/Dockerfile
index 02debc7..79f2e6c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -42,4 +42,5 @@ RUN ["ln", "-vs", "/usr/share/icingaweb2/bin/icingacli", "/usr/local/bin/"]
RUN ["icingacli", "setup", "config", "webserver", "apache", "--path=/", "--file=/etc/apache2/conf-enabled/icingaweb2.conf"]
USER www-data
+ENV ICINGAWEB_OFFICIAL_DOCKER_IMAGE 1
CMD ["bash", "-eo", "pipefail", "-c", ". /etc/apache2/envvars; exec apache2 -DFOREGROUND"]
From 73e5c1aa574c5b798d5419a0171afb25a8a98615 Mon Sep 17 00:00:00 2001
From: "Alexander A. Klimov"
Date: Mon, 23 Jan 2023 15:32:28 +0100
Subject: [PATCH 2/2] Remove broken and redundant patch
---
action.Dockerfile | 2 +-
action.bash | 1 -
build.bash | 1 -
icingaweb2.patch | 55 -----------------------------------------------
4 files changed, 1 insertion(+), 58 deletions(-)
delete mode 100644 icingaweb2.patch
diff --git a/action.Dockerfile b/action.Dockerfile
index 50a43e2..3a6b23c 100644
--- a/action.Dockerfile
+++ b/action.Dockerfile
@@ -33,7 +33,7 @@ RUN apt-get update ;\
COPY --from=clone /actions /actions
-COPY action.bash composer.bash Dockerfile get-mods.sh icingaweb2.patch php.ini /
+COPY action.bash composer.bash Dockerfile get-mods.sh php.ini /
COPY entrypoint /entrypoint
CMD ["/action.bash"]
diff --git a/action.bash b/action.bash
index 719ffa2..b96aca4 100755
--- a/action.bash
+++ b/action.bash
@@ -14,7 +14,6 @@ mkimg () {
/get-mods.sh "$MODE"
/composer.bash
- patch -d icingaweb2 -p0 < /icingaweb2.patch
cp -r /entrypoint /php.ini .
docker build -f /Dockerfile -t "${TARGET}:$TAG" .
diff --git a/build.bash b/build.bash
index c61bbfa..1cec99d 100755
--- a/build.bash
+++ b/build.bash
@@ -31,7 +31,6 @@ cd /iw2cp
/bldctx/get-mods.sh "$BUILD_MODE"
/bldctx/composer.bash
-patch -d icingaweb2 -p0 < /bldctx/icingaweb2.patch
cp -r /entrypoint /bldctx/php.ini .
docker build -f /bldctx/Dockerfile -t icinga/icingaweb2 .
diff --git a/icingaweb2.patch b/icingaweb2.patch
deleted file mode 100644
index c061aa5..0000000
--- a/icingaweb2.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-Icinga Web 2 Docker image | (c) 2020 Icinga GmbH | GPLv2+
---- 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