pmcf 3.21.1 → 3.22.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/README.md +20 -20
- package/bin/pmcf-package +11 -3
- package/package.json +1 -1
- package/src/cluster.mjs +3 -3
- package/src/services/chrony.mjs +2 -5
- package/src/services/influxdb.mjs +2 -3
- package/src/services/kea.mjs +2 -5
- package/src/services/mosquitto.mjs +38 -23
- package/src/services/openldap.mjs +2 -12
- package/types/services/mosquitto.d.mts +49 -4
package/README.md
CHANGED
|
@@ -58,26 +58,26 @@ generates config packages for:
|
|
|
58
58
|
* [HTTPEndpoint](#httpendpoint)
|
|
59
59
|
* [Parameters](#parameters-6)
|
|
60
60
|
* [port](#port-1)
|
|
61
|
+
* [SkeletonNetworkInterface](#skeletonnetworkinterface)
|
|
62
|
+
* [networkAddresses](#networkaddresses)
|
|
63
|
+
* [Parameters](#parameters-7)
|
|
61
64
|
* [SystemdJournalRemoteService](#systemdjournalremoteservice)
|
|
62
65
|
* [Properties](#properties)
|
|
63
66
|
* [systemdConfigs](#systemdconfigs)
|
|
64
|
-
* [Parameters](#parameters-
|
|
67
|
+
* [Parameters](#parameters-8)
|
|
65
68
|
* [SystemdJournalUploadService](#systemdjournaluploadservice)
|
|
66
69
|
* [Properties](#properties-1)
|
|
67
70
|
* [systemdConfigs](#systemdconfigs-1)
|
|
68
|
-
* [Parameters](#parameters-
|
|
71
|
+
* [Parameters](#parameters-9)
|
|
69
72
|
* [NetworkAddress](#networkaddress)
|
|
70
|
-
* [Parameters](#parameters-
|
|
73
|
+
* [Parameters](#parameters-10)
|
|
71
74
|
* [subnet](#subnet)
|
|
72
75
|
* [networkInterface](#networkinterface)
|
|
73
76
|
* [address](#address)
|
|
74
77
|
* [addresses](#addresses)
|
|
75
|
-
* [Parameters](#parameters-10)
|
|
76
|
-
* [cidrAddresses](#cidraddresses)
|
|
77
78
|
* [Parameters](#parameters-11)
|
|
78
|
-
* [
|
|
79
|
-
* [
|
|
80
|
-
* [Parameters](#parameters-12)
|
|
79
|
+
* [cidrAddresses](#cidraddresses)
|
|
80
|
+
* [Parameters](#parameters-12)
|
|
81
81
|
* [isTemplate](#istemplate)
|
|
82
82
|
* [services](#services)
|
|
83
83
|
* [Parameters](#parameters-13)
|
|
@@ -177,6 +177,18 @@ Endpoint based on http
|
|
|
177
177
|
|
|
178
178
|
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
|
|
179
179
|
|
|
180
|
+
## SkeletonNetworkInterface
|
|
181
|
+
|
|
182
|
+
**Extends ServiceOwner**
|
|
183
|
+
|
|
184
|
+
### networkAddresses
|
|
185
|
+
|
|
186
|
+
#### Parameters
|
|
187
|
+
|
|
188
|
+
* `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
|
|
189
|
+
|
|
190
|
+
Returns **Iterable<[NetworkAddress](#networkaddress)>** 
|
|
191
|
+
|
|
180
192
|
## SystemdJournalRemoteService
|
|
181
193
|
|
|
182
194
|
**Extends Service**
|
|
@@ -252,18 +264,6 @@ Returns **Iterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Re
|
|
|
252
264
|
|
|
253
265
|
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
|
254
266
|
|
|
255
|
-
## SkeletonNetworkInterface
|
|
256
|
-
|
|
257
|
-
**Extends ServiceOwner**
|
|
258
|
-
|
|
259
|
-
### networkAddresses
|
|
260
|
-
|
|
261
|
-
#### Parameters
|
|
262
|
-
|
|
263
|
-
* `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
|
|
264
|
-
|
|
265
|
-
Returns **Iterable<[NetworkAddress](#networkaddress)>** 
|
|
266
|
-
|
|
267
267
|
## isTemplate
|
|
268
268
|
|
|
269
269
|
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
package/bin/pmcf-package
CHANGED
|
@@ -42,12 +42,20 @@ const publishingDetails = createPublishingDetails(
|
|
|
42
42
|
);
|
|
43
43
|
|
|
44
44
|
for (const object of root.find(args)) {
|
|
45
|
+
if (object.isTemplate) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
45
48
|
const stagingDir = join(options.output, object.fullName);
|
|
46
49
|
|
|
47
50
|
//console.log(`packages for ${object.fullName}`);
|
|
48
51
|
for await (const { sources, outputs, properties } of object.preparePackages(
|
|
49
52
|
stagingDir
|
|
50
53
|
)) {
|
|
54
|
+
console.log(
|
|
55
|
+
(object.fullName + " ").substring(0, 20),
|
|
56
|
+
properties.name
|
|
57
|
+
);
|
|
58
|
+
|
|
51
59
|
for (const outputFactory of outputs) {
|
|
52
60
|
properties.version = pkg.version;
|
|
53
61
|
properties.license = pkg.license;
|
|
@@ -66,9 +74,9 @@ for (const object of root.find(args)) {
|
|
|
66
74
|
options
|
|
67
75
|
);
|
|
68
76
|
|
|
69
|
-
if (properties.verbose) {
|
|
70
|
-
|
|
71
|
-
}
|
|
77
|
+
// if (properties.verbose) {
|
|
78
|
+
console.log(" -> " + artifact);
|
|
79
|
+
// }
|
|
72
80
|
|
|
73
81
|
if (!options.dry) {
|
|
74
82
|
await Promise.all(
|
package/package.json
CHANGED
package/src/cluster.mjs
CHANGED
|
@@ -80,8 +80,8 @@ export class Cluster extends Host {
|
|
|
80
80
|
new Set()
|
|
81
81
|
)) {
|
|
82
82
|
const host = ni.host;
|
|
83
|
-
|
|
84
|
-
const packageStagingDir = join(stagingDir, name);
|
|
83
|
+
|
|
84
|
+
const packageStagingDir = join(stagingDir, host.name);
|
|
85
85
|
const result = {
|
|
86
86
|
sources: [
|
|
87
87
|
new FileContentProvider(packageStagingDir + "/")[
|
|
@@ -90,7 +90,7 @@ export class Cluster extends Host {
|
|
|
90
90
|
],
|
|
91
91
|
outputs: host.outputs,
|
|
92
92
|
properties: {
|
|
93
|
-
name
|
|
93
|
+
name: `keepalived-${host.location.name}-${host.name}`,
|
|
94
94
|
description: `${this.typeName} definitions for ${this.fullName}`,
|
|
95
95
|
access: "private",
|
|
96
96
|
dependencies: ["keepalived>=2.3.4"]
|
package/src/services/chrony.mjs
CHANGED
|
@@ -63,19 +63,16 @@ export class ChronyService extends ExtraSourceService {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
async *preparePackages(dir) {
|
|
66
|
-
const network = this.network;
|
|
67
66
|
const host = this.host;
|
|
68
67
|
const name = host.name;
|
|
69
68
|
|
|
70
|
-
console.log("chrony", host.name, network.name);
|
|
71
|
-
|
|
72
69
|
const packageData = {
|
|
73
70
|
dir,
|
|
74
71
|
sources: [new FileContentProvider(dir + "/")],
|
|
75
72
|
outputs: this.outputs,
|
|
76
73
|
properties: {
|
|
77
|
-
name:
|
|
78
|
-
description:
|
|
74
|
+
name: `${this.typeName}-${this.location.name}-${host.name}`,
|
|
75
|
+
description: `${this.typeName} definitions for ${this.fullName}@${name}`,
|
|
79
76
|
access: "private",
|
|
80
77
|
dependencies: ["chrony>=4.6.1"]
|
|
81
78
|
}
|
|
@@ -50,7 +50,6 @@ export class InfluxdbService extends Service {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
async *preparePackages(dir) {
|
|
53
|
-
const network = this.network;
|
|
54
53
|
const host = this.host;
|
|
55
54
|
const name = host.name;
|
|
56
55
|
|
|
@@ -59,8 +58,8 @@ export class InfluxdbService extends Service {
|
|
|
59
58
|
sources: [new FileContentProvider(dir + "/")],
|
|
60
59
|
outputs: this.outputs,
|
|
61
60
|
properties: {
|
|
62
|
-
name:
|
|
63
|
-
description:
|
|
61
|
+
name: `${this.typeName}-${this.location.name}-${host.name}`,
|
|
62
|
+
description: `${this.typeName} definitions for ${this.fullName}@${name}`,
|
|
64
63
|
access: "private",
|
|
65
64
|
dependencies: ["influxdb>=2.7.0"]
|
|
66
65
|
}
|
package/src/services/kea.mjs
CHANGED
|
@@ -152,9 +152,6 @@ export class KeaService extends Service {
|
|
|
152
152
|
const network = this.network;
|
|
153
153
|
const host = this.host;
|
|
154
154
|
const name = host.name;
|
|
155
|
-
const pkgName = `kea-${this.location.name}-${name}`;
|
|
156
|
-
|
|
157
|
-
console.log(pkgName, this.fullName, network.name);
|
|
158
155
|
|
|
159
156
|
const dnsServerEndpoints = serviceEndpoints(network, {
|
|
160
157
|
services: 'in("dns",types) && priority>=300',
|
|
@@ -166,8 +163,8 @@ export class KeaService extends Service {
|
|
|
166
163
|
sources: [new FileContentProvider(dir + "/")],
|
|
167
164
|
outputs: this.outputs,
|
|
168
165
|
properties: {
|
|
169
|
-
name:
|
|
170
|
-
description:
|
|
166
|
+
name: `${this.typeName}-${this.location.name}-${name}`,
|
|
167
|
+
description: `${this.typeName} definitions for ${this.fullName}@${name}`,
|
|
171
168
|
access: "private",
|
|
172
169
|
dependencies: [`kea>=${keaVersion}`]
|
|
173
170
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
boolean_attribute_writable_true,
|
|
5
|
+
port_attribute,
|
|
6
|
+
string_attribute_writable,
|
|
7
|
+
addType
|
|
8
|
+
} from "pacc";
|
|
4
9
|
import { addServiceType } from "pmcf";
|
|
5
|
-
import { writeLines } from "../utils.mjs";
|
|
10
|
+
import { writeLines, filterConfigurable } from "../utils.mjs";
|
|
6
11
|
import { Service, ServiceTypeDefinition } from "../service.mjs";
|
|
7
12
|
|
|
8
13
|
const MosquittoServiceTypeDefinition = {
|
|
@@ -12,13 +17,30 @@ const MosquittoServiceTypeDefinition = {
|
|
|
12
17
|
owners: ServiceTypeDefinition.owners,
|
|
13
18
|
key: "name",
|
|
14
19
|
attributes: {
|
|
15
|
-
log_timestamp: {
|
|
20
|
+
/*log_timestamp: {
|
|
16
21
|
...boolean_attribute_writable_true,
|
|
17
|
-
|
|
22
|
+
configurable: true
|
|
18
23
|
},
|
|
19
24
|
allow_anonymous: {
|
|
20
25
|
...boolean_attribute_writable_true,
|
|
21
|
-
|
|
26
|
+
configurable: true
|
|
27
|
+
},*/
|
|
28
|
+
listener: {
|
|
29
|
+
...port_attribute,
|
|
30
|
+
writable: true,
|
|
31
|
+
configurable: true
|
|
32
|
+
},
|
|
33
|
+
persistence_location: {
|
|
34
|
+
...string_attribute_writable,
|
|
35
|
+
configurable: true
|
|
36
|
+
},
|
|
37
|
+
password_file: {
|
|
38
|
+
...string_attribute_writable,
|
|
39
|
+
configurable: true
|
|
40
|
+
},
|
|
41
|
+
acl_file: {
|
|
42
|
+
...string_attribute_writable,
|
|
43
|
+
configurable: true
|
|
22
44
|
}
|
|
23
45
|
},
|
|
24
46
|
service: {
|
|
@@ -40,8 +62,11 @@ export class MosquittoService extends Service {
|
|
|
40
62
|
return MosquittoServiceTypeDefinition.name;
|
|
41
63
|
}
|
|
42
64
|
|
|
65
|
+
get listener() {
|
|
66
|
+
return this.endpoint("mqtt").port;
|
|
67
|
+
}
|
|
68
|
+
|
|
43
69
|
async *preparePackages(dir) {
|
|
44
|
-
const network = this.network;
|
|
45
70
|
const host = this.host;
|
|
46
71
|
const name = host.name;
|
|
47
72
|
|
|
@@ -50,31 +75,21 @@ export class MosquittoService extends Service {
|
|
|
50
75
|
sources: [new FileContentProvider(dir + "/")],
|
|
51
76
|
outputs: this.outputs,
|
|
52
77
|
properties: {
|
|
53
|
-
name:
|
|
54
|
-
description:
|
|
78
|
+
name: `${this.typeName}-${this.location.name}-${host.name}`,
|
|
79
|
+
description: `${this.typeName} definitions for ${this.fullName}@${name}`,
|
|
55
80
|
access: "private",
|
|
56
81
|
dependencies: ["mosquitto>=2.0.22"]
|
|
57
82
|
}
|
|
58
83
|
};
|
|
59
84
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
85
|
+
await writeLines(
|
|
86
|
+
join(dir, "etc", "mosquitto"),
|
|
87
|
+
"mosquitto.conf",
|
|
88
|
+
Object.entries(this.getProperties(filterConfigurable)).map(
|
|
89
|
+
([name, value]) => `${name} ${value}`
|
|
64
90
|
)
|
|
65
|
-
.map(([key]) => `${key}: ${this[key]}`);
|
|
66
|
-
|
|
67
|
-
const endpoint = this.endpoint("mqtt");
|
|
68
|
-
|
|
69
|
-
lines.push(
|
|
70
|
-
`listener ${endpoint.port}`,
|
|
71
|
-
"persistence_location /var/lib/mosquitto",
|
|
72
|
-
"password_file /etc/mosquitto/passwd",
|
|
73
|
-
"acl_file /etc/mosquitto/acl"
|
|
74
91
|
);
|
|
75
92
|
|
|
76
|
-
await writeLines(join(dir, "etc", "mosquitto"), "mosquitto.conf", lines);
|
|
77
|
-
|
|
78
93
|
yield packageData;
|
|
79
94
|
}
|
|
80
95
|
}
|
|
@@ -79,21 +79,11 @@ export class OpenLDAPService extends Service {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
async *preparePackages(dir) {
|
|
82
|
-
const network = this.network;
|
|
83
82
|
const host = this.host;
|
|
84
83
|
const name = host.name;
|
|
85
|
-
const pkgName = `openldap-${this.location.name}-${name}`;
|
|
86
84
|
const owner = "ldap";
|
|
87
85
|
const group = "ldap";
|
|
88
86
|
|
|
89
|
-
console.log(
|
|
90
|
-
pkgName,
|
|
91
|
-
this.fullName,
|
|
92
|
-
this.alias,
|
|
93
|
-
network.name,
|
|
94
|
-
this.extends.map(o => o.fullName)
|
|
95
|
-
);
|
|
96
|
-
|
|
97
87
|
const packageData = {
|
|
98
88
|
dir,
|
|
99
89
|
sources: [
|
|
@@ -113,8 +103,8 @@ export class OpenLDAPService extends Service {
|
|
|
113
103
|
],
|
|
114
104
|
outputs: this.outputs,
|
|
115
105
|
properties: {
|
|
116
|
-
name:
|
|
117
|
-
description:
|
|
106
|
+
name: `${this.typeName}-${this.location.name}-${name}`,
|
|
107
|
+
description: `${this.typeName} definitions for ${this.fullName}@${name}`,
|
|
118
108
|
access: "private",
|
|
119
109
|
dependencies: ["openldap>=2.6.10"],
|
|
120
110
|
hooks: {}
|
|
@@ -743,8 +743,52 @@ export class MosquittoService extends Service {
|
|
|
743
743
|
})[];
|
|
744
744
|
key: string;
|
|
745
745
|
attributes: {
|
|
746
|
-
|
|
747
|
-
|
|
746
|
+
listener: {
|
|
747
|
+
writable: boolean;
|
|
748
|
+
configurable: boolean;
|
|
749
|
+
type: object;
|
|
750
|
+
isKey: boolean;
|
|
751
|
+
mandatory: boolean;
|
|
752
|
+
collection: boolean;
|
|
753
|
+
private?: boolean;
|
|
754
|
+
credential?: boolean;
|
|
755
|
+
persistent?: boolean;
|
|
756
|
+
depends?: string;
|
|
757
|
+
description?: string;
|
|
758
|
+
default?: any;
|
|
759
|
+
set?: Function;
|
|
760
|
+
get?: Function;
|
|
761
|
+
toInternal?: Function;
|
|
762
|
+
toExternal?: Function;
|
|
763
|
+
values?: Set<any>;
|
|
764
|
+
externalName?: string;
|
|
765
|
+
env?: string[] | string;
|
|
766
|
+
additionalValues?: object;
|
|
767
|
+
};
|
|
768
|
+
persistence_location: {
|
|
769
|
+
configurable: boolean;
|
|
770
|
+
type: object;
|
|
771
|
+
isKey: boolean;
|
|
772
|
+
writable: boolean;
|
|
773
|
+
mandatory: boolean;
|
|
774
|
+
collection: boolean;
|
|
775
|
+
private?: boolean;
|
|
776
|
+
credential?: boolean;
|
|
777
|
+
persistent?: boolean;
|
|
778
|
+
depends?: string;
|
|
779
|
+
description?: string;
|
|
780
|
+
default?: any;
|
|
781
|
+
set?: Function;
|
|
782
|
+
get?: Function;
|
|
783
|
+
toInternal?: Function;
|
|
784
|
+
toExternal?: Function;
|
|
785
|
+
values?: Set<any>;
|
|
786
|
+
externalName?: string;
|
|
787
|
+
env?: string[] | string;
|
|
788
|
+
additionalValues?: object;
|
|
789
|
+
};
|
|
790
|
+
password_file: {
|
|
791
|
+
configurable: boolean;
|
|
748
792
|
type: object;
|
|
749
793
|
isKey: boolean;
|
|
750
794
|
writable: boolean;
|
|
@@ -765,8 +809,8 @@ export class MosquittoService extends Service {
|
|
|
765
809
|
env?: string[] | string;
|
|
766
810
|
additionalValues?: object;
|
|
767
811
|
};
|
|
768
|
-
|
|
769
|
-
|
|
812
|
+
acl_file: {
|
|
813
|
+
configurable: boolean;
|
|
770
814
|
type: object;
|
|
771
815
|
isKey: boolean;
|
|
772
816
|
writable: boolean;
|
|
@@ -793,6 +837,7 @@ export class MosquittoService extends Service {
|
|
|
793
837
|
};
|
|
794
838
|
};
|
|
795
839
|
get type(): string;
|
|
840
|
+
get listener(): any;
|
|
796
841
|
preparePackages(dir: any): AsyncGenerator<{
|
|
797
842
|
dir: any;
|
|
798
843
|
sources: FileContentProvider[];
|