pmcf 1.94.5 → 1.95.0
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 +1 -1
- package/src/dns.mjs +17 -13
- package/src/host.mjs +18 -9
- package/types/host.d.mts +3 -2
package/package.json
CHANGED
package/src/dns.mjs
CHANGED
|
@@ -323,7 +323,7 @@ async function generateZoneDefs(dns, packageData) {
|
|
|
323
323
|
address,
|
|
324
324
|
subnet,
|
|
325
325
|
networkInterface,
|
|
326
|
-
|
|
326
|
+
domainNames
|
|
327
327
|
} of dns.owner.networkAddresses()) {
|
|
328
328
|
const host = networkInterface.host;
|
|
329
329
|
if (
|
|
@@ -332,13 +332,15 @@ async function generateZoneDefs(dns, packageData) {
|
|
|
332
332
|
) {
|
|
333
333
|
addresses.add(address);
|
|
334
334
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
335
|
+
for (const domainName of domainNames) {
|
|
336
|
+
zone.records.add(
|
|
337
|
+
DNSRecord(
|
|
338
|
+
dnsFullName(domainName),
|
|
339
|
+
isIPv6Address(address) ? "AAAA" : "A",
|
|
340
|
+
normalizeIPAddress(address)
|
|
341
|
+
)
|
|
342
|
+
);
|
|
343
|
+
}
|
|
342
344
|
if (subnet && host.domain === domain) {
|
|
343
345
|
let reverseZone = reverseZones.get(subnet.address);
|
|
344
346
|
|
|
@@ -376,11 +378,13 @@ async function generateZoneDefs(dns, packageData) {
|
|
|
376
378
|
}
|
|
377
379
|
|
|
378
380
|
for (const service of host.findServices()) {
|
|
379
|
-
for (const
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
381
|
+
for (const domainName of domainNames) {
|
|
382
|
+
for (const record of service.dnsRecordsForDomainName(
|
|
383
|
+
domainName,
|
|
384
|
+
dns.hasSVRRecords
|
|
385
|
+
)) {
|
|
386
|
+
zone.records.add(record);
|
|
387
|
+
}
|
|
384
388
|
}
|
|
385
389
|
}
|
|
386
390
|
}
|
package/src/host.mjs
CHANGED
|
@@ -255,7 +255,7 @@ export class Host extends Base {
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
get os() {
|
|
258
|
-
return this.#os || this.extends.find(e => e.os)?.os
|
|
258
|
+
return this.#os || this.extends.find(e => e.os)?.os;
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
set distribution(value) {
|
|
@@ -263,7 +263,9 @@ export class Host extends Base {
|
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
get distribution() {
|
|
266
|
-
return
|
|
266
|
+
return (
|
|
267
|
+
this.#distribution || this.extends.find(e => e.distribution)?.distribution
|
|
268
|
+
);
|
|
267
269
|
}
|
|
268
270
|
|
|
269
271
|
get modelName() {
|
|
@@ -289,12 +291,19 @@ export class Host extends Base {
|
|
|
289
291
|
return this.foreignDomains.union(this.localDomains);
|
|
290
292
|
}
|
|
291
293
|
|
|
294
|
+
get directDomainNames() {
|
|
295
|
+
return new Set(
|
|
296
|
+
[this.hostName, ...this.aliases].map(n => domainName(n, this.domain))
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
|
|
292
300
|
get domainNames() {
|
|
293
301
|
return new Set(
|
|
294
302
|
[
|
|
295
|
-
...[...this.networkInterfaces.values()].
|
|
296
|
-
|
|
297
|
-
|
|
303
|
+
...[...this.networkInterfaces.values()].reduce(
|
|
304
|
+
(all, networkInterface) => all.union(networkInterface.domainNames),
|
|
305
|
+
this.directDomainNames
|
|
306
|
+
)
|
|
298
307
|
].map(n => domainName(n, this.domain))
|
|
299
308
|
);
|
|
300
309
|
}
|
|
@@ -376,7 +385,7 @@ export class Host extends Base {
|
|
|
376
385
|
for (const [address, subnet] of networkInterface.ipAddresses) {
|
|
377
386
|
yield {
|
|
378
387
|
networkInterface,
|
|
379
|
-
|
|
388
|
+
domainNames: networkInterface.domainNames,
|
|
380
389
|
address,
|
|
381
390
|
subnet
|
|
382
391
|
};
|
|
@@ -553,10 +562,10 @@ export class NetworkInterface extends Base {
|
|
|
553
562
|
}
|
|
554
563
|
}
|
|
555
564
|
|
|
556
|
-
get
|
|
565
|
+
get domainNames() {
|
|
557
566
|
return this.hostName
|
|
558
|
-
? [this.hostName, this.host.domain].join(".")
|
|
559
|
-
: this.host.
|
|
567
|
+
? new Set([[this.hostName, this.host.domain].join(".")])
|
|
568
|
+
: this.host.directDomainNames;
|
|
560
569
|
}
|
|
561
570
|
|
|
562
571
|
get host() {
|
package/types/host.d.mts
CHANGED
|
@@ -201,6 +201,7 @@ export class Host extends Base {
|
|
|
201
201
|
get foreignDomainNames(): any[];
|
|
202
202
|
get foreignDomains(): Set<any>;
|
|
203
203
|
get domains(): Set<any>;
|
|
204
|
+
get directDomainNames(): Set<any>;
|
|
204
205
|
get domainNames(): Set<any>;
|
|
205
206
|
get domainName(): any;
|
|
206
207
|
domainNamesIn(domain: any): Generator<any, void, unknown>;
|
|
@@ -210,7 +211,7 @@ export class Host extends Base {
|
|
|
210
211
|
get networkInterfaces(): Map<any, any>;
|
|
211
212
|
networkAddresses(): Generator<{
|
|
212
213
|
networkInterface: any;
|
|
213
|
-
|
|
214
|
+
domainNames: any;
|
|
214
215
|
address: any;
|
|
215
216
|
subnet: any;
|
|
216
217
|
}, void, unknown>;
|
|
@@ -386,7 +387,7 @@ export class NetworkInterface extends Base {
|
|
|
386
387
|
subnetForAddress(address: any): any;
|
|
387
388
|
get gateway(): any;
|
|
388
389
|
get gatewayAddress(): any;
|
|
389
|
-
get
|
|
390
|
+
get domainNames(): any;
|
|
390
391
|
get network_interface(): this;
|
|
391
392
|
set network(network: any);
|
|
392
393
|
get network(): any;
|