Skip to content

Commit d1b91db

Browse files
author
A. Täffner
committed
Merge branch 'master' into dns-status
Conflicts: install/sql/incremental/upd_dev_collection.sql server/plugins-available/bind_plugin.inc.php
2 parents de078e6 + f611abe commit d1b91db

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

+1376
-31
lines changed

TODO.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Installer
1313
--------------------------------------
1414

1515
- Add a function to let a server join a existing installation.
16+
- Add Package haveged to requirements (at least if entropy is low) as it raises available entropy significantly which is very needed for DNSSEC Key-generation
17+
If it is not installed and entropy is low generating dnssec-keys lasts minutes (and would time out the server thus is not done) and new signing keys are not generated.
18+
If there are no keys the zones can not be signed and will only be availableas a unsigned copy.
1619

1720
Uninstaller
1821
--------------------------------------
@@ -26,13 +29,6 @@ Server
2629
Mail module
2730
--------------------------------------
2831

29-
- Show mail statistics in the interface. The mail statistics are stored
30-
in the database table mail_traffic and are collected by the file
31-
server/cron_daily.php
32-
-- For Courier this works but not Dovecot. Maybe the intention needs
33-
reviewed as some clients think this should be the number of emails
34-
and not the size of the emails. (I agree that size is important)
35-
lathama
3632

3733
Administration module
3834
--------------------------------------
@@ -87,6 +83,7 @@ Remoting framework
8783
Interface
8884
--------------------------------------
8985
- Enhance the paging in lists (e.g. like this: [1 2 3 4 ... 10])
86+
- DNS: Add Checkbox to switch dnssec_wanted between Y and N to templates and/or wizard. I recommend doing it in the wizard though.
9087

9188
General tasks
9289
--------------------------------------

install/dist/conf/centos70.conf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144

145145
//* Amavisd
146146
$conf['amavis']['installed'] = false; // will be detected automatically during installation
147-
$conf['amavis']['config_dir'] = '/etc';
147+
$conf['amavis']['config_dir'] = '/etc/amavisd';
148148
$conf['amavis']['init_script'] = 'amavisd';
149149

150150
//* ClamAV

install/lib/installer_base.lib.php

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,6 +1469,27 @@ public function configure_powerdns() {
14691469

14701470

14711471
}
1472+
1473+
//** writes bind configuration files
1474+
public function process_bind_file($configfile, $target='/', $absolute=false) {
1475+
global $conf;
1476+
1477+
if ($absolute) $full_file_name = $target.$configfile;
1478+
else $full_file_name = $conf['ispconfig_install_dir'].$target.$configfile;
1479+
1480+
//* Backup exiting file
1481+
if(is_file($full_file_name)) {
1482+
copy($full_file_name, $config_dir.$configfile.'~');
1483+
}
1484+
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master');
1485+
$content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content);
1486+
$content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content);
1487+
$content = str_replace('{mysql_server_ispconfig_database}', $conf['mysql']['database'], $content);
1488+
$content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content);
1489+
$content = str_replace('{ispconfig_install_dir}', $conf['ispconfig_install_dir'], $content);
1490+
$content = str_replace('{dnssec_conffile}', $conf['ispconfig_install_dir'].'/server/scripts/dnssec-config.sh', $content);
1491+
wf($full_file_name, $content);
1492+
}
14721493

