pmcf 6.46.12 → 6.48.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 +41 -46
- package/package.json +1 -1
- package/src/base.mjs +30 -11
- package/src/cluster.mjs +3 -14
- package/src/content.mjs +1 -1
- package/src/host.mjs +1 -11
- package/src/services/bind.mjs +104 -96
- package/src/services/chrony.mjs +1 -13
- package/src/services/influxdb.mjs +1 -11
- package/src/services/kea.mjs +1 -13
- package/src/services/mosquitto.mjs +1 -11
package/README.md
CHANGED
|
@@ -44,82 +44,81 @@ generates config packages for:
|
|
|
44
44
|
* [base](#base)
|
|
45
45
|
* [enabled](#enabled)
|
|
46
46
|
* [priority](#priority)
|
|
47
|
-
* [templateContentAttributes](#templatecontentattributes)
|
|
48
|
-
* [Parameters](#parameters)
|
|
49
47
|
* [templateContent](#templatecontent)
|
|
48
|
+
* [Parameters](#parameters)
|
|
50
49
|
* [isTemplate](#istemplate)
|
|
51
50
|
* [access](#access)
|
|
52
51
|
* [loadHooks](#loadhooks)
|
|
53
|
-
* [Parameters](#parameters
|
|
52
|
+
* [Parameters](#parameters)
|
|
54
53
|
* [serviceEndpoints](#serviceendpoints)
|
|
55
|
-
* [Parameters](#parameters-
|
|
54
|
+
* [Parameters](#parameters-1)
|
|
56
55
|
* [attributeIterator](#attributeiterator)
|
|
57
|
-
* [Parameters](#parameters-
|
|
56
|
+
* [Parameters](#parameters-2)
|
|
58
57
|
* [getAttributes](#getattributes)
|
|
59
|
-
* [Parameters](#parameters-
|
|
58
|
+
* [Parameters](#parameters-3)
|
|
60
59
|
* [property](#property)
|
|
61
|
-
* [Parameters](#parameters-
|
|
60
|
+
* [Parameters](#parameters-4)
|
|
62
61
|
* [attribute](#attribute)
|
|
63
|
-
* [Parameters](#parameters-
|
|
62
|
+
* [Parameters](#parameters-5)
|
|
64
63
|
* [walkDirections](#walkdirections)
|
|
65
|
-
* [Parameters](#parameters-
|
|
64
|
+
* [Parameters](#parameters-6)
|
|
66
65
|
* [mapFromDirections](#mapfromdirections)
|
|
67
|
-
* [Parameters](#parameters-
|
|
66
|
+
* [Parameters](#parameters-7)
|
|
68
67
|
* [unionFromDirections](#unionfromdirections)
|
|
69
|
-
* [Parameters](#parameters-
|
|
68
|
+
* [Parameters](#parameters-8)
|
|
70
69
|
* [expand](#expand)
|
|
71
|
-
* [Parameters](#parameters-
|
|
70
|
+
* [Parameters](#parameters-9)
|
|
72
71
|
* [expression](#expression)
|
|
73
|
-
* [Parameters](#parameters-
|
|
72
|
+
* [Parameters](#parameters-10)
|
|
74
73
|
* [isTemplate](#istemplate-1)
|
|
75
74
|
* [PortEndpoint](#portendpoint)
|
|
76
|
-
* [Parameters](#parameters-
|
|
75
|
+
* [Parameters](#parameters-11)
|
|
77
76
|
* [port](#port)
|
|
78
77
|
* [socketAddress](#socketaddress)
|
|
79
78
|
* [HTTPEndpoint](#httpendpoint)
|
|
80
|
-
* [Parameters](#parameters-
|
|
79
|
+
* [Parameters](#parameters-12)
|
|
81
80
|
* [port](#port-1)
|
|
82
81
|
* [domainNames](#domainnames)
|
|
83
82
|
* [InitializationContext](#initializationcontext)
|
|
84
|
-
* [Parameters](#parameters-
|
|
83
|
+
* [Parameters](#parameters-13)
|
|
85
84
|
* [SkeletonNetworkInterface](#skeletonnetworkinterface)
|
|
86
85
|
* [networkAddresses](#networkaddresses)
|
|
87
|
-
* [Parameters](#parameters-
|
|
86
|
+
* [Parameters](#parameters-14)
|
|
88
87
|
* [zones](#zones)
|
|
89
88
|
* [addressesStatement](#addressesstatement)
|
|
90
|
-
* [Parameters](#parameters-
|
|
89
|
+
* [Parameters](#parameters-15)
|
|
91
90
|
* [SystemdJournalRemoteService](#systemdjournalremoteservice)
|
|
92
91
|
* [Properties](#properties)
|
|
93
92
|
* [systemdConfigs](#systemdconfigs)
|
|
94
|
-
* [Parameters](#parameters-
|
|
93
|
+
* [Parameters](#parameters-16)
|
|
95
94
|
* [SystemdJournalUploadService](#systemdjournaluploadservice)
|
|
96
95
|
* [Properties](#properties-1)
|
|
97
96
|
* [systemdConfigs](#systemdconfigs-1)
|
|
98
|
-
* [Parameters](#parameters-
|
|
97
|
+
* [Parameters](#parameters-17)
|
|
99
98
|
* [NetworkAddress](#networkaddress)
|
|
100
|
-
* [Parameters](#parameters-
|
|
99
|
+
* [Parameters](#parameters-18)
|
|
101
100
|
* [subnet](#subnet)
|
|
102
101
|
* [networkInterface](#networkinterface)
|
|
103
102
|
* [address](#address)
|
|
104
103
|
* [addresses](#addresses)
|
|
105
|
-
* [Parameters](#parameters-
|
|
104
|
+
* [Parameters](#parameters-19)
|
|
106
105
|
* [cidrAddresses](#cidraddresses)
|
|
107
|
-
* [Parameters](#parameters-
|
|
106
|
+
* [Parameters](#parameters-20)
|
|
108
107
|
* [families](#families)
|
|
109
108
|
* [secretName](#secretname)
|
|
110
109
|
* [directHosts](#directhosts)
|
|
111
110
|
* [subnetForAddress](#subnetforaddress)
|
|
112
|
-
* [Parameters](#parameters-
|
|
111
|
+
* [Parameters](#parameters-21)
|
|
113
112
|
* [ServiceType](#servicetype)
|
|
114
113
|
* [Properties](#properties-2)
|
|
115
114
|
* [serviceTypeEndpoints](#servicetypeendpoints)
|
|
116
|
-
* [Parameters](#parameters-
|
|
115
|
+
* [Parameters](#parameters-22)
|
|
117
116
|
* [domainName](#domainname)
|
|
118
|
-
* [Parameters](#parameters-
|
|
117
|
+
* [Parameters](#parameters-23)
|
|
119
118
|
* [domainFromDominName](#domainfromdominname)
|
|
120
|
-
* [Parameters](#parameters-
|
|
119
|
+
* [Parameters](#parameters-24)
|
|
121
120
|
* [sectionLines](#sectionlines)
|
|
122
|
-
* [Parameters](#parameters-
|
|
121
|
+
* [Parameters](#parameters-25)
|
|
123
122
|
|
|
124
123
|
## base
|
|
125
124
|
|
|
@@ -136,15 +135,11 @@ Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
|
136
135
|
|
|
137
136
|
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
|
|
138
137
|
|
|
139
|
-
###
|
|
138
|
+
### templateContent
|
|
140
139
|
|
|
141
140
|
#### Parameters
|
|
142
141
|
|
|
143
|
-
* `
|
|
144
|
-
|
|
145
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
146
|
-
|
|
147
|
-
### templateContent
|
|
142
|
+
* `content`  
|
|
148
143
|
|
|
149
144
|
Returns **AsyncIterable\<ContentProvider>** 
|
|
150
145
|
|
|
@@ -312,18 +307,6 @@ Keeps track of all in flight object creations and loose ends during config initi
|
|
|
312
307
|
|
|
313
308
|
* `directory` (optional, default `"/"`)
|
|
314
309
|
|
|
315
|
-
## SkeletonNetworkInterface
|
|
316
|
-
|
|
317
|
-
**Extends ServiceOwner**
|
|
318
|
-
|
|
319
|
-
### networkAddresses
|
|
320
|
-
|
|
321
|
-
#### Parameters
|
|
322
|
-
|
|
323
|
-
* `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
|
|
324
|
-
|
|
325
|
-
Returns **Iterable<[NetworkAddress](#networkaddress)>** 
|
|
326
|
-
|
|
327
310
|
## zones
|
|
328
311
|
|
|
329
312
|
Type: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<bind\_zone>
|
|
@@ -414,6 +397,18 @@ Returns **Iterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Re
|
|
|
414
397
|
|
|
415
398
|
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)>** 
|
|
416
399
|
|
|
400
|
+
## SkeletonNetworkInterface
|
|
401
|
+
|
|
402
|
+
**Extends ServiceOwner**
|
|
403
|
+
|
|
404
|
+
### networkAddresses
|
|
405
|
+
|
|
406
|
+
#### Parameters
|
|
407
|
+
|
|
408
|
+
* `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
|
|
409
|
+
|
|
410
|
+
Returns **Iterable<[NetworkAddress](#networkaddress)>** 
|
|
411
|
+
|
|
417
412
|
## families
|
|
418
413
|
|
|
419
414
|
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
|
@@ -225,17 +225,36 @@ export class base extends core {
|
|
|
225
225
|
return this._content;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
228
|
+
async preparePackage(options) {
|
|
229
|
+
const content = this.content;
|
|
230
|
+
if (content) {
|
|
231
|
+
const pd = await content.preparePackage();
|
|
232
|
+
|
|
233
|
+
pd.sources.push(
|
|
234
|
+
...(await Array.fromAsync(this.templateContent(content)))
|
|
235
|
+
);
|
|
236
|
+
|
|
237
|
+
switch (typeof options) {
|
|
238
|
+
case "string":
|
|
239
|
+
options = { dir: options };
|
|
240
|
+
case "object":
|
|
241
|
+
pd.sources.push(
|
|
242
|
+
new FileContentProvider({
|
|
243
|
+
pattern: ["**/*"],
|
|
244
|
+
permissions: content.permissions,
|
|
245
|
+
...options
|
|
246
|
+
})
|
|
247
|
+
);
|
|
248
|
+
}
|
|
234
249
|
|
|
235
|
-
|
|
250
|
+
return pd;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
236
253
|
|
|
237
|
-
|
|
238
|
-
|
|
254
|
+
async *preparePackages(dir) {
|
|
255
|
+
const packageData = await this.preparePackage(dir);
|
|
256
|
+
if (packageData) {
|
|
257
|
+
yield packageData;
|
|
239
258
|
}
|
|
240
259
|
}
|
|
241
260
|
|
|
@@ -258,7 +277,7 @@ export class base extends core {
|
|
|
258
277
|
*
|
|
259
278
|
* @returns {AsyncIterable<ContentProvider>}
|
|
260
279
|
*/
|
|
261
|
-
async *templateContent() {
|
|
280
|
+
async *templateContent(content) {
|
|
262
281
|
for (const node of this.walkDirections(["this", "extends"])) {
|
|
263
282
|
const dir = join(node.directory, "content");
|
|
264
283
|
|
|
@@ -268,7 +287,7 @@ export class base extends core {
|
|
|
268
287
|
new FileContentProvider({
|
|
269
288
|
dir,
|
|
270
289
|
pattern: "**/*",
|
|
271
|
-
permissions:
|
|
290
|
+
permissions: content.permissions
|
|
272
291
|
}),
|
|
273
292
|
this.templateTransformers
|
|
274
293
|
);
|
package/src/cluster.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
2
|
import { FAMILY_IPV4 } from "ip-utilties";
|
|
4
3
|
import { duration_attribute_writable } from "pacc";
|
|
5
4
|
import { host } from "./host.mjs";
|
|
@@ -46,11 +45,10 @@ export class cluster extends host {
|
|
|
46
45
|
return new Set(this.masters).union(new Set(this.backups));
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
get isCluster()
|
|
50
|
-
{
|
|
48
|
+
get isCluster() {
|
|
51
49
|
return true;
|
|
52
50
|
}
|
|
53
|
-
|
|
51
|
+
|
|
54
52
|
isMember(host) {
|
|
55
53
|
return super.isMember(host) || this.hosts.get(host.name) === host;
|
|
56
54
|
}
|
|
@@ -71,16 +69,7 @@ export class cluster extends host {
|
|
|
71
69
|
const host = ni.host;
|
|
72
70
|
|
|
73
71
|
const packageStagingDir = join(stagingDir, host.name);
|
|
74
|
-
const packageData = await host.
|
|
75
|
-
|
|
76
|
-
packageData.sources.push(
|
|
77
|
-
...(await Array.fromAsync(this.templateContent())),
|
|
78
|
-
new FileContentProvider({
|
|
79
|
-
dir: packageStagingDir,
|
|
80
|
-
pattern: "**/*",
|
|
81
|
-
permissions: this.content.permissions
|
|
82
|
-
})
|
|
83
|
-
);
|
|
72
|
+
const packageData = await host.preparePackage({ dir: packageStagingDir });
|
|
84
73
|
|
|
85
74
|
const extra = [];
|
|
86
75
|
|
package/src/content.mjs
CHANGED
package/src/host.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { FileContentProvider } from "npm-pkgbuild";
|
|
4
3
|
import { AggregatedMap } from "aggregated-map";
|
|
5
4
|
import {
|
|
6
5
|
string_attribute,
|
|
@@ -323,16 +322,7 @@ export class host extends ServiceOwner {
|
|
|
323
322
|
}
|
|
324
323
|
|
|
325
324
|
async *preparePackages(dir) {
|
|
326
|
-
const packageData = await this.
|
|
327
|
-
|
|
328
|
-
packageData.sources.push(
|
|
329
|
-
...(await Array.fromAsync(this.templateContent())),
|
|
330
|
-
new FileContentProvider({
|
|
331
|
-
dir,
|
|
332
|
-
pattern: ["**/*", "**/.ssh/*"],
|
|
333
|
-
permissions: this.content.permissions
|
|
334
|
-
})
|
|
335
|
-
);
|
|
325
|
+
const packageData = await this.preparePackage({ dir, pattern: ["**/*", "**/.ssh/*"]});
|
|
336
326
|
|
|
337
327
|
for (const ni of this.networkInterfaces.values()) {
|
|
338
328
|
await ni.systemdDefinitions(dir, packageData);
|
package/src/services/bind.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { createHmac } from "node:crypto";
|
|
3
|
-
import { FileContentProvider } from "npm-pkgbuild";
|
|
4
3
|
import { reverseArpa } from "ip-utilties";
|
|
5
4
|
import {
|
|
6
5
|
default_collection_attribute,
|
|
@@ -13,6 +12,7 @@ import {
|
|
|
13
12
|
string_attribute_writable,
|
|
14
13
|
boolean_attribute,
|
|
15
14
|
boolean_attribute_writable_false,
|
|
15
|
+
boolean_attribute_writable_true,
|
|
16
16
|
integer_attribute_writable,
|
|
17
17
|
integer_attribute,
|
|
18
18
|
secret_attribute_writable,
|
|
@@ -159,8 +159,7 @@ class bind_zone_config extends base {
|
|
|
159
159
|
this.name = name;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
async write(
|
|
163
|
-
const dir = outputControl.dir;
|
|
162
|
+
async write(dir) {
|
|
164
163
|
const view = this.owner;
|
|
165
164
|
const type = this.type;
|
|
166
165
|
|
|
@@ -190,7 +189,7 @@ class bind_zone_config extends base {
|
|
|
190
189
|
)
|
|
191
190
|
);
|
|
192
191
|
|
|
193
|
-
|
|
192
|
+
// content.push(`update-policy { grant updates zonesub ANY; };`);
|
|
194
193
|
break;
|
|
195
194
|
case SECONDARY:
|
|
196
195
|
const primaries = endpointAddresses(this.service.primaries);
|
|
@@ -312,8 +311,8 @@ export class bind_acl extends bind_object {
|
|
|
312
311
|
const acl_attribute = {
|
|
313
312
|
...default_attribute_writable,
|
|
314
313
|
type: bind_object,
|
|
315
|
-
name: "acl"
|
|
316
|
-
// default: "'any'"
|
|
314
|
+
name: "acl"
|
|
315
|
+
// default: "'any'"
|
|
317
316
|
};
|
|
318
317
|
|
|
319
318
|
class bind_view extends bind_object {
|
|
@@ -369,6 +368,14 @@ class bind_view extends bind_object {
|
|
|
369
368
|
type: bind_view
|
|
370
369
|
},
|
|
371
370
|
notify: { ...boolean_attribute_writable_false, name: "notify" },
|
|
371
|
+
hasForeignDomains: {
|
|
372
|
+
...boolean_attribute_writable_false,
|
|
373
|
+
name: "hasForeignDomains"
|
|
374
|
+
},
|
|
375
|
+
hasBaseRecords: {
|
|
376
|
+
...boolean_attribute_writable_true,
|
|
377
|
+
name: "hasBaseRecords"
|
|
378
|
+
},
|
|
372
379
|
hasCatalog: { ...boolean_attribute_writable_false, name: "hasCatalog" },
|
|
373
380
|
hasReverse: { ...boolean_attribute_writable_false, name: "hasReverse" },
|
|
374
381
|
hasSVRRecords: {
|
|
@@ -508,117 +515,125 @@ class bind_view extends bind_object {
|
|
|
508
515
|
)
|
|
509
516
|
);
|
|
510
517
|
|
|
511
|
-
|
|
518
|
+
if (this.hasBaseRecords) {
|
|
519
|
+
let reverseZone;
|
|
512
520
|
|
|
513
|
-
|
|
514
|
-
|
|
521
|
+
if (this.hasReverse && na.subnet.prefix) {
|
|
522
|
+
let subnet;
|
|
515
523
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
524
|
+
for (const s of subnets) {
|
|
525
|
+
if (s.isIncluded(na.subnet)) {
|
|
526
|
+
subnet = s;
|
|
527
|
+
}
|
|
519
528
|
}
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
if (!subnet) {
|
|
523
|
-
subnet = na.subnet;
|
|
524
|
-
subnets.add(subnet);
|
|
525
|
-
}
|
|
526
529
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
this.intoCatalog(
|
|
531
|
-
new bind_zone(this, domain, config, locationName),
|
|
532
|
-
locationName
|
|
533
|
-
)
|
|
534
|
-
);
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
if (!hosts.has(host)) {
|
|
538
|
-
hosts.add(host);
|
|
539
|
-
|
|
540
|
-
for (let foreignDomain of host.foreignDomainNames) {
|
|
541
|
-
const wildcard = foreignDomain.startsWith("*.");
|
|
542
|
-
if (wildcard) {
|
|
543
|
-
foreignDomain = foreignDomain.substring(2);
|
|
530
|
+
if (!subnet) {
|
|
531
|
+
subnet = na.subnet;
|
|
532
|
+
subnets.add(subnet);
|
|
544
533
|
}
|
|
545
534
|
|
|
546
|
-
this.
|
|
547
|
-
|
|
548
|
-
const config = this.zoneConfigs.getOrInsertComputed(
|
|
549
|
-
foreignDomain,
|
|
550
|
-
domain => new bind_zone_config(this, `${domain}.zone.conf`)
|
|
551
|
-
);
|
|
552
|
-
|
|
553
|
-
config.foreign = true;
|
|
554
|
-
const zone = this._zones.getOrInsertComputed(
|
|
555
|
-
foreignDomain,
|
|
535
|
+
reverseZone = this._zones.getOrInsertComputed(
|
|
536
|
+
reverseArpa(subnet.prefix),
|
|
556
537
|
domain =>
|
|
557
538
|
this.intoCatalog(
|
|
558
539
|
new bind_zone(this, domain, config, locationName),
|
|
559
540
|
locationName
|
|
560
541
|
)
|
|
561
542
|
);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
562
545
|
|
|
563
|
-
|
|
546
|
+
if (!hosts.has(host)) {
|
|
547
|
+
hosts.add(host);
|
|
564
548
|
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
549
|
+
if (this.hasForeignDomains) {
|
|
550
|
+
for (let foreignDomain of host.foreignDomainNames) {
|
|
551
|
+
const wildcard = foreignDomain.startsWith("*.");
|
|
552
|
+
if (wildcard) {
|
|
553
|
+
foreignDomain = foreignDomain.substring(2);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
this.foreignDomains.add(foreignDomain);
|
|
557
|
+
|
|
558
|
+
const config = this.zoneConfigs.getOrInsertComputed(
|
|
559
|
+
foreignDomain,
|
|
560
|
+
domain => new bind_zone_config(this, `${domain}.zone.conf`)
|
|
574
561
|
);
|
|
575
562
|
|
|
576
|
-
|
|
563
|
+
config.foreign = true;
|
|
564
|
+
const zone = this._zones.getOrInsertComputed(
|
|
565
|
+
foreignDomain,
|
|
566
|
+
domain =>
|
|
567
|
+
this.intoCatalog(
|
|
568
|
+
new bind_zone(this, domain, config, locationName),
|
|
569
|
+
locationName
|
|
570
|
+
)
|
|
571
|
+
);
|
|
572
|
+
|
|
573
|
+
zone.foreign = true;
|
|
574
|
+
|
|
575
|
+
for (const na of host.networkAddresses(
|
|
576
|
+
na => na.networkInterface.kind !== "loopback"
|
|
577
|
+
)) {
|
|
577
578
|
zone.records.add(
|
|
578
579
|
DNSRecord(
|
|
579
|
-
"
|
|
580
|
+
"@",
|
|
580
581
|
dnsRecordTypeForAddressFamily(na.family),
|
|
581
582
|
na.address
|
|
582
583
|
)
|
|
583
584
|
);
|
|
585
|
+
|
|
586
|
+
if (wildcard) {
|
|
587
|
+
zone.records.add(
|
|
588
|
+
DNSRecord(
|
|
589
|
+
"*",
|
|
590
|
+
dnsRecordTypeForAddressFamily(na.family),
|
|
591
|
+
na.address
|
|
592
|
+
)
|
|
593
|
+
);
|
|
594
|
+
}
|
|
584
595
|
}
|
|
585
596
|
}
|
|
586
597
|
}
|
|
587
598
|
|
|
588
|
-
|
|
599
|
+
if (this.hasBaseRecords) {
|
|
600
|
+
const sm = new Map();
|
|
589
601
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
602
|
+
for (const service of host.services.values()) {
|
|
603
|
+
for (const record of service.dnsRecordsForDomainName(
|
|
604
|
+
host.domainName,
|
|
605
|
+
this.hasSVRRecords
|
|
606
|
+
)) {
|
|
607
|
+
sm.set(record.toString(), record);
|
|
608
|
+
}
|
|
596
609
|
}
|
|
597
|
-
}
|
|
598
610
|
|
|
599
|
-
|
|
600
|
-
|
|
611
|
+
for (const r of sm.values()) {
|
|
612
|
+
zone.records.add(r);
|
|
613
|
+
}
|
|
601
614
|
}
|
|
602
615
|
}
|
|
603
616
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
dnsFullName(domainName),
|
|
609
|
-
dnsRecordTypeForAddressFamily(na.family),
|
|
610
|
-
address
|
|
611
|
-
)
|
|
612
|
-
);
|
|
613
|
-
|
|
614
|
-
if (reverseZone) {
|
|
615
|
-
reverseZone.records.add(
|
|
617
|
+
if (this.hasBaseRecords) {
|
|
618
|
+
for (const domainName of na.domainNames) {
|
|
619
|
+
if (domainName.endsWith(domain) && domainName[0] !== "*") {
|
|
620
|
+
zone.records.add(
|
|
616
621
|
DNSRecord(
|
|
617
|
-
dnsFullName(
|
|
618
|
-
|
|
619
|
-
|
|
622
|
+
dnsFullName(domainName),
|
|
623
|
+
dnsRecordTypeForAddressFamily(na.family),
|
|
624
|
+
address
|
|
620
625
|
)
|
|
621
626
|
);
|
|
627
|
+
|
|
628
|
+
if (reverseZone) {
|
|
629
|
+
reverseZone.records.add(
|
|
630
|
+
DNSRecord(
|
|
631
|
+
dnsFullName(reverseArpa(address)),
|
|
632
|
+
"PTR",
|
|
633
|
+
dnsFullName(domainName)
|
|
634
|
+
)
|
|
635
|
+
);
|
|
636
|
+
}
|
|
622
637
|
}
|
|
623
638
|
}
|
|
624
639
|
}
|
|
@@ -631,11 +646,11 @@ class bind_view extends bind_object {
|
|
|
631
646
|
|
|
632
647
|
async packageContent(outputControl) {
|
|
633
648
|
outputControl.packageData.sources.push(
|
|
634
|
-
...(await Array.fromAsync(this.templateContent()))
|
|
649
|
+
...(await Array.fromAsync(this.templateContent(this.service.content)))
|
|
635
650
|
);
|
|
636
651
|
|
|
637
652
|
for (const config of this.zoneConfigs.values()) {
|
|
638
|
-
await config.write(outputControl);
|
|
653
|
+
await config.write(outputControl.dir);
|
|
639
654
|
}
|
|
640
655
|
|
|
641
656
|
if (this.foreignDomains.size) {
|
|
@@ -661,7 +676,7 @@ class bind_view extends bind_object {
|
|
|
661
676
|
function addressesStatement(prefix, objects, empty = false, indent = "") {
|
|
662
677
|
const body = asArray(objects).map(value => {
|
|
663
678
|
if (typeof value !== "string") {
|
|
664
|
-
if(value instanceof bind_key) {
|
|
679
|
+
if (value instanceof bind_key) {
|
|
665
680
|
return `key ${value.name}`;
|
|
666
681
|
}
|
|
667
682
|
return value.name ?? value.address;
|
|
@@ -794,21 +809,14 @@ export class bind extends CoreService {
|
|
|
794
809
|
}
|
|
795
810
|
|
|
796
811
|
async *preparePackages(dir) {
|
|
797
|
-
const packageData = await this.
|
|
812
|
+
const packageData = await this.preparePackage(dir);
|
|
798
813
|
|
|
799
|
-
packageData
|
|
800
|
-
|
|
801
|
-
|
|
814
|
+
if (!packageData) {
|
|
815
|
+
return;
|
|
816
|
+
}
|
|
802
817
|
|
|
803
818
|
let hasContent = packageData.sources.length > 0;
|
|
804
819
|
|
|
805
|
-
packageData.sources.push(
|
|
806
|
-
new FileContentProvider({
|
|
807
|
-
dir: dir + "/",
|
|
808
|
-
permissions: this.content.permissions
|
|
809
|
-
})
|
|
810
|
-
);
|
|
811
|
-
|
|
812
820
|
const outputControl = { packageData, dir };
|
|
813
821
|
|
|
814
822
|
for (const key of this.keys.values()) {
|
package/src/services/chrony.mjs
CHANGED
|
@@ -46,19 +46,7 @@ export class chrony extends CoreService {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
async *preparePackages(dir) {
|
|
49
|
-
const packageData = await this.
|
|
50
|
-
|
|
51
|
-
packageData.sources.push(
|
|
52
|
-
...(await Array.fromAsync(this.templateContent()))
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
packageData.sources.push(
|
|
56
|
-
new FileContentProvider({
|
|
57
|
-
dir: dir + "/",
|
|
58
|
-
permissions: this.content.permissions
|
|
59
|
-
})
|
|
60
|
-
);
|
|
61
|
-
|
|
49
|
+
const packageData = await this.preparePackage(dir);
|
|
62
50
|
const subnets = [...new Map(this.subnets).values()]; // TODO should be normal
|
|
63
51
|
const host = this.host;
|
|
64
52
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { stringify } from "yaml";
|
|
3
|
-
import { FileContentProvider } from "npm-pkgbuild";
|
|
4
3
|
import { boolean_attribute_writable_true } from "pacc";
|
|
5
4
|
import { CoreService, addType, FAMILY_IPV4_IPV6 } from "pmcf";
|
|
6
5
|
import { writeLines, filterConfigurable } from "../utils.mjs";
|
|
@@ -31,16 +30,7 @@ export class influxdb extends CoreService {
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
async *preparePackages(dir) {
|
|
34
|
-
const packageData = await this.
|
|
35
|
-
|
|
36
|
-
packageData.sources.push(
|
|
37
|
-
...(await Array.fromAsync(this.templateContent())),
|
|
38
|
-
new FileContentProvider({
|
|
39
|
-
dir,
|
|
40
|
-
pattern: ["**/*"],
|
|
41
|
-
permissions: this.content.permissions
|
|
42
|
-
})
|
|
43
|
-
);
|
|
33
|
+
const packageData = await this.preparePackage(dir);
|
|
44
34
|
|
|
45
35
|
await writeLines(
|
|
46
36
|
join(dir, "etc", "influxdb"),
|
package/src/services/kea.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
2
|
import {
|
|
4
3
|
reverseArpa,
|
|
5
4
|
addressType,
|
|
@@ -185,18 +184,7 @@ export class kea extends CoreService {
|
|
|
185
184
|
const name = host.name;
|
|
186
185
|
const subnets = [...this.subnets.values()];
|
|
187
186
|
const dnsServerEndpoints = this.dnsServerEndpoints;
|
|
188
|
-
const packageData = await this.
|
|
189
|
-
|
|
190
|
-
packageData.sources.push(
|
|
191
|
-
...(await Array.fromAsync(this.templateContent()))
|
|
192
|
-
);
|
|
193
|
-
|
|
194
|
-
packageData.sources.push(
|
|
195
|
-
new FileContentProvider({
|
|
196
|
-
dir: dir + "/",
|
|
197
|
-
permissions: this.content.permissions
|
|
198
|
-
})
|
|
199
|
-
);
|
|
187
|
+
const packageData = await this.preparePackage(dir);
|
|
200
188
|
|
|
201
189
|
const loggers = [
|
|
202
190
|
{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
2
|
import { port_attribute, string_attribute_writable } from "pacc";
|
|
4
3
|
import { CoreService, addType } from "pmcf";
|
|
5
4
|
import {
|
|
@@ -51,16 +50,7 @@ export class mosquitto extends CoreService {
|
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
async *preparePackages(dir) {
|
|
54
|
-
const packageData = await this.
|
|
55
|
-
|
|
56
|
-
packageData.sources.push(
|
|
57
|
-
...(await Array.fromAsync(this.templateContent())),
|
|
58
|
-
new FileContentProvider({
|
|
59
|
-
dir,
|
|
60
|
-
pattern: ["**/*"],
|
|
61
|
-
permissions: this.content.permissions
|
|
62
|
-
})
|
|
63
|
-
);
|
|
53
|
+
const packageData = await this.preparePackage(dir);
|
|
64
54
|
|
|
65
55
|
await writeLines(
|
|
66
56
|
join(dir, "etc", "mosquitto"),
|