Skip to content

Commit d222778

Browse files
author
Marius Burkard
committed
- merged different fixes and updates from foreign branches
1 parent 0cc2861 commit d222778

Some content is hidden

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

41 files changed

+1396
-175
lines changed

install/install.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@
246246

247247
if($install_mode == 'standard') {
248248

249+
$inst->dbmaster = $inst->db;
250+
249251
//* Create the MySQL database
250252
$inst->configure_database();
251253

@@ -500,6 +502,9 @@
500502
$inst->install_crontab();
501503
} else swriteln('[ERROR] Cron not found');
502504

505+
swriteln('Detect IP addresses');
506+
$inst->detect_ips();
507+
503508
swriteln('Restarting services ...');
504509
if($conf['mysql']['installed'] == true && $conf['mysql']['init_script'] != '') system($inst->getinitcommand($conf['mysql']['init_script'], 'restart').' >/dev/null 2>&1');
505510
if($conf['postfix']['installed'] == true && $conf['postfix']['init_script'] != '') system($inst->getinitcommand($conf['postfix']['init_script'], 'restart'));
@@ -696,6 +701,9 @@
696701
swriteln('Configuring Pureftpd');
697702
$inst->configure_pureftpd();
698703
}
704+
705+
swriteln('Detect IP addresses');
706+
$inst->detect_ips();
699707

700708
//** Configure DNS
701709
if(strtolower($inst->simple_query('Configure DNS Server', array('y', 'n'), 'y','configure_dns')) == 'y') {
@@ -866,6 +874,9 @@
866874
if($conf['nginx']['php_fpm_init_script'] != '') system($inst->getinitcommand($conf['nginx']['php_fpm_init_script'], 'reload'));
867875
if($conf['nginx']['init_script'] != '') system($inst->getinitcommand($conf['nginx']['init_script'], 'reload'));
868876
}
877+
878+
swriteln('Detect IP addresses');
879+
$inst->detect_ips();
869880

870881

871882

