pmcf 6.46.2 → 6.46.4
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 +3 -3
- package/src/cluster.mjs +13 -7
- package/src/core.mjs +1 -1
- package/src/host.mjs +5 -1
- package/src/keepalived.mjs +3 -0
- package/src/module.mjs +2 -0
- package/src/service-types.mjs +6 -0
- package/src/services/chrony.mjs +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "6.46.
|
|
3
|
+
"version": "6.46.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"aggregated-map": "^1.0.11",
|
|
54
54
|
"content-entry-transform": "^1.7.6",
|
|
55
55
|
"ip-utilties": "^3.13.1",
|
|
56
|
-
"npm-pkgbuild": "^22.1.
|
|
56
|
+
"npm-pkgbuild": "^22.1.5",
|
|
57
57
|
"pacc": "^11.9.0",
|
|
58
58
|
"package-directory": "^8.2.0",
|
|
59
59
|
"yaml": "^2.9.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@types/node": "^26.5.
|
|
62
|
+
"@types/node": "^26.5.1",
|
|
63
63
|
"ava": "^8.0.1",
|
|
64
64
|
"c8": "^12.0.0",
|
|
65
65
|
"documentation": "^14.0.3",
|
package/src/cluster.mjs
CHANGED
|
@@ -10,8 +10,7 @@ import {
|
|
|
10
10
|
} from "./common-attributes.mjs";
|
|
11
11
|
import { writeLines } from "./utils.mjs";
|
|
12
12
|
|
|
13
|
-
export class
|
|
14
|
-
static name = "cluster";
|
|
13
|
+
export class cluster extends Host {
|
|
15
14
|
static priority = 1.5;
|
|
16
15
|
static attributes = {
|
|
17
16
|
masters: {
|
|
@@ -41,17 +40,24 @@ export class Cluster extends Host {
|
|
|
41
40
|
|
|
42
41
|
masters = [];
|
|
43
42
|
backups = [];
|
|
44
|
-
routerId = 100;
|
|
45
43
|
checkInterval = 60;
|
|
46
44
|
|
|
47
|
-
get content() {
|
|
48
|
-
return this.masters.map(m => m.host)[0]?.content;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
45
|
get members() {
|
|
52
46
|
return new Set(this.masters).union(new Set(this.backups));
|
|
53
47
|
}
|
|
54
48
|
|
|
49
|
+
isMember(host) {
|
|
50
|
+
return super.isMember(host) || this.hosts.get(host.name) === host;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get hosts() {
|
|
54
|
+
return new Map([...this.members].map(m => [m.host.name, m.host]));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
get content() {
|
|
58
|
+
return [...this.hosts.values()][0]?.content;
|
|
59
|
+
}
|
|
60
|
+
|
|
55
61
|
async *preparePackages(stagingDir) {
|
|
56
62
|
for (const ni of [...this.owner.clusters.values()].reduce(
|
|
57
63
|
(all, cluster) => all.union(cluster.members),
|
package/src/core.mjs
CHANGED
|
@@ -219,7 +219,7 @@ export class core {
|
|
|
219
219
|
mapFromDirections(directions, property) {
|
|
220
220
|
return new AggregatedMap(
|
|
221
221
|
[...this.walkDirections(directions)]
|
|
222
|
-
.filter(node => node
|
|
222
|
+
.filter(node => node?.[property])
|
|
223
223
|
.map(node => node[property])
|
|
224
224
|
);
|
|
225
225
|
}
|
package/src/host.mjs
CHANGED
|
@@ -178,6 +178,10 @@ export class Host extends ServiceOwner {
|
|
|
178
178
|
return parts[parts.length - 1].toLowerCase();
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
isMember(host) {
|
|
182
|
+
return this === host;
|
|
183
|
+
}
|
|
184
|
+
|
|
181
185
|
get services() {
|
|
182
186
|
return new AggregatedMap([
|
|
183
187
|
this._services,
|
|
@@ -318,7 +322,7 @@ export class Host extends ServiceOwner {
|
|
|
318
322
|
const packageData = await this.packageData;
|
|
319
323
|
|
|
320
324
|
packageData.sources.push(
|
|
321
|
-
...await Array.fromAsync(this.templateContent()),
|
|
325
|
+
...(await Array.fromAsync(this.templateContent())),
|
|
322
326
|
new FileContentProvider({
|
|
323
327
|
dir,
|
|
324
328
|
pattern: ["**/*", "**/.ssh/*"],
|
package/src/module.mjs
CHANGED
package/src/service-types.mjs
CHANGED
|
@@ -217,6 +217,12 @@ export const ServiceTypes = {
|
|
|
217
217
|
endpoints: [
|
|
218
218
|
{ family: FAMILY_IPV4_IPV6, protocol: UDP, port: 5350, tls: false }
|
|
219
219
|
]
|
|
220
|
+
},
|
|
221
|
+
"mbap": {
|
|
222
|
+
// Modbus TCP
|
|
223
|
+
endpoints: [
|
|
224
|
+
{ family: FAMILY_IPV4_IPV6, protocol: TCP, port: 502, tls: false }
|
|
225
|
+
]
|
|
220
226
|
}
|
|
221
227
|
};
|
|
222
228
|
|
package/src/services/chrony.mjs
CHANGED
|
@@ -83,7 +83,7 @@ export class chrony extends CoreService {
|
|
|
83
83
|
this.servers.flat().map(chronyServer),
|
|
84
84
|
this.peers
|
|
85
85
|
.flat()
|
|
86
|
-
.filter(endpoint => endpoint.host
|
|
86
|
+
.filter(endpoint => !endpoint.service.host.isMember(host))
|
|
87
87
|
.map(chronyServer),
|
|
88
88
|
`mailonchange ${this.administratorEmail} 0.5`,
|
|
89
89
|
"local stratum 10 orphan",
|