pmcf 2.24.1 → 2.24.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/package.json
CHANGED
package/src/dns-utils.mjs
CHANGED
|
@@ -5,6 +5,13 @@ export function dnsFullName(name) {
|
|
|
5
5
|
return name.endsWith(".") ? name : name + ".";
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
export function dnsRecordTypeForAddressFamily(family) {
|
|
9
|
+
switch(family) {
|
|
10
|
+
case 'IPv4': return "A";
|
|
11
|
+
case 'IPv6': return "AAAA";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
8
15
|
export function DNSRecord(key, type, ...values) {
|
|
9
16
|
let pad = "";
|
|
10
17
|
|
package/src/services/dns.mjs
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { createHmac } from "node:crypto";
|
|
3
3
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
4
|
-
import {
|
|
4
|
+
import { isLinkLocal, reverseArpa } from "ip-utilties";
|
|
5
5
|
import { writeLines } from "../utils.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
DNSRecord,
|
|
8
|
+
dnsFullName,
|
|
9
|
+
dnsRecordTypeForAddressFamily
|
|
10
|
+
} from "../dns-utils.mjs";
|
|
7
11
|
import { addType } from "../types.mjs";
|
|
8
12
|
import { ServiceTypeDefinition, serviceAddresses } from "../service.mjs";
|
|
9
13
|
import {
|
|
@@ -299,7 +303,7 @@ async function generateZoneDefs(dns, location, packageData) {
|
|
|
299
303
|
na => na.networkInterface.kind != "loopback"
|
|
300
304
|
)) {
|
|
301
305
|
zone.records.add(
|
|
302
|
-
DNSRecord("@", na.family
|
|
306
|
+
DNSRecord("@", dnsRecordTypeForAddressFamily(na.family), na.address)
|
|
303
307
|
);
|
|
304
308
|
}
|
|
305
309
|
}
|
|
@@ -364,7 +368,8 @@ async function generateZoneDefs(dns, location, packageData) {
|
|
|
364
368
|
address,
|
|
365
369
|
subnet,
|
|
366
370
|
networkInterface,
|
|
367
|
-
domainNames
|
|
371
|
+
domainNames,
|
|
372
|
+
family
|
|
368
373
|
} of location.networkAddresses()) {
|
|
369
374
|
if (
|
|
370
375
|
!dns.exclude.has(networkInterface.network) &&
|
|
@@ -381,7 +386,7 @@ async function generateZoneDefs(dns, location, packageData) {
|
|
|
381
386
|
zone.records.add(
|
|
382
387
|
DNSRecord(
|
|
383
388
|
dnsFullName(domainName),
|
|
384
|
-
|
|
389
|
+
dnsRecordTypeForAddressFamily(family),
|
|
385
390
|
address
|
|
386
391
|
)
|
|
387
392
|
);
|
package/types/dns-utils.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ export class NetworkAddress {
|
|
|
10
10
|
/** @type {Subnet} */ subnet: Subnet;
|
|
11
11
|
/** @type {NetworkInterface} */ networkInterface: NetworkInterface;
|
|
12
12
|
/** @type {string|Uint8Array|Uint16Array} */ address: string | Uint8Array | Uint16Array;
|
|
13
|
-
get domainNames():
|
|
13
|
+
get domainNames(): any;
|
|
14
14
|
get family(): any;
|
|
15
15
|
get cidrAddress(): any;
|
|
16
16
|
}
|