pmcf 6.5.0 → 6.6.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/package.json +1 -1
- package/src/base.mjs +25 -5
- package/src/host.mjs +0 -17
- package/src/initialization-context.mjs +5 -7
- package/src/service-owner.mjs +0 -18
- package/src/services/mosquitto.mjs +7 -1
- package/src/services/systemd-resolved.mjs +2 -2
package/README.md
CHANGED
|
@@ -77,26 +77,26 @@ generates config packages for:
|
|
|
77
77
|
* [domainNames](#domainnames)
|
|
78
78
|
* [InitializationContext](#initializationcontext)
|
|
79
79
|
* [Parameters](#parameters-13)
|
|
80
|
+
* [SkeletonNetworkInterface](#skeletonnetworkinterface)
|
|
81
|
+
* [networkAddresses](#networkaddresses)
|
|
82
|
+
* [Parameters](#parameters-14)
|
|
80
83
|
* [SystemdJournalRemoteService](#systemdjournalremoteservice)
|
|
81
84
|
* [Properties](#properties)
|
|
82
85
|
* [systemdConfigs](#systemdconfigs)
|
|
83
|
-
* [Parameters](#parameters-
|
|
86
|
+
* [Parameters](#parameters-15)
|
|
84
87
|
* [SystemdJournalUploadService](#systemdjournaluploadservice)
|
|
85
88
|
* [Properties](#properties-1)
|
|
86
89
|
* [systemdConfigs](#systemdconfigs-1)
|
|
87
|
-
* [Parameters](#parameters-
|
|
90
|
+
* [Parameters](#parameters-16)
|
|
88
91
|
* [NetworkAddress](#networkaddress)
|
|
89
|
-
* [Parameters](#parameters-
|
|
92
|
+
* [Parameters](#parameters-17)
|
|
90
93
|
* [subnet](#subnet)
|
|
91
94
|
* [networkInterface](#networkinterface)
|
|
92
95
|
* [address](#address)
|
|
93
96
|
* [addresses](#addresses)
|
|
94
|
-
* [Parameters](#parameters-17)
|
|
95
|
-
* [cidrAddresses](#cidraddresses)
|
|
96
97
|
* [Parameters](#parameters-18)
|
|
97
|
-
* [
|
|
98
|
-
* [
|
|
99
|
-
* [Parameters](#parameters-19)
|
|
98
|
+
* [cidrAddresses](#cidraddresses)
|
|
99
|
+
* [Parameters](#parameters-19)
|
|
100
100
|
* [families](#families)
|
|
101
101
|
* [secretName](#secretname)
|
|
102
102
|
* [directHosts](#directhosts)
|
|
@@ -286,6 +286,18 @@ Keeps track of all in flight object creations and loose ends during config initi
|
|
|
286
286
|
|
|
287
287
|
* `directory` (optional, default `"/"`)
|
|
288
288
|
|
|
289
|
+
## SkeletonNetworkInterface
|
|
290
|
+
|
|
291
|
+
**Extends ServiceOwner**
|
|
292
|
+
|
|
293
|
+
### networkAddresses
|
|
294
|
+
|
|
295
|
+
#### Parameters
|
|
296
|
+
|
|
297
|
+
* `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
|
|
298
|
+
|
|
299
|
+
Returns **Iterable<[NetworkAddress](#networkaddress)>** 
|
|
300
|
+
|
|
289
301
|
## SystemdJournalRemoteService
|
|
290
302
|
|
|
291
303
|
**Extends CoreService**
|
|
@@ -361,18 +373,6 @@ Returns **Iterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Re
|
|
|
361
373
|
|
|
362
374
|
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)>** 
|
|
363
375
|
|
|
364
|
-
## SkeletonNetworkInterface
|
|
365
|
-
|
|
366
|
-
**Extends ServiceOwner**
|
|
367
|
-
|
|
368
|
-
### networkAddresses
|
|
369
|
-
|
|
370
|
-
#### Parameters
|
|
371
|
-
|
|
372
|
-
* `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
|
|
373
|
-
|
|
374
|
-
Returns **Iterable<[NetworkAddress](#networkaddress)>** 
|
|
375
|
-
|
|
376
376
|
## families
|
|
377
377
|
|
|
378
378
|
Returns **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
package/package.json
CHANGED
package/src/base.mjs
CHANGED
|
@@ -91,7 +91,29 @@ export class Base {
|
|
|
91
91
|
return this;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
materializeExtends() {
|
|
94
|
+
materializeExtends() {
|
|
95
|
+
for (const [path, attribute] of extendingAttributeIterator(
|
|
96
|
+
this.constructor,
|
|
97
|
+
attribute => attribute.collection && !attribute.type.primitive
|
|
98
|
+
)) {
|
|
99
|
+
const collection = this[path];
|
|
100
|
+
if (typeof collection?.get === "function") {
|
|
101
|
+
for (const [name, extending] of this.mapFromDirections(
|
|
102
|
+
["extends"],
|
|
103
|
+
path
|
|
104
|
+
)) {
|
|
105
|
+
const present = collection.get(extending.name);
|
|
106
|
+
|
|
107
|
+
if (present) {
|
|
108
|
+
present.extends.add(extending);
|
|
109
|
+
present.materializeExtends();
|
|
110
|
+
} else {
|
|
111
|
+
collection.set(extending.name, extending.forOwner(this));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
95
117
|
|
|
96
118
|
named(name) {
|
|
97
119
|
if (name[0] === "/") {
|
|
@@ -190,7 +212,7 @@ export class Base {
|
|
|
190
212
|
*walkDirections(directions = ["this", "extends", "owner"]) {
|
|
191
213
|
if (directions.indexOf("this") >= 0) {
|
|
192
214
|
yield this;
|
|
193
|
-
directions = directions.filter(d => d
|
|
215
|
+
directions = directions.filter(d => d !== "this");
|
|
194
216
|
}
|
|
195
217
|
|
|
196
218
|
yield* this._walkDirections(directions, new Set());
|
|
@@ -422,7 +444,7 @@ export class Base {
|
|
|
422
444
|
get packageContentPermissions() {
|
|
423
445
|
const owner = this.constructor.name;
|
|
424
446
|
const group = owner;
|
|
425
|
-
|
|
447
|
+
return [
|
|
426
448
|
{
|
|
427
449
|
mode: 0o644,
|
|
428
450
|
owner,
|
|
@@ -434,8 +456,6 @@ export class Base {
|
|
|
434
456
|
group
|
|
435
457
|
}
|
|
436
458
|
];
|
|
437
|
-
|
|
438
|
-
return premissions;
|
|
439
459
|
}
|
|
440
460
|
|
|
441
461
|
get packageData() {
|
package/src/host.mjs
CHANGED
|
@@ -106,23 +106,6 @@ export class Host extends ServiceOwner {
|
|
|
106
106
|
_serial;
|
|
107
107
|
_keymap;
|
|
108
108
|
|
|
109
|
-
materializeExtends() {
|
|
110
|
-
super.materializeExtends();
|
|
111
|
-
|
|
112
|
-
for (const host of this.walkDirections(["extends"])) {
|
|
113
|
-
for (const ni of host.networkInterfaces.values()) {
|
|
114
|
-
const present = this.networkInterfaces.get(ni.name);
|
|
115
|
-
|
|
116
|
-
if (present) {
|
|
117
|
-
present.extends.add(ni);
|
|
118
|
-
present.materializeExtends();
|
|
119
|
-
} else {
|
|
120
|
-
this.networkInterfaces.set(ni.name, ni.forOwner(this));
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
109
|
set serial(value) {
|
|
127
110
|
this._serial = value;
|
|
128
111
|
}
|
|
@@ -25,13 +25,11 @@ export class InitializationContext {
|
|
|
25
25
|
.outstandingResolves) {
|
|
26
26
|
value = object.expand(value);
|
|
27
27
|
|
|
28
|
-
for (const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
continue nextOutstanding;
|
|
34
|
-
}
|
|
28
|
+
for (const node of object.walkDirections(["this", "owner"])) {
|
|
29
|
+
const resolved = this.named(value, node);
|
|
30
|
+
if (resolved) {
|
|
31
|
+
assign(attribute, object, resolved);
|
|
32
|
+
continue nextOutstanding;
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
35
|
|
package/src/service-owner.mjs
CHANGED
|
@@ -28,22 +28,4 @@ export class ServiceOwner extends Base {
|
|
|
28
28
|
get services() {
|
|
29
29
|
return this._services;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
materializeExtends() {
|
|
33
|
-
super.materializeExtends();
|
|
34
|
-
|
|
35
|
-
for (const [name, service] of this.mapFromDirections(
|
|
36
|
-
["extends"],
|
|
37
|
-
"services"
|
|
38
|
-
)) {
|
|
39
|
-
const present = this.services.get(service.name);
|
|
40
|
-
|
|
41
|
-
if (present) {
|
|
42
|
-
present.extends.add(service);
|
|
43
|
-
present.materializeExtends();
|
|
44
|
-
} else {
|
|
45
|
-
this.services.set(service.name, service.forOwner(this));
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
31
|
}
|
|
@@ -45,10 +45,16 @@ export class mosquitto extends CoreService {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
async *preparePackages(dir) {
|
|
48
|
+
const pm = this.root.named("/services/primary-SW/mosquitto");
|
|
49
|
+
|
|
48
50
|
console.log(
|
|
49
51
|
"MOSQUITTO",
|
|
50
|
-
|
|
52
|
+
pm.fullName,
|
|
53
|
+
this.fullName,
|
|
54
|
+
[...this.extends].map(n => n.fullName),
|
|
55
|
+
[...this.walkDirections(["this", "extends"])].map(n => this.fullName)
|
|
51
56
|
);
|
|
57
|
+
|
|
52
58
|
const permissions = this.packageContentPermissions;
|
|
53
59
|
const packageData = this.packageData;
|
|
54
60
|
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
boolean_attribute_writable,
|
|
7
7
|
yesno_attribute_writable
|
|
8
8
|
} from "pacc";
|
|
9
|
-
import { ExtraSourceService, serviceEndpoints, addType } from "pmcf";
|
|
9
|
+
import { ExtraSourceService, serviceEndpoints, addType, FAMILY_DNS } from "pmcf";
|
|
10
10
|
import {
|
|
11
11
|
filterConfigurable,
|
|
12
12
|
yesno,
|
|
@@ -100,7 +100,7 @@ export class SystemdResolvedService extends ExtraSourceService {
|
|
|
100
100
|
e.family == FAMILY_IPV4 &&
|
|
101
101
|
e.networkInterface &&
|
|
102
102
|
e.networkInterface.kind !== "loopback",
|
|
103
|
-
//e.family !==
|
|
103
|
+
//e.family !== FAMILY_DNS,
|
|
104
104
|
select: endpoint => endpoint.address,
|
|
105
105
|
join: " ",
|
|
106
106
|
limit
|