pmcf 1.89.2 → 1.91.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.89.2",
3
+ "version": "1.91.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/cluster.mjs CHANGED
@@ -14,7 +14,8 @@ const ClusterTypeDefinition = {
14
14
  routerId: { type: "number", collection: false, writeable: true },
15
15
  masters: { type: "network_interface", collection: true, writeable: true },
16
16
  backups: { type: "network_interface", collection: true, writeable: true },
17
- members: { type: "network_interface", collection: true, writeable: false }
17
+ members: { type: "network_interface", collection: true, writeable: false },
18
+ checkInterval: { type: "number", collection: false, writeable: true }
18
19
  }
19
20
  };
20
21
 
@@ -22,6 +23,7 @@ export class Cluster extends Host {
22
23
  #masters = new Set();
23
24
  #backups = new Set();
24
25
  routerId = 100;
26
+ checkInterval = 60;
25
27
 
26
28
  static {
27
29
  addType(this);
@@ -105,7 +107,9 @@ export class Cluster extends Host {
105
107
  );
106
108
  cfg.push(" }");
107
109
  cfg.push(` virtual_router_id ${cluster.routerId}`);
108
- cfg.push(` priority ${host.priority - (cluster.masters.has(ni) ? 0 : 5)}`);
110
+ cfg.push(
111
+ ` priority ${host.priority - (cluster.masters.has(ni) ? 0 : 5)}`
112
+ );
109
113
  cfg.push(" smtp_alert");
110
114
  cfg.push(" advert_int 5");
111
115
  cfg.push(" authentication {");
@@ -128,7 +132,7 @@ export class Cluster extends Host {
128
132
 
129
133
  for (const service of cluster.findServices({ type: "http|dns|smtp" })) {
130
134
  cfg.push(`virtual_server ${cluster.rawAddress} ${service.port} {`);
131
- cfg.push(" delay_loop 10");
135
+ cfg.push(` delay_loop ${cluster.checkInterval}`);
132
136
  cfg.push(" lb_algo wlc");
133
137
  cfg.push(" persistence_timeout 600");
134
138
  cfg.push(` protocol ${service.protocol.toUpperCase()}`);
package/src/dns.mjs CHANGED
@@ -21,6 +21,7 @@ const DNSServiceTypeDefinition = {
21
21
  source: { type: "network", collection: true, writeable: true },
22
22
  trusted: { type: "network", collection: true, writeable: true },
23
23
  protected: { type: "network", collection: true, writeable: true },
24
+ open: { type: "network", collection: true, writeable: true },
24
25
  hasSVRRecords: { type: "boolean", collection: false, writeable: true },
25
26
  hasCatalog: { type: "boolean", collection: false, writeable: true },
26
27
  hasLinkLocalAdresses: {
@@ -67,6 +68,7 @@ export class DNSService extends Base {
67
68
  #source = [];
68
69
  #trusted = [];
69
70
  #protected = [];
71
+ #open = [];
70
72
 
71
73
  serial = Math.ceil(Date.now() / 1000);
72
74
  refresh = 36000;
@@ -112,6 +114,14 @@ export class DNSService extends Base {
112
114
  return this.#trusted;
113
115
  }
114
116
 
117
+ set open(value) {
118
+ this.#open.push(value);
119
+ }
120
+
121
+ get open() {
122
+ return this.#open;
123
+ }
124
+
115
125
  set source(value) {
116
126
  this.#source.push(value);
117
127
  }
@@ -177,7 +187,7 @@ export class DNSService extends Base {
177
187
  const acls = [
178
188
  addressesStatement("acl trusted", subnets(this.trusted)),
179
189
  addressesStatement("acl protected", subnets(this.protected)),
180
- addressesStatement("acl open", [], true)
190
+ addressesStatement("acl open", subnets(this.open), true)
181
191
  ].flat();
182
192
 
183
193
  if (acls.length) {
@@ -263,6 +273,7 @@ async function generateZoneDefs(dns, packageData) {
263
273
  normalizeIPAddress(address)
264
274
  )
265
275
  );
276
+ zone.records.add(DNSRecord("location", "TXT", host.location.name));
266
277
  }
267
278
  }
268
279
  }
@@ -112,6 +112,11 @@ export class Cluster extends Host {
112
112
  collection: boolean;
113
113
  writeable: boolean;
114
114
  };
115
+ open: {
116
+ type: string;
117
+ collection: boolean;
118
+ writeable: boolean;
119
+ };
115
120
  hasSVRRecords: {
116
121
  type: string;
117
122
  collection: boolean;
@@ -411,9 +416,15 @@ export class Cluster extends Host {
411
416
  collection: boolean;
412
417
  writeable: boolean;
413
418
  };
419
+ checkInterval: {
420
+ type: string;
421
+ collection: boolean;
422
+ writeable: boolean;
423
+ };
414
424
  };
415
425
  };
416
426
  routerId: number;
427
+ checkInterval: number;
417
428
  set masters(value: Set<any>);
418
429
  get masters(): Set<any>;
419
430
  set backups(value: Set<any>);
package/types/dns.d.mts CHANGED
@@ -21,6 +21,11 @@ export class DNSService extends Base {
21
21
  collection: boolean;
22
22
  writeable: boolean;
23
23
  };
24
+ open: {
25
+ type: string;
26
+ collection: boolean;
27
+ writeable: boolean;
28
+ };
24
29
  hasSVRRecords: {
25
30
  type: string;
26
31
  collection: boolean;
@@ -94,6 +99,8 @@ export class DNSService extends Base {
94
99
  get protected(): any[];
95
100
  set trusted(value: any[]);
96
101
  get trusted(): any[];
102
+ set open(value: any[]);
103
+ get open(): any[];
97
104
  set source(value: any[]);
98
105
  get source(): any[];
99
106
  get systemdConfig(): (string | {
@@ -112,6 +112,11 @@ export class Location extends Owner {
112
112
  collection: boolean;
113
113
  writeable: boolean;
114
114
  };
115
+ open: {
116
+ type: string;
117
+ collection: boolean;
118
+ writeable: boolean;
119
+ };
115
120
  hasSVRRecords: {
116
121
  type: string;
117
122
  collection: boolean;
@@ -337,6 +342,11 @@ export class Location extends Owner {
337
342
  collection: boolean;
338
343
  writeable: boolean;
339
344
  };
345
+ open: {
346
+ type: string;
347
+ collection: boolean;
348
+ writeable: boolean;
349
+ };
340
350
  hasSVRRecords: {
341
351
  type: string;
342
352
  collection: boolean;
@@ -114,6 +114,11 @@ export class Network extends Owner {
114
114
  collection: boolean;
115
115
  writeable: boolean;
116
116
  };
117
+ open: {
118
+ type: string;
119
+ collection: boolean;
120
+ writeable: boolean;
121
+ };
117
122
  hasSVRRecords: {
118
123
  type: string;
119
124
  collection: boolean;
package/types/owner.d.mts CHANGED
@@ -110,6 +110,11 @@ export class Owner extends Base {
110
110
  collection: boolean;
111
111
  writeable: boolean;
112
112
  };
113
+ open: {
114
+ type: string;
115
+ collection: boolean;
116
+ writeable: boolean;
117
+ };
113
118
  hasSVRRecords: {
114
119
  type: string;
115
120
  collection: boolean;
package/types/root.d.mts CHANGED
@@ -116,6 +116,11 @@ export class Root extends Location {
116
116
  collection: boolean;
117
117
  writeable: boolean;
118
118
  };
119
+ open: {
120
+ type: string;
121
+ collection: boolean;
122
+ writeable: boolean;
123
+ };
119
124
  hasSVRRecords: {
120
125
  type: string;
121
126
  collection: boolean;
@@ -341,6 +346,11 @@ export class Root extends Location {
341
346
  collection: boolean;
342
347
  writeable: boolean;
343
348
  };
349
+ open: {
350
+ type: string;
351
+ collection: boolean;
352
+ writeable: boolean;
353
+ };
344
354
  hasSVRRecords: {
345
355
  type: string;
346
356
  collection: boolean;