pmcf 6.21.0 → 6.21.2
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 +29 -11
- package/bin/pmcf-info +8 -1
- package/package.json +3 -3
- package/src/base.mjs +14 -1
- package/src/core-service.mjs +2 -19
- package/src/host.mjs +1 -14
- package/src/services/bind.mjs +2 -1
package/README.md
CHANGED
|
@@ -81,39 +81,42 @@ generates config packages for:
|
|
|
81
81
|
* [SkeletonNetworkInterface](#skeletonnetworkinterface)
|
|
82
82
|
* [networkAddresses](#networkaddresses)
|
|
83
83
|
* [Parameters](#parameters-15)
|
|
84
|
+
* [zones](#zones)
|
|
84
85
|
* [type](#type)
|
|
86
|
+
* [addressesStatement](#addressesstatement)
|
|
87
|
+
* [Parameters](#parameters-16)
|
|
85
88
|
* [SystemdJournalRemoteService](#systemdjournalremoteservice)
|
|
86
89
|
* [Properties](#properties)
|
|
87
90
|
* [systemdConfigs](#systemdconfigs)
|
|
88
|
-
* [Parameters](#parameters-
|
|
91
|
+
* [Parameters](#parameters-17)
|
|
89
92
|
* [SystemdJournalUploadService](#systemdjournaluploadservice)
|
|
90
93
|
* [Properties](#properties-1)
|
|
91
94
|
* [systemdConfigs](#systemdconfigs-1)
|
|
92
|
-
* [Parameters](#parameters-
|
|
95
|
+
* [Parameters](#parameters-18)
|
|
93
96
|
* [NetworkAddress](#networkaddress)
|
|
94
|
-
* [Parameters](#parameters-
|
|
97
|
+
* [Parameters](#parameters-19)
|
|
95
98
|
* [subnet](#subnet)
|
|
96
99
|
* [networkInterface](#networkinterface)
|
|
97
100
|
* [address](#address)
|
|
98
101
|
* [addresses](#addresses)
|
|
99
|
-
* [Parameters](#parameters-19)
|
|
100
|
-
* [cidrAddresses](#cidraddresses)
|
|
101
102
|
* [Parameters](#parameters-20)
|
|
103
|
+
* [cidrAddresses](#cidraddresses)
|
|
104
|
+
* [Parameters](#parameters-21)
|
|
102
105
|
* [families](#families)
|
|
103
106
|
* [secretName](#secretname)
|
|
104
107
|
* [directHosts](#directhosts)
|
|
105
108
|
* [subnetForAddress](#subnetforaddress)
|
|
106
|
-
* [Parameters](#parameters-21)
|
|
107
|
-
* [domainName](#domainname)
|
|
108
109
|
* [Parameters](#parameters-22)
|
|
109
|
-
* [
|
|
110
|
+
* [domainName](#domainname)
|
|
110
111
|
* [Parameters](#parameters-23)
|
|
111
|
-
* [
|
|
112
|
+
* [domainFromDominName](#domainfromdominname)
|
|
112
113
|
* [Parameters](#parameters-24)
|
|
113
|
-
* [
|
|
114
|
+
* [sectionLines](#sectionlines)
|
|
114
115
|
* [Parameters](#parameters-25)
|
|
115
|
-
* [
|
|
116
|
+
* [asArray](#asarray)
|
|
116
117
|
* [Parameters](#parameters-26)
|
|
118
|
+
* [asIterator](#asiterator)
|
|
119
|
+
* [Parameters](#parameters-27)
|
|
117
120
|
|
|
118
121
|
## Base
|
|
119
122
|
|
|
@@ -305,12 +308,27 @@ Keeps track of all in flight object creations and loose ends during config initi
|
|
|
305
308
|
|
|
306
309
|
Returns **Iterable<[NetworkAddress](#networkaddress)>** 
|
|
307
310
|
|
|
311
|
+
## zones
|
|
312
|
+
|
|
313
|
+
Type: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<bind\_zone>
|
|
314
|
+
|
|
308
315
|
## type
|
|
309
316
|
|
|
310
317
|
Type of the group.
|
|
311
318
|
|
|
312
319
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** view | unknown
|
|
313
320
|
|
|
321
|
+
## addressesStatement
|
|
322
|
+
|
|
323
|
+
### Parameters
|
|
324
|
+
|
|
325
|
+
* `prefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
326
|
+
* `objects` **any** 
|
|
327
|
+
* `empty` **([boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))** (optional, default `false`)
|
|
328
|
+
* `indent` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (optional, default `""`)
|
|
329
|
+
|
|
330
|
+
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)>** 
|
|
331
|
+
|
|
314
332
|
## SystemdJournalRemoteService
|
|
315
333
|
|
|
316
334
|
**Extends CoreService**
|
package/bin/pmcf-info
CHANGED
|
@@ -48,7 +48,14 @@ function show(value, indent = 0, short = false) {
|
|
|
48
48
|
if (attribute.collection) {
|
|
49
49
|
const l = [...v];
|
|
50
50
|
if (l.length) {
|
|
51
|
-
|
|
51
|
+
if (attribute.separator || l.length === 1) {
|
|
52
|
+
console.log(`${name(attribute)}${l.join(attribute.separator)}`);
|
|
53
|
+
} else {
|
|
54
|
+
console.log(`${name(attribute)}`);
|
|
55
|
+
for (const vv of l) {
|
|
56
|
+
console.log(prefix(indent + 2) + vv);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
52
59
|
}
|
|
53
60
|
} else {
|
|
54
61
|
console.log(`${name(attribute)}${v}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "6.21.
|
|
3
|
+
"version": "6.21.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -59,14 +59,14 @@
|
|
|
59
59
|
"yaml": "^2.9.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@types/node": "^26.
|
|
62
|
+
"@types/node": "^26.2.0",
|
|
63
63
|
"ava": "^8.0.1",
|
|
64
64
|
"c8": "^12.0.0",
|
|
65
65
|
"documentation": "^14.0.3",
|
|
66
66
|
"semantic-release": "^25.0.9"
|
|
67
67
|
},
|
|
68
68
|
"engines": {
|
|
69
|
-
"node": ">=26.
|
|
69
|
+
"node": ">=26.7.0"
|
|
70
70
|
},
|
|
71
71
|
"repository": {
|
|
72
72
|
"type": "git",
|
package/src/base.mjs
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from "pacc";
|
|
26
26
|
import { union } from "./utils.mjs";
|
|
27
27
|
import { addType } from "pmcf";
|
|
28
|
-
import { owner_attribute } from "./common-attributes.mjs";
|
|
28
|
+
import { owner_attribute, aliases_attribute } from "./common-attributes.mjs";
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
*
|
|
@@ -39,6 +39,7 @@ export class Base {
|
|
|
39
39
|
static attributes = {
|
|
40
40
|
owner: owner_attribute,
|
|
41
41
|
name: name_attribute_writable,
|
|
42
|
+
aliases: aliases_attribute,
|
|
42
43
|
description: description_attribute_writable,
|
|
43
44
|
type: type_attribute,
|
|
44
45
|
directory: { ...string_attribute_writable, name: "directory" },
|
|
@@ -62,6 +63,7 @@ export class Base {
|
|
|
62
63
|
name;
|
|
63
64
|
properties = {};
|
|
64
65
|
extends = new Set();
|
|
66
|
+
_aliases = new Set();
|
|
65
67
|
_tags = new Set();
|
|
66
68
|
_packaging = new Set();
|
|
67
69
|
_directory;
|
|
@@ -488,6 +490,7 @@ export class Base {
|
|
|
488
490
|
outputs: this.outputs,
|
|
489
491
|
properties: {
|
|
490
492
|
name: nameParts.filter(n => n !== undefined && n.length > 0).join("-"),
|
|
493
|
+
description: `${this.type} definitions for ${this.fullName}`,
|
|
491
494
|
access: "private",
|
|
492
495
|
dependencies: this.depends,
|
|
493
496
|
groups: [this.typeName]
|
|
@@ -550,6 +553,16 @@ export class Base {
|
|
|
550
553
|
this._tags = union(value, this._tags);
|
|
551
554
|
}
|
|
552
555
|
|
|
556
|
+
set aliases(value) {
|
|
557
|
+
this._aliases = union(value, this._aliases);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
get aliases() {
|
|
561
|
+
return this.expand(
|
|
562
|
+
this.unionFromDirections(["this", "extends"], "_aliases")
|
|
563
|
+
);
|
|
564
|
+
}
|
|
565
|
+
|
|
553
566
|
/**
|
|
554
567
|
* @return {boolean}
|
|
555
568
|
*/
|
package/src/core-service.mjs
CHANGED
|
@@ -21,10 +21,7 @@ import {
|
|
|
21
21
|
FAMILY_DNS
|
|
22
22
|
} from "pmcf";
|
|
23
23
|
import { asArray, union } from "./utils.mjs";
|
|
24
|
-
import {
|
|
25
|
-
networkAddressAttributes,
|
|
26
|
-
aliases_attribute
|
|
27
|
-
} from "./common-attributes.mjs";
|
|
24
|
+
import { networkAddressAttributes } from "./common-attributes.mjs";
|
|
28
25
|
import {
|
|
29
26
|
serviceTypeEndpoints,
|
|
30
27
|
serviceTypes,
|
|
@@ -75,7 +72,6 @@ export class CoreService extends Base {
|
|
|
75
72
|
name: "extends",
|
|
76
73
|
type: CoreService
|
|
77
74
|
},
|
|
78
|
-
aliases: aliases_attribute,
|
|
79
75
|
priority: priority_attribute,
|
|
80
76
|
weight: { ...number_attribute_writable, name: "weight" /*default: 1*/ },
|
|
81
77
|
systemdService: { ...string_attribute_writable, name: "systemdService" },
|
|
@@ -87,7 +83,6 @@ export class CoreService extends Base {
|
|
|
87
83
|
addType(this);
|
|
88
84
|
}
|
|
89
85
|
|
|
90
|
-
_aliases = new Set();
|
|
91
86
|
_weight;
|
|
92
87
|
_port;
|
|
93
88
|
_systemdService;
|
|
@@ -211,16 +206,6 @@ export class CoreService extends Base {
|
|
|
211
206
|
return options.join !== undefined ? res.join(options.join) : res;
|
|
212
207
|
}
|
|
213
208
|
|
|
214
|
-
set aliases(value) {
|
|
215
|
-
this._aliases = union(value, this._aliases);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
get aliases() {
|
|
219
|
-
return this.expand(
|
|
220
|
-
this.unionFromDirections(["this", "extends"], "_aliases")
|
|
221
|
-
);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
209
|
set port(value) {
|
|
225
210
|
this._port = value;
|
|
226
211
|
}
|
|
@@ -291,7 +276,6 @@ export class CoreService extends Base {
|
|
|
291
276
|
const packageData = super.packageData;
|
|
292
277
|
const name = `${this.owner.owner.name}-${this.owner.name}`;
|
|
293
278
|
packageData.properties.name = `${this.name}-${name}`;
|
|
294
|
-
packageData.properties.description = `${this.type} service definitions for ${this.fullName}`;
|
|
295
279
|
packageData.properties.groups.push("config", name);
|
|
296
280
|
return packageData;
|
|
297
281
|
}
|
|
@@ -308,9 +292,8 @@ export class CoreService extends Base {
|
|
|
308
292
|
const records = [];
|
|
309
293
|
|
|
310
294
|
if (this.priority >= 390) {
|
|
311
|
-
console.log("DNS SERVICE ALIAS", this.aliases, dnsFullName(domainName));
|
|
312
|
-
|
|
313
295
|
for (const alias of this.aliases) {
|
|
296
|
+
console.log("CNAME", alias, dnsFullName(domainName));
|
|
314
297
|
records.push(DNSRecord(alias, "CNAME", dnsFullName(domainName)));
|
|
315
298
|
}
|
|
316
299
|
}
|
package/src/host.mjs
CHANGED
|
@@ -14,8 +14,7 @@ import { addresses, addType, assign } from "pmcf";
|
|
|
14
14
|
import {
|
|
15
15
|
networkAddressAttributes,
|
|
16
16
|
networkInterfaces_attribute,
|
|
17
|
-
hosts_attribute
|
|
18
|
-
aliases_attribute
|
|
17
|
+
hosts_attribute
|
|
19
18
|
} from "./common-attributes.mjs";
|
|
20
19
|
import { ServiceOwner } from "./service-owner.mjs";
|
|
21
20
|
import { addHook } from "./hooks.mjs";
|
|
@@ -35,7 +34,6 @@ export class Host extends ServiceOwner {
|
|
|
35
34
|
static attributes = {
|
|
36
35
|
...networkAddressAttributes,
|
|
37
36
|
networkInterfaces: networkInterfaces_attribute,
|
|
38
|
-
aliases: aliases_attribute,
|
|
39
37
|
os: {
|
|
40
38
|
...string_attribute_writable,
|
|
41
39
|
name: "os",
|
|
@@ -92,7 +90,6 @@ export class Host extends ServiceOwner {
|
|
|
92
90
|
addType(this);
|
|
93
91
|
}
|
|
94
92
|
|
|
95
|
-
_aliases = new Set();
|
|
96
93
|
_networkInterfaces = new Map();
|
|
97
94
|
_provides = new Set();
|
|
98
95
|
_replaces = new Set();
|
|
@@ -184,16 +181,6 @@ export class Host extends ServiceOwner {
|
|
|
184
181
|
}
|
|
185
182
|
}
|
|
186
183
|
|
|
187
|
-
set aliases(value) {
|
|
188
|
-
this._aliases = union(value, this._aliases);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
get aliases() {
|
|
192
|
-
return this.expand(
|
|
193
|
-
this.unionFromDirections(["this", "extends"], "_aliases")
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
184
|
set provides(value) {
|
|
198
185
|
this._provides = union(value, this._provides);
|
|
199
186
|
}
|
package/src/services/bind.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
name_attribute,
|
|
11
11
|
string_attribute,
|
|
12
12
|
string_set_attribute,
|
|
13
|
+
string_attribute_writable,
|
|
13
14
|
boolean_attribute,
|
|
14
15
|
boolean_attribute_writable_true,
|
|
15
16
|
boolean_attribute_writable_false,
|
|
@@ -45,7 +46,7 @@ class bind_zone extends Base {
|
|
|
45
46
|
static attributes = {
|
|
46
47
|
id: { ...name_attribute, name: "id" },
|
|
47
48
|
file: { ...string_attribute, name: "file" },
|
|
48
|
-
records: { ...
|
|
49
|
+
records: { ...string_attribute_writable, collection: true, name: "records" },
|
|
49
50
|
foreign: { ...boolean_attribute, name: "foreign" }
|
|
50
51
|
};
|
|
51
52
|
|