From bf3966c43e4510a1316e1958ccb3d2e75aa95313 Mon Sep 17 00:00:00 2001 From: Thom Date: Sun, 5 May 2024 14:06:13 +0200 Subject: [PATCH 01/13] Add version 24.04 to supported Ubuntu versions --- lib/os/class.ISPConfigBaseOS.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/os/class.ISPConfigBaseOS.inc.php b/lib/os/class.ISPConfigBaseOS.inc.php index b3a4827..facd9a2 100644 --- a/lib/os/class.ISPConfigBaseOS.inc.php +++ b/lib/os/class.ISPConfigBaseOS.inc.php @@ -38,7 +38,7 @@ class ISPConfigBaseOS { throw new ISPConfigOSException('Version ' . $os['VERSION_ID'] . ' is not supported for ' . $os['ID']); } } elseif($os['ID'] === 'ubuntu') { - if(!in_array($os['VERSION_ID'], array('18.04', '20.04', '22.04'))) { + if(!in_array($os['VERSION_ID'], array('18.04', '20.04', '22.04', '24.04'))) { throw new ISPConfigOSException('Version ' . $os['VERSION_ID'] . ' is not supported for ' . $os['ID']); } } else { -- GitLab From 55e9c1baa73587d0615326494076a8ec56299be8 Mon Sep 17 00:00:00 2001 From: Thom Date: Sun, 5 May 2024 14:07:05 +0200 Subject: [PATCH 02/13] Improve incompatible Mailman versions message --- lib/os/class.ISPConfigUbuntu2204OS.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/os/class.ISPConfigUbuntu2204OS.inc.php b/lib/os/class.ISPConfigUbuntu2204OS.inc.php index cb292bc..d3c0c50 100644 --- a/lib/os/class.ISPConfigUbuntu2204OS.inc.php +++ b/lib/os/class.ISPConfigUbuntu2204OS.inc.php @@ -76,7 +76,7 @@ deb http://security.ubuntu.com/ubuntu jammy-security multiverse } protected function installMailman($host_name) { - ISPConfigLog::info('ISPConfig does not yet support mailman3 and mailman2 is no longer available in Ubuntu 22.04.', true); + ISPConfigLog::info('ISPConfig does not yet support mailman3 and mailman2 is no longer available since Ubuntu 22.04.', true); return; } -- GitLab From e45876101823a388d4a0c42409b7e48b14780a7d Mon Sep 17 00:00:00 2001 From: Thom Date: Sun, 5 May 2024 14:07:23 +0200 Subject: [PATCH 03/13] Remove unneeded setDefaultPHP function --- lib/os/class.ISPConfigUbuntu2204OS.inc.php | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/lib/os/class.ISPConfigUbuntu2204OS.inc.php b/lib/os/class.ISPConfigUbuntu2204OS.inc.php index d3c0c50..5f2abe9 100644 --- a/lib/os/class.ISPConfigUbuntu2204OS.inc.php +++ b/lib/os/class.ISPConfigUbuntu2204OS.inc.php @@ -39,28 +39,6 @@ deb http://security.ubuntu.com/ubuntu jammy-security multiverse return $packages; } - protected function setDefaultPHP() { - ISPConfigLog::info('Setting default system PHP version.', true); - $cmd = 'update-alternatives --set php /usr/bin/php8.1'; - $result = $this->exec($cmd); - if($result === false) { - throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); - } - - if(ISPConfig::shallInstall('web')) { - // When --use-php-system is used, there is no alternative for php-fpm.sock. - if(ISPConfig::wantsPHP() === 'system') { - $cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi8.1'; - } else { - $cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi8.1 ; update-alternatives --set php-fpm.sock /run/php/php8.1-fpm.sock'; - } - $result = $this->exec($cmd); - if($result === false) { - throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); - } - } - } - protected function getMySQLUserQueries($mysql_root_pw) { $escaped_pw = preg_replace('/[\'\\\\]/', '\\$1', $mysql_root_pw); $queries = array( -- GitLab From 01b8825975ab4824342326180fa8a21ac84e1e6d Mon Sep 17 00:00:00 2001 From: Thom Date: Sun, 5 May 2024 14:07:50 +0200 Subject: [PATCH 04/13] Add Ubuntu 24.04 class --- lib/os/class.ISPConfigUbuntu2404OS.inc.php | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lib/os/class.ISPConfigUbuntu2404OS.inc.php diff --git a/lib/os/class.ISPConfigUbuntu2404OS.inc.php b/lib/os/class.ISPConfigUbuntu2404OS.inc.php new file mode 100644 index 0000000..256d5e4 --- /dev/null +++ b/lib/os/class.ISPConfigUbuntu2404OS.inc.php @@ -0,0 +1,32 @@ + Date: Sun, 5 May 2024 21:50:03 +0200 Subject: [PATCH 05/13] Update supported distributions list --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7bb7e4b..03fa406 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,13 @@ ![alt text](https://www.ispconfig.org/wp-content/themes/ispconfig/images/ispconfig_logo.png "") \ [![pipeline status](https://git.ispconfig.org/ispconfig/ispconfig-autoinstaller/badges/master/pipeline.svg)](https://git.ispconfig.org/ispconfig/ispconfig-autoinstaller/commits/master) -This script configures your server (Ubuntu 18.04, Ubuntu 20.04, Debian 9, 10 and 11 currently) following the "perfect server tutorials" from howtoforge.com and installs ISPConfig 3.2. It currently supports the x86_64 (also known as AMD64) CPU architecture only while ARM is not supported. +This script configures your server following the "perfect server tutorials" from howtoforge.com and installs ISPConfig 3.2. It currently supports the x86_64 (also known as AMD64) CPU architecture only while ARM is not supported. + +## Supported distributions +- Ubuntu 18.04, 20.04, 22.04 and 24.04. +- Debian 9, 10, 11 and 12. + +A list of all supported distributions by ISPConfig itself can be found at https://www.ispconfig.org/. ## Using the script You can use the script with curl -- GitLab From f41db9203ea3b4852d75e85e7865932e78c93292 Mon Sep 17 00:00:00 2001 From: Thom Date: Fri, 24 May 2024 15:55:48 +0200 Subject: [PATCH 06/13] Remove support for EOL Ubuntu and Debian versions Remove support for Ubuntu 18.04 and 20.04 and Debian 9 and 10. Show a message that these versions are not supported anymore. --- lib/os/class.ISPConfigBaseOS.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/os/class.ISPConfigBaseOS.inc.php b/lib/os/class.ISPConfigBaseOS.inc.php index facd9a2..c66eb5f 100644 --- a/lib/os/class.ISPConfigBaseOS.inc.php +++ b/lib/os/class.ISPConfigBaseOS.inc.php @@ -34,11 +34,17 @@ class ISPConfigBaseOS { throw new ISPConfigOSException('Could not detect version of distribution ' . $os['ID']); } if($os['ID'] === 'debian') { - if(!in_array($os['VERSION_ID'], array('9', '10', '11', '12'))) { + if(in_array($os['VERSION_ID'], array('9', '10'))) { + throw new ISPConfigOSException('Version ' . $os['VERSION_ID'] . ' is not supported anymore for ' . $os['ID']); + } + if(!in_array($os['VERSION_ID'], array('11', '12'))) { throw new ISPConfigOSException('Version ' . $os['VERSION_ID'] . ' is not supported for ' . $os['ID']); } } elseif($os['ID'] === 'ubuntu') { - if(!in_array($os['VERSION_ID'], array('18.04', '20.04', '22.04', '24.04'))) { + if(in_array($os['VERSION_ID'], array('18.04', '20.04'))) { + throw new ISPConfigOSException('Version ' . $os['VERSION_ID'] . ' is not supported anymore for ' . $os['ID']); + } + if(!in_array($os['VERSION_ID'], array('22.04', '24.04'))) { throw new ISPConfigOSException('Version ' . $os['VERSION_ID'] . ' is not supported for ' . $os['ID']); } } else { -- GitLab From e61a3b2f0dfbd738a619165929ea60dad1bb2422 Mon Sep 17 00:00:00 2001 From: Till Date: Sun, 26 May 2024 17:59:08 +0200 Subject: [PATCH 07/13] Do not activate Rspamd Repository for Ubuntu 24.04 as its not available yet. --- README.md | 4 ++-- lib/os/class.ISPConfigDebianOS.inc.php | 16 ++++++++++------ lib/os/class.ISPConfigUbuntu2404OS.inc.php | 4 ++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 03fa406..2b78b01 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ This script configures your server following the "perfect server tutorials" from howtoforge.com and installs ISPConfig 3.2. It currently supports the x86_64 (also known as AMD64) CPU architecture only while ARM is not supported. ## Supported distributions -- Ubuntu 18.04, 20.04, 22.04 and 24.04. -- Debian 9, 10, 11 and 12. +- Ubuntu 20.04, 22.04 and 24.04. +- Debian 11 and 12. A list of all supported distributions by ISPConfig itself can be found at https://www.ispconfig.org/. diff --git a/lib/os/class.ISPConfigDebianOS.inc.php b/lib/os/class.ISPConfigDebianOS.inc.php index d35f371..895392c 100644 --- a/lib/os/class.ISPConfigDebianOS.inc.php +++ b/lib/os/class.ISPConfigDebianOS.inc.php @@ -493,6 +493,15 @@ Alias /phpmyadmin /usr/share/phpmyadmin } } + protected function addRspamdRepo() { + ISPConfigLog::info('Activating rspamd repository.', true); + $cmd = 'mkdir -p /etc/apt/keyrings ; wget -q -O- https://rspamd.com/apt-stable/gpg.key | gpg --dearmor | tee /etc/apt/keyrings/rspamd.gpg > /dev/null ; echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rspamd.gpg] http://rspamd.com/apt-stable/ $(lsb_release -c -s) main" | tee /etc/apt/sources.list.d/rspamd.list ; echo "deb-src [arch=amd64 signed-by=/etc/apt/keyrings/rspamd.gpg] http://rspamd.com/apt-stable/ $(lsb_release -c -s) main" | tee -a /etc/apt/sources.list.d/rspamd.list'; + $result = $this->exec($cmd); + if($result === false) { + throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); + } + } + protected function installMonit() { ISPConfigLog::info('Installing Monit', true); @@ -1405,12 +1414,7 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"'; $this->installPackages($packages); if(ISPConfig::shallInstall('mail') && !ISPConfig::wantsAmavis()) { - ISPConfigLog::info('Activating rspamd repository.', true); - $cmd = 'mkdir -p /etc/apt/keyrings ; wget -q -O- https://rspamd.com/apt-stable/gpg.key | gpg --dearmor | tee /etc/apt/keyrings/rspamd.gpg > /dev/null ; echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rspamd.gpg] http://rspamd.com/apt-stable/ $(lsb_release -c -s) main" | tee /etc/apt/sources.list.d/rspamd.list ; echo "deb-src [arch=amd64 signed-by=/etc/apt/keyrings/rspamd.gpg] http://rspamd.com/apt-stable/ $(lsb_release -c -s) main" | tee -a /etc/apt/sources.list.d/rspamd.list'; - $result = $this->exec($cmd); - if($result === false) { - throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); - } + $this->addRspamdRepo(); } if(ISPConfig::wantsPHP() !== 'system') { diff --git a/lib/os/class.ISPConfigUbuntu2404OS.inc.php b/lib/os/class.ISPConfigUbuntu2404OS.inc.php index 256d5e4..117871e 100644 --- a/lib/os/class.ISPConfigUbuntu2404OS.inc.php +++ b/lib/os/class.ISPConfigUbuntu2404OS.inc.php @@ -29,4 +29,8 @@ deb http://security.ubuntu.com/ubuntu noble-security multiverse return '8.3'; } + protected function addRspamdRepo() { + ISPConfigLog::info('Not Activating rspamd repository in Ubuntu 24.04.', true); + } + } -- GitLab From dbe3e4b5803a84d6df4fd98cd1f0e81695a9e626 Mon Sep 17 00:00:00 2001 From: Till Date: Sun, 26 May 2024 18:01:19 +0200 Subject: [PATCH 08/13] Updated Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b78b01..a8681a6 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This script configures your server following the "perfect server tutorials" from howtoforge.com and installs ISPConfig 3.2. It currently supports the x86_64 (also known as AMD64) CPU architecture only while ARM is not supported. ## Supported distributions -- Ubuntu 20.04, 22.04 and 24.04. +- Ubuntu 22.04 and 24.04. - Debian 11 and 12. A list of all supported distributions by ISPConfig itself can be found at https://www.ispconfig.org/. -- GitLab From 3253c81cd1e3c4647c5145e83f5b28495913fc91 Mon Sep 17 00:00:00 2001 From: Till Date: Sun, 26 May 2024 18:25:06 +0200 Subject: [PATCH 09/13] Changed Ubuntu 24.04 repo config and resolve check. --- lib/os/class.ISPConfigDebianOS.inc.php | 2 +- lib/os/class.ISPConfigUbuntu2404OS.inc.php | 25 +++++++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/os/class.ISPConfigDebianOS.inc.php b/lib/os/class.ISPConfigDebianOS.inc.php index 895392c..d289fac 100644 --- a/lib/os/class.ISPConfigDebianOS.inc.php +++ b/lib/os/class.ISPConfigDebianOS.inc.php @@ -1708,7 +1708,7 @@ SCRIPTWHITELIST=/usr/bin/lwp-request'; $result = $this->exec($cmd); if($result === false) { throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); - } elseif(strpos($result, '127.0.0.1') === false) { + } elseif(strpos($result, '127.0.0.1') === false && strpos($result, '127.0.0.53') === false) { ISPConfigLog::warn('Unexpected resolver response: ' . $result, true); } } else { diff --git a/lib/os/class.ISPConfigUbuntu2404OS.inc.php b/lib/os/class.ISPConfigUbuntu2404OS.inc.php index 117871e..5a671c4 100644 --- a/lib/os/class.ISPConfigUbuntu2404OS.inc.php +++ b/lib/os/class.ISPConfigUbuntu2404OS.inc.php @@ -10,19 +10,20 @@ class ISPConfigUbuntu2404OS extends ISPConfigUbuntu2204OS { // enable contrib and non-free ISPConfigLog::info('Configuring apt repositories.', true); - $contents = '# created by ISPConfig auto installer -deb http://archive.ubuntu.com/ubuntu/ noble main restricted -deb http://archive.ubuntu.com/ubuntu/ noble-updates main restricted -deb http://archive.ubuntu.com/ubuntu/ noble universe -deb http://archive.ubuntu.com/ubuntu/ noble-updates universe -deb http://archive.ubuntu.com/ubuntu/ noble multiverse -deb http://archive.ubuntu.com/ubuntu/ noble-updates multiverse -deb http://archive.ubuntu.com/ubuntu/ noble-backports main restricted universe multiverse -deb http://security.ubuntu.com/ubuntu noble-security main restricted -deb http://security.ubuntu.com/ubuntu noble-security universe -deb http://security.ubuntu.com/ubuntu noble-security multiverse + $contents = '# updated by ISPConfig auto installer + Types: deb + URIs: http://archive.ubuntu.com/ubuntu/ + Suites: noble noble-updates noble-backports + Components: main restricted universe multiverse + Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg + + Types: deb + URIs: http://security.ubuntu.com/ubuntu/ + Suites: noble-security + Components: main restricted universe multiverse + Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg '; - file_put_contents('/etc/apt/sources.list', $contents); + file_put_contents('/etc/apt/sources.list.d/ubuntu.sources', $contents); } protected function getSystemPHPVersion() { -- GitLab From a372fd2ace32e3795f6eb76aa7940bfe12639a45 Mon Sep 17 00:00:00 2001 From: Till Date: Sun, 26 May 2024 18:36:39 +0200 Subject: [PATCH 10/13] Install dialog program and fixed whitespace in file. --- ispc3-ai.sh | 2 +- lib/os/class.ISPConfigUbuntu2404OS.inc.php | 24 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ispc3-ai.sh b/ispc3-ai.sh index aa240ec..092fe14 100755 --- a/ispc3-ai.sh +++ b/ispc3-ai.sh @@ -34,7 +34,7 @@ fi if [ "$PHP" = "" ] ; then echo "PHP cli missing, trying to install." ; - apt-get update -qq && apt-get -y -qq install php-cli && apt-get -y -qq install php-mbstring ; + apt-get update -qq && apt-get -y -qq install dialog && apt-get -y -qq install php-cli && apt-get -y -qq install php-mbstring ; PHP=$(which php) ; fi if [ "$PHP" = "" ] ; then diff --git a/lib/os/class.ISPConfigUbuntu2404OS.inc.php b/lib/os/class.ISPConfigUbuntu2404OS.inc.php index 5a671c4..5ba7f2f 100644 --- a/lib/os/class.ISPConfigUbuntu2404OS.inc.php +++ b/lib/os/class.ISPConfigUbuntu2404OS.inc.php @@ -11,18 +11,18 @@ class ISPConfigUbuntu2404OS extends ISPConfigUbuntu2204OS { ISPConfigLog::info('Configuring apt repositories.', true); $contents = '# updated by ISPConfig auto installer - Types: deb - URIs: http://archive.ubuntu.com/ubuntu/ - Suites: noble noble-updates noble-backports - Components: main restricted universe multiverse - Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg - - Types: deb - URIs: http://security.ubuntu.com/ubuntu/ - Suites: noble-security - Components: main restricted universe multiverse - Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg - '; +Types: deb +URIs: http://archive.ubuntu.com/ubuntu/ +Suites: noble noble-updates noble-backports +Components: main restricted universe multiverse +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg + +Types: deb +URIs: http://security.ubuntu.com/ubuntu/ +Suites: noble-security +Components: main restricted universe multiverse +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg +'; file_put_contents('/etc/apt/sources.list.d/ubuntu.sources', $contents); } -- GitLab From 73f619877342411c9aab5f2833f13d8f8ebc5fb9 Mon Sep 17 00:00:00 2001 From: Till Brehm Date: Mon, 27 May 2024 09:09:01 +0000 Subject: [PATCH 11/13] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Thom --- lib/os/class.ISPConfigUbuntu2404OS.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/os/class.ISPConfigUbuntu2404OS.inc.php b/lib/os/class.ISPConfigUbuntu2404OS.inc.php index 5ba7f2f..8e26472 100644 --- a/lib/os/class.ISPConfigUbuntu2404OS.inc.php +++ b/lib/os/class.ISPConfigUbuntu2404OS.inc.php @@ -31,7 +31,7 @@ Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg } protected function addRspamdRepo() { - ISPConfigLog::info('Not Activating rspamd repository in Ubuntu 24.04.', true); + ISPConfigLog::info('Not activating Rspamd repository as it's not available for Ubuntu 24.04.', true); } } -- GitLab From 7c801dc64cfc4e9860145762242541eb8bcb1233 Mon Sep 17 00:00:00 2001 From: Till Date: Thu, 30 May 2024 12:51:13 +0200 Subject: [PATCH 12/13] Fixed typo in comment --- lib/os/class.ISPConfigUbuntu2404OS.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/os/class.ISPConfigUbuntu2404OS.inc.php b/lib/os/class.ISPConfigUbuntu2404OS.inc.php index 8e26472..70b71e5 100644 --- a/lib/os/class.ISPConfigUbuntu2404OS.inc.php +++ b/lib/os/class.ISPConfigUbuntu2404OS.inc.php @@ -31,7 +31,7 @@ Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg } protected function addRspamdRepo() { - ISPConfigLog::info('Not activating Rspamd repository as it's not available for Ubuntu 24.04.', true); + ISPConfigLog::info("Not activating Rspamd repository as it's not available for Ubuntu 24.04.", true); } } -- GitLab From 164acd319d304d2fbd1ff28afc46e43bb7e5a517 Mon Sep 17 00:00:00 2001 From: Till Date: Thu, 30 May 2024 13:33:21 +0200 Subject: [PATCH 13/13] Adjust RoundCube smtp port --- lib/os/class.ISPConfigUbuntu2404OS.inc.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/os/class.ISPConfigUbuntu2404OS.inc.php b/lib/os/class.ISPConfigUbuntu2404OS.inc.php index 70b71e5..c99816f 100644 --- a/lib/os/class.ISPConfigUbuntu2404OS.inc.php +++ b/lib/os/class.ISPConfigUbuntu2404OS.inc.php @@ -26,6 +26,16 @@ Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg file_put_contents('/etc/apt/sources.list.d/ubuntu.sources', $contents); } + protected function getPackagesToInstall($section) { + $packages = parent::getPackagesToInstall($section); + + if($section === 'first') { + $packages[] = 'rsyslog'; + } + + return $packages; + } + protected function getSystemPHPVersion() { return '8.3'; } @@ -34,4 +44,9 @@ Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg ISPConfigLog::info("Not activating Rspamd repository as it's not available for Ubuntu 24.04.", true); } + protected function installRoundcube($mysql_root_pw) { + parent::installRoundcube($mysql_root_pw); + $this->replaceLine('/etc/roundcube/config.inc.php', "\$config['smtp_host']", "\$config['smtp_host'] = 'localhost:25';"); + } + } -- GitLab