pmcf 2.71.9 → 2.71.11
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
CHANGED
package/src/services/chrony.mjs
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
3
|
import { addType } from "../types.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Service,
|
|
6
|
+
ServiceTypeDefinition,
|
|
7
|
+
serviceEndpoints
|
|
8
|
+
} from "../service.mjs";
|
|
5
9
|
import {
|
|
6
10
|
ExtraSourceService,
|
|
7
11
|
ExtraSourceServiceTypeDefinition
|
|
@@ -53,6 +57,9 @@ export class ChronyService extends ExtraSourceService {
|
|
|
53
57
|
|
|
54
58
|
constructor(owner, data) {
|
|
55
59
|
super(owner, data);
|
|
60
|
+
|
|
61
|
+
this._extends.push(new Service(owner, { name: this.name, type: "ntp" }));
|
|
62
|
+
|
|
56
63
|
this.read(data, ChronyServiceTypeDefinition);
|
|
57
64
|
|
|
58
65
|
this._systemd = "chronyd.service";
|
|
@@ -88,12 +95,12 @@ export class ChronyService extends ExtraSourceService {
|
|
|
88
95
|
priority: ">=200"
|
|
89
96
|
},
|
|
90
97
|
endpoints: e =>
|
|
91
|
-
e.
|
|
98
|
+
e.type === "ntp" &&
|
|
99
|
+
e.service.host !== host &&
|
|
100
|
+
e.networkInterface?.kind !== "loopback",
|
|
92
101
|
|
|
93
102
|
select: endpoint =>
|
|
94
|
-
`${endpoint.isPool ? "pool" : "server"} ${
|
|
95
|
-
endpoint.domainName
|
|
96
|
-
} iburst`,
|
|
103
|
+
`${endpoint.isPool ? "pool" : "server"} ${endpoint.address} iburst`,
|
|
97
104
|
|
|
98
105
|
limit: 7
|
|
99
106
|
}),
|
|
@@ -3,6 +3,7 @@ import { FileContentProvider } from "npm-pkgbuild";
|
|
|
3
3
|
import { addType } from "../types.mjs";
|
|
4
4
|
import { ServiceTypeDefinition, Service } from "../service.mjs";
|
|
5
5
|
import { writeLines } from "../utils.mjs";
|
|
6
|
+
import { addHook } from "../hooks.mjs";
|
|
6
7
|
|
|
7
8
|
const OpenLDAPServiceTypeDefinition = {
|
|
8
9
|
name: "openldap",
|
|
@@ -30,7 +31,7 @@ const OpenLDAPServiceTypeDefinition = {
|
|
|
30
31
|
service: {
|
|
31
32
|
extends: ["ldap"],
|
|
32
33
|
services: {
|
|
33
|
-
|
|
34
|
+
ldap: {
|
|
34
35
|
endpoints: [
|
|
35
36
|
{
|
|
36
37
|
family: "unix",
|
|
@@ -117,10 +118,23 @@ export class OpenLDAPService extends Service {
|
|
|
117
118
|
name: `openldap-${this.location.name}-${name}`,
|
|
118
119
|
description: `openldap definitions for ${this.fullName}@${name}`,
|
|
119
120
|
access: "private",
|
|
120
|
-
dependencies: ["openldap>=2.6.10"]
|
|
121
|
+
dependencies: ["openldap>=2.6.10"],
|
|
122
|
+
hooks: {}
|
|
121
123
|
}
|
|
122
124
|
};
|
|
123
125
|
|
|
126
|
+
addHook(
|
|
127
|
+
packageData.properties.hooks,
|
|
128
|
+
"post_upgrade",
|
|
129
|
+
"setfacl -m u:ldap:r /etc/letsencrypt/archive/*/privkey*.pem"
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
addHook(
|
|
133
|
+
packageData.properties.hooks,
|
|
134
|
+
"post_install",
|
|
135
|
+
"setfacl -m u:ldap:r /etc/letsencrypt/archive/*/privkey*.pem"
|
|
136
|
+
);
|
|
137
|
+
|
|
124
138
|
await writeLines(join(packageData.dir, "etc/conf.d"), "slapd", [
|
|
125
139
|
"SLAPD_OPTIONS=",
|
|
126
140
|
"SLAPD_URLS=ldap:/// ldaps:/// ldapi://%2Frun%2Fldapi"
|
|
@@ -38,23 +38,24 @@ export class SystemdTimesyncdService extends ExtraSourceService {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
systemdConfigs(name) {
|
|
41
|
+
const options = priority => {
|
|
42
|
+
return {
|
|
43
|
+
services: { types: "ntp", priority },
|
|
44
|
+
endpoints: e => e.networkInterface?.kind !== "loopback",
|
|
45
|
+
select: endpoint => endpoint.address,
|
|
46
|
+
join: " ",
|
|
47
|
+
limit: 2
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
|
|
41
51
|
return {
|
|
42
52
|
serviceName: "systemd-timesyncd.service",
|
|
43
53
|
configFileName: `etc/systemd/timesyncd.conf.d/${name}.conf`,
|
|
44
54
|
content: [
|
|
45
55
|
"Time",
|
|
46
56
|
{
|
|
47
|
-
NTP: serviceEndpoints(this,
|
|
48
|
-
|
|
49
|
-
types: "ntp",
|
|
50
|
-
priority: "[200:399]"
|
|
51
|
-
},
|
|
52
|
-
endpoints: endpoint =>
|
|
53
|
-
endpoint.networkInterface.kind !== "loopback",
|
|
54
|
-
select: endpoint => endpoint.domainName,
|
|
55
|
-
limit: 2,
|
|
56
|
-
join: " "
|
|
57
|
-
})
|
|
57
|
+
NTP: serviceEndpoints(this, options("[300:399]")),
|
|
58
|
+
FallbackNTP: serviceEndpoints(this, options("[100:199]"))
|
|
58
59
|
}
|
|
59
60
|
]
|
|
60
61
|
};
|