pmcf 1.90.0 → 1.91.1
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 +1 -1
- package/src/cluster.mjs +7 -3
- package/src/service.mjs +17 -3
- package/types/cluster.d.mts +6 -0
package/package.json
CHANGED
package/src/cluster.mjs
CHANGED
|
@@ -14,7 +14,8 @@ const ClusterTypeDefinition = {
|
|
|
14
14
|
routerId: { type: "number", collection: false, writeable: true },
|
|
15
15
|
masters: { type: "network_interface", collection: true, writeable: true },
|
|
16
16
|
backups: { type: "network_interface", collection: true, writeable: true },
|
|
17
|
-
members: { type: "network_interface", collection: true, writeable: false }
|
|
17
|
+
members: { type: "network_interface", collection: true, writeable: false },
|
|
18
|
+
checkInterval: { type: "number", collection: false, writeable: true }
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
21
|
|
|
@@ -22,6 +23,7 @@ export class Cluster extends Host {
|
|
|
22
23
|
#masters = new Set();
|
|
23
24
|
#backups = new Set();
|
|
24
25
|
routerId = 100;
|
|
26
|
+
checkInterval = 60;
|
|
25
27
|
|
|
26
28
|
static {
|
|
27
29
|
addType(this);
|
|
@@ -105,7 +107,9 @@ export class Cluster extends Host {
|
|
|
105
107
|
);
|
|
106
108
|
cfg.push(" }");
|
|
107
109
|
cfg.push(` virtual_router_id ${cluster.routerId}`);
|
|
108
|
-
cfg.push(
|
|
110
|
+
cfg.push(
|
|
111
|
+
` priority ${host.priority - (cluster.masters.has(ni) ? 0 : 5)}`
|
|
112
|
+
);
|
|
109
113
|
cfg.push(" smtp_alert");
|
|
110
114
|
cfg.push(" advert_int 5");
|
|
111
115
|
cfg.push(" authentication {");
|
|
@@ -128,7 +132,7 @@ export class Cluster extends Host {
|
|
|
128
132
|
|
|
129
133
|
for (const service of cluster.findServices({ type: "http|dns|smtp" })) {
|
|
130
134
|
cfg.push(`virtual_server ${cluster.rawAddress} ${service.port} {`);
|
|
131
|
-
cfg.push(
|
|
135
|
+
cfg.push(` delay_loop ${cluster.checkInterval}`);
|
|
132
136
|
cfg.push(" lb_algo wlc");
|
|
133
137
|
cfg.push(" persistence_timeout 600");
|
|
134
138
|
cfg.push(` protocol ${service.protocol.toUpperCase()}`);
|
package/src/service.mjs
CHANGED
|
@@ -35,7 +35,22 @@ const ServiceTypes = {
|
|
|
35
35
|
ssh: { protocol: "tcp", port: 22, tls: false },
|
|
36
36
|
imap: { protocol: "tcp", port: 143, tls: false },
|
|
37
37
|
imaps: { protocol: "tcp", port: 993, tls: true },
|
|
38
|
-
dhcp: { tls: false }
|
|
38
|
+
dhcp: { tls: false },
|
|
39
|
+
smb: { protocol: "tcp", port: 445, tls: false },
|
|
40
|
+
timemachine: {
|
|
41
|
+
type: "adisk",
|
|
42
|
+
protocol: "tcp",
|
|
43
|
+
tls: false,
|
|
44
|
+
dnsRecord: {
|
|
45
|
+
type: "TXT",
|
|
46
|
+
parameters: {
|
|
47
|
+
sys: "waMa=0",
|
|
48
|
+
adVF: "0x100",
|
|
49
|
+
dk0: "adVN=MF-TM-999",
|
|
50
|
+
// adVF: "0x82"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
39
54
|
};
|
|
40
55
|
|
|
41
56
|
const ServiceTypeDefinition = {
|
|
@@ -197,8 +212,7 @@ export class Service extends Base {
|
|
|
197
212
|
return ServiceTypes[this.type]?.tls || false;
|
|
198
213
|
}
|
|
199
214
|
|
|
200
|
-
get systemdServices()
|
|
201
|
-
{
|
|
215
|
+
get systemdServices() {
|
|
202
216
|
return this.#systemd;
|
|
203
217
|
}
|
|
204
218
|
|
package/types/cluster.d.mts
CHANGED
|
@@ -416,9 +416,15 @@ export class Cluster extends Host {
|
|
|
416
416
|
collection: boolean;
|
|
417
417
|
writeable: boolean;
|
|
418
418
|
};
|
|
419
|
+
checkInterval: {
|
|
420
|
+
type: string;
|
|
421
|
+
collection: boolean;
|
|
422
|
+
writeable: boolean;
|
|
423
|
+
};
|
|
419
424
|
};
|
|
420
425
|
};
|
|
421
426
|
routerId: number;
|
|
427
|
+
checkInterval: number;
|
|
422
428
|
set masters(value: Set<any>);
|
|
423
429
|
get masters(): Set<any>;
|
|
424
430
|
set backups(value: Set<any>);
|