Skip to content

Commit

Permalink
Adding support for PowerDNS-Replication (#974)
Browse files Browse the repository at this point in the history
Adding support for powerdns-replication
  • Loading branch information
ndum authored Aug 19, 2021
1 parent f1887aa commit 67351ec
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 11 deletions.
13 changes: 13 additions & 0 deletions actions/admin/settings/160.nameserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@
'default' => '',
'save_method' => 'storeSettingField'
),
'system_powerdns_mode' => array(
'label' => $lng['serversettings']['powerdns_mode'],
'settinggroup' => 'system',
'varname' => 'powerdns_mode',
'type' => 'option',
'default' => 'Native',
'option_mode' => 'one',
'option_options' => array(
'Native' => 'Native',
'Master' => 'Master'
),
'save_method' => 'storeSettingField'
),
'system_dns_createmailentry' => array(
'label' => $lng['serversettings']['mail_also_with_mxservers'],
'settinggroup' => 'system',
Expand Down
3 changes: 2 additions & 1 deletion install/froxlor.sql
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ opcache.interned_strings_buffer'),
('system', 'documentroot_use_default_value', '0'),
('system', 'passwordcryptfunc', '3'),
('system', 'axfrservers', ''),
('system', 'powerdns_mode', 'Native'),
('system', 'customer_ssl_path', '/etc/ssl/froxlor-custom/'),
('system', 'allow_error_report_admin', '1'),
('system', 'allow_error_report_customer', '0'),
Expand Down Expand Up @@ -722,7 +723,7 @@ opcache.interned_strings_buffer'),
('panel', 'logo_overridetheme', '0'),
('panel', 'logo_overridecustom', '0'),
('panel', 'version', '0.10.27'),
('panel', 'db_version', '202107300');
('panel', 'db_version', '202108180');


DROP TABLE IF EXISTS `panel_tasks`;
Expand Down
7 changes: 7 additions & 0 deletions install/updates/froxlor/0.10/update_0.10.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -914,3 +914,10 @@
lastStepStatus(0);
\Froxlor\Froxlor::updateToDbVersion('202107300');
}

if (\Froxlor\Froxlor::isDatabaseVersion('202107300')) {
showUpdateStep("Adds the possibility to select the PowerDNS Operation Mode", true);
Settings::AddNew("system.powerdns_mode", 'Native');
lastStepStatus(0);
\Froxlor\Froxlor::updateToDbVersion('202108180');
}
21 changes: 12 additions & 9 deletions lib/Froxlor/Cron/Dns/PowerDNS.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
namespace Froxlor\Cron\Dns;

use Froxlor\Settings;

/**
* This file is part of the Froxlor project.
* Copyright (c) 2016 the Froxlor Team (see authors).
Expand All @@ -13,7 +15,7 @@
* @author Froxlor team <[email protected]> (2016-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Cron
*
*
*/
class PowerDNS extends DnsBase
{
Expand Down Expand Up @@ -111,15 +113,16 @@ private function clearZoneTables($domains = null)

private function insertZone($domainname, $serial = 0)
{
$ins_stmt = \Froxlor\Dns\PowerDNS::getDB()->prepare("
INSERT INTO domains set `name` = :domainname, `notified_serial` = :serial, `type` = 'NATIVE'
$ins_stmt = \Froxlor\Dns\PowerDNS::getDB()->prepare("
INSERT INTO domains set `name` = :domainname, `notified_serial` = :serial, `type` = :type
");
$ins_stmt->execute(array(
'domainname' => $domainname,
'serial' => $serial
));
$lastid = \Froxlor\Dns\PowerDNS::getDB()->lastInsertId();
return $lastid;
$ins_stmt->execute(array(
'domainname' => $domainname,
'serial' => $serial,
'type' => strtoupper(Settings::Get('system.powerdns_mode'))
));
$lastid = \Froxlor\Dns\PowerDNS::getDB()->lastInsertId();
return $lastid;;
}

private function insertRecords($domainid = 0, $records = array(), $origin = "")
Expand Down
2 changes: 1 addition & 1 deletion lib/Froxlor/Froxlor.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class Froxlor
const VERSION = '0.10.27';

// Database version (YYYYMMDDC where C is a daily counter)
const DBVERSION = '202107300';
const DBVERSION = '202108180';

// Distribution branding-tag (used for Debian etc.)
const BRANDING = '';
Expand Down
2 changes: 2 additions & 0 deletions lng/english.lng.php
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,8 @@
$lng['serversettings']['panel_allow_theme_change_customer'] = 'Allow customers to change the theme';
$lng['serversettings']['axfrservers']['title'] = 'AXFR servers';
$lng['serversettings']['axfrservers']['description'] = 'A comma separated list of IP addresses allowed to transfer (AXFR) dns zones.';
$lng['serversettings']['powerdns_mode']['title'] = 'PowerDNS Operation Mode';
$lng['serversettings']['powerdns_mode']['description'] = 'Select the PoweDNS mode: Native for no replication (Default) / Master if DNS replication is needed.';
$lng['panel']['ssleditor'] = 'SSL settings for this domain';
$lng['admin']['ipsandports']['ssl_paste_description'] = 'Paste your complete certificate content in the textbox';
$lng['admin']['ipsandports']['ssl_cert_file_content'] = 'Content of the ssl certificate';
Expand Down
2 changes: 2 additions & 0 deletions lng/german.lng.php
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,8 @@
$lng['serversettings']['panel_allow_theme_change_customer'] = 'Erlaube Kunden das Theme zu wechseln';
$lng['serversettings']['axfrservers']['title'] = 'AXFR Server';
$lng['serversettings']['axfrservers']['description'] = 'Eine durch Kommas getrennte Liste von IP Adressen, die DNS-Zonen transferieren dürfen (AXFR).';
$lng['serversettings']['powerdns_mode']['title'] = 'PowerDNS Operation Mode';
$lng['serversettings']['powerdns_mode']['description'] = 'Wählen Sie den PowerDNS-Modus: Native für keine DNS-Replikation (Standard) / Master wenn eine DNS-Replikation benötigt wird.';
$lng['panel']['ssleditor'] = 'SSL-Einstellungen für diese Domain';
$lng['admin']['ipsandports']['ssl_paste_description'] = 'Bitte den Inhalt der Zertifikatsdatei in das Textfeld kopieren.';
$lng['admin']['ipsandports']['ssl_cert_file_content'] = 'Inhalt des SSL-Zertifikats (Certificate)';
Expand Down

0 comments on commit 67351ec

Please sign in to comment.