Skip to content

Commit a6f97c3

Browse files
committed
Merge branch 'develop' of git.ispconfig.org:ispconfig/ispconfig3 into develop
2 parents 5fbb46c + 963335e commit a6f97c3

File tree

460 files changed

+6963
-4890
lines changed

Some content is hidden

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

460 files changed

+6963
-4890
lines changed

install/install.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,8 @@
574574
if(!file_exists('/usr/local/ispconfig/interface/ssl/ispserver.crt')) {
575575
if(strtolower($inst->simple_query('Do you want to create SSL certs for your server?', array('y', 'n'), 'y')) == 'y')
576576
$inst->make_ispconfig_ssl_cert();
577+
} else {
578+
swriteln('Certificate exists. Not creating a new one.');
577579
}
578580

579581
if($conf['services']['web'] == true) {

install/lib/installer_base.lib.php

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class installer_base {
3333
var $wb = array();
3434
var $language = 'en';
3535
var $db;
36-
public $conf;
3736
public $install_ispconfig_interface = true;
3837
public $is_update = false; // true if it is an update, falsi if it is a new install
3938
public $min_php = '5.3.3'; // minimal php-version for update / install
@@ -42,7 +41,6 @@ class installer_base {
4241

4342
public function __construct() {
4443
global $conf; //TODO: maybe $conf should be passed to constructor
45-
//$this->conf = $conf;
4644
}
4745

4846
//: TODO Implement the translation function and language files for the installer.
@@ -2822,6 +2820,8 @@ public function make_ispconfig_ssl_cert() {
28222820

28232821
// Request for certs if no LE SSL folder for server fqdn exist
28242822

2823+
swriteln('Checking / creating certificate for ' . $hostname);
2824+
28252825
$acme_cert_dir = '/usr/local/ispconfig/server/scripts/' . $hostname;
28262826
$check_acme_file = $acme_cert_dir . '/' . $hostname . '.cer';
28272827
if(!@is_dir($acme_cert_dir)) {
@@ -2832,6 +2832,13 @@ public function make_ispconfig_ssl_cert() {
28322832
$check_acme_file = $acme_cert_dir . '/cert.pem';
28332833
}
28342834
}
2835+
2836+
swriteln('Using certificate path ' . $acme_cert_dir);
2837+
if(!(($svr_ip4 && in_array($svr_ip4, $dns_ips)) || ($svr_ip6 && in_array($svr_ip6, $dns_ips)))) {
2838+
swriteln('Server\'s public ip(s) (' . $svr_ip4 . ($svr_ip6 ? ', ' . $svr_ip6 : '') . ') not found in A/AAAA records for ' . $hostname . ': ' . implode(', ', $dns_ips));
2839+
}
2840+
2841+
28352842
if ((!@is_dir($acme_cert_dir) || !@file_exists($check_acme_file) || !@file_exists($ssl_crt_file) || md5_file($check_acme_file) != md5_file($ssl_crt_file)) && (($svr_ip4 && in_array($svr_ip4, $dns_ips)) || ($svr_ip6 && in_array($svr_ip6, $dns_ips)))) {
28362843

28372844
// This script is needed earlier to check and open http port 80 or standalone might fail
@@ -2881,8 +2888,10 @@ public function make_ispconfig_ssl_cert() {
28812888

28822889
// first of all create the acme vhosts if not existing
28832890
if($conf['nginx']['installed'] == true) {
2891+
swriteln('Using nginx for certificate validation');
28842892
$this->make_acme_vhost($hostname, 'nginx');
28852893
} elseif($conf['apache']['installed'] == true) {
2894+
swriteln('Using apache for certificate validation');
28862895
if($this->is_update == false && @is_link($vhost_conf_enabled_dir.'/000-ispconfig.conf')) {
28872896
$restore_conf_symlink = true;
28882897
unlink($vhost_conf_enabled_dir.'/000-ispconfig.conf');
@@ -2899,7 +2908,7 @@ public function make_ispconfig_ssl_cert() {
28992908
$out = null;
29002909
$ret = null;
29012910
if($conf['nginx']['installed'] == true || $conf['apache']['installed'] == true) {
2902-
exec("$acme --issue -w /usr/local/ispconfig/interface/acme -d $hostname $renew_hook", $out, $ret);
2911+
exec("$acme --issue -w /usr/local/ispconfig/interface/acme -d " . escapeshellarg($hostname) . " $renew_hook", $out, $ret);
29032912
}
29042913
// Else, it is not webserver, so we use standalone
29052914
else {
@@ -2909,6 +2918,7 @@ public function make_ispconfig_ssl_cert() {
29092918
if($ret == 0 || ($ret == 2 && file_exists($check_acme_file))) {
29102919
// acme.sh returns with 2 on issue for already existing certificate
29112920

2921+
29122922
// Backup existing ispserver ssl files
29132923
if(file_exists($ssl_crt_file) || is_link($ssl_crt_file)) {
29142924
rename($ssl_crt_file, $ssl_crt_file . '-' . $date->format('YmdHis') . '.bak');
@@ -2924,8 +2934,10 @@ public function make_ispconfig_ssl_cert() {
29242934
//$acme_cert = "--cert-file $acme_cert_dir/cert.pem";
29252935
$acme_key = "--key-file " . escapeshellarg($ssl_key_file);
29262936
$acme_chain = "--fullchain-file " . escapeshellarg($ssl_crt_file);
2927-
exec("$acme --install-cert -d $hostname $acme_key $acme_chain");
2937+
exec("$acme --install-cert -d " . escapeshellarg($hostname) . " $acme_key $acme_chain");
29282938
$issued_successfully = true;
2939+
} else {
2940+
swriteln('Issuing certificate via acme.sh failed. Please check that your hostname can be verified by letsencrypt');
29292941
}
29302942
// Else, we attempt to use the official LE certbot client certbot
29312943
} else {
@@ -2947,11 +2959,11 @@ public function make_ispconfig_ssl_cert() {
29472959

29482960
// If this is a webserver
29492961
if($conf['nginx']['installed'] == true || $conf['apache']['installed'] == true) {
2950-
exec("$le_client $certonly $acme_version --authenticator webroot --webroot-path /usr/local/ispconfig/interface/acme --email " . escapeshellarg('postmaster@$hostname') . " -d " . escapeshellarg($hostname) . " $renew_hook", $out, $ret);
2962+
exec("$le_client $certonly $acme_version --authenticator webroot --webroot-path /usr/local/ispconfig/interface/acme --email " . escapeshellarg('postmaster@' . $hostname) . " -d " . escapeshellarg($hostname) . " $renew_hook", $out, $ret);
29512963
}
29522964
// Else, it is not webserver, so we use standalone
29532965
else {
2954-
exec("$le_client $certonly $acme_version --standalone --email " . escapeshellarg('postmaster@$hostname') . " -d " . escapeshellarg($hostname) . " $hook", $out, $ret);
2966+
exec("$le_client $certonly $acme_version --standalone --email " . escapeshellarg('postmaster@' . $hostname) . " -d " . escapeshellarg($hostname) . " $hook", $out, $ret);
29552967
}
29562968

29572969
if($ret == 0) {
@@ -2969,7 +2981,11 @@ public function make_ispconfig_ssl_cert() {
29692981
}
29702982

29712983
$issued_successfully = true;
2984+
} else {
2985+
swriteln('Issuing certificate via certbot failed. Please check log files and make sure that your hostname can be verified by letsencrypt');
29722986
}
2987+
} else {
2988+
swriteln('Did not find any valid acme client (acme.sh or certbot)');
29732989
}
29742990
}
29752991

@@ -2985,6 +3001,12 @@ public function make_ispconfig_ssl_cert() {
29853001

29863002
// If the LE SSL certs for this hostname exists
29873003
if(!is_dir($acme_cert_dir) || !file_exists($check_acme_file) || !$issued_successfully) {
3004+
if(!$issued_successfully) {
3005+
swriteln('Could not issue letsencrypt certificate, falling back to self-signed.');
3006+
} else {
3007+
swriteln('Issuing certificate seems to have succeeded but ' . $check_acme_file . ' seems to be missing. Falling back to self-signed.');
3008+
}
3009+
29883010
// We can still use the old self-signed method
29893011
$ssl_pw = substr(md5(mt_rand()), 0, 6);
29903012
exec("openssl genrsa -des3 -passout pass:$ssl_pw -out $ssl_key_file 4096");
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ALTER TABLE `web_domain` ADD `jailkit_chroot_app_sections` mediumtext NULL DEFAULT NULL;
2+
ALTER TABLE `web_domain` ADD `jailkit_chroot_app_programs` mediumtext NULL DEFAULT NULL;
3+
ALTER TABLE `web_domain` ADD `delete_unused_jailkit` enum('n','y') NOT NULL DEFAULT 'n';
4+
ALTER TABLE `web_domain` ADD `last_jailkit_update` date NULL DEFAULT NULL;
5+
ALTER TABLE `web_domain` ADD `last_jailkit_hash` varchar(255) DEFAULT NULL;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

install/sql/ispconfig3.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,6 +2084,11 @@ CREATE TABLE `web_domain` (
20842084
`log_retention` int(11) NOT NULL DEFAULT '10',
20852085
`proxy_protocol` enum('n','y') NOT NULL default 'n',
20862086
`server_php_id` INT(11) UNSIGNED NOT NULL DEFAULT 0,
2087+
`jailkit_chroot_app_sections` mediumtext NULL DEFAULT NULL,
2088+
`jailkit_chroot_app_programs` mediumtext NULL DEFAULT NULL,
2089+
`delete_unused_jailkit` enum('n','y') NOT NULL default 'n',
2090+
`last_jailkit_update` date NULL DEFAULT NULL,
2091+
`last_jailkit_hash` varchar(255) DEFAULT NULL,
20872092
PRIMARY KEY (`domain_id`),
20882093
UNIQUE KEY `serverdomain` ( `server_id` , `ip_address`, `domain` )
20892094
) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

install/tpl/apache_ispconfig.conf.master

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ SetEnvIf Request_URI "^/datalogstatus.php$" dontlog
1212

1313
LogFormat "%v %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
1414
<tmpl_if name='logging' op='==' value='anon'>
15-
CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -p -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig env=!dontlog
15+
CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -p -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig
1616
</tmpl_if>
1717
<tmpl_if name='logging' op='==' value='yes'>
18-
CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig env=!dontlog
18+
CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig
1919
</tmpl_if>
2020

2121
<Directory /var/www/clients>

install/tpl/server.ini.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ jailkit_chroot_app_sections=basicshell editors extendedshell netutils ssh sftp s
146146
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 /usr/bin/which /usr/lib/x86_64-linux-gnu/libmemcached.so.11 /usr/lib/x86_64-linux-gnu/libmemcachedutil.so.2 /usr/lib/x86_64-linux-gnu/libMagickWand-6.Q16.so.2 /opt/php-5.6.8/bin/php /opt/php-5.6.8/include /opt/php-5.6.8/lib
147147
jailkit_chroot_cron_programs=/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php
148148
jailkit_chroot_authorized_keys_template=/root/.ssh/authorized_keys
149+
jailkit_hardlinks=allow
149150

150151
[vlogger]
151152
config_dir=/etc

install/update.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,30 @@
3030

3131
/*
3232
ISPConfig 3 updater.
33-
33+
3434
-------------------------------------------------------------------------------------
3535
- Interactive update
3636
-------------------------------------------------------------------------------------
3737
run:
38-
38+
3939
php update.php
40-
40+
4141
-------------------------------------------------------------------------------------
4242
- Noninteractive (autoupdate) mode
4343
-------------------------------------------------------------------------------------
44-
44+
4545
The autoupdate mode can read the updater questions from a .ini style file or from
46-
a php config file. Examples for both file types are in the docs folder.
46+
a php config file. Examples for both file types are in the docs folder.
4747
See autoinstall.ini.sample and autoinstall.conf_sample.php.
48-
48+
4949
run:
50-
50+
5151
php update.php --autoinstall=autoinstall.ini
52-
52+
5353
or
54-
54+
5555
php update.php --autoinstall=autoinstall.conf.php
56-
56+
5757
*/
5858

5959
error_reporting(E_ALL|E_STRICT);
@@ -263,7 +263,7 @@
263263
do {
264264
$tmp_mysql_server_host = $inst->free_query('MySQL master server hostname', $conf['mysql']['master_host'],'mysql_master_hostname');
265265
$tmp_mysql_server_port = $inst->free_query('MySQL master server port', $conf['mysql']['master_port'],'mysql_master_port');
266-
$tmp_mysql_server_admin_user = $inst->free_query('MySQL master server root username', $conf['mysql']['master_admin_user'],'mysql_master_root_user');
266+
$tmp_mysql_server_admin_user = $inst->free_query('MySQL master server root username', $conf['mysql']['master_admin_user'],'mysql_master_root_user');
267267
$tmp_mysql_server_admin_password = $inst->free_query('MySQL master server root password', $conf['mysql']['master_admin_password'],'mysql_master_root_password');
268268
$tmp_mysql_server_database = $inst->free_query('MySQL master server database name', $conf['mysql']['master_database'],'mysql_master_database');
269269

@@ -474,7 +474,7 @@
474474
$inst->configure_apps_vhost();
475475
} else swriteln('Skipping config of Apps vhost');
476476
}
477-
477+
478478
//* Configure Jailkit
479479
if($inst->reconfigure_app('Jailkit', $reconfigure_services_answer)) {
480480
swriteln('Configuring Jailkit');
@@ -540,6 +540,8 @@
540540
if(!file_exists('/usr/local/ispconfig/interface/ssl/ispserver.crt')) {
541541
if(strtolower($inst->simple_query('Do you want to create SSL certs for your server?', array('y', 'n'), 'y')) == 'y')
542542
$inst->make_ispconfig_ssl_cert();
543+
} else {
544+
swriteln('Certificate exists. Not creating a new one.');
543545
}
544546

545547
$inst->install_ispconfig();

interface/lib/classes/remoting.inc.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ public function __construct($methods = array())
5959
$app->uses('remoting_lib');
6060

6161
$this->_methods = $methods;
62-
63-
/*
64-
$this->app = $app;
65-
$this->conf = $conf;
66-
*/
6762
}
6863

6964
//* remote login function

interface/lib/lang/ar.lng

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ $wb['datalog_status_d_dns_rr'] = 'Delete DNS record';
109109
$wb['datalog_status_i_dns_soa'] = 'Create DNS zone';
110110
$wb['datalog_status_u_dns_soa'] = 'Update DNS zone';
111111
$wb['datalog_status_d_dns_soa'] = 'Delete DNS zone';
112+
$wb['datalog_status_i_dns_slave'] = 'Create new secondary DNS zone';
113+
$wb['datalog_status_u_dns_slave'] = 'Update secondary DNS zone';
114+
$wb['datalog_status_d_dns_slave'] = 'Delete secondary DNS zone';
115+
$wb['datalog_status_i_firewall'] = 'Create new firewall rule';
116+
$wb['datalog_status_u_firewall'] = 'Update firewall rule';
117+
$wb['datalog_status_d_firewall'] = 'Delete firewall rule';
118+
$wb['datalog_status_u_server'] = 'Update server settings';
119+
$wb['datalog_status_d_server'] = 'Delete server';
112120
$wb['datalog_status_i_cron'] = 'Create cron job';
113121
$wb['datalog_status_u_cron'] = 'Update cron job';
114122
$wb['datalog_status_d_cron'] = 'Delete cron job';
@@ -161,4 +169,4 @@ $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user';
161169
$wb['unlimited_txt'] = 'Unlimited';
162170
$wb['server_id_0_error_txt'] = 'Please select a valid Server. Server ID must be > 0.';
163171
$wb['datalog_changes_close_txt'] = 'Close';
164-
?>
172+
?>

0 commit comments

Comments
 (0)