pmcf 1.21.0 → 1.21.2
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/bin/pmcf-location-defs +18 -5
- package/package.json +1 -1
- package/src/dns.mjs +4 -0
- package/src/model.mjs +2 -2
- package/types/dns.d.mts +1 -0
package/bin/pmcf-location-defs
CHANGED
|
@@ -21,16 +21,29 @@ console.log("replaces", `mf-location-${location.name}`);
|
|
|
21
21
|
console.log("description", `location definitions for ${location.name}`);
|
|
22
22
|
|
|
23
23
|
async function generateLocationDefs(location, dir) {
|
|
24
|
-
const
|
|
25
|
-
const
|
|
24
|
+
const dns = location.dns;
|
|
25
|
+
const dnsServices = (await Array.fromAsync(dns.services())).sort(
|
|
26
|
+
(a, b) => a.priority - b.priority
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
console.log(dnsServices);
|
|
30
|
+
|
|
31
|
+
const master = dnsServices
|
|
32
|
+
.filter(s => s.priority < 10)
|
|
33
|
+
.map(s => s.ipAddresses)
|
|
34
|
+
.flat();
|
|
35
|
+
const fallback = dnsServices
|
|
36
|
+
.filter(s => s.priority >= 10)
|
|
37
|
+
.map(s => s.ipAddresses)
|
|
38
|
+
.flat();
|
|
26
39
|
|
|
27
40
|
await writeLines(
|
|
28
41
|
join(dir, "etc/systemd/resolved.conf.d"),
|
|
29
42
|
`${location.name}.conf`,
|
|
30
43
|
sectionLines("Resolve", {
|
|
31
|
-
DNS:
|
|
32
|
-
FallbackDNS:
|
|
33
|
-
Domains:
|
|
44
|
+
DNS: master.join(" "),
|
|
45
|
+
FallbackDNS: fallback.join(" "),
|
|
46
|
+
Domains: dns.domains.join(" "),
|
|
34
47
|
DNSSEC: "no",
|
|
35
48
|
MulticastDNS: "yes",
|
|
36
49
|
LLMNR: "no"
|
package/package.json
CHANGED
package/src/dns.mjs
CHANGED
package/src/model.mjs
CHANGED
|
@@ -865,7 +865,7 @@ export class Service extends Base {
|
|
|
865
865
|
|
|
866
866
|
Object.assign(this, data);
|
|
867
867
|
|
|
868
|
-
|
|
868
|
+
// this.owner = owner;
|
|
869
869
|
|
|
870
870
|
owner.addService(this);
|
|
871
871
|
}
|
|
@@ -914,7 +914,7 @@ export class Service extends Base {
|
|
|
914
914
|
}
|
|
915
915
|
|
|
916
916
|
get priority() {
|
|
917
|
-
return
|
|
917
|
+
return this.#priority || this.owner.priority || 99;
|
|
918
918
|
}
|
|
919
919
|
|
|
920
920
|
get weight() {
|