pmcf 2.64.2 → 2.64.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
CHANGED
|
@@ -17,6 +17,8 @@ const _localAddresses = new Map([
|
|
|
17
17
|
["::1", SUBNET_LOCALHOST_IPV6]
|
|
18
18
|
]);
|
|
19
19
|
|
|
20
|
+
const _localDomains = new Set(["localhost"]);
|
|
21
|
+
|
|
20
22
|
export class LoopbackNetworkInterface extends SkeletonNetworkInterface {
|
|
21
23
|
static {
|
|
22
24
|
addType(this);
|
|
@@ -40,7 +42,11 @@ export class LoopbackNetworkInterface extends SkeletonNetworkInterface {
|
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
get localDomains() {
|
|
43
|
-
return
|
|
45
|
+
return _localDomains;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
get domainNames() {
|
|
49
|
+
return _localDomains;
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
get hostName() {
|
package/src/services/bind.mjs
CHANGED
|
@@ -232,8 +232,8 @@ export class BindService extends ExtraSourceService {
|
|
|
232
232
|
async *preparePackages(dir) {
|
|
233
233
|
const sources = this.addresses.length ? this.addresses : [this.owner];
|
|
234
234
|
const names = sources.map(a => a.fullName).join(" ");
|
|
235
|
+
const name = this.owner.owner.name || this.owner.name;
|
|
235
236
|
|
|
236
|
-
const name = this.owner.owner.name;
|
|
237
237
|
const configPackageDir = join(dir, "config") + "/";
|
|
238
238
|
const packageData = {
|
|
239
239
|
dir: configPackageDir,
|
|
@@ -442,78 +442,69 @@ export class BindService extends ExtraSourceService {
|
|
|
442
442
|
!this.exclude.has(networkInterface.network) &&
|
|
443
443
|
!this.excludeInterfaceKinds.has(networkInterface.kind)
|
|
444
444
|
) {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
let reverseZone = reverseZones.get(subnet.address);
|
|
464
|
-
|
|
465
|
-
if (!reverseZone) {
|
|
466
|
-
const id = reverseArpa(subnet.prefix);
|
|
467
|
-
reverseZone = {
|
|
468
|
-
id,
|
|
469
|
-
type: "plain",
|
|
470
|
-
file: `${locationName}/${id}.zone`,
|
|
471
|
-
records: new Set(this.defaultRecords)
|
|
472
|
-
};
|
|
473
|
-
config.zones.push(reverseZone);
|
|
474
|
-
reverseZones.set(subnet.address, reverseZone);
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
for (const domainName of host.domainNames) {
|
|
478
|
-
reverseZone.records.add(
|
|
479
|
-
DNSRecord(
|
|
480
|
-
dnsFullName(reverseArpa(address)),
|
|
481
|
-
"PTR",
|
|
482
|
-
dnsFullName(domainName)
|
|
483
|
-
)
|
|
484
|
-
);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
445
|
+
if (
|
|
446
|
+
!addresses.has(address) &&
|
|
447
|
+
(this.hasLinkLocalAdresses || !isLinkLocal(address))
|
|
448
|
+
) {
|
|
449
|
+
addresses.add(address);
|
|
450
|
+
|
|
451
|
+
let reverseZone = reverseZones.get(subnet.address);
|
|
452
|
+
|
|
453
|
+
if (!reverseZone) {
|
|
454
|
+
const id = reverseArpa(subnet.prefix);
|
|
455
|
+
reverseZone = {
|
|
456
|
+
id,
|
|
457
|
+
type: "plain",
|
|
458
|
+
file: `${locationName}/${id}.zone`,
|
|
459
|
+
records: new Set(this.defaultRecords)
|
|
460
|
+
};
|
|
461
|
+
config.zones.push(reverseZone);
|
|
462
|
+
reverseZones.set(subnet.address, reverseZone);
|
|
487
463
|
}
|
|
488
464
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
465
|
+
for (const domainName of domainNames) {
|
|
466
|
+
zone.records.add(
|
|
467
|
+
DNSRecord(
|
|
468
|
+
dnsFullName(domainName),
|
|
469
|
+
dnsRecordTypeForAddressFamily(family),
|
|
470
|
+
address
|
|
471
|
+
)
|
|
472
|
+
);
|
|
473
|
+
|
|
474
|
+
reverseZone.records.add(
|
|
475
|
+
DNSRecord(
|
|
476
|
+
dnsFullName(reverseArpa(address)),
|
|
477
|
+
"PTR",
|
|
478
|
+
dnsFullName(domainName)
|
|
479
|
+
)
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
501
483
|
|
|
502
|
-
|
|
484
|
+
const host = networkInterface.host;
|
|
485
|
+
if (host && !hosts.has(host)) {
|
|
486
|
+
hosts.add(host);
|
|
503
487
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
sm.set(record.toString(), record);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
488
|
+
for (const foreignDomainName of host.foreignDomainNames) {
|
|
489
|
+
zone.records.add(
|
|
490
|
+
DNSRecord("outfacing", "PTR", dnsFullName(foreignDomainName))
|
|
491
|
+
);
|
|
492
|
+
}
|
|
512
493
|
|
|
513
|
-
|
|
514
|
-
|
|
494
|
+
const sm = new Map();
|
|
495
|
+
|
|
496
|
+
for (const service of host._services) {
|
|
497
|
+
for (const record of service.dnsRecordsForDomainName(
|
|
498
|
+
host.domainName,
|
|
499
|
+
this.hasSVRRecords
|
|
500
|
+
)) {
|
|
501
|
+
sm.set(record.toString(), record);
|
|
515
502
|
}
|
|
516
503
|
}
|
|
504
|
+
|
|
505
|
+
for (const r of sm.values()) {
|
|
506
|
+
zone.records.add(r);
|
|
507
|
+
}
|
|
517
508
|
}
|
|
518
509
|
}
|
|
519
510
|
}
|
|
@@ -324,6 +324,7 @@ export class LoopbackNetworkInterface extends SkeletonNetworkInterface {
|
|
|
324
324
|
get kind(): string;
|
|
325
325
|
get scope(): string;
|
|
326
326
|
get localDomains(): Set<string>;
|
|
327
|
+
get domainNames(): Set<string>;
|
|
327
328
|
get hostName(): string;
|
|
328
329
|
get ipAddresses(): Map<string, import("pmcf").Subnet>;
|
|
329
330
|
}
|