pmcf 1.64.1 → 1.64.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 +1 -1
- package/src/cluster.mjs +8 -3
- package/src/location.mjs +2 -7
- package/src/service.mjs +11 -7
package/package.json
CHANGED
package/src/cluster.mjs
CHANGED
|
@@ -75,9 +75,15 @@ export class Cluster extends Host {
|
|
|
75
75
|
const name = `keepalived-${host.name}`;
|
|
76
76
|
const packageStagingDir = join(stagingDir, name);
|
|
77
77
|
|
|
78
|
-
const cfg = [
|
|
78
|
+
const cfg = [
|
|
79
|
+
"global_defs {",
|
|
80
|
+
" notification_email {",
|
|
81
|
+
" " + this.administratorEmail,
|
|
82
|
+
" }",
|
|
79
83
|
" smtp_server 192.168.1.1",
|
|
80
|
-
|
|
84
|
+
` notification_email_from keepalived@${host.domainName}`,
|
|
85
|
+
"}"
|
|
86
|
+
];
|
|
81
87
|
|
|
82
88
|
for (const cluster of [...this.owner.clusters()].sort((a, b) =>
|
|
83
89
|
a.name.localeCompare(b.name)
|
|
@@ -101,7 +107,6 @@ export class Cluster extends Host {
|
|
|
101
107
|
cfg.push("");
|
|
102
108
|
|
|
103
109
|
for (const service of cluster.findServices({ type: "http" })) {
|
|
104
|
-
console.log("S", service.host.name, service.name);
|
|
105
110
|
cfg.push(`virtual_server ${cluster.rawAddress} ${service.port} {`);
|
|
106
111
|
cfg.push(" delay_loop 6");
|
|
107
112
|
cfg.push(" lb_algo wlc");
|
package/src/location.mjs
CHANGED
|
@@ -47,7 +47,6 @@ export class Location extends Owner {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
async *preparePackages(stagingDir) {
|
|
50
|
-
|
|
51
50
|
await this.loadPackageHooks(
|
|
52
51
|
new URL("location.install", import.meta.url).pathname
|
|
53
52
|
);
|
|
@@ -90,12 +89,8 @@ export class Location extends Owner {
|
|
|
90
89
|
|
|
91
90
|
result.properties.name = `${this.typeName}-${this.name}`;
|
|
92
91
|
|
|
93
|
-
result.properties.provides = [
|
|
94
|
-
|
|
95
|
-
"mf-location",
|
|
96
|
-
`mf-location-${this.name}`
|
|
97
|
-
];
|
|
98
|
-
result.properties.depends = {"jq":">=1.6"};
|
|
92
|
+
result.properties.provides = ["location", "mf-location"];
|
|
93
|
+
result.properties.depends = { jq: ">=1.6" };
|
|
99
94
|
result.properties.replaces = [`mf-location-${this.name}`];
|
|
100
95
|
|
|
101
96
|
result.sources.push(
|
package/src/service.mjs
CHANGED
|
@@ -79,18 +79,15 @@ export class Service extends Base {
|
|
|
79
79
|
return this;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
get server()
|
|
83
|
-
{
|
|
82
|
+
get server() {
|
|
84
83
|
return this.owner;
|
|
85
84
|
}
|
|
86
85
|
|
|
87
|
-
get domainName()
|
|
88
|
-
{
|
|
86
|
+
get domainName() {
|
|
89
87
|
return this.server.domainName;
|
|
90
88
|
}
|
|
91
89
|
|
|
92
|
-
get rawAddress()
|
|
93
|
-
{
|
|
90
|
+
get rawAddress() {
|
|
94
91
|
return this.#ipAddresses?.[0] || this.server.rawAddress;
|
|
95
92
|
}
|
|
96
93
|
|
|
@@ -119,7 +116,14 @@ export class Service extends Base {
|
|
|
119
116
|
}
|
|
120
117
|
|
|
121
118
|
get priority() {
|
|
122
|
-
|
|
119
|
+
if (this.#priority !== undefined) {
|
|
120
|
+
return this.#priority;
|
|
121
|
+
}
|
|
122
|
+
if (this.owner.priority !== undefined) {
|
|
123
|
+
return this.owner.priority;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return 99;
|
|
123
127
|
}
|
|
124
128
|
|
|
125
129
|
set weight(value) {
|