pmcf 2.68.1 → 2.69.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 -2
- package/src/module.mjs +1 -0
- package/src/services/mosquitto.mjs +66 -0
- package/types/module.d.mts +1 -0
- package/types/services/mosquitto.d.mts +273 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.69.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"systemd",
|
|
24
24
|
"chrony",
|
|
25
25
|
"influxdb",
|
|
26
|
-
"openldap"
|
|
26
|
+
"openldap",
|
|
27
|
+
"mosquitto"
|
|
27
28
|
],
|
|
28
29
|
"contributors": [
|
|
29
30
|
{
|
package/src/module.mjs
CHANGED
|
@@ -23,6 +23,7 @@ export * from "./services/chrony.mjs";
|
|
|
23
23
|
export * from "./services/kea.mjs";
|
|
24
24
|
export * from "./services/openldap.mjs";
|
|
25
25
|
export * from "./services/influxdb.mjs";
|
|
26
|
+
export * from "./services/mosquitto.mjs";
|
|
26
27
|
export * from "./services/systemd-journal.mjs";
|
|
27
28
|
export * from "./services/systemd-journal-remote.mjs";
|
|
28
29
|
export * from "./services/systemd-journal-upload.mjs";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
|
+
import { writeLines } from "../utils.mjs";
|
|
4
|
+
import { addType } from "../types.mjs";
|
|
5
|
+
import { Service, ServiceTypeDefinition } from "../service.mjs";
|
|
6
|
+
|
|
7
|
+
const MosquittoServiceTypeDefinition = {
|
|
8
|
+
name: "mosquitto",
|
|
9
|
+
specializationOf: ServiceTypeDefinition,
|
|
10
|
+
owners: ServiceTypeDefinition.owners,
|
|
11
|
+
extends: ServiceTypeDefinition,
|
|
12
|
+
priority: 0.1,
|
|
13
|
+
properties: {},
|
|
14
|
+
service: {
|
|
15
|
+
extends: ["mqtt"]
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export class MosquittoService extends Service {
|
|
20
|
+
static {
|
|
21
|
+
addType(this);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static get typeDefinition() {
|
|
25
|
+
return MosquittoServiceTypeDefinition;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
constructor(owner, data) {
|
|
29
|
+
super(owner, data);
|
|
30
|
+
this.read(data, MosquittoServiceTypeDefinition);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get type() {
|
|
34
|
+
return MosquittoServiceTypeDefinition.name;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async *preparePackages(dir) {
|
|
38
|
+
const network = this.network;
|
|
39
|
+
const host = this.host;
|
|
40
|
+
const name = host.name;
|
|
41
|
+
|
|
42
|
+
const packageData = {
|
|
43
|
+
dir,
|
|
44
|
+
sources: [new FileContentProvider(dir + "/")],
|
|
45
|
+
outputs: this.outputs,
|
|
46
|
+
properties: {
|
|
47
|
+
name: `mosquitto-${this.location.name}-${host.name}`,
|
|
48
|
+
description: `mosquitto definitions for ${this.fullName}@${name}`,
|
|
49
|
+
access: "private",
|
|
50
|
+
dependencies: ["mosquitto>=2.0.21"]
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const endpoint = this.endpoint(e => e.type === "mosquitto");
|
|
55
|
+
|
|
56
|
+
const lines = [
|
|
57
|
+
`listener ${endpoint.port}`,
|
|
58
|
+
"log_timestamp false",
|
|
59
|
+
"allow_anonymous true"
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
await writeLines(join(dir, "etc", "mosquitto"), "mosquitto.conf", lines);
|
|
63
|
+
|
|
64
|
+
yield packageData;
|
|
65
|
+
}
|
|
66
|
+
}
|
package/types/module.d.mts
CHANGED
|
@@ -23,6 +23,7 @@ export * from "./services/chrony.mjs";
|
|
|
23
23
|
export * from "./services/kea.mjs";
|
|
24
24
|
export * from "./services/openldap.mjs";
|
|
25
25
|
export * from "./services/influxdb.mjs";
|
|
26
|
+
export * from "./services/mosquitto.mjs";
|
|
26
27
|
export * from "./services/systemd-journal.mjs";
|
|
27
28
|
export * from "./services/systemd-journal-remote.mjs";
|
|
28
29
|
export * from "./services/systemd-journal-upload.mjs";
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
export class MosquittoService 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
|
+
alias: {
|
|
59
|
+
type: string;
|
|
60
|
+
collection: boolean;
|
|
61
|
+
writeable: boolean;
|
|
62
|
+
};
|
|
63
|
+
weight: {
|
|
64
|
+
type: string;
|
|
65
|
+
collection: boolean;
|
|
66
|
+
writeable: boolean;
|
|
67
|
+
default: number;
|
|
68
|
+
};
|
|
69
|
+
systemd: {
|
|
70
|
+
type: string;
|
|
71
|
+
collection: boolean;
|
|
72
|
+
writeable: boolean;
|
|
73
|
+
};
|
|
74
|
+
port: {
|
|
75
|
+
type: string;
|
|
76
|
+
collection: boolean;
|
|
77
|
+
writeable: boolean;
|
|
78
|
+
};
|
|
79
|
+
protocol: {
|
|
80
|
+
type: string;
|
|
81
|
+
collection: boolean;
|
|
82
|
+
writeable: boolean;
|
|
83
|
+
values: string[];
|
|
84
|
+
};
|
|
85
|
+
type: {
|
|
86
|
+
type: string;
|
|
87
|
+
collection: boolean;
|
|
88
|
+
writeable: boolean;
|
|
89
|
+
};
|
|
90
|
+
types: {
|
|
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
|
+
alias: {
|
|
184
|
+
type: string;
|
|
185
|
+
collection: boolean;
|
|
186
|
+
writeable: boolean;
|
|
187
|
+
};
|
|
188
|
+
weight: {
|
|
189
|
+
type: string;
|
|
190
|
+
collection: boolean;
|
|
191
|
+
writeable: boolean;
|
|
192
|
+
default: number;
|
|
193
|
+
};
|
|
194
|
+
systemd: {
|
|
195
|
+
type: string;
|
|
196
|
+
collection: boolean;
|
|
197
|
+
writeable: boolean;
|
|
198
|
+
};
|
|
199
|
+
port: {
|
|
200
|
+
type: string;
|
|
201
|
+
collection: boolean;
|
|
202
|
+
writeable: boolean;
|
|
203
|
+
};
|
|
204
|
+
protocol: {
|
|
205
|
+
type: string;
|
|
206
|
+
collection: boolean;
|
|
207
|
+
writeable: boolean;
|
|
208
|
+
values: string[];
|
|
209
|
+
};
|
|
210
|
+
type: {
|
|
211
|
+
type: string;
|
|
212
|
+
collection: boolean;
|
|
213
|
+
writeable: boolean;
|
|
214
|
+
};
|
|
215
|
+
types: {
|
|
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
|
+
service: {
|
|
256
|
+
extends: string[];
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
get type(): string;
|
|
260
|
+
preparePackages(dir: any): AsyncGenerator<{
|
|
261
|
+
dir: any;
|
|
262
|
+
sources: FileContentProvider[];
|
|
263
|
+
outputs: Set<typeof import("npm-pkgbuild").ARCH | typeof import("npm-pkgbuild").DOCKER>;
|
|
264
|
+
properties: {
|
|
265
|
+
name: string;
|
|
266
|
+
description: string;
|
|
267
|
+
access: string;
|
|
268
|
+
dependencies: string[];
|
|
269
|
+
};
|
|
270
|
+
}, void, unknown>;
|
|
271
|
+
}
|
|
272
|
+
import { Service } from "../service.mjs";
|
|
273
|
+
import { FileContentProvider } from "npm-pkgbuild";
|