Skip to content

Commit f71e00f

Browse files
author
Marius Burkard
committed
Merge branch 'stable-3.1'
2 parents 6879323 + d0e3363 commit f71e00f

File tree

403 files changed

+532
-449
lines changed

Some content is hidden

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

403 files changed

+532
-449
lines changed

docs/autoinstall_samples/autoinstall.conf_sample.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
$autoinstall['hostname'] = 'server1.example.com'; // default
66
$autoinstall['mysql_hostname'] = 'localhost'; // default: localhost
7+
$autoinstall['mysql_port'] = '3306'; // default: 3306
78
$autoinstall['mysql_root_user'] = 'root'; // default: root
89
$autoinstall['mysql_root_password'] = 'howtoforge';
910
$autoinstall['mysql_database'] = 'dbispconfig'; // default: dbispcongig
@@ -20,6 +21,7 @@
2021
$autoinstall['ssl_cert_organisation'] = 'Internet Widgits Pty Ltd';
2122
$autoinstall['ssl_cert_organisation_unit'] = 'IT department';
2223
$autoinstall['ssl_cert_common_name'] = $autoinstall['hostname'];
24+
$autoinstall['ssl_cert_email'] = 'hostmaster@'.$autoinstall['hostname'];
2325

2426
/* optional expert mode settings, needed only for expert mode */
2527
$autoinstall['mysql_ispconfig_user'] = 'ispconfig'; // default: ispconfig

docs/autoinstall_samples/autoinstall.ini.sample

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ language=en
33
install_mode=standard
44
hostname=server1.example.com
55
mysql_hostname=localhost
6+
mysql_port=3306
67
mysql_root_user=root
78
mysql_root_password=ispconfig
89
mysql_database=dbispconfig
@@ -19,6 +20,7 @@ ssl_cert_locality=Chicago
1920
ssl_cert_organisation=Internet Widgits Pty Ltd
2021
ssl_cert_organisation_unit=IT department
2122
ssl_cert_common_name=server1.example.com
23+
ssl_cert_email=hostmaster@example.com
2224

2325
[expert]
2426
mysql_ispconfig_user=ispconfig

