pmcf 6.68.14 → 6.69.0
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/owner.mjs +3 -4
- package/src/services/chrony.mjs +4 -4
- package/src/services/keepalived.mjs +11 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.69.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"content-entry-transform": "^1.7.11",
|
|
55
55
|
"filtered-map": "^1.0.0",
|
|
56
56
|
"ip-utilties": "^3.13.1",
|
|
57
|
-
"npm-pkgbuild": "^22.2.
|
|
58
|
-
"pacc": "^14.
|
|
57
|
+
"npm-pkgbuild": "^22.2.19",
|
|
58
|
+
"pacc": "^14.4.0",
|
|
59
59
|
"package-directory": "^8.2.0",
|
|
60
60
|
"yaml": "^2.9.1"
|
|
61
61
|
},
|
package/src/owner.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { FilteredMap } from "filtered-map";
|
|
|
5
5
|
import {
|
|
6
6
|
string_set_attribute_writable,
|
|
7
7
|
string_attribute_writable,
|
|
8
|
-
|
|
8
|
+
email_attribute_writable,
|
|
9
9
|
asArray
|
|
10
10
|
} from "pacc";
|
|
11
11
|
import { union } from "./utils.mjs";
|
|
@@ -54,9 +54,8 @@ export class owner extends ServiceOwner {
|
|
|
54
54
|
description: "unix locale"
|
|
55
55
|
},
|
|
56
56
|
administratorEmail: {
|
|
57
|
-
...
|
|
58
|
-
name: "administratorEmail"
|
|
59
|
-
writable: true
|
|
57
|
+
...email_attribute_writable,
|
|
58
|
+
name: "administratorEmail"
|
|
60
59
|
}
|
|
61
60
|
};
|
|
62
61
|
|
package/src/services/chrony.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
import { default_collection_attribute_writable, asArray } from "pacc";
|
|
2
|
+
import { default_collection_attribute_writable, leafValues, asArray } from "pacc";
|
|
3
3
|
import { addType, CoreService } from "pmcf";
|
|
4
4
|
import { writeLines } from "../utils.mjs";
|
|
5
5
|
import { FAMILY_UNIX, FAMILY_IPV4_IPV6, PROTOCOL_TCP } from "../constants.mjs";
|
|
@@ -41,7 +41,7 @@ export class chrony extends CoreService {
|
|
|
41
41
|
|
|
42
42
|
async *preparePackages(dir) {
|
|
43
43
|
const packageData = await this.preparePackage(dir);
|
|
44
|
-
const
|
|
44
|
+
const addresses = [...new Set(leafValues(this.subnets).map(s=>s.address))];
|
|
45
45
|
const host = this.host;
|
|
46
46
|
|
|
47
47
|
function chronyServer(endpoint) {
|
|
@@ -74,9 +74,9 @@ export class chrony extends CoreService {
|
|
|
74
74
|
"ntsdumpdir /var/lib/chrony",
|
|
75
75
|
"dumpdir /var/lib/chrony",
|
|
76
76
|
"pidfile /run/chrony/chronyd.pid",
|
|
77
|
-
|
|
77
|
+
addresses.map(address => `allow ${address}`),
|
|
78
78
|
"cmdratelimit interval -4 burst 16",
|
|
79
|
-
|
|
79
|
+
addresses.map(address => `cmdallow ${address}`)
|
|
80
80
|
];
|
|
81
81
|
|
|
82
82
|
await writeLines(join(dir, "etc"), "chrony.conf", lines);
|
|
@@ -3,7 +3,8 @@ import {
|
|
|
3
3
|
default_attribute_writable,
|
|
4
4
|
default_collection_attribute_writable,
|
|
5
5
|
enum_string_attribute_writable,
|
|
6
|
-
priority_attribute_writable
|
|
6
|
+
priority_attribute_writable,
|
|
7
|
+
email_attribute_writable
|
|
7
8
|
} from "pacc";
|
|
8
9
|
import { FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
|
|
9
10
|
import { addType } from "../type.mjs";
|
|
@@ -73,6 +74,8 @@ export class keepalive_cluster_member extends core {
|
|
|
73
74
|
|
|
74
75
|
const states = ["master", "backup", "fault"];
|
|
75
76
|
|
|
77
|
+
const SCOPE_KEEPALIVED = "keepalived";
|
|
78
|
+
|
|
76
79
|
export class keepalived extends CoreService {
|
|
77
80
|
static priority = 1.5;
|
|
78
81
|
static attributes = {
|
|
@@ -80,6 +83,12 @@ export class keepalived extends CoreService {
|
|
|
80
83
|
...default_collection_attribute_writable,
|
|
81
84
|
type: keepalive_cluster_member,
|
|
82
85
|
name: "clusters"
|
|
86
|
+
},
|
|
87
|
+
notification_email_from: {
|
|
88
|
+
...email_attribute_writable,
|
|
89
|
+
name: "notification_email_from",
|
|
90
|
+
default: "keepalived",
|
|
91
|
+
scope: SCOPE_KEEPALIVED
|
|
83
92
|
}
|
|
84
93
|
};
|
|
85
94
|
|
|
@@ -106,7 +115,7 @@ export class keepalived extends CoreService {
|
|
|
106
115
|
" " + this.administratorEmail,
|
|
107
116
|
" }",
|
|
108
117
|
...extra,
|
|
109
|
-
` notification_email_from
|
|
118
|
+
` notification_email_from ${this.notification_email_from}`,
|
|
110
119
|
" enable_script_security",
|
|
111
120
|
" script_user root",
|
|
112
121
|
" max_auto_priority 20",
|