pmcf 6.32.6 → 6.32.8
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-info +2 -2
- package/package.json +1 -1
- package/src/services/bind.mjs +19 -19
package/bin/pmcf-info
CHANGED
|
@@ -12,10 +12,10 @@ const { root, args, options } = await prepare({
|
|
|
12
12
|
for (const expression of args) {
|
|
13
13
|
const result = root.expression(expression);
|
|
14
14
|
|
|
15
|
-
show(result, 0, { short: false, maxDepth: options.maxDepth });
|
|
15
|
+
show(result, 0, { short: false, maxDepth: options.maxDepth ?? 5 });
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function show(value, indent = 0, options
|
|
18
|
+
function show(value, indent = 0, options) {
|
|
19
19
|
if (indent >= options.maxDepth) {
|
|
20
20
|
console.log("...");
|
|
21
21
|
return;
|
package/package.json
CHANGED
package/src/services/bind.mjs
CHANGED
|
@@ -160,10 +160,10 @@ class bind_zone_config extends Base {
|
|
|
160
160
|
|
|
161
161
|
async write(outputControl) {
|
|
162
162
|
const dir = outputControl.dir;
|
|
163
|
-
const
|
|
163
|
+
const view = this.owner;
|
|
164
164
|
|
|
165
165
|
console.log(
|
|
166
|
-
`config: ${
|
|
166
|
+
`config: ${view.name}/${this.name}${this.foreign ? " foreign" : ""}`
|
|
167
167
|
);
|
|
168
168
|
|
|
169
169
|
const content = [];
|
|
@@ -173,8 +173,8 @@ class bind_zone_config extends Base {
|
|
|
173
173
|
|
|
174
174
|
content.push(`zone \"${zone.id}\" {`);
|
|
175
175
|
|
|
176
|
-
if (
|
|
177
|
-
content.push(` in-view ${
|
|
176
|
+
if (view.sharedWith) {
|
|
177
|
+
content.push(` in-view ${view.sharedWith.name};`);
|
|
178
178
|
} else {
|
|
179
179
|
content.push(` type ${this.type};`);
|
|
180
180
|
content.push(` file \"${zone.file}\";`);
|
|
@@ -183,10 +183,10 @@ class bind_zone_config extends Base {
|
|
|
183
183
|
case "primary":
|
|
184
184
|
content.push(
|
|
185
185
|
addressesStatement(
|
|
186
|
-
"allow-update",
|
|
187
|
-
|
|
186
|
+
" allow-update",
|
|
187
|
+
view.allowUpdate,
|
|
188
188
|
"none;",
|
|
189
|
-
"
|
|
189
|
+
" "
|
|
190
190
|
)
|
|
191
191
|
);
|
|
192
192
|
break;
|
|
@@ -198,7 +198,7 @@ class bind_zone_config extends Base {
|
|
|
198
198
|
);
|
|
199
199
|
break;
|
|
200
200
|
}
|
|
201
|
-
content.push(` notify ${yesno(
|
|
201
|
+
content.push(` notify ${yesno(view.notify)};`);
|
|
202
202
|
}
|
|
203
203
|
content.push(`};`, "");
|
|
204
204
|
|
|
@@ -214,11 +214,11 @@ class bind_zone_config extends Base {
|
|
|
214
214
|
zone.textFile,
|
|
215
215
|
[...zone.records]
|
|
216
216
|
.sort(sortZoneRecords)
|
|
217
|
-
.map(r => r.toString(maxKeyLength,
|
|
217
|
+
.map(r => r.toString(maxKeyLength, view.recordTTL))
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
await writeLines(join(dir, `etc/named/${
|
|
221
|
+
await writeLines(join(dir, `etc/named/views/${view.name}`), this.name, content);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
|
|
@@ -314,7 +314,7 @@ const acl_attribute = {
|
|
|
314
314
|
default: "'any'"
|
|
315
315
|
};
|
|
316
316
|
|
|
317
|
-
class
|
|
317
|
+
class bind_view extends bind_object {
|
|
318
318
|
static priority = 1;
|
|
319
319
|
static attributes = {
|
|
320
320
|
matchClients: {
|
|
@@ -364,7 +364,7 @@ class bind_group extends bind_object {
|
|
|
364
364
|
sharedWith: {
|
|
365
365
|
...default_attribute_writable,
|
|
366
366
|
name: "sharedWith",
|
|
367
|
-
type:
|
|
367
|
+
type: bind_view
|
|
368
368
|
},
|
|
369
369
|
notify: { ...boolean_attribute_writable_false, name: "notify" },
|
|
370
370
|
hasCatalog: { ...boolean_attribute_writable_false, name: "hasCatalog" },
|
|
@@ -408,7 +408,7 @@ class bind_group extends bind_object {
|
|
|
408
408
|
recordTTL = "1W";
|
|
409
409
|
|
|
410
410
|
/**
|
|
411
|
-
* Type of the
|
|
411
|
+
* Type of the view.
|
|
412
412
|
* @return {string} view | unknown
|
|
413
413
|
*/
|
|
414
414
|
get type() {
|
|
@@ -718,10 +718,10 @@ export class bind extends CoreService {
|
|
|
718
718
|
type: bind_acl,
|
|
719
719
|
backpointer: owner_attribute
|
|
720
720
|
},
|
|
721
|
-
|
|
721
|
+
views: {
|
|
722
722
|
...default_collection_attribute_writable,
|
|
723
|
-
name: "
|
|
724
|
-
type:
|
|
723
|
+
name: "views",
|
|
724
|
+
type: bind_view,
|
|
725
725
|
backpointer: owner_attribute
|
|
726
726
|
}
|
|
727
727
|
};
|
|
@@ -771,7 +771,7 @@ export class bind extends CoreService {
|
|
|
771
771
|
|
|
772
772
|
keys = new Map();
|
|
773
773
|
acls = new Map();
|
|
774
|
-
|
|
774
|
+
views = new Map();
|
|
775
775
|
|
|
776
776
|
set serverType(value) {
|
|
777
777
|
this._serverType = value;
|
|
@@ -825,8 +825,8 @@ export class bind extends CoreService {
|
|
|
825
825
|
hasContent = true;
|
|
826
826
|
}
|
|
827
827
|
|
|
828
|
-
for (const
|
|
829
|
-
const present = await
|
|
828
|
+
for (const view of this.views.values()) {
|
|
829
|
+
const present = await view.packageContent(outputControl);
|
|
830
830
|
hasContent ||= present;
|
|
831
831
|
}
|
|
832
832
|
|