From 63d787c79c9a728fbe9dcaa1472d4bbd30b7b60c Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Thu, 8 May 2014 00:50:31 +0200 Subject: [PATCH] ajout de dnsslavekey --- app/app.pm | 2 +- app/zone/nsdc_interface.pm | 8 ++++---- www/conf/config.ini | 2 ++ www/lib/DNSManager.pm | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/app.pm b/app/app.pm index 4ddff96..27138c9 100644 --- a/app/app.pm +++ b/app/app.pm @@ -18,7 +18,7 @@ has dbh => ( is => 'rw', builder => '_void'); has dnsi => ( is => 'rw', builder => '_void'); has dnsisec => ( is => 'rw', builder => '_void'); has um => ( is => 'rw', builder => '_void'); -has [ qw/zdir dbname dbhost dbport dbuser dbpass sgbd dnsapp dnsappsec sshhost sshhostsec sshuser sshusersec sshport sshportsec nsmasterv4 nsmasterv6/ ] => qw/is ro required 1/; +has [ qw/zdir dbname dbhost dbport dbuser dbpass sgbd dnsapp dnsappsec sshhost sshhostsec sshuser sshusersec sshport sshportsec nsmasterv4 nsmasterv6 dnsslavekey/ ] => qw/is ro required 1/; sub _void { my $x = ''; \$x; } ### users diff --git a/app/zone/nsdc_interface.pm b/app/zone/nsdc_interface.pm index d56f42f..55f25db 100644 --- a/app/zone/nsdc_interface.pm +++ b/app/zone/nsdc_interface.pm @@ -38,12 +38,12 @@ sub addzone_sec { # allow notify & request xfr, v4 & v6 $nouveau .= - "\tallow-notify: " . $self->data->nsmasterv4. "\n" - . "\trequest-xfr: " . $self->data->nsmasterv4 . "\n"; + "\tallow-notify: " . $self->data->nsmasterv4 . ' ' . $self->data->dnsslavekey . "\n" + . "\trequest-xfr: " . $self->data->nsmasterv4 . ' ' . $self->data->dnsslavekey . "\n"; $nouveau .= - "\tallow-notify: " . $self->data->nsmasterv6. "\n" - . "\trequest-xfr: " . $self->data->nsmasterv6 . "\n\n"; + "\tallow-notify: " . $self->data->nsmasterv6. ' ' . $self->data->dnsslavekey . "\n" + . "\trequest-xfr: " . $self->data->nsmasterv6. ' ' . $self->data->dnsslavekey . "\n\n"; } $data =~ s/$debut.*/$debut\n$nouveau/gsm; diff --git a/www/conf/config.ini b/www/conf/config.ini index 607b6de..38324f2 100644 --- a/www/conf/config.ini +++ b/www/conf/config.ini @@ -21,6 +21,8 @@ dnsapp = rndc dnsappsec = knot zones_path = "/var/named/rndczones/" +dnssalvekey = key-alsace.tetaneutral.net + # to access zones on the server sshhost = host sshuser = dnsmanager diff --git a/www/lib/DNSManager.pm b/www/lib/DNSManager.pm index 27acfb1..20bb22e 100755 --- a/www/lib/DNSManager.pm +++ b/www/lib/DNSManager.pm @@ -47,6 +47,7 @@ sub initco { , sshusersec => $cfg->param('sshusersec') , sshport => $cfg->param('sshport') , sshportsec => $cfg->param('sshportsec') + , dnsslavekey => $cfg->param('dnsslavekey') , dnsapp => $cfg->param('dnsapp') , dnsappsec => $cfg->param('dnsappsec') );