Skip to content

Commit 9be955c

Browse files
author
Marius Burkard
committed
Merge branch 'stable-3.1' into 'http2-always'
# Conflicts: # install/sql/incremental/upd_dev_collection.sql
2 parents f31b004 + 60f8368 commit 9be955c

File tree

108 files changed

+741
-476
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+741
-476
lines changed
Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2020, Till Brehm, ISPConfig UG
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
//*** Ubuntu 18.04 default settings
32+
33+
//* Main
34+
$conf['language'] = 'en';
35+
$conf['distname'] = 'ubuntu2004';
36+
$conf['hostname'] = 'server1.domain.tld'; // Full hostname
37+
$conf['ispconfig_install_dir'] = '/usr/local/ispconfig';
38+
$conf['ispconfig_config_dir'] = '/usr/local/ispconfig';
39+
$conf['ispconfig_log_priority'] = 2; // 0 = Debug, 1 = Warning, 2 = Error
40+
$conf['ispconfig_log_dir'] = '/var/log/ispconfig';
41+
$conf['server_id'] = 1;
42+
$conf['init_scripts'] = '/etc/init.d';
43+
$conf['runlevel'] = '/etc';
44+
$conf['shells'] = '/etc/shells';
45+
$conf['pam'] = '/etc/pam.d';
46+
47+
//* Services provided by this server, this selection will be overridden by the expert mode
48+
$conf['services']['mail'] = true;
49+
$conf['services']['web'] = true;
50+
$conf['services']['dns'] = true;
51+
$conf['services']['file'] = true;
52+
$conf['services']['db'] = true;
53+
$conf['services']['vserver'] = true;
54+
$conf['services']['proxy'] = false;
55+
$conf['services']['firewall'] = false;
56+
57+
//* MySQL
58+
$conf['mysql']['installed'] = false; // will be detected automatically during installation
59+
$conf['mysql']['init_script'] = 'mysql';
60+
$conf['mysql']['host'] = 'localhost';
61+
$conf['mysql']['ip'] = '127.0.0.1';
62+
$conf['mysql']['port'] = '3306';
63+
$conf['mysql']['database'] = 'dbispconfig';
64+
$conf['mysql']['admin_user'] = 'root';
65+
$conf['mysql']['admin_password'] = '';
66+
$conf['mysql']['charset'] = 'utf8';
67+
$conf['mysql']['ispconfig_user'] = 'ispconfig';
68+
$conf['mysql']['ispconfig_password'] = md5(uniqid(rand()));
69+
$conf['mysql']['master_slave_setup'] = 'n';
70+
$conf['mysql']['master_host'] = '';
71+
$conf['mysql']['master_database'] = 'dbispconfig';
72+
$conf['mysql']['master_admin_user'] = 'root';
73+
$conf['mysql']['master_admin_password'] = '';
74+
$conf['mysql']['master_ispconfig_user'] = '';
75+
$conf['mysql']['master_ispconfig_password'] = md5(uniqid(rand()));
76+
77+
//* Apache
78+
$conf['apache']['installed'] = false; // will be detected automatically during installation
79+
$conf['apache']['user'] = 'www-data';
80+
$conf['apache']['group'] = 'www-data';
81+
$conf['apache']['init_script'] = 'apache2';
82+
$conf['apache']['version'] = '2.4';
83+
$conf['apache']['vhost_conf_dir'] = '/etc/apache2/sites-available';
84+
$conf['apache']['vhost_conf_enabled_dir'] = '/etc/apache2/sites-enabled';
85+
$conf['apache']['vhost_port'] = '8080';
86+
$conf['apache']['php_ini_path_apache'] = '/etc/php/7.4/apache2/php.ini';
87+
$conf['apache']['php_ini_path_cgi'] = '/etc/php/7.4/cgi/php.ini';
88+
89+
//* Website base settings
90+
$conf['web']['website_basedir'] = '/var/www';
91+
$conf['web']['website_path'] = '/var/www/clients/client[client_id]/web[website_id]';
92+
$conf['web']['website_symlinks'] = '/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/';
93+
94+
//* Apps base settings
95+
$conf['web']['apps_vhost_ip'] = '_default_';
96+
$conf['web']['apps_vhost_port'] = '8081';
97+
$conf['web']['apps_vhost_servername'] = '';
98+
$conf['web']['apps_vhost_user'] = 'ispapps';
99+
$conf['web']['apps_vhost_group'] = 'ispapps';
100+
101+
//* Fastcgi
102+
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/php/7.4/cgi/';
103+
$conf['fastcgi']['fastcgi_starter_path'] = '/var/www/php-fcgi-scripts/[system_user]/';
104+
$conf['fastcgi']['fastcgi_bin'] = '/usr/bin/php-cgi';
105+
106+
//* Postfix
107+
$conf['postfix']['installed'] = false; // will be detected automatically during installation
108+
$conf['postfix']['config_dir'] = '/etc/postfix';
109+
$conf['postfix']['init_script'] = 'postfix';
110+
$conf['postfix']['user'] = 'postfix';
111+
$conf['postfix']['group'] = 'postfix';
112+
$conf['postfix']['vmail_userid'] = '5000';
113+
$conf['postfix']['vmail_username'] = 'vmail';
114+
$conf['postfix']['vmail_groupid'] = '5000';
115+
$conf['postfix']['vmail_groupname'] = 'vmail';
116+
$conf['postfix']['vmail_mailbox_base'] = '/var/vmail';
117+
118+
//* Mailman
119+
$conf['mailman']['installed'] = false; // will be detected automatically during installation
120+
$conf['mailman']['config_dir'] = '/etc/mailman';
121+
$conf['mailman']['init_script'] = 'mailman';
122+
123+
//* Getmail
124+
$conf['getmail']['installed'] = false; // will be detected automatically during installation
125+
$conf['getmail']['config_dir'] = '/etc/getmail';
126+
$conf['getmail']['program'] = '/usr/bin/getmail';
127+
128+
//* Courier
129+
$conf['courier']['installed'] = false; // will be detected automatically during installation
130+
$conf['courier']['config_dir'] = '/etc/courier';
131+
$conf['courier']['courier-authdaemon'] = 'courier-authdaemon';
132+
$conf['courier']['courier-imap'] = 'courier-imap';
133+
$conf['courier']['courier-imap-ssl'] = 'courier-imap-ssl';
134+
$conf['courier']['courier-pop'] = 'courier-pop';
135+
$conf['courier']['courier-pop-ssl'] = 'courier-pop-ssl';
136+
137+
//* Dovecot
138+
$conf['dovecot']['installed'] = false; // will be detected automatically during installation
139+
$conf['dovecot']['config_dir'] = '/etc/dovecot';
140+
$conf['dovecot']['init_script'] = 'dovecot';
141+
142+
//* SASL
143+
$conf['saslauthd']['installed'] = false; // will be detected automatically during installation
144+
$conf['saslauthd']['config'] = '/etc/default/saslauthd';
145+
$conf['saslauthd']['init_script'] = 'saslauthd';
146+
147+
//* Amavisd
148+
$conf['amavis']['installed'] = false; // will be detected automatically during installation
149+
$conf['amavis']['config_dir'] = '/etc/amavis';
150+
$conf['amavis']['init_script'] = 'amavis';
151+
152+
//* Rspamd
153+
$conf['rspamd']['installed'] = false; // will be detected automatically during installation
154+
$conf['rspamd']['config_dir'] = '/etc/rspamd';
155+
$conf['rspamd']['init_script'] = 'rspamd';
156+
157+
//* ClamAV
158+
$conf['clamav']['installed'] = false; // will be detected automatically during installation
159+
$conf['clamav']['init_script'] = 'clamav-daemon';
160+
161+
//* Pureftpd
162+
$conf['pureftpd']['installed'] = false; // will be detected automatically during installation
163+
$conf['pureftpd']['config_dir'] = '/etc/pure-ftpd';
164+
$conf['pureftpd']['init_script'] = 'pure-ftpd-mysql';
165+
166+
//* MyDNS
167+
$conf['mydns']['installed'] = false; // will be detected automatically during installation
168+
$conf['mydns']['config_dir'] = '/etc';
169+
$conf['mydns']['init_script'] = 'mydns';
170+
171+
//* PowerDNS
172+
$conf['powerdns']['installed'] = false; // will be detected automatically during installation
173+
$conf['powerdns']['database'] = 'powerdns';
174+
$conf["powerdns"]["config_dir"] = '/etc/powerdns/pdns.d';
175+
$conf['powerdns']['init_script'] = 'pdns';
176+
177+
//* BIND DNS Server
178+
$conf['bind']['installed'] = false; // will be detected automatically during installation
179+
$conf['bind']['bind_user'] = 'root';
180+
$conf['bind']['bind_group'] = 'bind';
181+
$conf['bind']['bind_zonefiles_dir'] = '/etc/bind';
182+
$conf['bind']['named_conf_path'] = '/etc/bind/named.conf';
183+
$conf['bind']['named_conf_local_path'] = '/etc/bind/named.conf.local';
184+
$conf['bind']['init_script'] = 'bind9';
185+
186+
//* Jailkit
187+
$conf['jailkit']['installed'] = false; // will be detected automatically during installation
188+
$conf['jailkit']['config_dir'] = '/etc/jailkit';
189+
$conf['jailkit']['jk_init'] = 'jk_init.ini';
190+
$conf['jailkit']['jk_chrootsh'] = 'jk_chrootsh.ini';
191+
$conf['jailkit']['jailkit_chroot_app_programs'] = '/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico /usr/bin/mysql /usr/bin/mysqldump /usr/bin/git /usr/bin/git-receive-pack /usr/bin/git-upload-pack /usr/bin/unzip /usr/bin/zip /bin/tar /bin/rm /usr/bin/patch /etc/localtime';
192+
$conf['jailkit']['jailkit_chroot_cron_programs'] = '/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php';
193+
194+
//* Squid
195+
$conf['squid']['installed'] = false; // will be detected automatically during installation
196+
$conf['squid']['config_dir'] = '/etc/squid';
197+
$conf['squid']['init_script'] = 'squid';
198+
199+
//* Nginx
200+
$conf['nginx']['installed'] = false; // will be detected automatically during installation
201+
$conf['nginx']['user'] = 'www-data';
202+
$conf['nginx']['group'] = 'www-data';
203+
$conf['nginx']['config_dir'] = '/etc/nginx';
204+
$conf['nginx']['vhost_conf_dir'] = '/etc/nginx/sites-available';
205+
$conf['nginx']['vhost_conf_enabled_dir'] = '/etc/nginx/sites-enabled';
206+
$conf['nginx']['init_script'] = 'nginx';
207+
$conf['nginx']['vhost_port'] = '8080';
208+
$conf['nginx']['cgi_socket'] = '/var/run/fcgiwrap.socket';
209+
$conf['nginx']['php_fpm_init_script'] = 'php7.4-fpm';
210+
$conf['nginx']['php_fpm_ini_path'] = '/etc/php/7.4/fpm/php.ini';
211+
$conf['nginx']['php_fpm_pool_dir'] = '/etc/php/7.4/fpm/pool.d';
212+
$conf['nginx']['php_fpm_start_port'] = 9010;
213+
$conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php7.4-fpm';
214+
215+
//* OpenVZ
216+
$conf['openvz']['installed'] = false;
217+
218+
//*Bastille-Firwall
219+
$conf['bastille']['installed'] = false;
220+
$conf['bastille']['config_dir'] = '/etc/Bastille';
221+
222+
//* vlogger
223+
$conf['vlogger']['config_dir'] = '/etc';
224+
225+
//* cron
226+
$conf['cron']['init_script'] = 'cron';
227+
$conf['cron']['crontab_dir'] = '/etc/cron.d';
228+
$conf['cron']['wget'] = '/usr/bin/wget';
229+
230+
//* Metronome XMPP
231+
$conf['xmpp']['installed'] = false;
232+
$conf['xmpp']['init_script'] = 'metronome';
233+
234+
235+
?>

