pmcf 6.35.3 → 6.36.1
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/services/bind.mjs +22 -7
- package/src/subnet.mjs +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.36.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"aggregated-map": "^1.0.10",
|
|
54
54
|
"content-entry-transform": "^1.7.1",
|
|
55
55
|
"ip-utilties": "^3.13.0",
|
|
56
|
-
"npm-pkgbuild": "^20.9.
|
|
56
|
+
"npm-pkgbuild": "^20.9.2",
|
|
57
57
|
"pacc": "^11.5.1",
|
|
58
58
|
"package-directory": "^8.2.0",
|
|
59
59
|
"yaml": "^2.9.0"
|
package/src/services/bind.mjs
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
addType,
|
|
29
29
|
FAMILY_IPV4_IPV6
|
|
30
30
|
} from "pmcf";
|
|
31
|
-
import { yesno, writeLines
|
|
31
|
+
import { yesno, writeLines } from "../utils.mjs";
|
|
32
32
|
import {
|
|
33
33
|
DNSRecord,
|
|
34
34
|
dnsFullName,
|
|
@@ -486,6 +486,7 @@ class bind_view extends bind_object {
|
|
|
486
486
|
this._zoneConfigs = new Map();
|
|
487
487
|
this._zones = new Map();
|
|
488
488
|
|
|
489
|
+
const subnets = new Set();
|
|
489
490
|
const hosts = new Set();
|
|
490
491
|
const addresses = new Set();
|
|
491
492
|
|
|
@@ -511,17 +512,31 @@ class bind_view extends bind_object {
|
|
|
511
512
|
)
|
|
512
513
|
);
|
|
513
514
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
515
|
+
let reverseZone;
|
|
516
|
+
|
|
517
|
+
if (this.hasReverse && na.subnet.prefix) {
|
|
518
|
+
let subnet;
|
|
519
|
+
|
|
520
|
+
for (const s of subnets) {
|
|
521
|
+
if (s.isIncluded(na.subnet)) {
|
|
522
|
+
subnet = s;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
if (!subnet) {
|
|
527
|
+
subnet = na.subnet;
|
|
528
|
+
subnets.add(subnet);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
reverseZone = this._zones.getOrInsertComputed(
|
|
532
|
+
reverseArpa(subnet.prefix),
|
|
519
533
|
domain =>
|
|
520
534
|
this.intoCatalog(
|
|
521
535
|
new bind_zone(this, domain, config, locationName),
|
|
522
536
|
locationName
|
|
523
537
|
)
|
|
524
538
|
);
|
|
539
|
+
}
|
|
525
540
|
|
|
526
541
|
if (!hosts.has(host)) {
|
|
527
542
|
hosts.add(host);
|
|
@@ -801,7 +816,7 @@ export class bind extends CoreService {
|
|
|
801
816
|
attr.properties = {
|
|
802
817
|
"usr/share/libalpm/scripts/*": { mode: "0777" },
|
|
803
818
|
"etc/named/**/*": { user: "named", group: "named" },
|
|
804
|
-
"var/lib/named": { user: "named", group: "named" }
|
|
819
|
+
"var/lib/named/**/*": { user: "named", group: "named" }
|
|
805
820
|
};
|
|
806
821
|
|
|
807
822
|
console.log("templateContentAttributes", this.fullName, attr);
|
package/src/subnet.mjs
CHANGED
|
@@ -77,6 +77,10 @@ export class Subnet {
|
|
|
77
77
|
return this.address;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
isIncluded(subnet) {
|
|
81
|
+
return matchPrefixIP(this.address, this.prefixLength, subnet.address);
|
|
82
|
+
}
|
|
83
|
+
|
|
80
84
|
matchesAddress(address) {
|
|
81
85
|
return matchPrefixIP(this.address, this.prefixLength, address);
|
|
82
86
|
}
|