pmcf 6.64.8 → 6.65.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/README.md +5 -0
- package/package.json +2 -2
- package/src/base.mjs +4 -3
- package/src/host.mjs +2 -2
- package/src/owner.mjs +8 -0
- package/src/services/keepalived.mjs +15 -4
package/README.md
CHANGED
|
@@ -96,6 +96,7 @@ generates config packages for:
|
|
|
96
96
|
* [Properties](#properties-1)
|
|
97
97
|
* [systemdConfigs](#systemdconfigs-1)
|
|
98
98
|
* [Parameters](#parameters-18)
|
|
99
|
+
* [priority](#priority-1)
|
|
99
100
|
* [NetworkAddress](#networkaddress)
|
|
100
101
|
* [Parameters](#parameters-19)
|
|
101
102
|
* [subnet](#subnet)
|
|
@@ -373,6 +374,10 @@ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
373
374
|
|
|
374
375
|
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
375
376
|
|
|
377
|
+
## priority
|
|
378
|
+
|
|
379
|
+
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
|
|
380
|
+
|
|
376
381
|
## NetworkAddress
|
|
377
382
|
|
|
378
383
|
### Parameters
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.65.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"semantic-release": "^25.0.9"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
70
|
-
"node": ">=26.
|
|
70
|
+
"node": ">=26.10.0"
|
|
71
71
|
},
|
|
72
72
|
"repository": {
|
|
73
73
|
"type": "git",
|
package/src/base.mjs
CHANGED
|
@@ -109,6 +109,10 @@ export class base extends core {
|
|
|
109
109
|
return this.owner?.network;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
get smtp() {
|
|
113
|
+
return this.owner?.smtp;
|
|
114
|
+
}
|
|
115
|
+
|
|
112
116
|
get domain() {
|
|
113
117
|
return this.owner?.domain;
|
|
114
118
|
}
|
|
@@ -177,9 +181,6 @@ export class base extends core {
|
|
|
177
181
|
return this._priority ?? this.owner?.priority;
|
|
178
182
|
}
|
|
179
183
|
|
|
180
|
-
get smtp() {
|
|
181
|
-
return this.expression("services[types[smtp]][0]");
|
|
182
|
-
}
|
|
183
184
|
|
|
184
185
|
get services() {
|
|
185
186
|
return this.owner?.services || new Map();
|
package/src/host.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
string_attribute,
|
|
6
6
|
string_attribute_writable,
|
|
7
7
|
number_attribute_writable,
|
|
8
|
-
|
|
8
|
+
priority_attribute_writable,
|
|
9
9
|
enum_string_attribute_writable,
|
|
10
10
|
asArray
|
|
11
11
|
} from "pacc";
|
|
@@ -38,7 +38,7 @@ export class host extends ServiceOwner {
|
|
|
38
38
|
name: "deployment",
|
|
39
39
|
values: new Set(["production", "development"])
|
|
40
40
|
},
|
|
41
|
-
priority:
|
|
41
|
+
priority: priority_attribute_writable,
|
|
42
42
|
weight: { ...number_attribute_writable, name: "weight" },
|
|
43
43
|
serial: { ...string_attribute_writable, name: "serial" },
|
|
44
44
|
vendor: { ...string_attribute_writable, name: "vendor" },
|
package/src/owner.mjs
CHANGED
|
@@ -2,7 +2,8 @@ import { join } from "node:path";
|
|
|
2
2
|
import {
|
|
3
3
|
default_attribute_writable,
|
|
4
4
|
default_collection_attribute_writable,
|
|
5
|
-
enum_string_attribute_writable
|
|
5
|
+
enum_string_attribute_writable,
|
|
6
|
+
priority_attribute_writable
|
|
6
7
|
} from "pacc";
|
|
7
8
|
import { FAMILY_IPV4 } from "ip-utilties";
|
|
8
9
|
import { addType } from "../type.mjs";
|
|
@@ -29,7 +30,8 @@ export class keepalive_cluster_member extends core {
|
|
|
29
30
|
...enum_string_attribute_writable,
|
|
30
31
|
name: "role",
|
|
31
32
|
values: new Set(Object.keys(ROLE_PRIORITIES))
|
|
32
|
-
}
|
|
33
|
+
},
|
|
34
|
+
priority: priority_attribute_writable
|
|
33
35
|
};
|
|
34
36
|
static key = "cluster";
|
|
35
37
|
static {
|
|
@@ -58,7 +60,14 @@ export class keepalive_cluster_member extends core {
|
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
get priority() {
|
|
61
|
-
return
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @return {number}
|
|
68
|
+
*/
|
|
69
|
+
get priority() {
|
|
70
|
+
return this._priority ?? this.owner.priority + ROLE_PRIORITIES[this.role];
|
|
62
71
|
}
|
|
63
72
|
}
|
|
64
73
|
|
|
@@ -142,7 +151,9 @@ export class keepalived extends CoreService {
|
|
|
142
151
|
cfg.push(" authentication {");
|
|
143
152
|
cfg.push(" auth_type PASS");
|
|
144
153
|
cfg.push(" auth_pass pass1234");
|
|
145
|
-
cfg.push(
|
|
154
|
+
cfg.push(
|
|
155
|
+
` # auth_pass file:\${_ENV CREDENTIALS_DIRECTORY}/keepalived.${cluster.name}.password`
|
|
156
|
+
);
|
|
146
157
|
cfg.push(" # auth_pass ${_ENV " + cred.localName + "}");
|
|
147
158
|
cfg.push(" # auth_pass ${" + cred.localName + "}");
|
|
148
159
|
cfg.push(" }");
|