pmcf 6.65.3 → 6.65.5

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.65.3",
3
+ "version": "6.65.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -60,7 +60,7 @@
60
60
  "yaml": "^2.9.1"
61
61
  },
62
62
  "devDependencies": {
63
- "@types/node": "^26.6.2",
63
+ "@types/node": "^26.6.3",
64
64
  "ava": "^8.0.1",
65
65
  "c8": "^12.0.0",
66
66
  "documentation": "^14.0.3",
@@ -171,7 +171,7 @@ export class CoreService extends base {
171
171
  continue;
172
172
  }
173
173
 
174
- if (e.pathname) {
174
+ if (e.scheme || e.pathname) {
175
175
  result.push(new HTTPEndpoint(this, na, options));
176
176
  } else {
177
177
  result.push(new Endpoint(this, na, options));
package/src/endpoint.mjs CHANGED
@@ -186,6 +186,7 @@ export class HTTPEndpoint extends BaseEndpoint {
186
186
  * @param {Service} service
187
187
  * @param {string|URL} address
188
188
  * @param {object} data
189
+ * @param {string} data.scheme
189
190
  * @param {number} data.port
190
191
  * @param {string} data.pathname
191
192
  * @param {string} data.family
@@ -200,8 +201,11 @@ export class HTTPEndpoint extends BaseEndpoint {
200
201
  } else {
201
202
  this.family = data.family ?? address.family;
202
203
 
203
- this.url = new URL(
204
- (data.tls ? "https://" : "http://") +
204
+ const scheme = data.scheme ?
205
+ `${data.scheme}://` :
206
+ (data.tls ? "https://" : "http://");
207
+
208
+ this.url = new URL(scheme +
205
209
  (data.family === FAMILY_IPV6
206
210
  ? "[" + address.address + "]"
207
211
  : address.address) +
@@ -71,6 +71,8 @@ export class keepalive_cluster_member extends core {
71
71
  }
72
72
  }
73
73
 
74
+ const states = ["master", "backup", "fault"];
75
+
74
76
  export class keepalived extends CoreService {
75
77
  static priority = 1.5;
76
78
  static attributes = {
@@ -145,19 +147,19 @@ export class keepalived extends CoreService {
145
147
  cfg.push(" advert_int 5");
146
148
  cfg.push(" authentication {");
147
149
  cfg.push(" auth_type PASS");
148
- cfg.push(" auth_pass pass1234");
149
150
  cfg.push(
150
- ` # auth_pass file:\${_ENV CREDENTIALS_DIRECTORY}/keepalived.${cluster.name}.password`
151
+ ` auth_pass file:\${_ENV CREDENTIALS_DIRECTORY}/keepalived.${cluster.name}.password`
151
152
  );
153
+ cfg.push(" # auth_pass pass1234");
152
154
  cfg.push(" # auth_pass ${_ENV " + cred.localName + "}");
153
155
  cfg.push(" # auth_pass ${" + cred.localName + "}");
154
156
  cfg.push(" }");
155
157
 
156
- cfg.push(
157
- ` notify_master "/usr/bin/systemctl start ${clusterName}-master.target"`,
158
- ` notify_backup "/usr/bin/systemctl start ${clusterName}-backup.target"`,
159
- ` notify_fault "/usr/bin/systemctl start ${clusterName}-fault.target"`
160
- );
158
+ for (const state of states) {
159
+ cfg.push(
160
+ ` notify_${state} "/usr/bin/systemctl start ${clusterName}-${state}.target"`
161
+ );
162
+ }
161
163
 
162
164
  cfg.push("}", "");
163
165
 
@@ -209,37 +211,19 @@ export class keepalived extends CoreService {
209
211
  cfg.push("}", "");
210
212
  break; // only one for now
211
213
  }
212
- await writeLines(
213
- join(dir, "/usr/lib/systemd/system"),
214
- `${clusterName}-master.target`,
215
- [
216
- "[Unit]",
217
- `Description=master state of cluster ${clusterName}`,
218
- "PartOf=keepalived.service",
219
- `Conflicts=${clusterName}-backup.target ${clusterName}-fault.target`
220
- ]
221
- );
222
214
 
223
- await writeLines(
224
- join(dir, "/usr/lib/systemd/system"),
225
- `${clusterName}-backup.target`,
226
- [
227
- "[Unit]",
228
- `Description=backup state of cluster ${clusterName}`,
229
- "PartOf=keepalived.service",
230
- `Conflicts=${clusterName}-master.target ${clusterName}-fault.target`
231
- ]
232
- );
233
-
234
- await writeLines(
235
- join(dir, "/usr/lib/systemd/system"),
236
- `${clusterName}-fault.target`,
237
- [
238
- "[Unit]",
239
- `Description=fault state of cluster ${clusterName}`,
240
- `Conflicts=${clusterName}-master.target ${clusterName}-backup.target`
241
- ]
242
- );
215
+ for (const state of states) {
216
+ await writeLines(
217
+ join(dir, "/usr/lib/systemd/system"),
218
+ `${clusterName}-${state}.target`,
219
+ [
220
+ "[Unit]",
221
+ `Description=${state} state of cluster ${clusterName}`,
222
+ "PartOf=keepalived.service",
223
+ `Conflicts=${states.filter(s=>s!==state).map(other=>`${clusterName}-${other}.target`).join(' ')}`
224
+ ]
225
+ );
226
+ }
243
227
 
244
228
  await this.writeSystemdCredentialConfig(dir, "keepalived.service");
245
229
 
@@ -10,7 +10,7 @@ export class openldap extends CoreService {
10
10
  systemdService: "slapd.service",
11
11
  systemUserName: "ldap",
12
12
  systemGroupName: "ldap",
13
- extends: ["ldap", "ldapi"]
13
+ extends: ["ldap", "ldaps", "ldapi"]
14
14
  };
15
15
 
16
16
  static {