pmcf 1.92.0 → 1.93.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "1.92.0",
3
+ "version": "1.93.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/cluster.mjs CHANGED
@@ -186,7 +186,7 @@ export class Cluster extends Host {
186
186
  `${this.name}-master.target`,
187
187
  [
188
188
  "[Unit]",
189
- `Description=Target for master state of cluster ${this.name}`,
189
+ `Description=master state of cluster ${this.name}`,
190
190
  "PartOf=keepalived.service",
191
191
  `Conflicts=${this.name}-fault.target`
192
192
  ]
@@ -197,7 +197,7 @@ export class Cluster extends Host {
197
197
  `${this.name}-backup.target`,
198
198
  [
199
199
  "[Unit]",
200
- `Description=Target for backup state of cluster ${this.name}`,
200
+ `Description=backup state of cluster ${this.name}`,
201
201
  "PartOf=keepalived.service",
202
202
  `Conflicts=${this.name}-fault.target`
203
203
  ]
@@ -208,7 +208,7 @@ export class Cluster extends Host {
208
208
  `${this.name}-fault.target`,
209
209
  [
210
210
  "[Unit]",
211
- `Description=Target for fault state of cluster ${this.name}`,
211
+ `Description=fault state of cluster ${this.name}`,
212
212
  `Conflicts=${this.name}-master.target ${this.name}-backup.target`
213
213
  ]
214
214
  );
package/src/dns.mjs CHANGED
@@ -288,10 +288,12 @@ async function generateZoneDefs(dns, packageData) {
288
288
  };
289
289
  configs.push(config);
290
290
 
291
+ const locationRecord = DNSRecord("location", "TXT", dns.location.name)
292
+
291
293
  const zone = {
292
294
  id: domain,
293
295
  file: `${ownerName}/${domain}.zone`,
294
- records: new Set([SOARecord, NSRecord])
296
+ records: new Set([SOARecord, NSRecord, locationRecord])
295
297
  };
296
298
  config.zones.push(zone);
297
299
 
@@ -368,6 +370,13 @@ async function generateZoneDefs(dns, packageData) {
368
370
 
369
371
  if (!hosts.has(host)) {
370
372
  hosts.add(host);
373
+
374
+ for (const foreignDomainName of host.foreignDomainNames) {
375
+ zone.records.add(
376
+ DNSRecord("external", "PTR", dnsFullName(foreignDomainName))
377
+ );
378
+ }
379
+
371
380
  for (const service of host.findServices()) {
372
381
  for (const record of service.dnsRecordsForDomainName(
373
382
  domainName,
package/src/host.mjs CHANGED
@@ -361,9 +361,10 @@ export class Host extends Base {
361
361
 
362
362
  *networkAddresses() {
363
363
  for (const networkInterface of this.networkInterfaces.values()) {
364
- for (const [address, subnet] of networkInterface.ipAddresses) {
364
+ for (const [address, subnet, domainName] of networkInterface.ipAddresses) {
365
365
  yield {
366
366
  networkInterface,
367
+ domainName,
367
368
  address,
368
369
  subnet
369
370
  };
@@ -437,6 +438,7 @@ const NetworkInterfaceTypeDefinition = {
437
438
  properties: {
438
439
  ...networkProperties,
439
440
  ...networkAddressProperties,
441
+ hostName: { type: "string", collection: false, writeable: true },
440
442
  ipAddresses: { type: "string", collection: true, writeable: true },
441
443
 
442
444
  hwaddr: { type: "string", collection: false, writeable: true },
@@ -464,6 +466,7 @@ export class NetworkInterface extends Base {
464
466
  #kind;
465
467
  arpbridge;
466
468
  hwaddr;
469
+ hostName;
467
470
 
468
471
  constructor(owner, data) {
469
472
  super(owner, data);
@@ -542,6 +545,11 @@ export class NetworkInterface extends Base {
542
545
  }
543
546
  }
544
547
 
548
+ get domainName()
549
+ {
550
+ return this.hostName ? [this.hostName,this.host.domain].join('.') : this.host.dmainName;
551
+ }
552
+
545
553
  get host() {
546
554
  return this.owner;
547
555
  }
package/types/host.d.mts CHANGED
@@ -209,6 +209,7 @@ export class Host extends Base {
209
209
  get networkInterfaces(): Map<any, any>;
210
210
  networkAddresses(): Generator<{
211
211
  networkInterface: any;
212
+ domainName: any;
212
213
  address: any;
213
214
  subnet: any;
214
215
  }, void, unknown>;
@@ -282,6 +283,11 @@ export class NetworkInterface extends Base {
282
283
  };
283
284
  };
284
285
  properties: {
286
+ hostName: {
287
+ type: string;
288
+ collection: boolean;
289
+ writeable: boolean;
290
+ };
285
291
  ipAddresses: {
286
292
  type: string;
287
293
  collection: boolean;
@@ -366,6 +372,7 @@ export class NetworkInterface extends Base {
366
372
  };
367
373
  arpbridge: any;
368
374
  hwaddr: any;
375
+ hostName: any;
369
376
  addSubnet(address: any): any;
370
377
  set ipAddresses(value: Map<any, any>);
371
378
  get ipAddresses(): Map<any, any>;
@@ -378,6 +385,7 @@ export class NetworkInterface extends Base {
378
385
  subnetForAddress(address: any): any;
379
386
  get gateway(): any;
380
387
  get gatewayAddress(): any;
388
+ get domainName(): any;
381
389
  get network_interface(): this;
382
390
  set network(network: any);
383
391
  get network(): any;