14731494
public function configure_bind() {
14741495
global $conf;
@@ -1481,13 +1502,15 @@ public function configure_bind() {
14811502

14821503
//* Create the slave subdirectory
14831504
$content .= 'slave';
1484-
if(!@is_dir($content)) mkdir($content, 2770, true);
1505+
if(!@is_dir($content)) mkdir($content, 02770, true);
14851506

14861507
//* Chown the slave subdirectory to $conf['bind']['bind_user']
14871508
chown($content, $conf['bind']['bind_user']);
14881509
chgrp($content, $conf['bind']['bind_group']);
1489-
chmod($content, 2770);
1490-
1510+
chmod($content, 02770);
1511+
1512+
//* Install scripts for dnssec implementation
1513+
$this->process_bind_file('named.conf.options', '/etc/bind/', true); //TODO replace hardcoded path
14911514
}
14921515

14931516

@@ -2822,4 +2845,4 @@ protected function insert_db_credentials($tContents) {
28222845

28232846
}
28242847

2825-
?>
2848+
?>

install/sql/incremental/upd_dev_collection.sql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,5 +204,15 @@ CREATE TABLE `ftp_traffic` (
204204
ALTER TABLE `mail_forwarding` ADD COLUMN `allow_send_as` ENUM('n','y') NOT NULL DEFAULT 'n' AFTER `active`;
205205
UPDATE `mail_forwarding` SET `allow_send_as` = 'y' WHERE `type` = 'alias';
206206

207+
--- DNSSEC-Implementation by dark alex
208+
--- TODO: Review and resolve conflicts if more has been done in that column
209+
ALTER TABLE `dns_rr` CHANGE COLUMN `type` `type` ENUM('A','AAAA','ALIAS','CNAME','DS','HINFO','LOC','MX','NAPTR','NS','PTR','RP','SRV','TXT','TLSA','DNSKEY') NULL DEFAULT NULL AFTER `name`;
210+
211+
ALTER TABLE `dns_soa`
212+
ADD COLUMN `dnssec_initialized` ENUM('Y','N') NOT NULL DEFAULT 'N',
213+
ADD COLUMN `dnssec_wanted` ENUM('Y','N') NOT NULL DEFAULT 'N',
214+
ADD COLUMN `dnssec_last_signed` BIGINT NOT NULL DEFAULT '0',
215+
ADD COLUMN `dnssec_info` TEXT NULL;
216+
207217
ALTER TABLE `dns_soa` ADD COLUMN `status` enum('OK','ERROR','PENDING') NOT NULL DEFAULT 'OK' AFTER `active`;
208218
ALTER TABLE `dns_soa` ADD COLUMN `status_txt` text AFTER `status`;

install/sql/ispconfig3.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ CREATE TABLE `dns_rr` (
478478
`server_id` int(11) NOT NULL default '1',
479479
`zone` int(11) unsigned NOT NULL DEFAULT '0',
480480
`name` varchar(255) NOT NULL DEFAULT '',
481-
`type` enum('A','AAAA','ALIAS','CNAME','HINFO','MX','NAPTR','NS','PTR','RP','SRV','TXT') default NULL,
481+
`type` enum('A','AAAA','ALIAS','CNAME','DS','HINFO','LOC','MX','NAPTR','NS','PTR','RP','SRV','TXT','TLSA','DNSKEY') default NULL,
482482
`data` TEXT NOT NULL DEFAULT '',
483483
`aux` int(11) unsigned NOT NULL default '0',
484484
`ttl` int(11) unsigned NOT NULL default '3600',
@@ -541,6 +541,10 @@ CREATE TABLE `dns_soa` (
541541
`xfer` varchar(255) NOT NULL DEFAULT '',
542542
`also_notify` varchar(255) default NULL,
543543
`update_acl` varchar(255) default NULL,
544+
`dnssec_initialized` ENUM('Y','N') NOT NULL DEFAULT 'N',
545+
`dnssec_wanted` ENUM('Y','N') NOT NULL DEFAULT 'N',
546+
`dnssec_last_signed` BIGINT NOT NULL DEFAULT '0',
547+
`dnssec_info` TEXT NULL,
544548
PRIMARY KEY (`id`),
545549
UNIQUE KEY `origin` (`origin`),
546550
KEY `active` (`active`)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
options {
2+
directory "/var/cache/bind";
3+
4+
// If there is a firewall between you and nameservers you want
5+
// to talk to, you may need to fix the firewall to allow multiple
6+
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
7+
8+
// If your ISP provided one or more IP addresses for stable
9+
// nameservers, you probably want to use them as forwarders.
10+
// Uncomment the following block, and insert the addresses replacing
11+
// the all-0's placeholder.
12+
13+
// forwarders {
14+
// 0.0.0.0;
15+
// };
16+
17+
//========================================================================
18+
// If BIND logs error messages about the root key being expired,
19+
// you will need to update your keys. See https://www.isc.org/bind-keys
20+
//========================================================================
21+
dnssec-enable yes;
22+
dnssec-validation yes;
23+
dnssec-lookaside auto;
24+
25+
auth-nxdomain no; # conform to RFC1035
26+
listen-on-v6 { any; };
27+
};
28+

interface/lib/classes/tform_base.inc.php

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -974,16 +974,21 @@ function validateField($field_name, $field_value, $validators) {
974974
}
975975
}
976976
case 'ISEMAIL':
977-
if(function_exists('filter_var')) {
978-
if(filter_var($field_value, FILTER_VALIDATE_EMAIL) === false) {
979-
$errmsg = $validator['errmsg'];
980-
if(isset($this->wordbook[$errmsg])) {
981-
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
982-
} else {
983-
$this->errorMessage .= $errmsg."<br />\r\n";
977+
if($validator['allowempty'] != 'y') $validator['allowempty'] = 'n';
978+
if($validator['allowempty'] == 'y' && $field_value == '') {
979+
//* Do nothing
980+
} else {
981+
if(function_exists('filter_var')) {
982+
if(filter_var($field_value, FILTER_VALIDATE_EMAIL) === false) {
983+
$errmsg = $validator['errmsg'];
984+
if(isset($this->wordbook[$errmsg])) {
985+
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
986+
} else {
987+
$this->errorMessage .= $errmsg."<br />\r\n";
988+
}
984989
}
985-
}
986-
} else $this->errorMessage .= "function filter_var missing <br />\r\n";
990+
} else $this->errorMessage .= "function filter_var missing <br />\r\n";
991+
}
987992
break;
988993
case 'ISINT':
989994
if(function_exists('filter_var') && $field_value < 2147483647) {

interface/web/client/form/client.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@
501501
'type' => 'TOLOWER')
502502
),
503503
'validators' => array (
504-
0 => array ( 'type' => 'ISEMAIL', 'errmsg'=> 'email_error_isemail'),
504+
0 => array ( 'type' => 'ISEMAIL', 'allowempty' => 'y', 'errmsg'=> 'email_error_isemail'),
505505
),
506506
'default' => '',
507507
'value' => '',

interface/web/client/form/reseller.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@
499499
'type' => 'TOLOWER')
500500
),
501501
'validators' => array (
502-
0 => array ( 'type' => 'ISEMAIL', 'errmsg'=> 'paypal_email_error_isemail'),
502+
0 => array ( 'type' => 'ISEMAIL', 'allowempty' => 'y', 'errmsg'=> 'paypal_email_error_isemail'),
503503
),
504504
'default' => '',
505505
'value' => '',

interface/web/dns/dns_ds_edit.php

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
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+
/******************************************
32+
* Begin Form configuration
33+
******************************************/
34+
35+
$tform_def_file = "form/dns_ds.tform.php";
36+
37+
/******************************************
38+
* End Form configuration
39+
******************************************/
40+
41+
require_once '../../lib/config.inc.php';
42+
require_once '../../lib/app.inc.php';
43+
require_once './dns_edit_base.php';
44+
45+
// Loading classes
46+
class page_action extends dns_page_action {
47+
48+
}
49+
50+
$page = new page_action;
51+
$page->onLoad();
52+
53+
?>

0 commit comments

Comments
 (0)