diff --git a/dns/bind/Makefile b/dns/bind/Makefile index f128980f2..49a4e7ce2 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 1.25 +PLUGIN_VERSION= 1.26 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind918 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index 425d1c4c2..4ae5a0759 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -9,6 +9,10 @@ WWW: https://www.isc.org Plugin Changelog ================ +1.26 + +* Rename Master/Slave to Primary/Secondary (contributed by Robbert Rijkse) + 1.25 * Ensure you can only add one ACL with the same name (contributed by Robbert Rijkse) 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 f5b5678db..d840caa6b 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,26 +39,36 @@ class DomainController extends ApiMutableModelControllerBase protected static $internalModelName = 'domain'; protected static $internalModelClass = '\OPNsense\Bind\Domain'; + # These are here for backwards compatability, should be removed after a bit. public function searchMasterDomainAction() + { + return seachPrimaryDomainAction(); + } + public function searchSlaveDomainAction() + { + return seachSecondaryDomainAction(); + } + + public function searchPrimaryDomainAction() { return $this->searchBase( 'domains.domain', [ "enabled", "type", "domainname", "ttl", "refresh", "retry", "expire", "negative" ], "domainname", function ($record) { - return $record->type->getNodeData()["master"]["selected"] === 1; + return $record->type->getNodeData()["primary"]["selected"] === 1; } ); } - public function searchSlaveDomainAction() + public function searchSecondaryDomainAction() { return $this->searchBase( 'domains.domain', - [ "enabled", "type", "domainname", "masterip" ], + [ "enabled", "type", "domainname", "primaryip" ], "domainname", function ($record) { - return $record->type->getNodeData()["slave"]["selected"] === 1; + return $record->type->getNodeData()["secondary"]["selected"] === 1; } ); } @@ -69,14 +79,14 @@ class DomainController extends ApiMutableModelControllerBase return $this->getBase('domain', 'domains.domain', $uuid); } - public function addMasterDomainAction($uuid = null) + public function addPrimaryDomainAction($uuid = null) { - return $this->addBase('domain', 'domains.domain', ['type' => 'master']); + return $this->addBase('domain', 'domains.domain', ['type' => 'primary']); } - public function addSlaveDomainAction($uuid = null) + public function addSecondaryDomainAction($uuid = null) { - return $this->addBase('domain', 'domains.domain', ['type' => 'slave']); + return $this->addBase('domain', 'domains.domain', ['type' => 'secondary']); } 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 f2bdcac42..f233b57bb 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 @@ -36,8 +36,8 @@ class GeneralController extends \OPNsense\Base\IndexController $this->view->dnsblForm = $this->getForm("dnsbl"); $this->view->rndcKeyForm = $this->getForm("rndcKey"); $this->view->formDialogEditBindAcl = $this->getForm("dialogEditBindAcl"); - $this->view->formDialogEditBindMasterDomain = $this->getForm("dialogEditBindMasterDomain"); - $this->view->formDialogEditBindSlaveDomain = $this->getForm("dialogEditBindSlaveDomain"); + $this->view->formDialogEditBindPrimaryDomain = $this->getForm("dialogEditBindPrimaryDomain"); + $this->view->formDialogEditBindSecondaryDomain = $this->getForm("dialogEditBindSecondaryDomain"); $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/dialogEditBindMasterDomain.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindPrimaryDomain.xml similarity index 100% rename from dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindMasterDomain.xml rename to dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindPrimaryDomain.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/dialogEditBindSecondaryDomain.xml similarity index 85% rename from dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindSlaveDomain.xml rename to dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindSecondaryDomain.xml index 3b7ebd9b9..38c563c1d 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindSlaveDomain.xml +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindSecondaryDomain.xml @@ -24,24 +24,24 @@ Define an ACL where you allow which client are allowed to query this zone. - domain.masterip - + domain.primaryip + select_multiple true - Set the IP address of master server. + Set the IP address of primary server. domain.transferkeyalgo dropdown - Set the authentication algorithm for the TSIG key used to transfer domain data from the master server. + Set the authentication algorithm for the TSIG key used to transfer domain data from the primary server. domain.transferkeyname text - The name of the TSIG key, which must match the value on the master server. + The name of the TSIG key, which must match the value on the primary server. domain.transferkey @@ -50,11 +50,11 @@ The TSIG key used to transfer domain data from the master server in Base64 encoding. - domain.allownotifyslave + domain.allownotifysecondary select_multiple true - A list of allowed IP addresses to receive notifies from (in addition to the master server). + A list of allowed IP addresses to receive notifies from (in addition to the primary server.) diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Domain.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Domain.xml index c33f41c97..e00591dec 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Domain.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Domain.xml @@ -1,7 +1,7 @@ //OPNsense/bind/domain BIND domain configuration - 1.0.1 + 1.1.0 @@ -10,18 +10,18 @@ Y - master + primary Y - master - slave + Primary + Secondary - + N , Y - + N @@ -41,11 +41,11 @@ N - + N , Y - + Y diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Migrations/M1_1_0.php b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Migrations/M1_1_0.php new file mode 100644 index 000000000..ceda64428 --- /dev/null +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Migrations/M1_1_0.php @@ -0,0 +1,80 @@ +object(); + + # Checks to see if there is a bind config section, otherwise skips the rest of the migration + if (empty($config->OPNsense->bind)) { + return; + } + + $bindConfig = $config->OPNsense->bind; + # Loops through the domains in the config + foreach ($bindConfig->domain->domains->domain as $domain) { + $domainModel = $model->getNodeByReference('domains.domain.' . $domain->attributes()["uuid"]); + + # Migrates the domain type + if ($domain->type == "master") { + $domainModel->type->setValue("primary"); + } else { + $domainModel->type->setValue("secondary"); + } + + # Migrates the Master IP to Primary IP field + if (!empty($domain->masterip)) { + $domainModel->primaryip->setValue($domain->masterip); + } + + # Migrates the AllowNotify Slave to AllowNotify Secondary field + if (!empty($domain->allownotifyslave)) { + $domainModel->allownotifysecondary->setValue($domain->allownotifyslave); + } + } + + parent::run($model); + } + } +} + 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 cac119a12..9e8749d3b 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 @@ -33,8 +33,8 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('DNSBL') }}
  • {{ lang._('ACLs') }}
  • {{ lang._('Keys') }}
  • -
  • {{ lang._('Master Zones') }}
  • -
  • {{ lang._('Slave Zones') }}
  • +
  • {{ lang._('Primary Zones') }}
  • +
  • {{ lang._('Secondary Zones') }}
  • @@ -85,7 +85,7 @@ POSSIBILITY OF SUCH DAMAGE.

    -
    +

    {{ lang._('RNDC Key') }}

    @@ -100,11 +100,11 @@ POSSIBILITY OF SUCH DAMAGE.

    -
    +

    {{ lang._('Zones') }}

    - +
    @@ -130,11 +130,11 @@ POSSIBILITY OF SUCH DAMAGE.
    {{ lang._('Enabled') }}

    -
    +

    {{ lang._('Records') }}

    - +
    @@ -168,16 +168,16 @@ POSSIBILITY OF SUCH DAMAGE.

    -
    +

    {{ lang._('Zones') }}

    -
    {{ lang._('Enabled') }}
    +
    - + @@ -206,8 +206,8 @@ POSSIBILITY OF SUCH DAMAGE. {{ partial("layout_partials/base_dialog",['fields':formDialogEditBindAcl,'id':'dialogEditBindAcl','label':lang._('Edit ACL')])}} -{{ partial("layout_partials/base_dialog",['fields':formDialogEditBindMasterDomain,'id':'dialogEditBindMasterDomain','label':lang._('Edit Master Zone')])}} -{{ partial("layout_partials/base_dialog",['fields':formDialogEditBindSlaveDomain,'id':'dialogEditBindSlaveDomain','label':lang._('Edit Slave Zone')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogEditBindPrimaryDomain,'id':'dialogEditBindPrimaryDomain','label':lang._('Edit Primary Zone')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogEditBindSecondaryDomain,'id':'dialogEditBindSecondaryDomain','label':lang._('Edit Secondary Zone')])}} {{ partial("layout_partials/base_dialog",['fields':formDialogEditBindRecord,'id':'dialogEditBindRecord','label':lang._('Edit Record')])}}
    {{ lang._('Enabled') }} {{ lang._('Zone') }}{{ lang._('Master IPs') }}{{ lang._('Primary IPs') }} {{ lang._('ID') }} {{ lang._('Commands') }}