pmcf 6.31.2 → 6.31.4
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 +34 -7
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))
|
|
@@ -235,8 +246,19 @@ export class bind_key extends Base {
|
|
|
235
246
|
addType(this);
|
|
236
247
|
}
|
|
237
248
|
|
|
238
|
-
|
|
239
|
-
|
|
249
|
+
async packageContent(outputControl) {
|
|
250
|
+
await writeLines(
|
|
251
|
+
join(outputControl.dir, "etc/named/keys"),
|
|
252
|
+
`${this.name}.conf`,
|
|
253
|
+
[
|
|
254
|
+
`key "${this.name}" {`,
|
|
255
|
+
` algorithm ${this.algorithm};`,
|
|
256
|
+
` secret "${this.secret}";`,
|
|
257
|
+
"};"
|
|
258
|
+
]
|
|
259
|
+
);
|
|
260
|
+
|
|
261
|
+
return true;
|
|
240
262
|
}
|
|
241
263
|
}
|
|
242
264
|
|
|
@@ -781,9 +803,14 @@ export class bind extends CoreService {
|
|
|
781
803
|
|
|
782
804
|
const outputControl = { packageData, dir, permissions };
|
|
783
805
|
|
|
806
|
+
for (const key of this.keys.values()) {
|
|
807
|
+
await key.packageContent(outputControl);
|
|
808
|
+
hasContent = true;
|
|
809
|
+
}
|
|
810
|
+
|
|
784
811
|
for (const acl of this.acls.values()) {
|
|
785
|
-
|
|
786
|
-
hasContent
|
|
812
|
+
await acl.packageContent(outputControl);
|
|
813
|
+
hasContent = true;
|
|
787
814
|
}
|
|
788
815
|
|
|
789
816
|
for (const group of this.groups.values()) {
|