pmcf 2.33.4 → 2.33.6
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/dns-utils.mjs +1 -1
- package/src/location.mjs +2 -3
- package/src/module.mjs +2 -1
- package/src/service.mjs +1 -1
- package/src/services/dns.mjs +0 -3
- package/src/services/ntp.mjs +1 -25
- package/src/services/{systemd-journald.mjs → systemd-journal.mjs} +7 -7
- package/src/services/systemd-timesyncd.mjs +56 -0
- package/types/module.d.mts +2 -1
- package/types/services/ntp.d.mts +0 -6
- package/types/services/{systemd-journald.d.mts → systemd-journal.d.mts} +1 -1
- package/types/services/systemd-timesyncd.d.mts +265 -0
package/package.json
CHANGED
package/src/dns-utils.mjs
CHANGED
|
@@ -85,7 +85,7 @@ export function dnsFormatParameters(parameters) {
|
|
|
85
85
|
return Object.entries(parameters)
|
|
86
86
|
.map(([name, value]) =>
|
|
87
87
|
value !== undefined && [...asIterator(value)].length > 0
|
|
88
|
-
? `${name}="${[...asIterator(value)].join(",")}"`
|
|
88
|
+
? `${name}="${[...asIterator(value)].sort().join(",")}"`
|
|
89
89
|
: name
|
|
90
90
|
)
|
|
91
91
|
.sort((a, b) => a[0].localeCompare(b[0]))
|
package/src/location.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
2
1
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
2
|
import { Owner } from "./owner.mjs";
|
|
4
3
|
import { addType } from "./types.mjs";
|
|
@@ -72,8 +71,8 @@ export class Location extends Owner {
|
|
|
72
71
|
|
|
73
72
|
const configs = [
|
|
74
73
|
{ type: "dns" },
|
|
75
|
-
{ type: "
|
|
76
|
-
{ type: "systemd-
|
|
74
|
+
{ type: "systemd-timesyncd" },
|
|
75
|
+
{ type: "systemd-journal" }
|
|
77
76
|
];
|
|
78
77
|
|
|
79
78
|
for (const cfg of configs) {
|
package/src/module.mjs
CHANGED
|
@@ -19,5 +19,6 @@ export * from "./endpoint.mjs";
|
|
|
19
19
|
export * from "./services/dns.mjs";
|
|
20
20
|
export * from "./services/ntp.mjs";
|
|
21
21
|
export * from "./services/dhcp.mjs";
|
|
22
|
-
export * from "./services/systemd-
|
|
22
|
+
export * from "./services/systemd-journal.mjs";
|
|
23
|
+
export * from "./services/systemd-timesyncd.mjs";
|
|
23
24
|
export * from "./types.mjs";
|
package/src/service.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
const ServiceTypes = {
|
|
14
14
|
"systemd-resolved": { endpoints: [] },
|
|
15
15
|
"systemd-timesyncd": { endpoints: [] },
|
|
16
|
-
"systemd-
|
|
16
|
+
"systemd-journal": { endpoints: [] },
|
|
17
17
|
"systemd-journal-remote": { endpoints: [] },
|
|
18
18
|
"systemd-journal-upload": { endpoints: [] },
|
|
19
19
|
ntp: { endpoints: [{ protocol: "udp", port: 123, tls: false }] },
|
package/src/services/dns.mjs
CHANGED
|
@@ -418,7 +418,6 @@ async function generateZoneDefs(dns, location, packageData) {
|
|
|
418
418
|
const hosts = new Set();
|
|
419
419
|
const addresses = new Set();
|
|
420
420
|
|
|
421
|
-
console.log("LIST", location.toString());
|
|
422
421
|
for await (const {
|
|
423
422
|
address,
|
|
424
423
|
subnet,
|
|
@@ -426,8 +425,6 @@ async function generateZoneDefs(dns, location, packageData) {
|
|
|
426
425
|
domainNames,
|
|
427
426
|
family
|
|
428
427
|
} of location.networkAddresses()) {
|
|
429
|
-
console.log("ADDRESS", address);
|
|
430
|
-
|
|
431
428
|
if (
|
|
432
429
|
!dns.exclude.has(networkInterface.network) &&
|
|
433
430
|
!dns.excludeInterfaceKinds.has(networkInterface.kind)
|
package/src/services/ntp.mjs
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
3
|
import { addType } from "../types.mjs";
|
|
4
|
-
import {
|
|
5
|
-
ServiceTypeDefinition,
|
|
6
|
-
serviceAddresses,
|
|
7
|
-
serviceEndpoints
|
|
8
|
-
} from "../service.mjs";
|
|
4
|
+
import { ServiceTypeDefinition, serviceEndpoints } from "../service.mjs";
|
|
9
5
|
import {
|
|
10
6
|
ExtraSourceService,
|
|
11
7
|
ExtraSourceServiceTypeDefinition
|
|
@@ -48,26 +44,6 @@ export class NTPService extends ExtraSourceService {
|
|
|
48
44
|
return NTPServiceTypeDefinition.name;
|
|
49
45
|
}
|
|
50
46
|
|
|
51
|
-
systemdConfig(name) {
|
|
52
|
-
return {
|
|
53
|
-
name: `etc/systemd/timesyncd.conf.d/${name}.conf`,
|
|
54
|
-
content: [
|
|
55
|
-
"Time",
|
|
56
|
-
{
|
|
57
|
-
NTP: serviceAddresses(
|
|
58
|
-
this,
|
|
59
|
-
{
|
|
60
|
-
...NTP_SERVICE_FILTER,
|
|
61
|
-
priority: "<20"
|
|
62
|
-
},
|
|
63
|
-
"domainName",
|
|
64
|
-
() => true
|
|
65
|
-
).join(" ")
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
47
|
async *preparePackages(dir) {
|
|
72
48
|
const network = this.network;
|
|
73
49
|
const host = this.host;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Service, ServiceTypeDefinition } from "pmcf";
|
|
2
2
|
import { addType } from "../types.mjs";
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
name: "systemd-
|
|
4
|
+
const SystemdJournalServiceTypeDefinition = {
|
|
5
|
+
name: "systemd-journal",
|
|
6
6
|
specializationOf: ServiceTypeDefinition,
|
|
7
7
|
owners: ServiceTypeDefinition.owners,
|
|
8
8
|
extends: ServiceTypeDefinition,
|
|
@@ -10,26 +10,26 @@ const SystemdJournaldServiceTypeDefinition = {
|
|
|
10
10
|
properties: {}
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export class
|
|
13
|
+
export class SystemdJournalService extends Service {
|
|
14
14
|
static {
|
|
15
15
|
addType(this);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
static get typeDefinition() {
|
|
19
|
-
return
|
|
19
|
+
return SystemdJournalServiceTypeDefinition;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
constructor(owner, data) {
|
|
23
23
|
super(owner, data);
|
|
24
|
-
this.read(data,
|
|
24
|
+
this.read(data, SystemdJournalServiceTypeDefinition);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
get type() {
|
|
28
|
-
return
|
|
28
|
+
return SystemdJournalServiceTypeDefinition.name;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
get systemdServices() {
|
|
32
|
-
return
|
|
32
|
+
return SystemdJournalServiceTypeDefinition.name;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
systemdConfig(name) {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Service, ServiceTypeDefinition } from "pmcf";
|
|
2
|
+
import { serviceAddresses } from "../service.mjs";
|
|
3
|
+
|
|
4
|
+
import { addType } from "../types.mjs";
|
|
5
|
+
|
|
6
|
+
const SystemdTimesyncdServiceTypeDefinition = {
|
|
7
|
+
name: "systemd-timesyncd",
|
|
8
|
+
specializationOf: ServiceTypeDefinition,
|
|
9
|
+
owners: ServiceTypeDefinition.owners,
|
|
10
|
+
extends: ServiceTypeDefinition,
|
|
11
|
+
priority: 0.1,
|
|
12
|
+
properties: {}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export class SystemdTimesyncdService extends Service {
|
|
16
|
+
static {
|
|
17
|
+
addType(this);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static get typeDefinition() {
|
|
21
|
+
return SystemdTimesyncdServiceTypeDefinition;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
constructor(owner, data) {
|
|
25
|
+
super(owner, data);
|
|
26
|
+
this.read(data, SystemdTimesyncdServiceTypeDefinition);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get type() {
|
|
30
|
+
return SystemdTimesyncdServiceTypeDefinition.name;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get systemdServices() {
|
|
34
|
+
return SystemdTimesyncdServiceTypeDefinition.name;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
systemdConfig(name) {
|
|
38
|
+
return {
|
|
39
|
+
name: `etc/systemd/timesyncd.conf.d/${name}.conf`,
|
|
40
|
+
content: [
|
|
41
|
+
"Time",
|
|
42
|
+
{
|
|
43
|
+
NTP: serviceAddresses(
|
|
44
|
+
this,
|
|
45
|
+
{
|
|
46
|
+
type: "ntp",
|
|
47
|
+
priority: "<20"
|
|
48
|
+
},
|
|
49
|
+
"domainName",
|
|
50
|
+
() => true
|
|
51
|
+
).join(" ")
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
package/types/module.d.mts
CHANGED
|
@@ -19,5 +19,6 @@ export * from "./endpoint.mjs";
|
|
|
19
19
|
export * from "./services/dns.mjs";
|
|
20
20
|
export * from "./services/ntp.mjs";
|
|
21
21
|
export * from "./services/dhcp.mjs";
|
|
22
|
-
export * from "./services/systemd-
|
|
22
|
+
export * from "./services/systemd-journal.mjs";
|
|
23
|
+
export * from "./services/systemd-timesyncd.mjs";
|
|
23
24
|
export * from "./types.mjs";
|
package/types/services/ntp.d.mts
CHANGED
|
@@ -272,12 +272,6 @@ export class NTPService extends ExtraSourceService {
|
|
|
272
272
|
};
|
|
273
273
|
};
|
|
274
274
|
};
|
|
275
|
-
systemdConfig(name: any): {
|
|
276
|
-
name: string;
|
|
277
|
-
content: (string | {
|
|
278
|
-
NTP: string;
|
|
279
|
-
})[];
|
|
280
|
-
};
|
|
281
275
|
preparePackages(dir: any): AsyncGenerator<{
|
|
282
276
|
dir: any;
|
|
283
277
|
sources: FileContentProvider[];
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
export class SystemdTimesyncdService extends Service {
|
|
2
|
+
static get typeDefinition(): {
|
|
3
|
+
name: string;
|
|
4
|
+
specializationOf: {
|
|
5
|
+
name: string;
|
|
6
|
+
owners: string[];
|
|
7
|
+
priority: number;
|
|
8
|
+
extends: {
|
|
9
|
+
name: string;
|
|
10
|
+
owners: any[];
|
|
11
|
+
properties: {
|
|
12
|
+
owner: {
|
|
13
|
+
type: string;
|
|
14
|
+
collection: boolean;
|
|
15
|
+
writeable: boolean;
|
|
16
|
+
};
|
|
17
|
+
type: {
|
|
18
|
+
type: string;
|
|
19
|
+
collection: boolean;
|
|
20
|
+
writeable: boolean;
|
|
21
|
+
};
|
|
22
|
+
name: {
|
|
23
|
+
type: string;
|
|
24
|
+
collection: boolean;
|
|
25
|
+
identifier: boolean;
|
|
26
|
+
writeable: boolean;
|
|
27
|
+
};
|
|
28
|
+
description: {
|
|
29
|
+
type: string;
|
|
30
|
+
collection: boolean;
|
|
31
|
+
writeable: boolean;
|
|
32
|
+
};
|
|
33
|
+
priority: {
|
|
34
|
+
type: string;
|
|
35
|
+
collection: boolean;
|
|
36
|
+
writeable: boolean;
|
|
37
|
+
};
|
|
38
|
+
directory: {
|
|
39
|
+
type: string;
|
|
40
|
+
collection: boolean;
|
|
41
|
+
writeable: boolean;
|
|
42
|
+
};
|
|
43
|
+
packaging: {
|
|
44
|
+
type: string;
|
|
45
|
+
collection: boolean;
|
|
46
|
+
writeable: boolean;
|
|
47
|
+
};
|
|
48
|
+
tags: {
|
|
49
|
+
type: string;
|
|
50
|
+
collection: boolean;
|
|
51
|
+
writeable: boolean;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
specializations: {};
|
|
56
|
+
factoryFor(owner: any, value: any): any;
|
|
57
|
+
properties: {
|
|
58
|
+
ipAddresses: {
|
|
59
|
+
type: string;
|
|
60
|
+
collection: boolean;
|
|
61
|
+
writeable: boolean;
|
|
62
|
+
};
|
|
63
|
+
alias: {
|
|
64
|
+
type: string;
|
|
65
|
+
collection: boolean;
|
|
66
|
+
writeable: boolean;
|
|
67
|
+
};
|
|
68
|
+
weight: {
|
|
69
|
+
type: string;
|
|
70
|
+
collection: boolean;
|
|
71
|
+
writeable: boolean;
|
|
72
|
+
default: number;
|
|
73
|
+
};
|
|
74
|
+
systemd: {
|
|
75
|
+
type: string;
|
|
76
|
+
collection: boolean;
|
|
77
|
+
writeable: boolean;
|
|
78
|
+
};
|
|
79
|
+
port: {
|
|
80
|
+
type: string;
|
|
81
|
+
collection: boolean;
|
|
82
|
+
writeable: boolean;
|
|
83
|
+
};
|
|
84
|
+
protocol: {
|
|
85
|
+
type: string;
|
|
86
|
+
collection: boolean;
|
|
87
|
+
writeable: boolean;
|
|
88
|
+
values: string[];
|
|
89
|
+
};
|
|
90
|
+
type: {
|
|
91
|
+
type: string;
|
|
92
|
+
collection: boolean;
|
|
93
|
+
writeable: boolean;
|
|
94
|
+
};
|
|
95
|
+
tls: {
|
|
96
|
+
type: string;
|
|
97
|
+
collection: boolean;
|
|
98
|
+
writeable: boolean;
|
|
99
|
+
default: boolean;
|
|
100
|
+
};
|
|
101
|
+
hostName: {
|
|
102
|
+
type: string;
|
|
103
|
+
collection: boolean;
|
|
104
|
+
writeable: boolean;
|
|
105
|
+
};
|
|
106
|
+
cidrAddresses: {
|
|
107
|
+
type: string;
|
|
108
|
+
collection: boolean;
|
|
109
|
+
writeable: boolean;
|
|
110
|
+
};
|
|
111
|
+
cidrAddress: {
|
|
112
|
+
type: string;
|
|
113
|
+
collection: boolean;
|
|
114
|
+
writeable: boolean;
|
|
115
|
+
};
|
|
116
|
+
addresses: {
|
|
117
|
+
type: string;
|
|
118
|
+
collection: boolean;
|
|
119
|
+
writeable: boolean;
|
|
120
|
+
};
|
|
121
|
+
address: {
|
|
122
|
+
type: string;
|
|
123
|
+
collection: boolean;
|
|
124
|
+
writeable: boolean;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
owners: string[];
|
|
129
|
+
extends: {
|
|
130
|
+
name: string;
|
|
131
|
+
owners: string[];
|
|
132
|
+
priority: number;
|
|
133
|
+
extends: {
|
|
134
|
+
name: string;
|
|
135
|
+
owners: any[];
|
|
136
|
+
properties: {
|
|
137
|
+
owner: {
|
|
138
|
+
type: string;
|
|
139
|
+
collection: boolean;
|
|
140
|
+
writeable: boolean;
|
|
141
|
+
};
|
|
142
|
+
type: {
|
|
143
|
+
type: string;
|
|
144
|
+
collection: boolean;
|
|
145
|
+
writeable: boolean;
|
|
146
|
+
};
|
|
147
|
+
name: {
|
|
148
|
+
type: string;
|
|
149
|
+
collection: boolean;
|
|
150
|
+
identifier: boolean;
|
|
151
|
+
writeable: boolean;
|
|
152
|
+
};
|
|
153
|
+
description: {
|
|
154
|
+
type: string;
|
|
155
|
+
collection: boolean;
|
|
156
|
+
writeable: boolean;
|
|
157
|
+
};
|
|
158
|
+
priority: {
|
|
159
|
+
type: string;
|
|
160
|
+
collection: boolean;
|
|
161
|
+
writeable: boolean;
|
|
162
|
+
};
|
|
163
|
+
directory: {
|
|
164
|
+
type: string;
|
|
165
|
+
collection: boolean;
|
|
166
|
+
writeable: boolean;
|
|
167
|
+
};
|
|
168
|
+
packaging: {
|
|
169
|
+
type: string;
|
|
170
|
+
collection: boolean;
|
|
171
|
+
writeable: boolean;
|
|
172
|
+
};
|
|
173
|
+
tags: {
|
|
174
|
+
type: string;
|
|
175
|
+
collection: boolean;
|
|
176
|
+
writeable: boolean;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
specializations: {};
|
|
181
|
+
factoryFor(owner: any, value: any): any;
|
|
182
|
+
properties: {
|
|
183
|
+
ipAddresses: {
|
|
184
|
+
type: string;
|
|
185
|
+
collection: boolean;
|
|
186
|
+
writeable: boolean;
|
|
187
|
+
};
|
|
188
|
+
alias: {
|
|
189
|
+
type: string;
|
|
190
|
+
collection: boolean;
|
|
191
|
+
writeable: boolean;
|
|
192
|
+
};
|
|
193
|
+
weight: {
|
|
194
|
+
type: string;
|
|
195
|
+
collection: boolean;
|
|
196
|
+
writeable: boolean;
|
|
197
|
+
default: number;
|
|
198
|
+
};
|
|
199
|
+
systemd: {
|
|
200
|
+
type: string;
|
|
201
|
+
collection: boolean;
|
|
202
|
+
writeable: boolean;
|
|
203
|
+
};
|
|
204
|
+
port: {
|
|
205
|
+
type: string;
|
|
206
|
+
collection: boolean;
|
|
207
|
+
writeable: boolean;
|
|
208
|
+
};
|
|
209
|
+
protocol: {
|
|
210
|
+
type: string;
|
|
211
|
+
collection: boolean;
|
|
212
|
+
writeable: boolean;
|
|
213
|
+
values: string[];
|
|
214
|
+
};
|
|
215
|
+
type: {
|
|
216
|
+
type: string;
|
|
217
|
+
collection: boolean;
|
|
218
|
+
writeable: boolean;
|
|
219
|
+
};
|
|
220
|
+
tls: {
|
|
221
|
+
type: string;
|
|
222
|
+
collection: boolean;
|
|
223
|
+
writeable: boolean;
|
|
224
|
+
default: boolean;
|
|
225
|
+
};
|
|
226
|
+
hostName: {
|
|
227
|
+
type: string;
|
|
228
|
+
collection: boolean;
|
|
229
|
+
writeable: boolean;
|
|
230
|
+
};
|
|
231
|
+
cidrAddresses: {
|
|
232
|
+
type: string;
|
|
233
|
+
collection: boolean;
|
|
234
|
+
writeable: boolean;
|
|
235
|
+
};
|
|
236
|
+
cidrAddress: {
|
|
237
|
+
type: string;
|
|
238
|
+
collection: boolean;
|
|
239
|
+
writeable: boolean;
|
|
240
|
+
};
|
|
241
|
+
addresses: {
|
|
242
|
+
type: string;
|
|
243
|
+
collection: boolean;
|
|
244
|
+
writeable: boolean;
|
|
245
|
+
};
|
|
246
|
+
address: {
|
|
247
|
+
type: string;
|
|
248
|
+
collection: boolean;
|
|
249
|
+
writeable: boolean;
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
priority: number;
|
|
254
|
+
properties: {};
|
|
255
|
+
};
|
|
256
|
+
get type(): string;
|
|
257
|
+
get systemdServices(): string;
|
|
258
|
+
systemdConfig(name: any): {
|
|
259
|
+
name: string;
|
|
260
|
+
content: (string | {
|
|
261
|
+
NTP: string;
|
|
262
|
+
})[];
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
import { Service } from "pmcf";
|