pmcf 4.13.0 → 4.14.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 +2 -2
- package/src/dns-utils.mjs +2 -1
- package/src/services/bind.mjs +16 -7
- package/types/services/bind.d.mts +22 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.14.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"content-entry-transform": "^1.6.1",
|
|
57
57
|
"ip-utilties": "^2.0.3",
|
|
58
58
|
"npm-pkgbuild": "^20.2.2",
|
|
59
|
-
"pacc": "^8.1.
|
|
59
|
+
"pacc": "^8.1.2",
|
|
60
60
|
"package-directory": "^8.1.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
package/src/dns-utils.mjs
CHANGED
|
@@ -20,7 +20,8 @@ export function sortZoneRecords(a, b) {
|
|
|
20
20
|
return order;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
const numSortable =
|
|
23
|
+
const numSortable = record =>
|
|
24
|
+
record.type === "PTR" && record.key.indexOf(".arpa") > 0;
|
|
24
25
|
|
|
25
26
|
if (numSortable(a) && numSortable(b)) {
|
|
26
27
|
const toNum = key => {
|
package/src/services/bind.mjs
CHANGED
|
@@ -92,7 +92,12 @@ const BindServiceTypeDefinition = {
|
|
|
92
92
|
retry: { ...string_attribute_writable, default: 72000 },
|
|
93
93
|
expire: { ...string_attribute_writable, default: 600000 },
|
|
94
94
|
minimum: { ...string_attribute_writable, default: 60000 },
|
|
95
|
-
allowedUpdates: string_collection_attribute_writable
|
|
95
|
+
allowedUpdates: string_collection_attribute_writable,
|
|
96
|
+
primaries: {
|
|
97
|
+
...default_attribute_writable,
|
|
98
|
+
type: networkAddressType,
|
|
99
|
+
collection: true
|
|
100
|
+
}
|
|
96
101
|
},
|
|
97
102
|
service: {
|
|
98
103
|
systemdService: "bind.service",
|
|
@@ -182,6 +187,11 @@ export class BindService extends ExtraSourceService {
|
|
|
182
187
|
return BindServiceTypeDefinition.name;
|
|
183
188
|
}
|
|
184
189
|
|
|
190
|
+
get serverType()
|
|
191
|
+
{
|
|
192
|
+
return this.primaries ? "secondary" : "primary";
|
|
193
|
+
}
|
|
194
|
+
|
|
185
195
|
get soaUpdates() {
|
|
186
196
|
return [this.serial, this.refresh, this.retry, this.expire, this.minimum];
|
|
187
197
|
}
|
|
@@ -375,7 +385,7 @@ export class BindService extends ExtraSourceService {
|
|
|
375
385
|
const config = {
|
|
376
386
|
view,
|
|
377
387
|
name: `${domain}.zone.conf`,
|
|
378
|
-
type:
|
|
388
|
+
type: this.serverType,
|
|
379
389
|
zones: []
|
|
380
390
|
};
|
|
381
391
|
outputControl.configs.push(config);
|
|
@@ -431,7 +441,6 @@ export class BindService extends ExtraSourceService {
|
|
|
431
441
|
reverseZone = {
|
|
432
442
|
id,
|
|
433
443
|
config,
|
|
434
|
-
type: "plain",
|
|
435
444
|
file: `${locationName}/${id}.zone`,
|
|
436
445
|
records: new Set(this.defaultRecords)
|
|
437
446
|
};
|
|
@@ -518,7 +527,7 @@ export class BindService extends ExtraSourceService {
|
|
|
518
527
|
const config = {
|
|
519
528
|
view,
|
|
520
529
|
name: `${domain}.zone.conf`,
|
|
521
|
-
type:
|
|
530
|
+
type: this.serverType,
|
|
522
531
|
zones: [zone]
|
|
523
532
|
};
|
|
524
533
|
zone.config = config;
|
|
@@ -565,14 +574,14 @@ export class BindService extends ExtraSourceService {
|
|
|
565
574
|
file: `${directory}/catalog.${name}.zone`,
|
|
566
575
|
records: new Set([
|
|
567
576
|
...this.defaultRecords,
|
|
568
|
-
DNSRecord(
|
|
577
|
+
DNSRecord("version", "TXT", '"2"')
|
|
569
578
|
])
|
|
570
579
|
};
|
|
571
580
|
outputControl.catalogs.set(directory, catalogZone);
|
|
572
581
|
const config = {
|
|
573
582
|
view: zone.config.view,
|
|
574
583
|
name: `catalog.${name}.zone.conf`,
|
|
575
|
-
type:
|
|
584
|
+
type: this.serverType,
|
|
576
585
|
zones: [catalogZone]
|
|
577
586
|
};
|
|
578
587
|
catalogZone.config = config;
|
|
@@ -582,7 +591,7 @@ export class BindService extends ExtraSourceService {
|
|
|
582
591
|
|
|
583
592
|
const hash = createHmac("sha1", zone.id).digest("hex");
|
|
584
593
|
catalogZone.records.add(
|
|
585
|
-
|
|
594
|
+
DNSRecord(`${hash}.zones`, "PTR", dnsFullName(zone.id))
|
|
586
595
|
);
|
|
587
596
|
|
|
588
597
|
return catalogZone;
|
|
@@ -1421,6 +1421,27 @@ export class BindService extends ExtraSourceService {
|
|
|
1421
1421
|
additionalValues?: object;
|
|
1422
1422
|
};
|
|
1423
1423
|
allowedUpdates: import("pacc").AttributeDefinition;
|
|
1424
|
+
primaries: {
|
|
1425
|
+
type: string;
|
|
1426
|
+
collection: boolean;
|
|
1427
|
+
isKey: boolean;
|
|
1428
|
+
writable: boolean;
|
|
1429
|
+
mandatory: boolean;
|
|
1430
|
+
private?: boolean;
|
|
1431
|
+
credential?: boolean;
|
|
1432
|
+
persistent?: boolean;
|
|
1433
|
+
depends?: string;
|
|
1434
|
+
description?: string;
|
|
1435
|
+
default?: any;
|
|
1436
|
+
set?: Function;
|
|
1437
|
+
get?: Function;
|
|
1438
|
+
toInternal?: Function;
|
|
1439
|
+
toExternal?: Function;
|
|
1440
|
+
values?: Set<any>;
|
|
1441
|
+
externalName?: string;
|
|
1442
|
+
env?: string[] | string;
|
|
1443
|
+
additionalValues?: object;
|
|
1444
|
+
};
|
|
1424
1445
|
};
|
|
1425
1446
|
service: {
|
|
1426
1447
|
systemdService: string;
|
|
@@ -1465,6 +1486,7 @@ export class BindService extends ExtraSourceService {
|
|
|
1465
1486
|
expire: number;
|
|
1466
1487
|
minimum: number;
|
|
1467
1488
|
views: {};
|
|
1489
|
+
get serverType(): "secondary" | "primary";
|
|
1468
1490
|
get soaUpdates(): number[];
|
|
1469
1491
|
set zones(value: any[]);
|
|
1470
1492
|
get zones(): any[];
|