pmcf 6.31.3 → 6.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/services/bind.mjs +30 -4
package/package.json
CHANGED
package/src/services/bind.mjs
CHANGED
|
@@ -43,8 +43,6 @@ import { addHook } from "../hooks.mjs";
|
|
|
43
43
|
import { owner_attribute } from "../common-attributes.mjs";
|
|
44
44
|
import { NetworkAddress } from "../network-address.mjs";
|
|
45
45
|
|
|
46
|
-
const bindNetworkAddressTypes = networkAddressType + "|bind_group";
|
|
47
|
-
|
|
48
46
|
class bind_zone extends Base {
|
|
49
47
|
static priority = 1;
|
|
50
48
|
static key = "id";
|
|
@@ -63,6 +61,14 @@ class bind_zone extends Base {
|
|
|
63
61
|
addType(this);
|
|
64
62
|
}
|
|
65
63
|
|
|
64
|
+
get service() {
|
|
65
|
+
return this.owner.service;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
get type() {
|
|
69
|
+
return this.service.serverType;
|
|
70
|
+
}
|
|
71
|
+
|
|
66
72
|
get isCatalog() {
|
|
67
73
|
return false;
|
|
68
74
|
}
|
|
@@ -80,6 +86,11 @@ class bind_zone extends Base {
|
|
|
80
86
|
}
|
|
81
87
|
|
|
82
88
|
get file() {
|
|
89
|
+
const fileType = this.type === "master" ? "zone" : "raw";
|
|
90
|
+
return `${this.directory}/${this.domain}.${fileType}`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
get textFile() {
|
|
83
94
|
return `${this.directory}/${this.domain}.zone`;
|
|
84
95
|
}
|
|
85
96
|
|
|
@@ -209,7 +220,7 @@ class bind_zone_config extends Base {
|
|
|
209
220
|
|
|
210
221
|
await writeLines(
|
|
211
222
|
join(dir, "var/lib/named"),
|
|
212
|
-
zone.
|
|
223
|
+
zone.textFile,
|
|
213
224
|
[...zone.records]
|
|
214
225
|
.sort(sortZoneRecords)
|
|
215
226
|
.map(r => r.toString(maxKeyLength, group.recordTTL))
|
|
@@ -684,6 +695,10 @@ export class bind extends CoreService {
|
|
|
684
695
|
type: networkAddressType,
|
|
685
696
|
deferredExpression: true
|
|
686
697
|
},
|
|
698
|
+
serverType: {
|
|
699
|
+
...string_attribute_writable,
|
|
700
|
+
name: "serverType"
|
|
701
|
+
},
|
|
687
702
|
keys: {
|
|
688
703
|
...default_collection_attribute_writable,
|
|
689
704
|
name: "keys",
|
|
@@ -751,8 +766,19 @@ export class bind extends CoreService {
|
|
|
751
766
|
acls = new Map();
|
|
752
767
|
groups = new Map();
|
|
753
768
|
|
|
769
|
+
set serverType(value) {
|
|
770
|
+
//console.log("SET SERVERTYPE", this.fullName, value);
|
|
771
|
+
this._serverType = value;
|
|
772
|
+
}
|
|
773
|
+
|
|
754
774
|
get serverType() {
|
|
755
|
-
|
|
775
|
+
/*console.log(
|
|
776
|
+
"GET SERVERTYPE",
|
|
777
|
+
this.fullName,
|
|
778
|
+
this._serverType ?? (this.primaries ? "secondary" : "primary")
|
|
779
|
+
);*/
|
|
780
|
+
|
|
781
|
+
return this._serverType ?? (this.primaries ? "secondary" : "primary");
|
|
756
782
|
}
|
|
757
783
|
|
|
758
784
|
async writeForwarders(outputControl) {
|