install/dist/lib/fedora.lib.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -953,24 +953,13 @@ public function install_ispconfig()
953953
//* copy the ISPConfig security part
954954
$command = 'cp -rf ../security '.$install_dir;
955955
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
956-
957-
//* Apply changed security_settings.ini values to new security_settings.ini file
958-
if(is_file('/usr/local/ispconfig/security/security_settings.ini~')) {
959-
$security_settings_old = ini_to_array(file_get_contents('/usr/local/ispconfig/security/security_settings.ini~'));
960-
$security_settings_new = ini_to_array(file_get_contents('/usr/local/ispconfig/security/security_settings.ini'));
961-
if(is_array($security_settings_new) && is_array($security_settings_old)) {
962-
foreach($security_settings_new as $section => $sval) {
963-
if(is_array($sval)) {
964-
foreach($sval as $key => $val) {
965-
if(isset($security_settings_old[$section]) && isset($security_settings_old[$section][$key])) {
966-
$security_settings_new[$section][$key] = $security_settings_old[$section][$key];
967-
}
968-
}
969-
}
970-
}
971-
file_put_contents('/usr/local/ispconfig/security/security_settings.ini',array_to_ini($security_settings_new));
972-
}
956+
957+
$configfile = 'security_settings.ini';
958+
if(is_file($install_dir.'/security/'.$configfile)) {
959+
copy($install_dir.'/security/'.$configfile, $install_dir.'/security/'.$configfile.'~');
973960
}
961+
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master');
962+
wf($install_dir.'/security/'.$configfile, $content);
974963

975964
//* Create a symlink, so ISPConfig is accessible via web
976965
// Replaced by a separate vhost definition for port 8080

install/lib/install.lib.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ function get_distname() {
9595
$mainver = current($mainver).'.'.next($mainver);
9696
}
9797
switch ($mainver){
98+
case "20.04":
99+
$relname = "(Focal Fossa)";
100+
$distconfid = 'ubuntu2004';
101+
break;
98102
case "18.04":
99103
$relname = "(Bionic Beaver)";
100104
$distconfid = 'ubuntu1804';
@@ -186,7 +190,7 @@ function get_distname() {
186190
break;
187191
default:
188192
$relname = "UNKNOWN";
189-
$distconfid = 'ubuntu1804';
193+
$distconfid = 'ubuntu2004';
190194
}
191195
$distver = $ver.$lts." ".$relname;
192196
swriteln("Operating System: ".$distname.' '.$distver."\n");
@@ -341,15 +345,15 @@ function get_distname() {
341345
$distid = 'centos72';
342346
}
343347
swriteln("Operating System: CentOS $var\n");
344-
} elseif(stristr($content, 'CentOS Linux release 8')) {
345-
$distname = 'CentOS';
346-
$distver = 'Unknown';
347-
$distbaseid = 'fedora';
348+
} elseif(stristr($content, 'CentOS Linux release 8')) {
349+
$distname = 'CentOS';
350+
$distver = 'Unknown';
351+
$distbaseid = 'fedora';
348352
$distid = 'centos80';
349-
$var=explode(" ", $content);
350-
$var=explode(".", $var[3]);
351-
$var=$var[0].".".$var[1];
352-
swriteln("Operating System: CentOS $var\n");
353+
$var=explode(" ", $content);
354+
$var=explode(".", $var[3]);
355+
$var=$var[0].".".$var[1];
356+
swriteln("Operating System: CentOS $var\n");
353357
} else {
354358
$distname = 'Redhat';
355359
$distver = 'Unknown';
@@ -687,8 +691,7 @@ function ini_to_array($ini) {
687691

688692

689693
//* Converts a config array to a string
690-
function array_to_ini($config_array = '') {
691-
if($config_array == '') $config_array = $this->config;
694+
function array_to_ini($config_array) {
692695
$content = '';
693696
foreach($config_array as $section => $data) {
694697
$content .= "[$section]\n";

install/lib/installer_base.lib.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3228,6 +3228,9 @@ protected function get_template_file($tLocal, $tRf=false, $tDBCred=false) {
32283228
* @return bool
32293229
*/
32303230
protected function write_config_file($tConf, $tContents) {
3231+
3232+
$args = func_get_args();
3233+
32313234
// Backup config file before writing new contents and stat file
32323235
if ( is_file($tConf) ) {
32333236
$stat = exec('stat -c \'%a %U %G\' '.escapeshellarg($tConf), $output, $res);
@@ -3241,10 +3244,9 @@ protected function write_config_file($tConf, $tContents) {
32413244
}
32423245

32433246
wf($tConf, $tContents); // write file
3244-
32453247
if (func_num_args() >= 4) // override rights and/or ownership
32463248
{
3247-
$args = func_get_args();
3249+
32483250
$output = array_slice($args, 2);
32493251

32503252
switch (sizeof($output)) {

install/lib/mysql.lib.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ private function _setCharset() {
192192
}
193193

194194
private function _query($sQuery = '') {
195+
196+
$aArgs = func_get_args();
195197
$this->do_connect();
196198

197199
if ($sQuery == '') {
@@ -227,7 +229,6 @@ private function _query($sQuery = '') {
227229
}
228230
} while($ok == false);
229231

230-
$aArgs = func_get_args();
231232
$sQuery = call_user_func_array(array(&$this, '_build_query_string'), $aArgs);
232233

233234
$this->_iQueryId = mysqli_query($this->_iConnId, $sQuery);
@@ -283,10 +284,17 @@ public function query($sQuery = '') {
283284
* @return array result row or NULL if none found
284285
*/
285286
public function queryOneRecord($sQuery = '') {
286-
if(!preg_match('/limit \d+\s*,\s*\d+$/i', $sQuery)) $sQuery .= ' LIMIT 0,1';
287-
287+
288288
$aArgs = func_get_args();
289-
$oResult = call_user_func_array(array(&$this, 'query'), $aArgs);
289+
if(!empty($aArgs)) {
290+
$sQuery = array_shift($aArgs);
291+
if($sQuery && !preg_match('/limit \d+(\s*,\s*\d+)?$/i', $sQuery)) {
292+
$sQuery .= ' LIMIT 0,1';
293+
}
294+
array_unshift($aArgs, $sQuery);
295+
}
296+
297+
$oResult = call_user_func_array([&$this, 'query'], $aArgs);
290298
if(!$oResult) return null;
291299

292300
$aReturn = $oResult->get();
@@ -956,7 +964,7 @@ public function get() {
956964

957965
if(!is_array($this->aLimitedData)) return $aItem;
958966

959-
if(list($vKey, $aItem) = each($this->aLimitedData)) {
967+
foreach($this->aLimitedData as $vKey => $aItem) {
960968
if(!$aItem) $aItem = null;
961969
}
962970
return $aItem;

install/sql/incremental/upd_0085.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
-- folder_directive_snippets was missing in incremental, inserted for fixing older installations
2+
ALTER TABLE `web_domain` ADD `folder_directive_snippets` TEXT NULL AFTER `https_port`;
13
ALTER TABLE `web_domain` CHANGE `folder_directive_snippets` `folder_directive_snippets` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL;
24
ALTER TABLE `web_domain` ADD `log_retention` INT NOT NULL DEFAULT '30' AFTER `https_port`;
35
ALTER TABLE `web_domain` CHANGE `stats_type` `stats_type` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'awstats';

0 commit comments

Comments
 (0)