pmcf 6.50.3 → 6.52.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": "6.50.3",
3
+ "version": "6.52.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -401,9 +401,9 @@ export function serviceEndpoints(sources, options = {}) {
401
401
  return options.join ? res.join(options.join) : res;
402
402
  }
403
403
 
404
- export function endpoints(entries) {
404
+ export function endpoints(entries,filter) {
405
405
  return asArray(entries)
406
- .map(e => e.endpoints())
406
+ .map(e => e.endpoints(filter))
407
407
  .flat();
408
408
  }
409
409
 
@@ -248,6 +248,7 @@ export class bind_key extends base {
248
248
  `${this.name}.conf`,
249
249
  [
250
250
  `key "${this.name}" {`,
251
+ ` # ` + asArray(this.tags).join(','),
251
252
  ` algorithm ${this.algorithm};`,
252
253
  ` secret "${this.secret}";`,
253
254
  "};"
@@ -319,7 +320,7 @@ const acl_attribute = {
319
320
  class bind_view extends bind_object {
320
321
  static priority = 1;
321
322
  static attributes = {
322
- notify: { ...boolean_attribute_writable_false, name: "notify" },
323
+ notify: { ...boolean_attribute_writable_false, name: "notify" },
323
324
  hasCatalog: { ...boolean_attribute_writable_false, name: "hasCatalog" },
324
325
  hasForeignDomainRecords: {
325
326
  ...boolean_attribute_writable_false,
@@ -358,7 +359,11 @@ class bind_view extends bind_object {
358
359
  },
359
360
  retry: { ...duration_attribute_writable, name: "retry", default: 72000 },
360
361
  expire: { ...duration_attribute_writable, name: "expire", default: 600000 },
361
- minimum: { ...duration_attribute_writable, name: "minimum", default: 60000 },
362
+ minimum: {
363
+ ...duration_attribute_writable,
364
+ name: "minimum",
365
+ default: 60000
366
+ },
362
367
  sharedWith: {
363
368
  ...default_attribute_writable,
364
369
  name: "sharedWith",
@@ -408,7 +413,7 @@ class bind_view extends bind_object {
408
413
  type: bind_zone_config,
409
414
  backpointer: owner_attribute,
410
415
  name: "zoneConfigs"
411
- },
416
+ }
412
417
  };
413
418
 
414
419
  static {
@@ -851,6 +856,24 @@ export class bind extends CoreService {
851
856
  return false;
852
857
  }
853
858
 
859
+ async writeServers(outputControl) {
860
+ await writeLines(
861
+ join(outputControl.dir, "etc/named"),
862
+ `servers.conf`,
863
+ asArray(this.primaries).map(service => {
864
+ return [
865
+ `server ${service.address()} {`,
866
+ " keys {" +
867
+ asArray(service.keys.values())
868
+ .map(key => ` ${key.name};`)
869
+ .join("") +
870
+ " };",
871
+ "};"
872
+ ];
873
+ })
874
+ );
875
+ }
876
+
854
877
  async *preparePackages(dir) {
855
878
  const packageData = await this.preparePackage(dir);
856
879
 
@@ -877,7 +900,10 @@ export class bind extends CoreService {
877
900
  hasContent ||= present;
878
901
  }
879
902
 
880
- const present = await this.writeForwarders(outputControl);
903
+ let present;
904
+ present = await this.writeServers(outputControl);
905
+
906
+ present = await this.writeForwarders(outputControl);
881
907
 
882
908
  if (hasContent || present) {
883
909
  yield packageData;
@@ -20,7 +20,8 @@ import {
20
20
  Subnet,
21
21
  CoreService,
22
22
  Endpoint,
23
- sortDescendingByPriority
23
+ sortDescendingByPriority,
24
+ bind_key
24
25
  } from "pmcf";
25
26
  import { FAMILY_UNIX, PROTOCOL_TCP } from "../constants.mjs";
26
27
  import { writeLines } from "../utils.mjs";
@@ -53,6 +54,12 @@ export class kea extends CoreService {
53
54
  name: "peers",
54
55
  deferredExpression: true
55
56
  },
57
+ keys: {
58
+ ...default_collection_attribute_writable,
59
+ name: "keys",
60
+ type: bind_key,
61
+ deferredExpression: true
62
+ },
56
63
  dnsServerEndpoints: {
57
64
  ...default_collection_attribute_writable,
58
65
  type: Endpoint,
@@ -347,7 +354,15 @@ export class kea extends CoreService {
347
354
  "ip-address": ddnsEndpoint.address,
348
355
  port: ddnsEndpoint.port,
349
356
  "control-socket": toSocket(this.endpoint("kea-control-ddns")),
350
- "tsig-keys": [],
357
+ "tsig-keys": [
358
+ asArray(this.keys).map(key => {
359
+ return {
360
+ name: key.name,
361
+ algorithm: key.algorithm,
362
+ secret: key.secret
363
+ };
364
+ })
365
+ ],
351
366
  "forward-ddns": {
352
367
  "ddns-domains": dnsServersSlot([...this.domains])
353
368
  },