pmcf 4.30.8 → 5.0.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/bin/pmcf-diagram +1 -1
- package/package.json +7 -7
- package/src/base.mjs +81 -182
- package/src/cluster.mjs +22 -40
- package/src/{network-support.mjs → common-attributes.mjs} +66 -5
- package/src/extra-source-service.mjs +8 -7
- package/src/host.mjs +50 -53
- package/src/initialization-context.mjs +110 -216
- package/src/module.mjs +1 -2
- package/src/network-address.mjs +2 -2
- package/src/network-interfaces/ethernet.mjs +7 -15
- package/src/network-interfaces/loopback.mjs +1 -8
- package/src/network-interfaces/network-interface.mjs +28 -40
- package/src/network-interfaces/skeleton.mjs +14 -9
- package/src/network-interfaces/tun.mjs +0 -5
- package/src/network-interfaces/wireguard.mjs +0 -4
- package/src/network-interfaces/wlan.mjs +7 -18
- package/src/network.mjs +39 -43
- package/src/owner.mjs +120 -236
- package/src/root.mjs +13 -7
- package/src/service-owner.mjs +7 -26
- package/src/service.mjs +32 -19
- package/src/services/alpm.mjs +10 -6
- package/src/services/bind.mjs +73 -79
- package/src/services/chrony.mjs +3 -4
- package/src/services/headscale.mjs +0 -1
- package/src/services/influxdb.mjs +2 -2
- package/src/services/kea.mjs +16 -6
- package/src/services/mosquitto.mjs +4 -1
- package/src/services/openldap.mjs +4 -5
- package/src/services/postfix.mjs +0 -2
- package/src/services/systemd-journal-remote.mjs +12 -2
- package/src/services/systemd-journal-upload.mjs +8 -2
- package/src/services/systemd-journald.mjs +23 -1
- package/src/services/systemd-resolved.mjs +41 -19
- package/src/services/systemd-timesyncd.mjs +32 -10
- package/src/services/tailscale.mjs +0 -1
- package/src/subnet.mjs +38 -34
- package/src/type.mjs +86 -1
- package/src/utils.mjs +2 -2
- package/src/location.mjs +0 -48
package/src/services/alpm.mjs
CHANGED
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
default_collection_attribute_writable,
|
|
3
3
|
name_attribute_writable,
|
|
4
4
|
string_attribute_writable,
|
|
5
5
|
string_set_attribute_writable
|
|
6
6
|
} from "pacc";
|
|
7
7
|
import { addType, Service, Base } from "pmcf";
|
|
8
|
+
import { owner_attribute } from "../common-attributes.mjs";
|
|
8
9
|
|
|
9
10
|
class alpm_repository extends Base {
|
|
10
11
|
static attributes = {
|
|
11
12
|
name: name_attribute_writable,
|
|
12
|
-
base: string_attribute_writable,
|
|
13
|
-
architectures: string_set_attribute_writable
|
|
13
|
+
base: { ...string_attribute_writable, name: "base" },
|
|
14
|
+
architectures: { ...string_set_attribute_writable, name: "architectures" },
|
|
15
|
+
owner: owner_attribute
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
static {
|
|
17
19
|
addType(this);
|
|
18
20
|
}
|
|
21
|
+
|
|
22
|
+
architectures = new Set();
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
export class alpm extends Service {
|
|
22
|
-
static specializationOf = Service;
|
|
23
26
|
static attributes = {
|
|
24
27
|
repositories: {
|
|
25
|
-
...
|
|
28
|
+
...default_collection_attribute_writable,
|
|
29
|
+
name: "repositories",
|
|
26
30
|
type: alpm_repository,
|
|
27
|
-
|
|
31
|
+
backpointer: owner_attribute
|
|
28
32
|
}
|
|
29
33
|
};
|
|
30
34
|
|
package/src/services/bind.mjs
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { join, dirname } from "node:path";
|
|
2
2
|
import { createHmac } from "node:crypto";
|
|
3
3
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
4
|
-
import { isLinkLocal, reverseArpa, FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
|
|
5
4
|
import {
|
|
5
|
+
isLinkLocal,
|
|
6
|
+
reverseArpa,
|
|
7
|
+
FAMILY_IPV4,
|
|
8
|
+
FAMILY_IPV6
|
|
9
|
+
} from "ip-utilties";
|
|
10
|
+
import {
|
|
11
|
+
default_collection_attribute_writable,
|
|
6
12
|
default_attribute_writable,
|
|
7
13
|
duration_attribute_writable,
|
|
8
14
|
string_set_attribute_writable,
|
|
@@ -12,7 +18,6 @@ import {
|
|
|
12
18
|
name_attribute_writable
|
|
13
19
|
} from "pacc";
|
|
14
20
|
import {
|
|
15
|
-
Service,
|
|
16
21
|
Base,
|
|
17
22
|
ExtraSourceService,
|
|
18
23
|
serviceEndpoints,
|
|
@@ -28,6 +33,7 @@ import {
|
|
|
28
33
|
sortZoneRecords
|
|
29
34
|
} from "../dns-utils.mjs";
|
|
30
35
|
import { addHook } from "../hooks.mjs";
|
|
36
|
+
import { owner_attribute } from "../common-attributes.mjs";
|
|
31
37
|
|
|
32
38
|
const bindNetworkAddressTypes = networkAddressType + "|bind_group";
|
|
33
39
|
|
|
@@ -35,44 +41,71 @@ class bind_group extends Base {
|
|
|
35
41
|
static priority = 1;
|
|
36
42
|
static attributes = {
|
|
37
43
|
name: name_attribute_writable,
|
|
44
|
+
owner: owner_attribute,
|
|
38
45
|
access: {
|
|
39
46
|
type: bindNetworkAddressTypes,
|
|
47
|
+
name: "access",
|
|
40
48
|
collection: true,
|
|
41
49
|
writable: true
|
|
42
50
|
},
|
|
43
|
-
excludeInterfaceKinds:
|
|
51
|
+
excludeInterfaceKinds: {
|
|
52
|
+
...string_set_attribute_writable,
|
|
53
|
+
name: "excludeInterfaceKinds"
|
|
54
|
+
},
|
|
44
55
|
exclude: {
|
|
45
|
-
...
|
|
46
|
-
|
|
47
|
-
|
|
56
|
+
...default_collection_attribute_writable,
|
|
57
|
+
name: "exclude",
|
|
58
|
+
type: networkAddressType
|
|
48
59
|
},
|
|
49
60
|
entries: {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
61
|
+
...default_collection_attribute_writable,
|
|
62
|
+
type: networkAddressType + "|owner",
|
|
63
|
+
name: "entries"
|
|
64
|
+
},
|
|
65
|
+
sharedWith: {
|
|
66
|
+
...default_attribute_writable,
|
|
67
|
+
name: "sharedWith",
|
|
68
|
+
type: bind_group
|
|
53
69
|
},
|
|
54
|
-
sharedWith: { ...default_attribute_writable, type: bind_group },
|
|
55
70
|
allowedUpdates: {
|
|
56
71
|
type: bindNetworkAddressTypes,
|
|
72
|
+
name: "allowedUpdates",
|
|
57
73
|
collection: true,
|
|
58
74
|
writable: true
|
|
59
75
|
},
|
|
60
|
-
notify: boolean_attribute_writable_false,
|
|
61
|
-
hasCatalog: boolean_attribute_writable_true,
|
|
62
|
-
hasReverse: boolean_attribute_writable_false,
|
|
63
|
-
hasSVRRecords:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
76
|
+
notify: { ...boolean_attribute_writable_false, name: "notify" },
|
|
77
|
+
hasCatalog: { ...boolean_attribute_writable_true, name: "hasCatalog" },
|
|
78
|
+
hasReverse: { ...boolean_attribute_writable_false, name: "hasReverse" },
|
|
79
|
+
hasSVRRecords: {
|
|
80
|
+
...boolean_attribute_writable_false,
|
|
81
|
+
name: "hasSVRRecords"
|
|
82
|
+
},
|
|
83
|
+
hasLinkLocalAdresses: {
|
|
84
|
+
...boolean_attribute_writable_false,
|
|
85
|
+
name: "hasLinkLocalAdresses"
|
|
86
|
+
},
|
|
87
|
+
hasLocationRecord: {
|
|
88
|
+
...boolean_attribute_writable_true,
|
|
89
|
+
name: "hasLocationRecord"
|
|
90
|
+
},
|
|
91
|
+
recordTTL: {
|
|
92
|
+
...duration_attribute_writable,
|
|
93
|
+
name: "recordTTL",
|
|
94
|
+
default: "1W"
|
|
95
|
+
},
|
|
68
96
|
serial: {
|
|
69
97
|
...integer_attribute_writable,
|
|
98
|
+
name: "serial",
|
|
70
99
|
default: Math.ceil(Date.now() / 1000)
|
|
71
100
|
},
|
|
72
|
-
refresh: {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
101
|
+
refresh: {
|
|
102
|
+
...duration_attribute_writable,
|
|
103
|
+
name: "refresh",
|
|
104
|
+
default: 36000
|
|
105
|
+
},
|
|
106
|
+
retry: { ...duration_attribute_writable, name: "retry", default: 72000 },
|
|
107
|
+
expire: { ...duration_attribute_writable, name: "expire", default: 600000 },
|
|
108
|
+
minimum: { ...duration_attribute_writable, name: "minimum", default: 60000 }
|
|
76
109
|
};
|
|
77
110
|
|
|
78
111
|
static {
|
|
@@ -100,12 +133,6 @@ class bind_group extends Base {
|
|
|
100
133
|
}
|
|
101
134
|
|
|
102
135
|
get defaultRecords() {
|
|
103
|
-
/*
|
|
104
|
-
const ss = this.location.services.filter(s=>s.types.has('dns') && s.priority>=300);
|
|
105
|
-
const ss = [
|
|
106
|
-
...this.location.expression("services[types['dns'] && priority>=300]")
|
|
107
|
-
].sort(sortAscendingByPriority)
|
|
108
|
-
*/
|
|
109
136
|
const nameService = this.owner; //ss[0];
|
|
110
137
|
|
|
111
138
|
console.log(
|
|
@@ -167,7 +194,7 @@ class bind_group extends Base {
|
|
|
167
194
|
);
|
|
168
195
|
|
|
169
196
|
for (const domain of source.localDomains) {
|
|
170
|
-
const locationName = source.
|
|
197
|
+
const locationName = source.owner.name;
|
|
171
198
|
const reverseZones = new Map();
|
|
172
199
|
|
|
173
200
|
const config = {
|
|
@@ -270,7 +297,7 @@ class bind_group extends Base {
|
|
|
270
297
|
|
|
271
298
|
const sm = new Map();
|
|
272
299
|
|
|
273
|
-
for (const service of host.services) {
|
|
300
|
+
for (const service of host.services.values()) {
|
|
274
301
|
for (const record of service.dnsRecordsForDomainName(
|
|
275
302
|
host.domainName,
|
|
276
303
|
this.hasSVRRecords
|
|
@@ -395,18 +422,17 @@ function addressesStatement(prefix, objects, generateEmpty = false) {
|
|
|
395
422
|
}
|
|
396
423
|
|
|
397
424
|
export class bind extends ExtraSourceService {
|
|
398
|
-
static specializationOf = Service;
|
|
399
425
|
static attributes = {
|
|
400
426
|
groups: {
|
|
401
|
-
...
|
|
427
|
+
...default_collection_attribute_writable,
|
|
428
|
+
name: "groups",
|
|
402
429
|
type: bind_group,
|
|
403
|
-
|
|
404
|
-
writable: true
|
|
430
|
+
backpointer: owner_attribute
|
|
405
431
|
},
|
|
406
432
|
primaries: {
|
|
407
|
-
...
|
|
408
|
-
|
|
409
|
-
|
|
433
|
+
...default_collection_attribute_writable,
|
|
434
|
+
name: "primaries",
|
|
435
|
+
type: networkAddressType
|
|
410
436
|
}
|
|
411
437
|
};
|
|
412
438
|
static service = {
|
|
@@ -451,52 +477,24 @@ export class bind extends ExtraSourceService {
|
|
|
451
477
|
addType(this);
|
|
452
478
|
}
|
|
453
479
|
|
|
454
|
-
groups =
|
|
480
|
+
groups = new Map();
|
|
455
481
|
|
|
456
482
|
materializeExtends() {
|
|
457
483
|
super.materializeExtends();
|
|
458
484
|
|
|
459
|
-
//console.log("ME", this.fullName, this.extends);
|
|
460
485
|
for (const service of this.walkDirections(["extends"])) {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
this.fullName,
|
|
464
|
-
service.fullName
|
|
465
|
-
);
|
|
466
|
-
|
|
467
|
-
for (const group of Object.values(service.groups)) {
|
|
468
|
-
const present = this.groups[group.name];
|
|
486
|
+
for (const group of service.groups.values()) {
|
|
487
|
+
const present = this.groups.get(group.name);
|
|
469
488
|
|
|
470
489
|
if (present) {
|
|
471
|
-
|
|
472
|
-
present.extends.push(group);
|
|
490
|
+
present.extends.add(group);
|
|
473
491
|
} else {
|
|
474
|
-
this.groups
|
|
475
|
-
|
|
476
|
-
console.log(
|
|
477
|
-
group.fullName,
|
|
478
|
-
this.groups[group.name].entries.map(e => e.fullName)
|
|
479
|
-
);
|
|
492
|
+
this.groups.set(group.name, group.forOwner(this));
|
|
480
493
|
}
|
|
481
|
-
|
|
482
|
-
/*
|
|
483
|
-
console.log(
|
|
484
|
-
eg.fullName,
|
|
485
|
-
eg.entries.map(e => e.fullName)
|
|
486
|
-
);*/
|
|
487
|
-
//console.log("EXTENDS", this.fullName, service.fullName, eg.fullName, eg.owner.fullName);
|
|
488
494
|
}
|
|
489
495
|
}
|
|
490
496
|
}
|
|
491
497
|
|
|
492
|
-
typeNamed(type, name) {
|
|
493
|
-
if (type === bind_group.name) {
|
|
494
|
-
return this.groups[name];
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
return super.typeNamed(type, name);
|
|
498
|
-
}
|
|
499
|
-
|
|
500
498
|
get serverType() {
|
|
501
499
|
return this.primaries ? "secondary" : "primary";
|
|
502
500
|
}
|
|
@@ -596,11 +594,11 @@ export class bind extends ExtraSourceService {
|
|
|
596
594
|
|
|
597
595
|
async *generateOutfacingDefs(outputControl, sources) {
|
|
598
596
|
for (const source of sources) {
|
|
599
|
-
for (const host of source.hosts) {
|
|
597
|
+
for (const host of source.hosts.values()) {
|
|
600
598
|
this.outfacingZones(
|
|
601
599
|
outputControl,
|
|
602
600
|
host,
|
|
603
|
-
this.groups.internal,
|
|
601
|
+
this.groups.get("internal"),
|
|
604
602
|
this.defaultRecords
|
|
605
603
|
);
|
|
606
604
|
}
|
|
@@ -631,7 +629,7 @@ export class bind extends ExtraSourceService {
|
|
|
631
629
|
|
|
632
630
|
const zone = {
|
|
633
631
|
id: domain,
|
|
634
|
-
file: `${host.
|
|
632
|
+
file: `${host.owner.name}/outfacing/${domain}.zone`,
|
|
635
633
|
records: new Set(records)
|
|
636
634
|
};
|
|
637
635
|
const config = {
|
|
@@ -644,7 +642,7 @@ export class bind extends ExtraSourceService {
|
|
|
644
642
|
outputControl.configs.push(config);
|
|
645
643
|
|
|
646
644
|
if (this.hasLocationRecord) {
|
|
647
|
-
zone.records.add(DNSRecord("location", "TXT", host.
|
|
645
|
+
zone.records.add(DNSRecord("location", "TXT", host.owner.name));
|
|
648
646
|
}
|
|
649
647
|
for (const na of host.networkAddresses(
|
|
650
648
|
na => na.networkInterface.kind !== "loopback"
|
|
@@ -660,11 +658,7 @@ export class bind extends ExtraSourceService {
|
|
|
660
658
|
}
|
|
661
659
|
}
|
|
662
660
|
|
|
663
|
-
this.assignCatalog(
|
|
664
|
-
outputControl,
|
|
665
|
-
zone,
|
|
666
|
-
`outfacting.${host.location.name}`
|
|
667
|
-
);
|
|
661
|
+
this.assignCatalog(outputControl, zone, `outfacting.${host.owner.name}`);
|
|
668
662
|
});
|
|
669
663
|
}
|
|
670
664
|
}
|
package/src/services/chrony.mjs
CHANGED
|
@@ -2,11 +2,10 @@ import { join } from "node:path";
|
|
|
2
2
|
import { FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
|
|
3
3
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
4
4
|
import { isLinkLocal } from "ip-utilties";
|
|
5
|
-
import {
|
|
5
|
+
import { serviceEndpoints, addType, ExtraSourceService } from "pmcf";
|
|
6
6
|
import { writeLines } from "../utils.mjs";
|
|
7
7
|
|
|
8
8
|
export class chrony extends ExtraSourceService {
|
|
9
|
-
static specializationOf = Service;
|
|
10
9
|
static service = {
|
|
11
10
|
systemdService: "chronyd.service",
|
|
12
11
|
extends: ["ntp"],
|
|
@@ -78,9 +77,9 @@ export class chrony extends ExtraSourceService {
|
|
|
78
77
|
"ntsdumpdir /var/lib/chrony",
|
|
79
78
|
"dumpdir /var/lib/chrony",
|
|
80
79
|
"pidfile /run/chrony/chronyd.pid",
|
|
81
|
-
[...this.
|
|
80
|
+
[...this.values()].map(s => `allow ${s.address}`),
|
|
82
81
|
"cmdratelimit interval -4 burst 16",
|
|
83
|
-
[...this.subnets].map(s => `cmdallow ${s.address}`)
|
|
82
|
+
[...this.subnets.values()].map(s => `cmdallow ${s.address}`)
|
|
84
83
|
];
|
|
85
84
|
|
|
86
85
|
await writeLines(join(dir, "etc"), "chrony.conf", lines);
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
} from "../utils.mjs";
|
|
11
11
|
|
|
12
12
|
export class influxdb extends Service {
|
|
13
|
-
static specializationOf = Service;
|
|
14
13
|
static attributes = {
|
|
15
14
|
metricsDisabled: {
|
|
16
|
-
externalName: "metrics-disabled",
|
|
17
15
|
...boolean_attribute_writable_true,
|
|
16
|
+
name: "metricsDisabled",
|
|
17
|
+
externalName: "metrics-disabled",
|
|
18
18
|
configurable: true
|
|
19
19
|
}
|
|
20
20
|
};
|
package/src/services/kea.mjs
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
reverseArpa,
|
|
5
|
+
isLinkLocal,
|
|
6
|
+
FAMILY_IPV4,
|
|
7
|
+
FAMILY_IPV6
|
|
8
|
+
} from "ip-utilties";
|
|
4
9
|
import {
|
|
5
10
|
string_attribute_writable,
|
|
6
11
|
number_attribute_writable,
|
|
@@ -19,32 +24,36 @@ import { writeLines } from "../utils.mjs";
|
|
|
19
24
|
const keaVersion = "3.0.1";
|
|
20
25
|
|
|
21
26
|
export class kea extends Service {
|
|
22
|
-
static specializationOf = Service;
|
|
23
27
|
static attributes = {
|
|
24
28
|
"ddns-send-updates": {
|
|
25
29
|
...boolean_attribute_writable_true,
|
|
30
|
+
name: "ddns-send-updates",
|
|
26
31
|
configurable: true
|
|
27
32
|
},
|
|
28
33
|
"renew-timer": {
|
|
29
34
|
...number_attribute_writable,
|
|
35
|
+
name: "renew-timer",
|
|
30
36
|
configurable: true,
|
|
31
37
|
default: 900
|
|
32
38
|
},
|
|
33
39
|
"rebind-timer": {
|
|
34
40
|
...number_attribute_writable,
|
|
41
|
+
name: "rebind-timer",
|
|
35
42
|
configurable: true,
|
|
36
43
|
default: 1800
|
|
37
44
|
},
|
|
38
45
|
"valid-lifetime": {
|
|
39
46
|
...number_attribute_writable,
|
|
47
|
+
name: "valid-lifetime",
|
|
40
48
|
mandatory: true,
|
|
41
49
|
configurable: true,
|
|
42
50
|
default: 86400
|
|
43
51
|
},
|
|
44
52
|
"ddns-conflict-resolution-mode": {
|
|
45
53
|
...string_attribute_writable,
|
|
54
|
+
name: "ddns-conflict-resolution-mode",
|
|
46
55
|
configurable: true
|
|
47
|
-
//values: ["check-exists-with-dhcid","no-check-with-dhcid"]
|
|
56
|
+
//values: new Set(["check-exists-with-dhcid","no-check-with-dhcid"])
|
|
48
57
|
}
|
|
49
58
|
};
|
|
50
59
|
static service = {
|
|
@@ -287,7 +296,8 @@ export class kea extends Service {
|
|
|
287
296
|
name,
|
|
288
297
|
"dns-servers": dnsServerEndpoints
|
|
289
298
|
.filter(
|
|
290
|
-
endpoint =>
|
|
299
|
+
endpoint =>
|
|
300
|
+
endpoint.family === FAMILY_IPV4 && endpoint.type === "dns"
|
|
291
301
|
)
|
|
292
302
|
.map(endpoint => {
|
|
293
303
|
return { "ip-address": endpoint.address };
|
|
@@ -298,7 +308,7 @@ export class kea extends Service {
|
|
|
298
308
|
const ddnsEndpoint = this.endpoint("kea-ddns");
|
|
299
309
|
|
|
300
310
|
const subnetPrefixes = new Set(
|
|
301
|
-
[...this.subnets]
|
|
311
|
+
[...this.subnets.values()]
|
|
302
312
|
.filter(s => s != SUBNET_LOCALHOST_IPV4 && s != SUBNET_LOCALHOST_IPV6)
|
|
303
313
|
.map(s => s.prefix)
|
|
304
314
|
);
|
|
@@ -379,7 +389,7 @@ export class kea extends Service {
|
|
|
379
389
|
endpoint => `${endpoint.networkInterface.name}/${endpoint.address}`
|
|
380
390
|
);
|
|
381
391
|
|
|
382
|
-
const subnets = [...this.subnets].filter(
|
|
392
|
+
const subnets = [...this.subnets.values()].filter(
|
|
383
393
|
s => s !== SUBNET_LOCALHOST_IPV4 && s !== SUBNET_LOCALHOST_IPV6
|
|
384
394
|
);
|
|
385
395
|
|
|
@@ -2,23 +2,26 @@ import { port_attribute, string_attribute_writable } from "pacc";
|
|
|
2
2
|
import { Service, addType } from "pmcf";
|
|
3
3
|
|
|
4
4
|
export class mosquitto extends Service {
|
|
5
|
-
static specializationOf = Service;
|
|
6
5
|
static attributes = {
|
|
7
6
|
listener: {
|
|
8
7
|
...port_attribute,
|
|
8
|
+
name: "listener",
|
|
9
9
|
writable: true,
|
|
10
10
|
configurable: true
|
|
11
11
|
},
|
|
12
12
|
persistence_location: {
|
|
13
13
|
...string_attribute_writable,
|
|
14
|
+
name: "persistence_location",
|
|
14
15
|
configurable: true
|
|
15
16
|
},
|
|
16
17
|
password_file: {
|
|
17
18
|
...string_attribute_writable,
|
|
19
|
+
name: "password_file",
|
|
18
20
|
configurable: true
|
|
19
21
|
},
|
|
20
22
|
acl_file: {
|
|
21
23
|
...string_attribute_writable,
|
|
24
|
+
name: "acl_file",
|
|
22
25
|
configurable: true
|
|
23
26
|
}
|
|
24
27
|
};
|
|
@@ -2,10 +2,9 @@ import { string_attribute_writable } from "pacc";
|
|
|
2
2
|
import { Service, addType } from "pmcf";
|
|
3
3
|
|
|
4
4
|
export class openldap extends Service {
|
|
5
|
-
static specializationOf = Service;
|
|
6
5
|
static attributes = {
|
|
7
|
-
base: string_attribute_writable,
|
|
8
|
-
uri: string_attribute_writable
|
|
6
|
+
base: { ...string_attribute_writable, name: "base" },
|
|
7
|
+
uri: { ...string_attribute_writable, name: "uri" }
|
|
9
8
|
};
|
|
10
9
|
static service = {
|
|
11
10
|
systemdService: "slapd.service",
|
|
@@ -41,9 +40,9 @@ export class openldap extends Service {
|
|
|
41
40
|
|
|
42
41
|
const packageData = this.packageData;
|
|
43
42
|
|
|
44
|
-
console.log(
|
|
43
|
+
/*console.log(
|
|
45
44
|
[...this.walkDirections(["this", "extends"])].map(n => n.fullName)
|
|
46
|
-
)
|
|
45
|
+
);*/
|
|
47
46
|
|
|
48
47
|
packageData.sources = await Array.fromAsync(
|
|
49
48
|
this.templateContent(
|
package/src/services/postfix.mjs
CHANGED
|
@@ -14,50 +14,60 @@ import { filterConfigurable, sectionLines } from "../utils.mjs";
|
|
|
14
14
|
*/
|
|
15
15
|
export class SystemdJournalRemoteService extends Service {
|
|
16
16
|
static name = "systemd-journal-remote";
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
static attributes = {
|
|
19
19
|
Seal: {
|
|
20
20
|
...boolean_attribute_writable,
|
|
21
|
+
name: "Seal",
|
|
21
22
|
configurable: true
|
|
22
23
|
},
|
|
23
24
|
SplitMode: {
|
|
24
25
|
...string_attribute_writable,
|
|
25
|
-
|
|
26
|
+
name: "SplitMode",
|
|
27
|
+
values: new Set([false, "host"]),
|
|
26
28
|
configurable: true
|
|
27
29
|
},
|
|
28
30
|
ServerKeyFile: {
|
|
29
31
|
...string_attribute_writable,
|
|
32
|
+
name: "ServerKeyFile",
|
|
30
33
|
configurable: true
|
|
31
34
|
// default: "/etc/ssl/private/journal-upload.pem"
|
|
32
35
|
},
|
|
33
36
|
ServerCertificateFile: {
|
|
34
37
|
...string_attribute_writable,
|
|
38
|
+
name: "ServerCertificateFile",
|
|
35
39
|
configurable: true
|
|
36
40
|
// default: "/etc/ssl/certs/journal-upload.pem"
|
|
37
41
|
},
|
|
38
42
|
TrustedCertificateFile: {
|
|
39
43
|
...string_attribute_writable,
|
|
44
|
+
name: "TrustedCertificateFile",
|
|
40
45
|
configurable: true
|
|
41
46
|
// default: "/etc/ssl/ca/trusted.pem"
|
|
42
47
|
},
|
|
43
48
|
MaxUse: {
|
|
44
49
|
...string_attribute_writable,
|
|
50
|
+
name: "MaxUse",
|
|
45
51
|
configurable: true
|
|
46
52
|
},
|
|
47
53
|
KeepFree: {
|
|
48
54
|
...string_attribute_writable,
|
|
55
|
+
name: "KeepFree",
|
|
49
56
|
configurable: true
|
|
50
57
|
},
|
|
51
58
|
MaxFileSize: {
|
|
52
59
|
...string_attribute_writable,
|
|
60
|
+
name: "MaxFileSize",
|
|
53
61
|
configurable: true
|
|
54
62
|
},
|
|
55
63
|
MaxFiles: {
|
|
56
64
|
...integer_attribute_writable,
|
|
65
|
+
name: "MaxFiles",
|
|
57
66
|
configurable: true
|
|
58
67
|
},
|
|
59
68
|
Compression: {
|
|
60
69
|
...string_collection_attribute_writable,
|
|
70
|
+
name: "Compression",
|
|
61
71
|
configurable: true
|
|
62
72
|
// default: "zstd lz4 xz"
|
|
63
73
|
}
|
|
@@ -13,31 +13,35 @@ import { filterConfigurable, sectionLines } from "../utils.mjs";
|
|
|
13
13
|
*/
|
|
14
14
|
export class SystemdJournalUploadService extends Service {
|
|
15
15
|
static name = "systemd-journal-upload";
|
|
16
|
-
static specializationOf = Service;
|
|
17
16
|
static attributes = {
|
|
18
|
-
URL: { ...string_attribute_writable, configurable: true },
|
|
17
|
+
URL: { ...string_attribute_writable, name: "URL", configurable: true },
|
|
19
18
|
ServerKeyFile: {
|
|
20
19
|
...string_attribute_writable,
|
|
20
|
+
name: "ServerKeyFile",
|
|
21
21
|
configurable: true
|
|
22
22
|
// default: "/etc/ssl/private/journal-upload.pem"
|
|
23
23
|
},
|
|
24
24
|
ServerCertificateFile: {
|
|
25
25
|
...string_attribute_writable,
|
|
26
|
+
name: "ServerCertificateFile",
|
|
26
27
|
configurable: true
|
|
27
28
|
// default: "/etc/ssl/certs/journal-upload.pem"
|
|
28
29
|
},
|
|
29
30
|
TrustedCertificateFile: {
|
|
30
31
|
...string_attribute_writable,
|
|
32
|
+
name: "TrustedCertificateFile",
|
|
31
33
|
configurable: true
|
|
32
34
|
// default: "/etc/ssl/ca/trusted.pem"
|
|
33
35
|
},
|
|
34
36
|
Compression: {
|
|
35
37
|
...string_collection_attribute_writable,
|
|
38
|
+
name: "Compression",
|
|
36
39
|
configurable: true
|
|
37
40
|
// default: "zstd lz4 xz"
|
|
38
41
|
},
|
|
39
42
|
ForceCompression: {
|
|
40
43
|
...boolean_attribute_writable,
|
|
44
|
+
name: "ForceCompression",
|
|
41
45
|
configurable: true
|
|
42
46
|
// default: false
|
|
43
47
|
}
|
|
@@ -59,10 +63,12 @@ export class SystemdJournalUploadService extends Service {
|
|
|
59
63
|
* @returns {Object}
|
|
60
64
|
*/
|
|
61
65
|
systemdConfigs(name) {
|
|
66
|
+
/*
|
|
62
67
|
console.log(this.fullName, this.owner.fullName);
|
|
63
68
|
console.log(this.property("domainName"), this.name);
|
|
64
69
|
console.log(this.property("certs_private_dir"));
|
|
65
70
|
console.log("PROPS", this.expand(this.getAttributes(filterConfigurable)));
|
|
71
|
+
*/
|
|
66
72
|
return {
|
|
67
73
|
serviceName: this.systemdService,
|
|
68
74
|
configFileName: `etc/systemd/journal-upload.conf.d/${name}.conf`,
|