pmcf 2.54.0 → 2.55.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/endpoint.mjs +6 -1
- package/src/host.mjs +3 -3
- package/src/services/chrony.mjs +8 -14
- package/types/endpoint.d.mts +1 -0
- package/types/services/chrony.d.mts +1 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.55.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"ip-utilties": "^1.3.3",
|
|
49
49
|
"npm-pkgbuild": "^18.2.8",
|
|
50
|
-
"pacc": "^3.4.
|
|
50
|
+
"pacc": "^3.4.3",
|
|
51
51
|
"pkg-dir": "^8.0.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"ava": "^6.3.0",
|
|
56
56
|
"c8": "^10.1.3",
|
|
57
57
|
"documentation": "^14.0.3",
|
|
58
|
-
"semantic-release": "^24.2.
|
|
58
|
+
"semantic-release": "^24.2.5",
|
|
59
59
|
"typescript": "^5.8.3"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
package/src/endpoint.mjs
CHANGED
|
@@ -62,7 +62,7 @@ export class Endpoint extends PortEndpoint {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
get address() {
|
|
65
|
-
return this.networkAddress
|
|
65
|
+
return this.networkAddress.address;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
get family() {
|
|
@@ -87,6 +87,11 @@ export class DomainNameEndpoint extends PortEndpoint {
|
|
|
87
87
|
get address() {
|
|
88
88
|
return this.domainName;
|
|
89
89
|
}
|
|
90
|
+
|
|
91
|
+
get isPool()
|
|
92
|
+
{
|
|
93
|
+
return this.domainName.indexOf('pool') >= 0; // TODO
|
|
94
|
+
}
|
|
90
95
|
}
|
|
91
96
|
|
|
92
97
|
export class HTTPEndpoint extends BaseEndpoint {
|
package/src/host.mjs
CHANGED
|
@@ -453,15 +453,15 @@ export class Host extends ServiceOwner {
|
|
|
453
453
|
}
|
|
454
454
|
|
|
455
455
|
get subnets() {
|
|
456
|
-
const sn = new
|
|
456
|
+
const sn = new Map();
|
|
457
457
|
|
|
458
458
|
for (const networkInterface of this.networkInterfaces.values()) {
|
|
459
459
|
for (const s of networkInterface.subnets()) {
|
|
460
|
-
sn.
|
|
460
|
+
sn.set(s.address,s);
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
463
|
|
|
464
|
-
return sn;
|
|
464
|
+
return new Set(sn.values());
|
|
465
465
|
}
|
|
466
466
|
|
|
467
467
|
async publicKey(type = "ed25519") {
|
package/src/services/chrony.mjs
CHANGED
|
@@ -14,14 +14,7 @@ const ChronyServiceTypeDefinition = {
|
|
|
14
14
|
owners: ServiceTypeDefinition.owners,
|
|
15
15
|
extends: ExtraSourceServiceTypeDefinition,
|
|
16
16
|
priority: 0.1,
|
|
17
|
-
properties: {
|
|
18
|
-
isPool: {
|
|
19
|
-
type: "boolean",
|
|
20
|
-
collection: false,
|
|
21
|
-
writeable: true,
|
|
22
|
-
default: false
|
|
23
|
-
}
|
|
24
|
-
}
|
|
17
|
+
properties: {}
|
|
25
18
|
};
|
|
26
19
|
|
|
27
20
|
export class ChronyService extends ExtraSourceService {
|
|
@@ -69,24 +62,25 @@ export class ChronyService extends ExtraSourceService {
|
|
|
69
62
|
},
|
|
70
63
|
endpoints: e =>
|
|
71
64
|
e.service.host !== host &&
|
|
72
|
-
e.family === "IPv4" &&
|
|
65
|
+
//e.family === "IPv4" &&
|
|
73
66
|
e.networkInterface.kind !== "loopback",
|
|
74
67
|
|
|
75
68
|
select: endpoint =>
|
|
76
|
-
`${endpoint.
|
|
77
|
-
endpoint.domainName
|
|
78
|
-
} iburst`
|
|
69
|
+
`${endpoint.isPool ? "pool" : "server"} ${endpoint.domainName} iburst`
|
|
79
70
|
}),
|
|
80
71
|
`mailonchange ${this.administratorEmail} 0.5`,
|
|
81
72
|
"local stratum 10",
|
|
82
73
|
"leapsectz right/UTC",
|
|
83
74
|
"makestep 1.0 3",
|
|
84
75
|
"ratelimit interval 3 burst 8",
|
|
85
|
-
"cmdratelimit interval -4 burst 16",
|
|
86
76
|
"driftfile /var/lib/chrony/drift",
|
|
87
77
|
"ntsdumpdir /var/lib/chrony",
|
|
88
78
|
"dumpdir /var/lib/chrony",
|
|
89
|
-
"pidfile /run/chrony/chronyd.pid"
|
|
79
|
+
"pidfile /run/chrony/chronyd.pid",
|
|
80
|
+
[...this.subnets].map(s => `allow ${s.address}`),
|
|
81
|
+
"cmdratelimit interval -4 burst 16",
|
|
82
|
+
[...this.subnets].map(s => `cmdallow ${s.address}`)
|
|
83
|
+
//this.endpoints(e=>e.type === "ntp" && e.networkInterface.kind=='loopback').map(endpoint=>`alllow ${endpoint.address}`)
|
|
90
84
|
];
|
|
91
85
|
|
|
92
86
|
await writeLines(join(dir, "etc"), "chrony.conf", lines);
|
package/types/endpoint.d.mts
CHANGED
|
@@ -13,6 +13,7 @@ export class DomainNameEndpoint extends PortEndpoint {
|
|
|
13
13
|
domainName: any;
|
|
14
14
|
get networkInterface(): {};
|
|
15
15
|
get address(): any;
|
|
16
|
+
get isPool(): boolean;
|
|
16
17
|
}
|
|
17
18
|
export class HTTPEndpoint extends BaseEndpoint {
|
|
18
19
|
constructor(service: any, address: any, data: any);
|
|
@@ -253,14 +253,7 @@ export class ChronyService extends ExtraSourceService {
|
|
|
253
253
|
};
|
|
254
254
|
};
|
|
255
255
|
priority: number;
|
|
256
|
-
properties: {
|
|
257
|
-
isPool: {
|
|
258
|
-
type: string;
|
|
259
|
-
collection: boolean;
|
|
260
|
-
writeable: boolean;
|
|
261
|
-
default: boolean;
|
|
262
|
-
};
|
|
263
|
-
};
|
|
256
|
+
properties: {};
|
|
264
257
|
};
|
|
265
258
|
preparePackages(dir: any): AsyncGenerator<{
|
|
266
259
|
dir: any;
|