pmcf 6.16.4 → 6.17.1
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 +2 -2
- package/src/services/bind.mjs +57 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.17.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"aggregated-map": "^1.0.8",
|
|
54
54
|
"content-entry-transform": "^1.7.0",
|
|
55
|
-
"ip-utilties": "^3.
|
|
55
|
+
"ip-utilties": "^3.9.0",
|
|
56
56
|
"npm-pkgbuild": "^20.8.6",
|
|
57
57
|
"pacc": "^10.4.1",
|
|
58
58
|
"package-directory": "^8.2.0",
|
package/src/services/bind.mjs
CHANGED
|
@@ -43,7 +43,7 @@ import { owner_attribute } from "../common-attributes.mjs";
|
|
|
43
43
|
|
|
44
44
|
const bindNetworkAddressTypes = networkAddressType + "|bind_group";
|
|
45
45
|
|
|
46
|
-
class
|
|
46
|
+
class bind_zone extends Base {
|
|
47
47
|
static priority = 1;
|
|
48
48
|
static key = "id";
|
|
49
49
|
static attributes = {
|
|
@@ -56,8 +56,6 @@ class zone extends Base {
|
|
|
56
56
|
addType(this);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
records = new Set();
|
|
60
|
-
|
|
61
59
|
get name() {
|
|
62
60
|
return this.id;
|
|
63
61
|
}
|
|
@@ -77,6 +75,39 @@ class zone extends Base {
|
|
|
77
75
|
get file() {
|
|
78
76
|
return `${this.directory}/${this.domain}.zone`;
|
|
79
77
|
}
|
|
78
|
+
|
|
79
|
+
constructor(owner, id, config, source) {
|
|
80
|
+
super();
|
|
81
|
+
this.id = id;
|
|
82
|
+
this.config = config;
|
|
83
|
+
this.source = source;
|
|
84
|
+
this.records = new Set(owner.defaultRecords);
|
|
85
|
+
|
|
86
|
+
config.zones.push(this);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
class bind_zone_config extends Base {
|
|
91
|
+
static priority = 1;
|
|
92
|
+
static attributes = {
|
|
93
|
+
zones: { ...default_collection_attribute, type: bind_zone, name: "zones" }
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
static {
|
|
97
|
+
addType(this);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
zones = [];
|
|
101
|
+
|
|
102
|
+
get type() {
|
|
103
|
+
return this.owner.service.serverType;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
constructor(owner, name) {
|
|
107
|
+
super();
|
|
108
|
+
this.owner = owner;
|
|
109
|
+
this.name = name;
|
|
110
|
+
}
|
|
80
111
|
}
|
|
81
112
|
|
|
82
113
|
class bind_group extends Base {
|
|
@@ -104,12 +135,22 @@ class bind_group extends Base {
|
|
|
104
135
|
type: networkAddressType + "|owner",
|
|
105
136
|
name: "entries"
|
|
106
137
|
},
|
|
138
|
+
domains: {
|
|
139
|
+
...string_set_attribute,
|
|
140
|
+
name: "domains"
|
|
141
|
+
},
|
|
107
142
|
zones: {
|
|
108
143
|
...default_collection_attribute,
|
|
109
|
-
type:
|
|
144
|
+
type: bind_zone,
|
|
110
145
|
backpointer: owner_attribute,
|
|
111
146
|
name: "zones"
|
|
112
147
|
},
|
|
148
|
+
zoneConfigs: {
|
|
149
|
+
...default_collection_attribute,
|
|
150
|
+
type: bind_zone_config,
|
|
151
|
+
backpointer: owner_attribute,
|
|
152
|
+
name: "zoneConfigs"
|
|
153
|
+
},
|
|
113
154
|
sharedWith: {
|
|
114
155
|
...default_attribute_writable,
|
|
115
156
|
name: "sharedWith",
|
|
@@ -163,6 +204,7 @@ class bind_group extends Base {
|
|
|
163
204
|
access = [];
|
|
164
205
|
allowedUpdates = [];
|
|
165
206
|
entries = [];
|
|
207
|
+
zoneConfigs = [];
|
|
166
208
|
exclude = new Set();
|
|
167
209
|
excludeInterfaceKinds = new Set();
|
|
168
210
|
notify = true;
|
|
@@ -217,29 +259,27 @@ class bind_group extends Base {
|
|
|
217
259
|
];
|
|
218
260
|
}
|
|
219
261
|
|
|
262
|
+
get domains() {
|
|
263
|
+
return this.entries.reduce(
|
|
264
|
+
(all, net) => all.union(net.localDomains),
|
|
265
|
+
new Set()
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
220
269
|
get zones() {
|
|
221
270
|
const zs = new Map();
|
|
222
271
|
|
|
272
|
+
|
|
223
273
|
for (const source of this.entries) {
|
|
224
274
|
for (const domain of source.localDomains) {
|
|
225
|
-
const config = {
|
|
226
|
-
name: `${domain}.zone.conf`,
|
|
227
|
-
type: this.service.serverType,
|
|
228
|
-
zones: []
|
|
229
|
-
};
|
|
275
|
+
const config = new bind_zone_config(this, `${domain}.zone.conf`);
|
|
230
276
|
|
|
231
|
-
|
|
277
|
+
this.zoneConfigs.push(config);
|
|
232
278
|
|
|
233
|
-
z
|
|
234
|
-
z.source = source;
|
|
235
|
-
z.owner = this;
|
|
236
|
-
z.config = config;
|
|
237
|
-
z.records = new Set(this.defaultRecords);
|
|
279
|
+
const z = new bind_zone(this, domain, config, source);
|
|
238
280
|
|
|
239
281
|
zs.set(z.id, z);
|
|
240
282
|
|
|
241
|
-
config.zones.push(z);
|
|
242
|
-
|
|
243
283
|
for (const {
|
|
244
284
|
address,
|
|
245
285
|
subnet,
|