pmcf 1.64.4 → 1.64.6

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.64.4",
3
+ "version": "1.64.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -284,6 +284,10 @@ export class Base {
284
284
  return this.owner?.timezone;
285
285
  }
286
286
 
287
+ get smtp() {
288
+ return this.findService({ type: "smtp" });
289
+ }
290
+
287
291
  findService(filter) {
288
292
  let best;
289
293
  for (const service of this.findServices(filter)) {
package/src/cluster.mjs CHANGED
@@ -80,9 +80,11 @@ export class Cluster extends Host {
80
80
  " notification_email {",
81
81
  " " + this.administratorEmail,
82
82
  " }",
83
- " smtp_server 192.168.1.1",
83
+ ` smtp_server ${this.smtp.rawAddress}`,
84
84
  ` notification_email_from keepalived@${host.domainName}`,
85
- "}"
85
+ ` lvs_id ${host.hostName}`,
86
+ "}",
87
+ ""
86
88
  ];
87
89
 
88
90
  for (const cluster of [...this.owner.clusters()].sort((a, b) =>
@@ -98,6 +100,7 @@ export class Cluster extends Host {
98
100
  cfg.push(" }");
99
101
  cfg.push(` virtual_router_id ${cluster.routerId}`);
100
102
  cfg.push(` priority ${host.priority}`);
103
+ cfg.push(" smtp_alert");
101
104
  cfg.push(" advert_int 5");
102
105
  cfg.push(" authentication {");
103
106
  cfg.push(" auth_type PASS");
package/src/owner.mjs CHANGED
@@ -146,9 +146,9 @@ export class Owner extends Base {
146
146
  return this.typeNamed("host", name);
147
147
  }
148
148
 
149
- * hosts() {
150
- yield * this.typeList("host");
151
- yield * this.typeList("cluster");
149
+ *hosts() {
150
+ yield* this.typeList("host");
151
+ yield* this.typeList("cluster");
152
152
  }
153
153
 
154
154
  networkNamed(name) {
@@ -225,7 +225,10 @@ export class Owner extends Base {
225
225
  }
226
226
 
227
227
  for (const nameOrNetwork of asIterator(destinationNetworks)) {
228
- const other = nameOrNetwork instanceof Owner ? nameOrNetwork : this.networkNamed(nameOrNetwork);
228
+ const other =
229
+ nameOrNetwork instanceof Owner
230
+ ? nameOrNetwork
231
+ : this.networkNamed(nameOrNetwork);
229
232
  if (other) {
230
233
  if (!bridge.has(other)) {
231
234
  bridge.add(other);
@@ -360,4 +363,5 @@ export class Owner extends Base {
360
363
  yield location.domain;
361
364
  }
362
365
  }
366
+
363
367
  }
package/src/service.mjs CHANGED
@@ -21,7 +21,6 @@ const ServiceTypeDefinition = {
21
21
  extends: Base.typeDefinition,
22
22
  properties: {
23
23
  ipAddresses: { type: "string", collection: true, writeable: true },
24
- addresses: { type: "string", collection: true, writeable: true },
25
24
  port: { type: "number", collection: false, writeable: true },
26
25
  protocol: { type: "string", collection: false, writeable: true },
27
26
  alias: { type: "string", collection: false, writeable: true },
package/types/base.d.mts CHANGED
@@ -62,6 +62,7 @@ export class Base {
62
62
  get locales(): any;
63
63
  get country(): any;
64
64
  get timezone(): any;
65
+ get smtp(): any;
65
66
  findService(filter: any): any;
66
67
  findServices(filter: any): Generator<any, void, any>;
67
68
  set directory(directory: any);
@@ -46,11 +46,6 @@ export class Service extends Base {
46
46
  collection: boolean;
47
47
  writeable: boolean;
48
48
  };
49
- addresses: {
50
- type: string;
51
- collection: boolean;
52
- writeable: boolean;
53
- };
54
49
  port: {
55
50
  type: string;
56
51
  collection: boolean;