diff --git a/dns/bind/Makefile b/dns/bind/Makefile index 292e24d28..4631ccc03 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 1.23 +PLUGIN_VERSION= 1.24 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind916 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index c9e9d6e90..57a8283f3 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -9,6 +9,10 @@ WWW: https://www.isc.org Plugin Changelog ================ +1.24 + +* Separate tables for master and slave zones in UI (contributed by Patrick M. Hausen and Manuel Faux) + 1.23 * Avoid errors with repeated primary servers and keys (contributed by Michael Newton) diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/DomainController.php b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/DomainController.php index df278dc53..7dc5ef6b1 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/DomainController.php +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/DomainController.php @@ -39,12 +39,20 @@ class DomainController extends ApiMutableModelControllerBase protected static $internalModelName = 'domain'; protected static $internalModelClass = '\OPNsense\Bind\Domain'; - public function searchDomainAction() + public function searchMasterDomainAction() { - return $this->searchBase('domains.domain', array( - "enabled", "type", "masterip", "domainname", "allowtransfer", "allowquery", "ttl", - "refresh", "retry", "expire", "negative", "mailadmin", "dnsserver" - )); + return $this->searchBase('domains.domain', + [ "enabled", "type", "domainname", "ttl", "refresh", "retry", "expire", "negative" ], + "domainname", function($record){return $record->type->getNodeData()["master"]["selected"] === 1;} + ); + } + + public function searchSlaveDomainAction() + { + return $this->searchBase('domains.domain', + [ "enabled", "type", "domainname", "masterip" ], + "domainname", function($record){return $record->type->getNodeData()["slave"]["selected"] === 1;} + ); } public function getDomainAction($uuid = null) @@ -53,9 +61,14 @@ class DomainController extends ApiMutableModelControllerBase return $this->getBase('domain', 'domains.domain', $uuid); } - public function addDomainAction($uuid = null) + public function addMasterDomainAction($uuid = null) { - return $this->addBase('domain', 'domains.domain'); + return $this->addBase('domain', 'domains.domain', ['type' => 'master']); + } + + public function addSlaveDomainAction($uuid = null) + { + return $this->addBase('domain', 'domains.domain', ['type' => 'slave']); } public function delDomainAction($uuid) diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/GeneralController.php b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/GeneralController.php index 3f0b046b8..132322f19 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/GeneralController.php +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/GeneralController.php @@ -35,7 +35,8 @@ class GeneralController extends \OPNsense\Base\IndexController $this->view->generalForm = $this->getForm("general"); $this->view->dnsblForm = $this->getForm("dnsbl"); $this->view->formDialogEditBindAcl = $this->getForm("dialogEditBindAcl"); - $this->view->formDialogEditBindDomain = $this->getForm("dialogEditBindDomain"); + $this->view->formDialogEditBindMasterDomain = $this->getForm("dialogEditBindMasterDomain"); + $this->view->formDialogEditBindSlaveDomain = $this->getForm("dialogEditBindSlaveDomain"); $this->view->formDialogEditBindRecord = $this->getForm("dialogEditBindRecord"); $this->view->pick('OPNsense/Bind/general'); } diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindMasterDomain.xml similarity index 100% rename from dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml rename to dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindMasterDomain.xml diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindSlaveDomain.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindSlaveDomain.xml new file mode 100644 index 000000000..52eac8fcb --- /dev/null +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindSlaveDomain.xml @@ -0,0 +1,54 @@ +
+ + domain.enabled + + checkbox + This will enable or disable this zone. + + + domain.domainname + + text + Set the name for this zone. Both forward and reverse zones may be specified, i.e. example.com or 0.168.192.in-addr.arpa. + + + domain.allowtransfer + + dropdown + Define an ACL where you allow which server can retrieve this zone. + + + domain.allowquery + + dropdown + Define an ACL where you allow which client are allowed to query this zone. + + + domain.masterip + + + select_multiple + true + Set the IP address of master server when using slave mode. + + + domain.transferkeyalgo + + dropdown + Set the authentication algorithm for the TSIG key. + + + domain.transferkey + + text + The TSIG key used to transfer domain data from the master server. + + + domain.allownotifyslave + + + select_multiple + true + A list of allowed IP addresses to receive notifies from. + +
diff --git a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt index 13e9fb12a..3eb6b8f0c 100644 --- a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt +++ b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt @@ -32,7 +32,8 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('General') }}
  • {{ lang._('DNSBL') }}
  • {{ lang._('ACLs') }}
  • -
  • {{ lang._('Zones') }}
  • +
  • {{ lang._('Master Zones') }}
  • +
  • {{ lang._('Slave Zones') }}
  • @@ -83,11 +84,11 @@ POSSIBILITY OF SUCH DAMAGE.

    -
    -