pmcf 4.8.2 → 4.9.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 +1 -1
- package/src/host-utils.mjs +5 -3
- package/src/host.mjs +3 -2
- package/src/location.mjs +2 -3
- package/src/services/openldap.mjs +2 -17
- package/types/host.d.mts +1 -2
- package/types/location.d.mts +0 -1
package/package.json
CHANGED
package/src/host-utils.mjs
CHANGED
|
@@ -21,13 +21,15 @@ export async function generateMachineInfo(host, packageData) {
|
|
|
21
21
|
|
|
22
22
|
export async function generateKnownHosts(hosts, dir) {
|
|
23
23
|
const keys = [];
|
|
24
|
-
for
|
|
24
|
+
for (const host of hosts) {
|
|
25
25
|
try {
|
|
26
26
|
const [alg, key, desc] = (await host.publicKey("ed25519")).split(/\s+/);
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
for(const domainName of host.domainNames) {
|
|
29
|
+
keys.push(`${domainName} ${alg} ${key}`);
|
|
30
|
+
}
|
|
29
31
|
|
|
30
|
-
for
|
|
32
|
+
for (const addr of host.networkAddresses(
|
|
31
33
|
na => na.networkInterface.kind !== "loopback"
|
|
32
34
|
)) {
|
|
33
35
|
keys.push(`${addr.address} ${alg} ${key}`);
|
package/src/host.mjs
CHANGED
|
@@ -428,12 +428,13 @@ export class Host extends ServiceOwner {
|
|
|
428
428
|
let packageData = {
|
|
429
429
|
dir,
|
|
430
430
|
sources: [
|
|
431
|
+
...this.templateContent(),
|
|
431
432
|
new FileContentProvider(
|
|
432
|
-
{
|
|
433
|
+
{ dir: this.directory, pattern: "*.pub" },
|
|
433
434
|
{ destination: "/etc/ssh/", mode: 0o644 }
|
|
434
435
|
),
|
|
435
436
|
new FileContentProvider(
|
|
436
|
-
{
|
|
437
|
+
{ dir: this.directory, pattern: "*_key" },
|
|
437
438
|
{ destination: "/etc/ssh/", mode: 0o600 }
|
|
438
439
|
),
|
|
439
440
|
new FileContentProvider(dir + "/")
|
package/src/location.mjs
CHANGED
|
@@ -44,7 +44,7 @@ export class Location extends Owner {
|
|
|
44
44
|
sources: [
|
|
45
45
|
new FileContentProvider(dir + "/"),
|
|
46
46
|
new FileContentProvider(
|
|
47
|
-
{
|
|
47
|
+
{ dir: this.directory, pattern: "location.json" },
|
|
48
48
|
{ destination: "/etc/location/location.json" }
|
|
49
49
|
)
|
|
50
50
|
],
|
|
@@ -54,8 +54,7 @@ export class Location extends Owner {
|
|
|
54
54
|
description: `${this.typeName} definitions for ${this.fullName}`,
|
|
55
55
|
access: "private",
|
|
56
56
|
dependencies: { jq: ">=1.8" },
|
|
57
|
-
provides: ["location", "mf-location"]
|
|
58
|
-
replaces: [`mf-location-${this.name}`]
|
|
57
|
+
provides: ["location", "mf-location"]
|
|
59
58
|
}
|
|
60
59
|
};
|
|
61
60
|
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
} from "pacc";
|
|
8
8
|
import { addServiceType } from "pmcf";
|
|
9
9
|
import { ServiceTypeDefinition, Service } from "../service.mjs";
|
|
10
|
-
import { addHook } from "../hooks.mjs";
|
|
11
10
|
|
|
12
11
|
const OpenLDAPServiceTypeDefinition = {
|
|
13
12
|
name: "openldap",
|
|
@@ -84,8 +83,6 @@ export class OpenLDAPService extends Service {
|
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
async *preparePackages(dir) {
|
|
87
|
-
const host = this.host;
|
|
88
|
-
const name = host.name;
|
|
89
86
|
const owner = "ldap";
|
|
90
87
|
const group = "ldap";
|
|
91
88
|
|
|
@@ -108,25 +105,13 @@ export class OpenLDAPService extends Service {
|
|
|
108
105
|
],
|
|
109
106
|
outputs: this.outputs,
|
|
110
107
|
properties: {
|
|
111
|
-
name: `${this.typeName}-${this.location.name}-${name}`,
|
|
112
|
-
description: `${this.typeName} definitions for ${this.fullName}@${name}`,
|
|
108
|
+
name: `${this.typeName}-${this.location.name}-${this.host.name}`,
|
|
109
|
+
description: `${this.typeName} definitions for ${this.fullName}@${this.host.name}`,
|
|
113
110
|
access: "private",
|
|
114
111
|
dependencies: ["openldap>=2.6.10"]
|
|
115
112
|
}
|
|
116
113
|
};
|
|
117
114
|
|
|
118
|
-
addHook(
|
|
119
|
-
packageData,
|
|
120
|
-
"post_upgrade",
|
|
121
|
-
`setfacl -m u:${owner}:r /etc/letsencrypt/archive/*/privkey*.pem`
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
addHook(
|
|
125
|
-
packageData,
|
|
126
|
-
"post_install",
|
|
127
|
-
`setfacl -m u:${owner}:r /etc/letsencrypt/archive/*/privkey*.pem`
|
|
128
|
-
);
|
|
129
|
-
|
|
130
115
|
yield packageData;
|
|
131
116
|
}
|
|
132
117
|
}
|
package/types/host.d.mts
CHANGED
|
@@ -254,7 +254,7 @@ export class Host extends ServiceOwner {
|
|
|
254
254
|
publicKey(type?: string): Promise<string>;
|
|
255
255
|
preparePackages(dir: any): AsyncGenerator<{
|
|
256
256
|
dir: any;
|
|
257
|
-
sources:
|
|
257
|
+
sources: any[];
|
|
258
258
|
outputs: Set<typeof import("npm-pkgbuild").OCI | typeof import("npm-pkgbuild").DOCKER>;
|
|
259
259
|
properties: {
|
|
260
260
|
name: string;
|
|
@@ -269,5 +269,4 @@ export class Host extends ServiceOwner {
|
|
|
269
269
|
}, void, unknown>;
|
|
270
270
|
}
|
|
271
271
|
import { ServiceOwner } from "pmcf";
|
|
272
|
-
import { FileContentProvider } from "npm-pkgbuild";
|
|
273
272
|
import { Base } from "pmcf";
|