pmcf 2.70.11 → 2.71.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": "2.70.11",
3
+ "version": "2.71.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/cluster.mjs CHANGED
@@ -125,7 +125,13 @@ export class Cluster extends Host {
125
125
  }
126
126
 
127
127
  cfg.push(` virtual_router_id ${cluster.routerId}`);
128
- cfg.push(` priority ${host.priority - cluster.masters.indexOf(ni)}`);
128
+
129
+ let reducedPrio = cluster.masters.indexOf(ni);
130
+ if(reducedPrio < 0) {
131
+ reducedPrio = cluster.backups.indexOf(ni) + 5;
132
+ }
133
+
134
+ cfg.push(` priority ${host.priority - reducedPrio}`);
129
135
  cfg.push(" smtp_alert");
130
136
  cfg.push(" advert_int 5");
131
137
  cfg.push(" authentication {");
@@ -1,10 +1,7 @@
1
1
  import { join } from "node:path";
2
2
  import { FileContentProvider } from "npm-pkgbuild";
3
3
  import { addType } from "../types.mjs";
4
- import {
5
- ServiceTypeDefinition,
6
- Service
7
- } from "../service.mjs";
4
+ import { ServiceTypeDefinition, Service } from "../service.mjs";
8
5
  import { writeLines } from "../utils.mjs";
9
6
 
10
7
  const OpenLDAPServiceTypeDefinition = {
@@ -13,7 +10,23 @@ const OpenLDAPServiceTypeDefinition = {
13
10
  owners: ServiceTypeDefinition.owners,
14
11
  extends: ServiceTypeDefinition,
15
12
  priority: 0.1,
16
- properties: {},
13
+ properties: {
14
+ baseDN: {
15
+ type: "string",
16
+ collection: false,
17
+ writeable: true
18
+ },
19
+ rootDN: {
20
+ type: "string",
21
+ collection: false,
22
+ writeable: true
23
+ },
24
+ uri: {
25
+ type: "string",
26
+ collection: false,
27
+ writeable: true
28
+ }
29
+ },
17
30
  service: {}
18
31
  };
19
32
 
@@ -26,6 +39,9 @@ export class OpenLDAPService extends Service {
26
39
  return OpenLDAPServiceTypeDefinition;
27
40
  }
28
41
 
42
+ baseDN;
43
+ rootDN;
44
+
29
45
  constructor(owner, data) {
30
46
  super(owner, data);
31
47
  this.read(data, OpenLDAPServiceTypeDefinition);
@@ -35,6 +51,17 @@ export class OpenLDAPService extends Service {
35
51
  return OpenLDAPServiceTypeDefinition.name;
36
52
  }
37
53
 
54
+ get uri()
55
+ {
56
+ return this._uri;
57
+ }
58
+
59
+ set uri(value)
60
+ {
61
+ console.log("SET URI",value);
62
+ this._uri = value;
63
+ }
64
+
38
65
  async *preparePackages(dir) {
39
66
  const network = this.network;
40
67
  const host = this.host;
@@ -59,6 +86,12 @@ export class OpenLDAPService extends Service {
59
86
  "SLAPD_URLS=ldap:/// ldaps:///"
60
87
  ]);
61
88
 
89
+ console.log(this);
90
+ await writeLines(join(packageData.dir, "etc/openldap"), "ldap.conf", [
91
+ `BASE=${this.baseDN}`,
92
+ `URI=${this.uri}`
93
+ ]);
94
+
62
95
  yield packageData;
63
96
  }
64
97
  }
@@ -251,10 +251,31 @@ export class OpenLDAPService extends Service {
251
251
  };
252
252
  };
253
253
  priority: number;
254
- properties: {};
254
+ properties: {
255
+ baseDN: {
256
+ type: string;
257
+ collection: boolean;
258
+ writeable: boolean;
259
+ };
260
+ rootDN: {
261
+ type: string;
262
+ collection: boolean;
263
+ writeable: boolean;
264
+ };
265
+ uri: {
266
+ type: string;
267
+ collection: boolean;
268
+ writeable: boolean;
269
+ };
270
+ };
255
271
  service: {};
256
272
  };
273
+ baseDN: any;
274
+ rootDN: any;
257
275
  get type(): string;
276
+ set uri(value: any);
277
+ get uri(): any;
278
+ _uri: any;
258
279
  preparePackages(dir: any): AsyncGenerator<{
259
280
  dir: any;
260
281
  sources: FileContentProvider[];