pmcf 1.64.5 → 1.65.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.64.5",
3
+ "version": "1.65.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/cluster.mjs CHANGED
@@ -82,7 +82,9 @@ export class Cluster extends Host {
82
82
  " }",
83
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/dns.mjs CHANGED
@@ -172,22 +172,33 @@ async function generateNamedDefs(dns, targetDir) {
172
172
 
173
173
  const NSRecord = createRecord("@", "NS", fullName(nameService.rawAddress));
174
174
 
175
+ const zone = {
176
+ id: domain,
177
+ type: "plain",
178
+ file: `${domain}.zone`,
179
+ records: new Set([SOARecord, NSRecord, ...records])
180
+ };
181
+ zones.push(zone);
182
+
175
183
  const catalogZone = {
176
184
  id: `catalog.${domain}`,
185
+ type: "catalog",
177
186
  file: `catalog.${domain}.zone`,
178
187
  records: new Set([
179
188
  SOARecord,
180
189
  NSRecord,
181
- createRecord(fullName(`version.${domain}`), "TXT", '"2"')
190
+ createRecord(fullName(`version.${domain}`), "TXT", '"1"')
182
191
  ])
183
192
  };
184
193
 
185
- const zone = {
186
- id: domain,
187
- file: `${domain}.zone`,
188
- records: new Set([SOARecord, NSRecord, ...records])
194
+ const configs = {
195
+ plain: { name: `${domain}.zone.conf`, content: [] }
189
196
  };
190
- zones.push(zone);
197
+
198
+ if (dns.hasCatalog) {
199
+ zones.push(catalogZone);
200
+ configs.catalog = { name: `catalog.${domain}.zone.conf`, content: [] };
201
+ }
191
202
 
192
203
  const hosts = new Set();
193
204
  const addresses = new Set();
@@ -217,6 +228,7 @@ async function generateNamedDefs(dns, targetDir) {
217
228
  const reverseArpa = reverseArpaAddress(subnet.prefix);
218
229
  reverseZone = {
219
230
  id: reverseArpa,
231
+ type: "plain",
220
232
  file: `${reverseArpa}.zone`,
221
233
  records: new Set([SOARecord, NSRecord])
222
234
  };
@@ -258,32 +270,28 @@ async function generateNamedDefs(dns, targetDir) {
258
270
  }
259
271
  }
260
272
 
261
- const zoneConfig = [];
262
-
263
- if (dns.hasCatalog) {
264
- zones.push(catalogZone);
265
- }
266
-
267
273
  for (const zone of zones) {
268
- if (zone !== catalogZone) {
274
+ const content = configs[zone.type].content;
275
+
276
+ if (zone.type !== "catalog") {
269
277
  const hash = createHmac("md5", zone.id).digest("hex");
270
278
  catalogZone.records.add(
271
- createRecord(`${hash}.zones.${domain}.`, "PTR", `${zone.id}.`)
279
+ createRecord(`${hash}.zones.${domain}.`, "PTR", fullName(zone.id))
272
280
  );
273
281
  }
274
282
 
275
- zoneConfig.push(`zone \"${zone.id}\" {`);
276
- zoneConfig.push(` type master;`);
277
- zoneConfig.push(` file \"${zone.file}\";`);
283
+ content.push(`zone \"${zone.id}\" {`);
284
+ content.push(` type master;`);
285
+ content.push(` file \"${zone.file}\";`);
278
286
 
279
- zoneConfig.push(
287
+ content.push(
280
288
  ` allow-update { ${
281
289
  dns.allowedUpdates.length ? dns.allowedUpdates.join(";") : "none"
282
290
  }; };`
283
291
  );
284
- zoneConfig.push(` notify ${dns.notify ? "yes" : "no"};`);
285
- zoneConfig.push(`};`);
286
- zoneConfig.push("");
292
+ content.push(` notify ${dns.notify ? "yes" : "no"};`);
293
+ content.push(`};`);
294
+ content.push("");
287
295
 
288
296
  maxKeyLength = 0;
289
297
  for (const r of zone.records) {
@@ -299,11 +307,13 @@ async function generateNamedDefs(dns, targetDir) {
299
307
  );
300
308
  }
301
309
 
302
- await writeLines(
303
- join(targetDir, "etc/named.d/zones"),
304
- `${domain}.zone.conf`,
305
- zoneConfig
306
- );
310
+ for (const cfg of Object.values(configs)) {
311
+ await writeLines(
312
+ join(targetDir, "etc/named.d/zones"),
313
+ cfg.name,
314
+ cfg.content
315
+ );
316
+ }
307
317
  }
308
318
  }
309
319
 
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 },
@@ -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;