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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "2.64.2",
3
+ "version": "2.64.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -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 new Set(["localhost"]);
45
+ return _localDomains;
46
+ }
47
+
48
+ get domainNames() {
49
+ return _localDomains;
44
50
  }
45
51
 
46
52
  get hostName() {
@@ -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
- const host = networkInterface.host;
446
- if (host) {
447
- if (
448
- !addresses.has(address) &&
449
- (this.hasLinkLocalAdresses || !isLinkLocal(address))
450
- ) {
451
- addresses.add(address);
452
-
453
- for (const domainName of domainNames) {
454
- zone.records.add(
455
- DNSRecord(
456
- dnsFullName(domainName),
457
- dnsRecordTypeForAddressFamily(family),
458
- address
459
- )
460
- );
461
- }
462
- if (subnet && host.domain === domain) {
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
- if (!hosts.has(host)) {
490
- hosts.add(host);
491
-
492
- for (const foreignDomainName of host.foreignDomainNames) {
493
- zone.records.add(
494
- DNSRecord(
495
- "outfacing",
496
- "PTR",
497
- dnsFullName(foreignDomainName)
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
- const sm = new Map();
484
+ const host = networkInterface.host;
485
+ if (host && !hosts.has(host)) {
486
+ hosts.add(host);
503
487
 
504
- for (const service of host._services) {
505
- for (const record of service.dnsRecordsForDomainName(
506
- host.domainName,
507
- this.hasSVRRecords
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
- for (const r of sm.values()) {
514
- zone.records.add(r);
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
  }