pmcf 6.26.1 → 6.26.3
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
package/src/cluster.mjs
CHANGED
|
@@ -88,7 +88,7 @@ export class Cluster extends Host {
|
|
|
88
88
|
""
|
|
89
89
|
];
|
|
90
90
|
|
|
91
|
-
const credentials =
|
|
91
|
+
const credentials = new Map();
|
|
92
92
|
for (const cluster of [...this.owner.clusters.values()].sort((a, b) =>
|
|
93
93
|
a.name.localeCompare(b.name)
|
|
94
94
|
)) {
|
|
@@ -121,7 +121,7 @@ export class Cluster extends Host {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
const credential = name.toUpperCase() + "_PASSWORD";
|
|
124
|
-
credentials.
|
|
124
|
+
credentials.set(credential,name);
|
|
125
125
|
cfg.push(` priority ${host.priority - reducedPrio}`);
|
|
126
126
|
cfg.push(" smtp_alert");
|
|
127
127
|
cfg.push(" advert_int 5");
|
|
@@ -150,11 +150,9 @@ export class Cluster extends Host {
|
|
|
150
150
|
cfg.push(` protocol ${endpoint.protocol.toUpperCase()}`);
|
|
151
151
|
|
|
152
152
|
for (const member of this.members) {
|
|
153
|
-
const memberService =
|
|
154
|
-
member.expression(`services[types[${endpoint.type}]][0]`)
|
|
155
|
-
);
|
|
153
|
+
const memberService = member.expression(`services[types[${endpoint.type}]][0]`);
|
|
156
154
|
|
|
157
|
-
console.log(member.fullName, endpoint.type, memberService);
|
|
155
|
+
console.log(member.fullName, endpoint.type, memberService?.fullName);
|
|
158
156
|
cfg.push(` real_server ${member.address} ${memberService.port} {`);
|
|
159
157
|
cfg.push(` weight ${memberService.weight}`);
|
|
160
158
|
|
|
@@ -223,9 +221,9 @@ export class Cluster extends Host {
|
|
|
223
221
|
"credentials.conf",
|
|
224
222
|
[
|
|
225
223
|
"[Service]",
|
|
226
|
-
...credentials.map(
|
|
227
|
-
|
|
228
|
-
`LoadCredentialEncrypted=${
|
|
224
|
+
...credentials.entries().map(
|
|
225
|
+
([credName,instance]) =>
|
|
226
|
+
`LoadCredentialEncrypted=${credName}:/etc/credstore.encrypted/keepalived.${instance}.password`
|
|
229
227
|
)
|
|
230
228
|
]
|
|
231
229
|
);
|