install/lib/installer_base.lib.php

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,84 @@ public function add_database_server_record() {
371371

372372

373373
}
374+
375+
public function detect_ips(){
376+
global $conf;
377+
378+
exec("ip addr show | awk '/global/ { print $2 }' | cut -d '/' -f 1", $output, $retval);
379+
380+
if($retval == 0){
381+
if(is_array($output) && !empty($output)){
382+
foreach($output as $line){
383+
$line = trim($line);
384+
$ip_type = '';
385+
if (filter_var($line, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
386+
$ip_type = 'IPv4';
387+
}
388+
if (filter_var($line, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
389+
$ip_type = 'IPv6';
390+
}
391+
if($ip_type == '') continue;
392+
if($this->db->dbHost != $this->dbmaster->dbHost){
393+
$this->dbmaster->query('INSERT INTO server_ip (
394+
sys_userid, sys_groupid, sys_perm_user, sys_perm_group,
395+
sys_perm_other, server_id, client_id, ip_type, ip_address,
396+
virtualhost, virtualhost_port
397+
) VALUES (
398+
1,
399+
1,
400+
"riud",
401+
"riud",
402+
"",
403+
' . $conf['server_id'] . ',
404+
0,
405+
"'.$ip_type.'",
406+
"'.$line.'",
407+
"y",
408+
"80,443"
409+
)');
410+
$server_ip_id = $this->dbmaster->insertID();
411+
$this->db->query('INSERT INTO server_ip (
412+
server_php_id, sys_userid, sys_groupid, sys_perm_user, sys_perm_group,
413+
sys_perm_other, server_id, client_id, ip_type, ip_address,
414+
virtualhost, virtualhost_port
415+
) VALUES (
416+
'.$server_ip_id.',
417+
1,
418+
1,
419+
"riud",
420+
"riud",
421+
"",
422+
' . $conf['server_id'] . ',
423+
0,
424+
"'.$ip_type.'",
425+
"'.$line.'",
426+
"y",
427+
"80,443"
428+
)');
429+
} else {
430+
$this->db->query('INSERT INTO server_ip (
431+
sys_userid, sys_groupid, sys_perm_user, sys_perm_group,
432+
sys_perm_other, server_id, client_id, ip_type, ip_address,
433+
virtualhost, virtualhost_port
434+
) VALUES (
435+
1,
436+
1,
437+
"riud",
438+
"riud",
439+
"",
440+
' . $conf['server_id'] . ',
441+
0,
442+
"'.$ip_type.'",
443+
"'.$line.'",
444+
"y",
445+
"80,443"
446+
)');
447+
}
448+
}
449+
}
450+
}
451+
}
374452

375453
public function grant_master_database_rights($verbose = false) {
376454
global $conf;

install/sql/ispconfig3.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ CREATE TABLE `client` (
257257
`customer_no_counter` int(11) NOT NULL DEFAULT '0',
258258
`added_date` date NOT NULL DEFAULT '0000-00-00',
259259
`added_by` varchar(255) DEFAULT NULL,
260+
`validation_status` enum('accept','review','reject') NOT NULL DEFAULT 'accept',
261+
`risk_score` int(10) unsigned NOT NULL DEFAULT '0',
262+
`activation_code` varchar(10) NOT NULL DEFAULT '',
260263
PRIMARY KEY (`client_id`)
261264
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
262265

@@ -455,6 +458,7 @@ CREATE TABLE IF NOT EXISTS `directive_snippets` (
455458
`customer_viewable` ENUM('n','y') NOT NULL DEFAULT 'n',
456459
`required_php_snippets` varchar(255) NOT NULL DEFAULT '',
457460
`active` enum('n','y') NOT NULL DEFAULT 'y',
461+
`master_directive_snippets_id` int(11) unsigned NOT NULL DEFAULT '0',
458462
PRIMARY KEY (`directive_snippets_id`)
459463
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
460464

@@ -1946,6 +1950,7 @@ CREATE TABLE `web_domain` (
19461950
`enable_pagespeed` ENUM('y','n') NOT NULL DEFAULT 'n',
19471951
`http_port` int(11) unsigned NOT NULL DEFAULT '80',
19481952
`https_port` int(11) unsigned NOT NULL DEFAULT '443',
1953+
`folder_directive_snippets` text NOT NULL,
19491954
PRIMARY KEY (`domain_id`),
19501955
UNIQUE KEY `serverdomain` ( `server_id` , `ip_address`, `domain` )
19511956
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

install/tpl/server.ini.master

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ admin_notify_events=1
1818
backup_dir=/var/backup
1919
backup_dir_is_mount=n
2020
backup_mode=rootgz
21+
backup_time=0:00
2122
backup_delete=n
2223
monit_url=
2324
monit_user=
@@ -46,7 +47,7 @@ relayhost_password=
4647
mailbox_size_limit=0
4748
message_size_limit=0
4849
mailbox_quota_stats=y
49-
realtime_blackhole_list=
50+
realtime_blackhole_list=zen.spamhaus.org
5051
overquota_notify_admin=y
5152
overquota_notify_client=y
5253
overquota_notify_freq=7
@@ -78,7 +79,6 @@ apps_vhost_ip=_default_
7879
apps_vhost_servername=
7980
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
8081
htaccess_allow_override=All
81-
enable_spdy=y
8282
awstats_conf_dir=/etc/awstats
8383
awstats_data_dir=/var/lib/awstats
8484
awstats_pl=/usr/lib/cgi-bin/awstats.pl
@@ -131,7 +131,7 @@ fastcgi_config_syntax=1
131131
[jailkit]
132132
jailkit_chroot_home=/home/[username]
133133
jailkit_chroot_app_sections=basicshell editors extendedshell netutils ssh sftp scp groups jk_lsh
134-
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
134+
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
135135
jailkit_chroot_cron_programs=/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php
136136

137137
[vlogger]

0 commit comments

Comments
 (0)