pmcf 1.68.0 → 1.69.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 +1 -1
- package/src/dns.mjs +16 -12
- package/src/subnet.mjs +14 -0
- package/types/cluster.d.mts +10 -0
- package/types/dns.d.mts +7 -0
- package/types/location.d.mts +10 -0
- package/types/network.d.mts +5 -0
- package/types/owner.d.mts +5 -0
- package/types/root.d.mts +10 -0
- package/types/subnet.d.mts +1 -0
package/package.json
CHANGED
package/src/dns.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import { Base } from "./base.mjs";
|
|
11
11
|
import { addType } from "./types.mjs";
|
|
12
12
|
import { sortByPriority } from "./service.mjs";
|
|
13
|
+
import { subnets } from "./subnet.mjs";
|
|
13
14
|
|
|
14
15
|
const DNSServiceTypeDefinition = {
|
|
15
16
|
name: "dns",
|
|
@@ -30,6 +31,7 @@ const DNSServiceTypeDefinition = {
|
|
|
30
31
|
expire: { type: "string", collection: false, writeable: true },
|
|
31
32
|
minimum: { type: "string", collection: false, writeable: true },
|
|
32
33
|
forwardsTo: { type: "network", collection: true, writeable: true },
|
|
34
|
+
trusts: { type: "network", collection: true, writeable: true },
|
|
33
35
|
allowedUpdates: { type: "string", collection: true, writeable: true }
|
|
34
36
|
}
|
|
35
37
|
};
|
|
@@ -44,6 +46,7 @@ export class DNSService extends Base {
|
|
|
44
46
|
hasLinkLocalAdresses = true;
|
|
45
47
|
notify = true;
|
|
46
48
|
#forwardsTo = [];
|
|
49
|
+
#trusts = [];
|
|
47
50
|
|
|
48
51
|
refresh = 36000;
|
|
49
52
|
retry = 72000;
|
|
@@ -72,6 +75,14 @@ export class DNSService extends Base {
|
|
|
72
75
|
return [this.refresh, this.retry, this.expire, this.minimum];
|
|
73
76
|
}
|
|
74
77
|
|
|
78
|
+
set trusts(value) {
|
|
79
|
+
this.#trusts.push(value);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
get trusts() {
|
|
83
|
+
return this.#trusts;
|
|
84
|
+
}
|
|
85
|
+
|
|
75
86
|
set forwardsTo(value) {
|
|
76
87
|
this.#forwardsTo.push(value);
|
|
77
88
|
}
|
|
@@ -146,18 +157,11 @@ export class DNSService extends Base {
|
|
|
146
157
|
];
|
|
147
158
|
await writeLines(join(p1, "etc/named.d/options"), `${name}.conf`, options);
|
|
148
159
|
|
|
149
|
-
const category = [
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const network = this.owner.named("LOCAL");
|
|
155
|
-
for (const subnet of network.subnets()) {
|
|
156
|
-
category.push(`${subnet.name};`);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
category.push("}");
|
|
160
|
-
*/
|
|
160
|
+
const category = [
|
|
161
|
+
"acl trusted {",
|
|
162
|
+
...Array.from(subnets(this.trusts)).map(subnet => ` ${subnet.name};`),
|
|
163
|
+
"};"
|
|
164
|
+
];
|
|
161
165
|
|
|
162
166
|
await writeLines(
|
|
163
167
|
join(p1, "etc/named.d/categories"),
|
package/src/subnet.mjs
CHANGED
|
@@ -75,3 +75,17 @@ export class Subnet extends Base {
|
|
|
75
75
|
return false;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
export function subnets(sources) {
|
|
81
|
+
const all = new Set();
|
|
82
|
+
|
|
83
|
+
for (const owner of sources) {
|
|
84
|
+
for (const subnet of owner.subnets()) {
|
|
85
|
+
all.add(subnet);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return all;
|
|
90
|
+
}
|
|
91
|
+
|
package/types/cluster.d.mts
CHANGED
|
@@ -142,6 +142,11 @@ export class Cluster extends Host {
|
|
|
142
142
|
collection: boolean;
|
|
143
143
|
writeable: boolean;
|
|
144
144
|
};
|
|
145
|
+
trusts: {
|
|
146
|
+
type: string;
|
|
147
|
+
collection: boolean;
|
|
148
|
+
writeable: boolean;
|
|
149
|
+
};
|
|
145
150
|
allowedUpdates: {
|
|
146
151
|
type: string;
|
|
147
152
|
collection: boolean;
|
|
@@ -326,6 +331,11 @@ export class Cluster extends Host {
|
|
|
326
331
|
collection: boolean;
|
|
327
332
|
writeable: boolean;
|
|
328
333
|
};
|
|
334
|
+
trusts: {
|
|
335
|
+
type: string;
|
|
336
|
+
collection: boolean;
|
|
337
|
+
writeable: boolean;
|
|
338
|
+
};
|
|
329
339
|
allowedUpdates: {
|
|
330
340
|
type: string;
|
|
331
341
|
collection: boolean;
|
package/types/dns.d.mts
CHANGED
|
@@ -56,6 +56,11 @@ export class DNSService extends Base {
|
|
|
56
56
|
collection: boolean;
|
|
57
57
|
writeable: boolean;
|
|
58
58
|
};
|
|
59
|
+
trusts: {
|
|
60
|
+
type: string;
|
|
61
|
+
collection: boolean;
|
|
62
|
+
writeable: boolean;
|
|
63
|
+
};
|
|
59
64
|
allowedUpdates: {
|
|
60
65
|
type: string;
|
|
61
66
|
collection: boolean;
|
|
@@ -74,6 +79,8 @@ export class DNSService extends Base {
|
|
|
74
79
|
expire: number;
|
|
75
80
|
minimum: number;
|
|
76
81
|
get soaUpdates(): number[];
|
|
82
|
+
set trusts(value: any[]);
|
|
83
|
+
get trusts(): any[];
|
|
77
84
|
set forwardsTo(value: any[]);
|
|
78
85
|
get forwardsTo(): any[];
|
|
79
86
|
get forwardsToAdresses(): any[];
|
package/types/location.d.mts
CHANGED
|
@@ -142,6 +142,11 @@ export class Location extends Owner {
|
|
|
142
142
|
collection: boolean;
|
|
143
143
|
writeable: boolean;
|
|
144
144
|
};
|
|
145
|
+
trusts: {
|
|
146
|
+
type: string;
|
|
147
|
+
collection: boolean;
|
|
148
|
+
writeable: boolean;
|
|
149
|
+
};
|
|
145
150
|
allowedUpdates: {
|
|
146
151
|
type: string;
|
|
147
152
|
collection: boolean;
|
|
@@ -326,6 +331,11 @@ export class Location extends Owner {
|
|
|
326
331
|
collection: boolean;
|
|
327
332
|
writeable: boolean;
|
|
328
333
|
};
|
|
334
|
+
trusts: {
|
|
335
|
+
type: string;
|
|
336
|
+
collection: boolean;
|
|
337
|
+
writeable: boolean;
|
|
338
|
+
};
|
|
329
339
|
allowedUpdates: {
|
|
330
340
|
type: string;
|
|
331
341
|
collection: boolean;
|
package/types/network.d.mts
CHANGED
|
@@ -144,6 +144,11 @@ export class Network extends Owner {
|
|
|
144
144
|
collection: boolean;
|
|
145
145
|
writeable: boolean;
|
|
146
146
|
};
|
|
147
|
+
trusts: {
|
|
148
|
+
type: string;
|
|
149
|
+
collection: boolean;
|
|
150
|
+
writeable: boolean;
|
|
151
|
+
};
|
|
147
152
|
allowedUpdates: {
|
|
148
153
|
type: string;
|
|
149
154
|
collection: boolean;
|
package/types/owner.d.mts
CHANGED
package/types/root.d.mts
CHANGED
|
@@ -146,6 +146,11 @@ export class Root extends Location {
|
|
|
146
146
|
collection: boolean;
|
|
147
147
|
writeable: boolean;
|
|
148
148
|
};
|
|
149
|
+
trusts: {
|
|
150
|
+
type: string;
|
|
151
|
+
collection: boolean;
|
|
152
|
+
writeable: boolean;
|
|
153
|
+
};
|
|
149
154
|
allowedUpdates: {
|
|
150
155
|
type: string;
|
|
151
156
|
collection: boolean;
|
|
@@ -330,6 +335,11 @@ export class Root extends Location {
|
|
|
330
335
|
collection: boolean;
|
|
331
336
|
writeable: boolean;
|
|
332
337
|
};
|
|
338
|
+
trusts: {
|
|
339
|
+
type: string;
|
|
340
|
+
collection: boolean;
|
|
341
|
+
writeable: boolean;
|
|
342
|
+
};
|
|
333
343
|
allowedUpdates: {
|
|
334
344
|
type: string;
|
|
335
345
|
collection: boolean;
|
package/types/subnet.d.mts
CHANGED