pmcf 4.28.10 → 4.29.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 -3
- package/src/cluster.mjs +2 -1
- package/src/dns-utils.mjs +2 -2
- package/src/endpoint.mjs +2 -1
- package/src/host.mjs +1 -2
- package/src/module.mjs +1 -0
- package/src/owner.mjs +8 -4
- package/src/service-types.mjs +55 -53
- package/src/service.mjs +3 -2
- package/src/services/alpm.mjs +1 -4
- package/src/services/bind.mjs +6 -8
- package/src/services/chrony.mjs +5 -7
- package/src/services/headscale.mjs +5 -7
- package/src/services/influxdb.mjs +5 -6
- package/src/services/kea.mjs +11 -15
- package/src/services/mosquitto.mjs +2 -4
- package/src/services/openldap.mjs +5 -5
- package/src/services/postfix.mjs +1 -5
- package/src/services/systemd-journal-remote.mjs +4 -5
- package/src/services/systemd-journal-upload.mjs +2 -4
- package/src/services/systemd-journald.mjs +2 -7
- package/src/services/systemd-resolved.mjs +3 -9
- package/src/services/systemd-timesyncd.mjs +2 -12
- package/src/services/tailscale.mjs +3 -3
- package/src/subnet.mjs +1 -1
- package/src/type.mjs +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.29.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"aggregated-map": "^1.0.4",
|
|
54
54
|
"content-entry-transform": "^1.6.9",
|
|
55
|
-
"ip-utilties": "^3.0
|
|
55
|
+
"ip-utilties": "^3.1.0",
|
|
56
56
|
"npm-pkgbuild": "^20.7.3",
|
|
57
|
-
"pacc": "^9.3.
|
|
57
|
+
"pacc": "^9.3.3",
|
|
58
58
|
"package-directory": "^8.2.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
package/src/cluster.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
|
+
import { FAMILY_IPV4 } from "ip-utilties";
|
|
3
4
|
import {
|
|
4
5
|
default_attribute_writable,
|
|
5
6
|
default_attribute,
|
|
@@ -123,7 +124,7 @@ export class Cluster extends Host {
|
|
|
123
124
|
)) {
|
|
124
125
|
cfg.push(
|
|
125
126
|
` ${
|
|
126
|
-
na.family ===
|
|
127
|
+
na.family === FAMILY_IPV4
|
|
127
128
|
? "virtual_ipaddress"
|
|
128
129
|
: "virtual_ipaddress_excluded"
|
|
129
130
|
} {`
|
package/src/dns-utils.mjs
CHANGED
package/src/endpoint.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FAMILY_IPV6 } from "ip-utilties";
|
|
1
2
|
import { addType } from "pacc";
|
|
2
3
|
import { endpointAttributes, Service } from "./service.mjs";
|
|
3
4
|
|
|
@@ -146,7 +147,7 @@ export class HTTPEndpoint extends BaseEndpoint {
|
|
|
146
147
|
this.family = address.family;
|
|
147
148
|
this.url = new URL(
|
|
148
149
|
(data.tls ? "https://" : "http://") +
|
|
149
|
-
(address.family ===
|
|
150
|
+
(address.family === FAMILY_IPV6
|
|
150
151
|
? "[" + address.address + "]"
|
|
151
152
|
: address.address) +
|
|
152
153
|
":" +
|
package/src/host.mjs
CHANGED
|
@@ -27,7 +27,6 @@ import { generateKnownHosts } from "./host-utils.mjs";
|
|
|
27
27
|
export class Host extends ServiceOwner {
|
|
28
28
|
static name = "host";
|
|
29
29
|
static priority = 1.9;
|
|
30
|
-
static owners = ["owner", "network", "root"];
|
|
31
30
|
static attributes = {
|
|
32
31
|
...networkAddressAttributes,
|
|
33
32
|
networkInterfaces: {
|
|
@@ -75,7 +74,7 @@ export class Host extends ServiceOwner {
|
|
|
75
74
|
replaces: string_set_attribute_writable,
|
|
76
75
|
depends: string_set_attribute_writable,
|
|
77
76
|
provides: string_set_attribute_writable,
|
|
78
|
-
extends: { ...default_attribute_writable, type:
|
|
77
|
+
extends: { ...default_attribute_writable, type: Host, collection: true, owner: false },
|
|
79
78
|
model: string_attribute,
|
|
80
79
|
isModel: boolean_attribute_false
|
|
81
80
|
};
|
package/src/module.mjs
CHANGED
package/src/owner.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeCIDR, familyIP } from "ip-utilties";
|
|
1
|
+
import { normalizeCIDR, familyIP, FAMILY_IPV4 } from "ip-utilties";
|
|
2
2
|
import {
|
|
3
3
|
default_attribute_writable,
|
|
4
4
|
string_set_attribute_writable,
|
|
@@ -12,6 +12,7 @@ import { asIterator, union } from "./utils.mjs";
|
|
|
12
12
|
import { Base } from "./base.mjs";
|
|
13
13
|
import { Subnet, SUBNET_GLOBAL_IPV4, SUBNET_GLOBAL_IPV6 } from "./subnet.mjs";
|
|
14
14
|
import { networks_attribute } from "./network-support.mjs";
|
|
15
|
+
import { Host } from "./host.mjs";
|
|
15
16
|
|
|
16
17
|
const EMPTY = new Map();
|
|
17
18
|
|
|
@@ -23,7 +24,7 @@ export class Owner extends Base {
|
|
|
23
24
|
networks: networks_attribute,
|
|
24
25
|
hosts: {
|
|
25
26
|
...default_attribute_writable,
|
|
26
|
-
type:
|
|
27
|
+
type: Host,
|
|
27
28
|
collection: true
|
|
28
29
|
},
|
|
29
30
|
clusters: {
|
|
@@ -40,7 +41,10 @@ export class Owner extends Base {
|
|
|
40
41
|
domain: string_attribute_writable,
|
|
41
42
|
domains: string_set_attribute_writable,
|
|
42
43
|
timezone: string_attribute_writable,
|
|
43
|
-
architectures:
|
|
44
|
+
architectures: {
|
|
45
|
+
...string_set_attribute_writable,
|
|
46
|
+
description: "all supported architectures"
|
|
47
|
+
},
|
|
44
48
|
locales: { ...string_set_attribute_writable, description: "unix locale" },
|
|
45
49
|
administratorEmail: { ...email_attribute, writable: true },
|
|
46
50
|
template: { ...boolean_attribute_writable, private: true }
|
|
@@ -193,7 +197,7 @@ export class Owner extends Base {
|
|
|
193
197
|
|
|
194
198
|
if (!subnet) {
|
|
195
199
|
subnet =
|
|
196
|
-
familyIP(address) ===
|
|
200
|
+
familyIP(address) === FAMILY_IPV4 ? SUBNET_GLOBAL_IPV4 : SUBNET_GLOBAL_IPV6;
|
|
197
201
|
|
|
198
202
|
this.error(
|
|
199
203
|
`Address without subnet ${address}`,
|
package/src/service-types.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
|
|
2
|
+
|
|
1
3
|
export const ServiceTypes = {
|
|
2
4
|
"alpm-repo": {
|
|
3
5
|
extends: ["https"]
|
|
@@ -6,25 +8,25 @@ export const ServiceTypes = {
|
|
|
6
8
|
endpoints: [
|
|
7
9
|
{
|
|
8
10
|
protocol: "udp",
|
|
9
|
-
family:
|
|
11
|
+
family: FAMILY_IPV4,
|
|
10
12
|
port: 514,
|
|
11
13
|
tls: false
|
|
12
14
|
},
|
|
13
15
|
{
|
|
14
16
|
protocol: "udp",
|
|
15
|
-
family:
|
|
17
|
+
family: FAMILY_IPV6,
|
|
16
18
|
port: 514,
|
|
17
19
|
tls: false
|
|
18
20
|
},
|
|
19
21
|
{
|
|
20
22
|
protocol: "tcp",
|
|
21
|
-
family:
|
|
23
|
+
family: FAMILY_IPV4,
|
|
22
24
|
port: 514,
|
|
23
25
|
tls: false
|
|
24
26
|
},
|
|
25
27
|
{
|
|
26
28
|
protocol: "tcp",
|
|
27
|
-
family:
|
|
29
|
+
family: FAMILY_IPV6,
|
|
28
30
|
port: 514,
|
|
29
31
|
tls: false
|
|
30
32
|
}
|
|
@@ -32,52 +34,52 @@ export const ServiceTypes = {
|
|
|
32
34
|
},
|
|
33
35
|
mqtt: {
|
|
34
36
|
endpoints: [
|
|
35
|
-
{ family:
|
|
36
|
-
{ family:
|
|
37
|
+
{ family: FAMILY_IPV4, protocol: "tcp", port: 1883, tls: false },
|
|
38
|
+
{ family: FAMILY_IPV6, protocol: "tcp", port: 1883, tls: false }
|
|
37
39
|
]
|
|
38
40
|
},
|
|
39
41
|
"secure-mqtt": {
|
|
40
42
|
endpoints: [
|
|
41
|
-
{ family:
|
|
42
|
-
{ family:
|
|
43
|
+
{ family: FAMILY_IPV4, protocol: "tcp", port: 8883, tls: true },
|
|
44
|
+
{ family: FAMILY_IPV6, protocol: "tcp", port: 8883, tls: true }
|
|
43
45
|
]
|
|
44
46
|
},
|
|
45
47
|
ntp: {
|
|
46
48
|
endpoints: [
|
|
47
|
-
{ family:
|
|
48
|
-
{ family:
|
|
49
|
+
{ family: FAMILY_IPV4, protocol: "udp", port: 123, tls: false },
|
|
50
|
+
{ family: FAMILY_IPV6, protocol: "udp", port: 123, tls: false }
|
|
49
51
|
]
|
|
50
52
|
},
|
|
51
53
|
dns: {
|
|
52
54
|
endpoints: [
|
|
53
|
-
{ family:
|
|
54
|
-
{ family:
|
|
55
|
+
{ family: FAMILY_IPV4, protocol: "udp", port: 53, tls: false },
|
|
56
|
+
{ family: FAMILY_IPV6, protocol: "udp", port: 53, tls: false }
|
|
55
57
|
]
|
|
56
58
|
},
|
|
57
59
|
mdns: {
|
|
58
60
|
endpoints: [
|
|
59
|
-
{ family:
|
|
60
|
-
{ family:
|
|
61
|
+
{ family: FAMILY_IPV4, protocol: "udp", port: 5353, tls: false },
|
|
62
|
+
{ family: FAMILY_IPV6, protocol: "udp", port: 5353, tls: false }
|
|
61
63
|
]
|
|
62
64
|
},
|
|
63
65
|
llmnr: {
|
|
64
66
|
endpoints: [
|
|
65
|
-
{ family:
|
|
66
|
-
{ family:
|
|
67
|
-
{ family:
|
|
68
|
-
{ family:
|
|
67
|
+
{ family: FAMILY_IPV4, protocol: "udp", port: 5355, tls: false },
|
|
68
|
+
{ family: FAMILY_IPV4, protocol: "tcp", port: 5355, tls: false },
|
|
69
|
+
{ family: FAMILY_IPV6, protocol: "udp", port: 5355, tls: false },
|
|
70
|
+
{ family: FAMILY_IPV6, protocol: "tcp", port: 5355, tls: false }
|
|
69
71
|
]
|
|
70
72
|
},
|
|
71
73
|
ldap: {
|
|
72
74
|
endpoints: [
|
|
73
|
-
{ family:
|
|
74
|
-
{ family:
|
|
75
|
+
{ family: FAMILY_IPV4, scheme: "ldap", protocol: "tcp", port: 389, tls: false },
|
|
76
|
+
{ family: FAMILY_IPV6, scheme: "ldap", protocol: "tcp", port: 389, tls: false }
|
|
75
77
|
]
|
|
76
78
|
},
|
|
77
79
|
ldaps: {
|
|
78
80
|
endpoints: [
|
|
79
|
-
{ family:
|
|
80
|
-
{ family:
|
|
81
|
+
{ family: FAMILY_IPV4, scheme: "ldaps", protocol: "tcp", port: 636, tls: true },
|
|
82
|
+
{ family: FAMILY_IPV6, scheme: "ldaps", protocol: "tcp", port: 636, tls: true }
|
|
81
83
|
]
|
|
82
84
|
},
|
|
83
85
|
ldapi: {
|
|
@@ -85,21 +87,21 @@ export const ServiceTypes = {
|
|
|
85
87
|
},
|
|
86
88
|
http: {
|
|
87
89
|
endpoints: [
|
|
88
|
-
{ family:
|
|
89
|
-
{ family:
|
|
90
|
+
{ family: FAMILY_IPV4, scheme: "http", protocol: "tcp", port: 80, tls: false },
|
|
91
|
+
{ family: FAMILY_IPV6, scheme: "http", protocol: "tcp", port: 80, tls: false }
|
|
90
92
|
]
|
|
91
93
|
},
|
|
92
94
|
https: {
|
|
93
95
|
endpoints: [
|
|
94
|
-
{ family:
|
|
95
|
-
{ family:
|
|
96
|
+
{ family: FAMILY_IPV4, scheme: "https", protocol: "tcp", port: 443, tls: true },
|
|
97
|
+
{ family: FAMILY_IPV6, scheme: "https", protocol: "tcp", port: 443, tls: true }
|
|
96
98
|
],
|
|
97
99
|
dnsRecord: { type: "HTTPS", parameters: { alpn: "h2" } }
|
|
98
100
|
},
|
|
99
101
|
http3: {
|
|
100
102
|
endpoints: [
|
|
101
|
-
{ family:
|
|
102
|
-
{ family:
|
|
103
|
+
{ family: FAMILY_IPV4, scheme: "https", protocol: "udp", port: 443, tls: true },
|
|
104
|
+
{ family: FAMILY_IPV6, scheme: "https", protocol: "udp", port: 443, tls: true }
|
|
103
105
|
],
|
|
104
106
|
dnsRecord: {
|
|
105
107
|
type: "HTTPS",
|
|
@@ -108,64 +110,64 @@ export const ServiceTypes = {
|
|
|
108
110
|
},
|
|
109
111
|
rtsp: {
|
|
110
112
|
endpoints: [
|
|
111
|
-
{ family:
|
|
112
|
-
{ family:
|
|
113
|
+
{ family: FAMILY_IPV4, protocol: "tcp", port: 554, tls: false },
|
|
114
|
+
{ family: FAMILY_IPV6, protocol: "tcp", port: 554, tls: false }
|
|
113
115
|
]
|
|
114
116
|
},
|
|
115
117
|
smtp: {
|
|
116
118
|
endpoints: [
|
|
117
|
-
{ family:
|
|
118
|
-
{ family:
|
|
119
|
+
{ family: FAMILY_IPV4, protocol: "tcp", port: 25, tls: false },
|
|
120
|
+
{ family: FAMILY_IPV6, protocol: "tcp", port: 25, tls: false }
|
|
119
121
|
],
|
|
120
122
|
dnsRecord: { type: "MX" }
|
|
121
123
|
},
|
|
122
124
|
submission: {
|
|
123
125
|
endpoints: [
|
|
124
|
-
{ family:
|
|
125
|
-
{ family:
|
|
126
|
+
{ family: FAMILY_IPV4, protocol: "tcp", port: 587, tls: false },
|
|
127
|
+
{ family: FAMILY_IPV6, protocol: "tcp", port: 587, tls: false }
|
|
126
128
|
]
|
|
127
129
|
},
|
|
128
130
|
lmtp: {
|
|
129
131
|
endpoints: [
|
|
130
|
-
{ family:
|
|
131
|
-
{ family:
|
|
132
|
+
{ family: FAMILY_IPV4, protocol: "tcp", port: 24, tls: false },
|
|
133
|
+
{ family: FAMILY_IPV6, protocol: "tcp", port: 24, tls: false }
|
|
132
134
|
]
|
|
133
135
|
},
|
|
134
136
|
ssh: {
|
|
135
137
|
endpoints: [
|
|
136
|
-
{ family:
|
|
137
|
-
{ family:
|
|
138
|
+
{ family: FAMILY_IPV4, protocol: "tcp", port: 22, tls: false },
|
|
139
|
+
{ family: FAMILY_IPV6, protocol: "tcp", port: 22, tls: false }
|
|
138
140
|
]
|
|
139
141
|
},
|
|
140
142
|
imap: {
|
|
141
143
|
endpoints: [
|
|
142
|
-
{ family:
|
|
143
|
-
{ family:
|
|
144
|
+
{ family: FAMILY_IPV4, protocol: "tcp", port: 143, tls: false },
|
|
145
|
+
{ family: FAMILY_IPV6, protocol: "tcp", port: 143, tls: false }
|
|
144
146
|
]
|
|
145
147
|
},
|
|
146
148
|
imaps: {
|
|
147
149
|
endpoints: [
|
|
148
|
-
{ family:
|
|
149
|
-
{ family:
|
|
150
|
+
{ family: FAMILY_IPV4, protocol: "tcp", port: 993, tls: true },
|
|
151
|
+
{ family: FAMILY_IPV6, protocol: "tcp", port: 993, tls: true }
|
|
150
152
|
]
|
|
151
153
|
},
|
|
152
154
|
dhcp: {
|
|
153
155
|
endpoints: [
|
|
154
|
-
{ family:
|
|
155
|
-
{ family:
|
|
156
|
+
{ family: FAMILY_IPV4, protocol: "udp", port: 547, tls: false },
|
|
157
|
+
{ family: FAMILY_IPV6, protocol: "udp", port: 547, tls: false }
|
|
156
158
|
]
|
|
157
159
|
},
|
|
158
160
|
"dhcpv6-client": {
|
|
159
161
|
endpoints: [
|
|
160
|
-
{ family:
|
|
161
|
-
{ family:
|
|
162
|
+
{ family: FAMILY_IPV6, protocol: "tcp", port: 546, tls: false },
|
|
163
|
+
{ family: FAMILY_IPV6, protocol: "udp", port: 546, tls: false }
|
|
162
164
|
]
|
|
163
165
|
},
|
|
164
|
-
"dhcpv6-server": { endpoints: [{ family:
|
|
166
|
+
"dhcpv6-server": { endpoints: [{ family: FAMILY_IPV6, port: 547, tls: false }] },
|
|
165
167
|
smb: {
|
|
166
168
|
endpoints: [
|
|
167
|
-
{ family:
|
|
168
|
-
{ family:
|
|
169
|
+
{ family: FAMILY_IPV4, protocol: "tcp", port: 445, tls: false },
|
|
170
|
+
{ family: FAMILY_IPV6, protocol: "tcp", port: 445, tls: false }
|
|
169
171
|
]
|
|
170
172
|
},
|
|
171
173
|
timemachine: {
|
|
@@ -183,15 +185,15 @@ export const ServiceTypes = {
|
|
|
183
185
|
pcp: {
|
|
184
186
|
// rfc6887
|
|
185
187
|
endpoints: [
|
|
186
|
-
{ family:
|
|
187
|
-
{ family:
|
|
188
|
+
{ family: FAMILY_IPV4, protocol: "udp", port: 5351, tls: false },
|
|
189
|
+
{ family: FAMILY_IPV6, protocol: "udp", port: 5351, tls: false }
|
|
188
190
|
]
|
|
189
191
|
},
|
|
190
192
|
"pcp-multicast": {
|
|
191
193
|
// rfc6887
|
|
192
194
|
endpoints: [
|
|
193
|
-
{ family:
|
|
194
|
-
{ family:
|
|
195
|
+
{ family: FAMILY_IPV4, protocol: "udp", port: 5350, tls: false },
|
|
196
|
+
{ family: FAMILY_IPV6, protocol: "udp", port: 5350, tls: false }
|
|
195
197
|
]
|
|
196
198
|
}
|
|
197
199
|
};
|
package/src/service.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
|
|
1
2
|
import {
|
|
2
3
|
string_attribute_writable,
|
|
3
4
|
number_attribute_writable,
|
|
@@ -136,8 +137,8 @@ export class Service extends Base {
|
|
|
136
137
|
|
|
137
138
|
case undefined:
|
|
138
139
|
case "dns":
|
|
139
|
-
case
|
|
140
|
-
case
|
|
140
|
+
case FAMILY_IPV4:
|
|
141
|
+
case FAMILY_IPV6:
|
|
141
142
|
const options =
|
|
142
143
|
this._port === undefined ? { ...e } : { ...e, port: this._port };
|
|
143
144
|
delete options.kind;
|
package/src/services/alpm.mjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
addType,
|
|
3
2
|
default_attribute_writable,
|
|
4
3
|
name_attribute_writable,
|
|
5
4
|
string_attribute_writable,
|
|
6
5
|
string_set_attribute_writable
|
|
7
6
|
} from "pacc";
|
|
8
|
-
import {
|
|
9
|
-
import { Service } from "../service.mjs";
|
|
7
|
+
import { addType, Service, Base } from "pmcf";
|
|
10
8
|
|
|
11
9
|
class alpm_repository extends Base {
|
|
12
10
|
static attributes = {
|
|
@@ -36,7 +34,6 @@ export class alpm extends Service {
|
|
|
36
34
|
|
|
37
35
|
static {
|
|
38
36
|
addType(this);
|
|
39
|
-
addServiceType(this.service, this.name);
|
|
40
37
|
}
|
|
41
38
|
|
|
42
39
|
repositories = new Map();
|
package/src/services/bind.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
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 } from "ip-utilties";
|
|
4
|
+
import { isLinkLocal, reverseArpa, FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
|
|
5
5
|
import {
|
|
6
|
-
addType,
|
|
7
6
|
default_attribute_writable,
|
|
8
7
|
duration_attribute_writable,
|
|
9
8
|
string_set_attribute_writable,
|
|
@@ -13,12 +12,13 @@ import {
|
|
|
13
12
|
name_attribute_writable
|
|
14
13
|
} from "pacc";
|
|
15
14
|
import {
|
|
15
|
+
Service,
|
|
16
16
|
Base,
|
|
17
17
|
ExtraSourceService,
|
|
18
18
|
serviceEndpoints,
|
|
19
19
|
addresses,
|
|
20
20
|
networkAddressType,
|
|
21
|
-
|
|
21
|
+
addType
|
|
22
22
|
} from "pmcf";
|
|
23
23
|
import { yesno, writeLines, asArray } from "../utils.mjs";
|
|
24
24
|
import {
|
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
dnsRecordTypeForAddressFamily,
|
|
28
28
|
sortZoneRecords
|
|
29
29
|
} from "../dns-utils.mjs";
|
|
30
|
-
import { Service } from "../service.mjs";
|
|
31
30
|
import { addHook } from "../hooks.mjs";
|
|
32
31
|
|
|
33
32
|
const bindNetworkAddressTypes = networkAddressType + "|bind_group";
|
|
@@ -417,7 +416,7 @@ export class bind extends ExtraSourceService {
|
|
|
417
416
|
"bind-statistics": {
|
|
418
417
|
endpoints: [
|
|
419
418
|
{
|
|
420
|
-
family:
|
|
419
|
+
family: FAMILY_IPV4,
|
|
421
420
|
port: 19521,
|
|
422
421
|
protocol: "tcp",
|
|
423
422
|
pathname: "/",
|
|
@@ -425,7 +424,7 @@ export class bind extends ExtraSourceService {
|
|
|
425
424
|
kind: "loopback"
|
|
426
425
|
},
|
|
427
426
|
{
|
|
428
|
-
family:
|
|
427
|
+
family: FAMILY_IPV6,
|
|
429
428
|
port: 19521,
|
|
430
429
|
protocol: "tcp",
|
|
431
430
|
pathname: "/",
|
|
@@ -437,7 +436,7 @@ export class bind extends ExtraSourceService {
|
|
|
437
436
|
"bind-rdnc": {
|
|
438
437
|
endpoints: [
|
|
439
438
|
{
|
|
440
|
-
family:
|
|
439
|
+
family: FAMILY_IPV4,
|
|
441
440
|
port: 953,
|
|
442
441
|
protocol: "tcp",
|
|
443
442
|
tls: false,
|
|
@@ -450,7 +449,6 @@ export class bind extends ExtraSourceService {
|
|
|
450
449
|
|
|
451
450
|
static {
|
|
452
451
|
addType(this);
|
|
453
|
-
addServiceType(this.service, this.name);
|
|
454
452
|
}
|
|
455
453
|
|
|
456
454
|
groups = {};
|
package/src/services/chrony.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
+
import { FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
|
|
2
3
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
4
|
import { isLinkLocal } from "ip-utilties";
|
|
4
|
-
import { addType } from "
|
|
5
|
-
import { addServiceType, ExtraSourceService } from "pmcf";
|
|
6
|
-
import { Service, serviceEndpoints } from "../service.mjs";
|
|
5
|
+
import { Service, serviceEndpoints, addType, ExtraSourceService } from "pmcf";
|
|
7
6
|
import { writeLines } from "../utils.mjs";
|
|
8
7
|
|
|
9
8
|
export class chrony extends ExtraSourceService {
|
|
@@ -15,13 +14,13 @@ export class chrony extends ExtraSourceService {
|
|
|
15
14
|
"chrony-cmd": {
|
|
16
15
|
endpoints: [
|
|
17
16
|
{
|
|
18
|
-
family:
|
|
17
|
+
family: FAMILY_IPV4,
|
|
19
18
|
port: 323,
|
|
20
19
|
protocol: "tcp",
|
|
21
20
|
tls: false
|
|
22
21
|
},
|
|
23
22
|
{
|
|
24
|
-
family:
|
|
23
|
+
family: FAMILY_IPV6,
|
|
25
24
|
port: 323,
|
|
26
25
|
protocol: "tcp",
|
|
27
26
|
tls: false
|
|
@@ -37,7 +36,6 @@ export class chrony extends ExtraSourceService {
|
|
|
37
36
|
|
|
38
37
|
static {
|
|
39
38
|
addType(this);
|
|
40
|
-
addServiceType(this.service, this.name);
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
async *preparePackages(dir) {
|
|
@@ -65,7 +63,7 @@ export class chrony extends ExtraSourceService {
|
|
|
65
63
|
if (endpoint.isPool) {
|
|
66
64
|
options.push("maxsources 2");
|
|
67
65
|
}
|
|
68
|
-
if (endpoint.priority > 300 && endpoint.family ===
|
|
66
|
+
if (endpoint.priority > 300 && endpoint.family === FAMILY_IPV4) {
|
|
69
67
|
options.push("prefer");
|
|
70
68
|
}
|
|
71
69
|
return options.join(" ");
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Service } from "../service.mjs";
|
|
1
|
+
import { FAMILY_IPV4 } from "ip-utilties";
|
|
2
|
+
import { Service, addType } from "pmcf";
|
|
4
3
|
|
|
5
4
|
export class headscale extends Service {
|
|
6
5
|
static specializationOf = Service;
|
|
@@ -11,21 +10,21 @@ export class headscale extends Service {
|
|
|
11
10
|
path: "/run/headscale/headscale.sock"
|
|
12
11
|
},
|
|
13
12
|
{
|
|
14
|
-
family:
|
|
13
|
+
family: FAMILY_IPV4,
|
|
15
14
|
port: 8080,
|
|
16
15
|
protocol: "tcp",
|
|
17
16
|
tls: false
|
|
18
17
|
},
|
|
19
18
|
{
|
|
20
19
|
description: "grpc",
|
|
21
|
-
family:
|
|
20
|
+
family: FAMILY_IPV4,
|
|
22
21
|
port: 50443,
|
|
23
22
|
protocol: "tcp",
|
|
24
23
|
tls: false
|
|
25
24
|
},
|
|
26
25
|
{
|
|
27
26
|
description: "metrics debug",
|
|
28
|
-
family:
|
|
27
|
+
family: FAMILY_IPV4,
|
|
29
28
|
port: 9090,
|
|
30
29
|
protocol: "tcp",
|
|
31
30
|
tls: false
|
|
@@ -34,6 +33,5 @@ export class headscale extends Service {
|
|
|
34
33
|
};
|
|
35
34
|
static {
|
|
36
35
|
addType(this);
|
|
37
|
-
addServiceType(this.service, this.name);
|
|
38
36
|
}
|
|
39
37
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
+
import { FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
|
|
2
3
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
|
-
import { boolean_attribute_writable_true
|
|
4
|
-
import {
|
|
4
|
+
import { boolean_attribute_writable_true } from "pacc";
|
|
5
|
+
import { Service, addType } from "pmcf";
|
|
5
6
|
import {
|
|
6
7
|
writeLines,
|
|
7
8
|
setionLinesFromPropertyIterator,
|
|
8
9
|
filterConfigurable
|
|
9
10
|
} from "../utils.mjs";
|
|
10
|
-
import { Service } from "../service.mjs";
|
|
11
11
|
|
|
12
12
|
export class influxdb extends Service {
|
|
13
13
|
static specializationOf = Service;
|
|
@@ -21,14 +21,14 @@ export class influxdb extends Service {
|
|
|
21
21
|
static service = {
|
|
22
22
|
endpoints: [
|
|
23
23
|
{
|
|
24
|
-
family:
|
|
24
|
+
family: FAMILY_IPV4,
|
|
25
25
|
port: 8086,
|
|
26
26
|
protocol: "tcp",
|
|
27
27
|
tls: false,
|
|
28
28
|
pathname: "/"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
family:
|
|
31
|
+
family: FAMILY_IPV6,
|
|
32
32
|
port: 8086,
|
|
33
33
|
protocol: "tcp",
|
|
34
34
|
tls: false,
|
|
@@ -39,7 +39,6 @@ export class influxdb extends Service {
|
|
|
39
39
|
|
|
40
40
|
static {
|
|
41
41
|
addType(this);
|
|
42
|
-
addServiceType(this.service, this.name);
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
async *preparePackages(dir) {
|
package/src/services/kea.mjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
|
-
import { reverseArpa, isLinkLocal } from "ip-utilties";
|
|
3
|
+
import { reverseArpa, isLinkLocal, FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
|
|
4
4
|
import {
|
|
5
5
|
string_attribute_writable,
|
|
6
6
|
number_attribute_writable,
|
|
7
|
-
boolean_attribute_writable_true
|
|
8
|
-
addType
|
|
7
|
+
boolean_attribute_writable_true
|
|
9
8
|
} from "pacc";
|
|
10
9
|
import {
|
|
11
|
-
|
|
10
|
+
addType,
|
|
12
11
|
Service,
|
|
13
12
|
sortDescendingByPriority,
|
|
14
13
|
serviceEndpoints,
|
|
@@ -54,7 +53,7 @@ export class kea extends Service {
|
|
|
54
53
|
"kea-ddns": {
|
|
55
54
|
endpoints: [
|
|
56
55
|
{
|
|
57
|
-
family:
|
|
56
|
+
family: FAMILY_IPV4,
|
|
58
57
|
kind: "loopback",
|
|
59
58
|
port: 53001,
|
|
60
59
|
protocol: "tcp",
|
|
@@ -65,7 +64,7 @@ export class kea extends Service {
|
|
|
65
64
|
/*"kea-control-agent": {
|
|
66
65
|
endpoints: [
|
|
67
66
|
{
|
|
68
|
-
family:
|
|
67
|
+
family: FAMILY_IPV4,
|
|
69
68
|
port: 53002,
|
|
70
69
|
pathname: "/",
|
|
71
70
|
protocol: "tcp",
|
|
@@ -76,7 +75,7 @@ export class kea extends Service {
|
|
|
76
75
|
"kea-ha-4": {
|
|
77
76
|
endpoints: [
|
|
78
77
|
{
|
|
79
|
-
family:
|
|
78
|
+
family: FAMILY_IPV4,
|
|
80
79
|
port: 53003,
|
|
81
80
|
pathname: "/",
|
|
82
81
|
protocol: "tcp",
|
|
@@ -87,7 +86,7 @@ export class kea extends Service {
|
|
|
87
86
|
"kea-ha-6": {
|
|
88
87
|
endpoints: [
|
|
89
88
|
{
|
|
90
|
-
family:
|
|
89
|
+
family: FAMILY_IPV6,
|
|
91
90
|
port: 53004,
|
|
92
91
|
pathname: "/",
|
|
93
92
|
protocol: "tcp",
|
|
@@ -124,7 +123,6 @@ export class kea extends Service {
|
|
|
124
123
|
|
|
125
124
|
static {
|
|
126
125
|
addType(this);
|
|
127
|
-
addServiceType(this.service, this.name);
|
|
128
126
|
}
|
|
129
127
|
|
|
130
128
|
async *preparePackages(dir) {
|
|
@@ -254,9 +252,7 @@ export class kea extends Service {
|
|
|
254
252
|
]
|
|
255
253
|
};
|
|
256
254
|
|
|
257
|
-
for (const [key] of Object.entries(
|
|
258
|
-
KeaService.attributes
|
|
259
|
-
).filter(
|
|
255
|
+
for (const [key] of Object.entries(KeaService.attributes).filter(
|
|
260
256
|
([key, attribute]) => attribute.configurable && this[key] !== undefined
|
|
261
257
|
)) {
|
|
262
258
|
cfg[key] = this[key];
|
|
@@ -291,7 +287,7 @@ export class kea extends Service {
|
|
|
291
287
|
name,
|
|
292
288
|
"dns-servers": dnsServerEndpoints
|
|
293
289
|
.filter(
|
|
294
|
-
endpoint => endpoint.family ===
|
|
290
|
+
endpoint => endpoint.family === FAMILY_IPV4 && endpoint.type === "dns"
|
|
295
291
|
)
|
|
296
292
|
.map(endpoint => {
|
|
297
293
|
return { "ip-address": endpoint.address };
|
|
@@ -399,7 +395,7 @@ export class kea extends Service {
|
|
|
399
395
|
subnet4: subnets
|
|
400
396
|
.filter(
|
|
401
397
|
s =>
|
|
402
|
-
s.family ===
|
|
398
|
+
s.family === FAMILY_IPV4 &&
|
|
403
399
|
// TODO keep out tailscale
|
|
404
400
|
s.cidr !== "100.64.0.2/32" &&
|
|
405
401
|
s.cidr !== "100.64.0.3/32"
|
|
@@ -426,7 +422,7 @@ export class kea extends Service {
|
|
|
426
422
|
subnet6: subnets
|
|
427
423
|
.filter(
|
|
428
424
|
s =>
|
|
429
|
-
s.family ===
|
|
425
|
+
s.family === FAMILY_IPV6 &&
|
|
430
426
|
!isLinkLocal(s.address) &&
|
|
431
427
|
// TODO keep out tailscale
|
|
432
428
|
s.cidr !== "fd7a:115c:a1e0::/64"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { port_attribute, string_attribute_writable
|
|
2
|
-
import {
|
|
3
|
-
import { Service } from "../service.mjs";
|
|
1
|
+
import { port_attribute, string_attribute_writable } from "pacc";
|
|
2
|
+
import { Service, addType } from "pmcf";
|
|
4
3
|
|
|
5
4
|
export class mosquitto extends Service {
|
|
6
5
|
static specializationOf = Service;
|
|
@@ -29,7 +28,6 @@ export class mosquitto extends Service {
|
|
|
29
28
|
|
|
30
29
|
static {
|
|
31
30
|
addType(this);
|
|
32
|
-
addServiceType(this.service, this.name);
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
get listener() {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { string_attribute_writable
|
|
2
|
-
import {
|
|
3
|
-
import { Service } from "../service.mjs";
|
|
1
|
+
import { string_attribute_writable } from "pacc";
|
|
2
|
+
import { Service, addType } from "pmcf";
|
|
4
3
|
|
|
5
4
|
export class openldap extends Service {
|
|
6
5
|
static specializationOf = Service;
|
|
@@ -16,7 +15,6 @@ export class openldap extends Service {
|
|
|
16
15
|
|
|
17
16
|
static {
|
|
18
17
|
addType(this);
|
|
19
|
-
addServiceType(this.service, this.name);
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
_base;
|
|
@@ -43,7 +41,9 @@ export class openldap extends Service {
|
|
|
43
41
|
|
|
44
42
|
const packageData = this.packageData;
|
|
45
43
|
|
|
46
|
-
console.log(
|
|
44
|
+
console.log(
|
|
45
|
+
[...this.walkDirections(["this", "extends"])].map(n => n.fullName)
|
|
46
|
+
);
|
|
47
47
|
|
|
48
48
|
packageData.sources = await Array.fromAsync(
|
|
49
49
|
this.templateContent(
|
package/src/services/postfix.mjs
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { addType } from "
|
|
2
|
-
import { addServiceType } from "pmcf";
|
|
3
|
-
import { Service } from "../service.mjs";
|
|
1
|
+
import { Service, addType } from "pmcf";
|
|
4
2
|
|
|
5
3
|
export class postfix extends Service {
|
|
6
4
|
static specializationOf = Service;
|
|
@@ -13,7 +11,5 @@ export class postfix extends Service {
|
|
|
13
11
|
|
|
14
12
|
static {
|
|
15
13
|
addType(this);
|
|
16
|
-
addServiceType(this.service, this.name);
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
|
|
1
2
|
import {
|
|
2
|
-
addType,
|
|
3
3
|
string_attribute_writable,
|
|
4
4
|
string_collection_attribute_writable,
|
|
5
5
|
boolean_attribute_writable,
|
|
6
6
|
integer_attribute_writable
|
|
7
7
|
} from "pacc";
|
|
8
|
-
import { Service,
|
|
8
|
+
import { Service, addType } from "pmcf";
|
|
9
9
|
import { filterConfigurable, sectionLines } from "../utils.mjs";
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -66,14 +66,14 @@ export class SystemdJournalRemoteService extends Service {
|
|
|
66
66
|
systemdService: "systemd-journal-remote.service",
|
|
67
67
|
endpoints: [
|
|
68
68
|
{
|
|
69
|
-
family:
|
|
69
|
+
family: FAMILY_IPV4,
|
|
70
70
|
port: 19532,
|
|
71
71
|
protocol: "tcp",
|
|
72
72
|
tls: false,
|
|
73
73
|
pathname: "/"
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
|
-
family:
|
|
76
|
+
family: FAMILY_IPV6,
|
|
77
77
|
port: 19532,
|
|
78
78
|
protocol: "tcp",
|
|
79
79
|
tls: false,
|
|
@@ -84,7 +84,6 @@ export class SystemdJournalRemoteService extends Service {
|
|
|
84
84
|
|
|
85
85
|
static {
|
|
86
86
|
addType(this);
|
|
87
|
-
addServiceType(this.service, this.name);
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
get type() {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
string_attribute_writable,
|
|
3
3
|
string_collection_attribute_writable,
|
|
4
|
-
boolean_attribute_writable
|
|
5
|
-
addType
|
|
4
|
+
boolean_attribute_writable
|
|
6
5
|
} from "pacc";
|
|
7
|
-
import { Service,
|
|
6
|
+
import { Service, addType } from "pmcf";
|
|
8
7
|
import { filterConfigurable, sectionLines } from "../utils.mjs";
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -48,7 +47,6 @@ export class SystemdJournalUploadService extends Service {
|
|
|
48
47
|
};
|
|
49
48
|
static {
|
|
50
49
|
addType(this);
|
|
51
|
-
addServiceType(this.service, this.name);
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
get type() {
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
string_attribute_writable,
|
|
4
|
-
duration_attribute_writable
|
|
5
|
-
} from "pacc";
|
|
6
|
-
import { Service, addServiceType } from "pmcf";
|
|
1
|
+
import { string_attribute_writable, duration_attribute_writable } from "pacc";
|
|
2
|
+
import { Service, addType } from "pmcf";
|
|
7
3
|
import { filterConfigurable, sectionLines } from "../utils.mjs";
|
|
8
4
|
|
|
9
5
|
export class SystemdJournaldService extends Service {
|
|
@@ -108,7 +104,6 @@ export class SystemdJournaldService extends Service {
|
|
|
108
104
|
};
|
|
109
105
|
static {
|
|
110
106
|
addType(this);
|
|
111
|
-
addServiceType(this.service, this.name);
|
|
112
107
|
}
|
|
113
108
|
|
|
114
109
|
get type() {
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
+
import { FAMILY_IPV4 } from "ip-utilties";
|
|
1
2
|
import {
|
|
2
|
-
addType,
|
|
3
3
|
string_collection_attribute_writable,
|
|
4
4
|
duration_attribute_writable,
|
|
5
5
|
string_attribute_writable,
|
|
6
6
|
boolean_attribute_writable,
|
|
7
7
|
yesno_attribute_writable
|
|
8
8
|
} from "pacc";
|
|
9
|
-
import {
|
|
10
|
-
ExtraSourceService,
|
|
11
|
-
serviceEndpoints,
|
|
12
|
-
addServiceType,
|
|
13
|
-
Service
|
|
14
|
-
} from "pmcf";
|
|
9
|
+
import { ExtraSourceService, serviceEndpoints, addType, Service } from "pmcf";
|
|
15
10
|
import {
|
|
16
11
|
filterConfigurable,
|
|
17
12
|
yesno,
|
|
@@ -73,7 +68,6 @@ export class SystemdResolvedService extends ExtraSourceService {
|
|
|
73
68
|
|
|
74
69
|
static {
|
|
75
70
|
addType(this);
|
|
76
|
-
addServiceType(this.service, this.name);
|
|
77
71
|
}
|
|
78
72
|
|
|
79
73
|
systemdConfigs(name) {
|
|
@@ -81,7 +75,7 @@ export class SystemdResolvedService extends ExtraSourceService {
|
|
|
81
75
|
return {
|
|
82
76
|
services: `services[types[dns] && priority>=${lower} && priority<=${upper}]`,
|
|
83
77
|
endpoints: e =>
|
|
84
|
-
e.family ==
|
|
78
|
+
e.family == FAMILY_IPV4 &&
|
|
85
79
|
e.networkInterface &&
|
|
86
80
|
e.networkInterface.kind !== "loopback",
|
|
87
81
|
//e.family !== "dns",
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
string_attribute_writable,
|
|
4
|
-
duration_attribute_writable
|
|
5
|
-
} from "pacc";
|
|
6
|
-
import {
|
|
7
|
-
ExtraSourceService,
|
|
8
|
-
Service,
|
|
9
|
-
serviceEndpoints,
|
|
10
|
-
addServiceType
|
|
11
|
-
} from "pmcf";
|
|
1
|
+
import { string_attribute_writable, duration_attribute_writable } from "pacc";
|
|
2
|
+
import { ExtraSourceService, Service, serviceEndpoints, addType } from "pmcf";
|
|
12
3
|
import { filterConfigurable, sectionLines } from "../utils.mjs";
|
|
13
4
|
|
|
14
5
|
export class SystemdTimesyncdService extends ExtraSourceService {
|
|
@@ -30,7 +21,6 @@ export class SystemdTimesyncdService extends ExtraSourceService {
|
|
|
30
21
|
|
|
31
22
|
static {
|
|
32
23
|
addType(this);
|
|
33
|
-
addServiceType(this.service, this.name);
|
|
34
24
|
}
|
|
35
25
|
|
|
36
26
|
systemdConfigs(name) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Service } from "
|
|
1
|
+
import { FAMILY_IPV4 } from "ip-utilties";
|
|
2
|
+
import { Service, addType } from "pmcf";
|
|
3
3
|
|
|
4
4
|
export class tailscale extends Service {
|
|
5
5
|
static specializationOf = Service;
|
|
6
6
|
static service = {
|
|
7
7
|
endpoints: [
|
|
8
8
|
{
|
|
9
|
-
family:
|
|
9
|
+
family: FAMILY_IPV4,
|
|
10
10
|
port: 41641,
|
|
11
11
|
protocol: "tcp",
|
|
12
12
|
tls: false
|
package/src/subnet.mjs
CHANGED