install/lib/install.lib.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -297,19 +297,19 @@ function get_distname() {
297297
$distid = 'centos53';
298298
$distbaseid = 'fedora';
299299
swriteln("Operating System: CentOS 6 or compatible\n");
300-
} elseif(stristr($content, 'CentOS Linux release 7.2')) {
301-
$distname = 'CentOS';
302-
$distver = 'Unknown';
303-
$distid = 'centos72';
304-
$distconfid = 'centos72';
305-
$distbaseid = 'fedora';
306-
swriteln("Operating System: CentOS 7.2\n");
307300
} elseif(stristr($content, 'CentOS Linux release 7')) {
308301
$distname = 'CentOS';
309302
$distver = 'Unknown';
310-
$distid = 'centos70';
311303
$distbaseid = 'fedora';
312-
swriteln("Operating System: CentOS 7 or compatible\n");
304+
$var=explode(" ", $content);
305+
$var=explode(".", $var[3]);
306+
$var=$var[0].".".$var[1];
307+
if($var=='7.0' || $var=='7.1') {
308+
$distid = 'centos70';
309+
} else {
310+
$distid = 'centos72';
311+
}
312+
swriteln("Operating System: CentOS $var\n");
313313
} else {
314314
$distname = 'Redhat';
315315
$distver = 'Unknown';

install/lib/installer_base.lib.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,7 @@ public function configure_amavis() {
14341434
$add_amavis = !$this->get_postfix_service('amavis','unix');
14351435
$add_amavis_10025 = !$this->get_postfix_service('127.0.0.1:10025','inet');
14361436
$add_amavis_10027 = !$this->get_postfix_service('127.0.0.1:10027','inet');
1437+
//*TODO: check templates against existing postfix-services to make sure we use the template
14371438

14381439
if ($add_amavis || $add_amavis_10025 || $add_amavis_10027) {
14391440
//* backup master.cf
@@ -1707,12 +1708,12 @@ public function configure_xmpp($options = '') {
17071708
// Create SSL Certificate for localhost
17081709
// Ensure no line is left blank
17091710
echo "writing new private key to 'localhost.key'\n-----\n";
1710-
$ssl_country = $this->free_query('Country Name (2 letter code)', 'AU');
1711-
$ssl_locality = $this->free_query('Locality Name (eg, city)', 'City Name');
1712-
$ssl_organisation = $this->free_query('Organization Name (eg, company)', 'Internet Widgits Pty Ltd');
1713-
$ssl_organisation_unit = $this->free_query('Organizational Unit Name (eg, section)', 'Infrastructure');
1714-
$ssl_domain = $this->free_query('Common Name (e.g. server FQDN or YOUR name)', $conf['hostname']);
1715-
$ssl_email = $this->free_query('Email Address', 'hostmaster@'.$conf['hostname']);
1711+
$ssl_country = $this->free_query('Country Name (2 letter code)', 'AU','ssl_cert_country');
1712+
$ssl_locality = $this->free_query('Locality Name (eg, city)', 'City Name','ssl_cert_locality');
1713+
$ssl_organisation = $this->free_query('Organization Name (eg, company)', 'Internet Widgits Pty Ltd','ssl_cert_organisation');
1714+
$ssl_organisation_unit = $this->free_query('Organizational Unit Name (eg, section)', 'Infrastructure','ssl_cert_organisation_unit');
1715+
$ssl_domain = $this->free_query('Common Name (e.g. server FQDN or YOUR name)', $conf['hostname'],'ssl_cert_common_name');
1716+
$ssl_email = $this->free_query('Email Address', 'hostmaster@'.$conf['hostname'],'ssl_cert_email');
17161717

17171718
$tpl = new tpl('metronome_conf_ssl.master');
17181719
$tpl->setVar('ssl_country',$ssl_country);
@@ -1738,10 +1739,12 @@ public function configure_xmpp($options = '') {
17381739
echo "\n";
17391740

17401741
}else{
1741-
echo "-----\n";
1742+
/*
1743+
echo "-----\n";
17421744
echo "Metronome XMPP SSL server certificate is not renewed. Run the following command manual as root to recreate it:\n";
17431745
echo "# (cd /etc/metronome/certs && make localhost.key && make localhost.csr && make localhost.cert && chmod 0400 localhost.key && chown metronome localhost.key)\n";
17441746
echo "-----\n";
1747+
*/
17451748
}
17461749

17471750
// Copy init script
@@ -2164,6 +2167,11 @@ public function configure_apps_vhost() {
21642167
// SSL in apps vhost is off by default. Might change later.
21652168
$content = str_replace('{ssl_on}', 'off', $content);
21662169
$content = str_replace('{ssl_comment}', '#', $content);
2170+
2171+
// Fix socket path on PHP 7 systems
2172+
if(file_exists('/var/run/php/php7.0-fpm.sock')) {
2173+
$content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.0-fpm.sock', $content);
2174+
}
21672175

21682176
wf($vhost_conf_dir.'/apps.vhost', $content);
21692177

install/tpl/master_cf_amavis.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
amavis unix - - - - 2 smtp
33
-o smtp_data_done_timeout=1200
44
-o smtp_send_xforward_command=yes
5+
-o smtp_bind_address=
56

install/tpl/php_fpm_pool.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ chdir = /
2020
php_admin_value[session.save_path] = /usr/local/ispconfig/interface/temp
2121
php_admin_flag[magic_quotes_gpc] = off
2222

23-
php_admin_value[memory_limit] = 4096M
23+
php_admin_value[memory_limit] = -1
2424
php_admin_value[max_execution_time] = 1200

install/tpl/server.ini.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ apps_vhost_enabled=y
7979
apps_vhost_port=8081
8080
apps_vhost_ip=_default_
8181
apps_vhost_servername=
82-
php_open_basedir=[website_path]/web:[website_path]/private:[website_path]/tmp:/var/www/[website_domain]/web:/srv/www/[website_domain]/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin
82+
php_open_basedir=[website_path]/web:[website_path]/private:[website_path]/tmp:/var/www/[website_domain]/web:/srv/www/[website_domain]/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom
8383
htaccess_allow_override=All
8484
awstats_conf_dir=/etc/awstats
8585
awstats_data_dir=/var/lib/awstats

interface/lib/classes/custom_datasource.inc.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ function webdav_domains($field, $record) {
9898
}
9999
}
100100
if(count($server_ids) == 0) return array();
101-
$server_ids = implode(',', $server_ids);
102-
$records = $app->db->queryAllRecords("SELECT web_domain.domain_id, CONCAT(web_domain.domain, ' :: ', server.server_name) AS parent_domain FROM web_domain, server WHERE web_domain.type = 'vhost' AND web_domain.server_id IN (?) AND web_domain.server_id = server.server_id AND ".$app->tform->getAuthSQL('r', 'web_domain')." ORDER BY web_domain.domain", $server_ids);
101+
$records = $app->db->queryAllRecords("SELECT web_domain.domain_id, CONCAT(web_domain.domain, ' :: ', server.server_name) AS parent_domain FROM web_domain, server WHERE web_domain.type = 'vhost' AND web_domain.server_id IN ? AND web_domain.server_id = server.server_id AND ".$app->tform->getAuthSQL('r', 'web_domain')." ORDER BY web_domain.domain", $server_ids);
103102

104103
$records_new = array();
105104
if(is_array($records)) {

interface/lib/classes/functions.inc.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,23 @@ public function generate_customer_no(){
437437

438438
return $customer_no;
439439
}
440+
441+
public function generate_ssh_key($client_id, $username = ''){
442+
global $app;
443+
444+
// generate the SSH key pair for the client
445+
$id_rsa_file = '/tmp/'.uniqid('',true);
446+
$id_rsa_pub_file = $id_rsa_file.'.pub';
447+
if(file_exists($id_rsa_file)) unset($id_rsa_file);
448+
if(file_exists($id_rsa_pub_file)) unset($id_rsa_pub_file);
449+
if(!file_exists($id_rsa_file) && !file_exists($id_rsa_pub_file)) {
450+
exec('ssh-keygen -t rsa -C '.$username.'-rsa-key-'.time().' -f '.$id_rsa_file.' -N ""');
451+
$app->db->query("UPDATE client SET created_at = UNIX_TIMESTAMP(), id_rsa = ?, ssh_rsa = ? WHERE client_id = ?", @file_get_contents($id_rsa_file), @file_get_contents($id_rsa_pub_file), $client_id);
452+
exec('rm -f '.$id_rsa_file.' '.$id_rsa_pub_file);
453+
} else {
454+
$app->log("Failed to create SSH keypair for ".$username, LOGLEVEL_WARN);
455+
}
456+
}
440457
}
441458

442459
?>

interface/lib/classes/listform_actions.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function onLoad()
131131
$records = $app->db->queryAllRecords($this->getQueryString($php_sort));
132132

133133
$this->DataRowColor = "#FFFFFF";
134-
$records_new = '';
134+
$records_new = array();
135135
if(is_array($records)) {
136136
$this->idx_key = $app->listform->listDef["table_idx"];
137137
foreach($records as $rec) {

0 commit comments

Comments
 (0)