pmcf 1.87.1 → 1.87.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/dns.mjs +25 -20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "1.87.1",
3
+ "version": "1.87.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/dns.mjs CHANGED
@@ -151,9 +151,15 @@ export class DNSService extends Base {
151
151
  ...serviceAddresses(this.source, DNS_SERVICE_FILTER).map(a => ` ${a};`),
152
152
  "};"
153
153
  ];
154
- await writeLines(join(p1, "etc/named/options"), `${name}.conf`, options);
154
+ if (options.length > 2) {
155
+ await writeLines(
156
+ join(p1, "etc/named/options"),
157
+ `forwarders.conf`,
158
+ options
159
+ );
160
+ }
155
161
 
156
- const category = [
162
+ const acls = [
157
163
  "acl trusted {",
158
164
  ...Array.from(subnets(this.trusted)).map(subnet => ` ${subnet.name};`),
159
165
  "};",
@@ -166,13 +172,10 @@ export class DNSService extends Base {
166
172
  "};"
167
173
  ];
168
174
 
169
- await writeLines(
170
- join(p1, "etc/named"),
171
- `0-${name}.conf`,
172
- category
173
- );
174
-
175
- if (options.length > 2 || category.length > 2) {
175
+ if (options.length > 8) {
176
+ await writeLines(join(p1, "etc/named"), `0-acl-${name}.conf`, acls);
177
+ }
178
+ if (options.length > 2 || acls.length > 8) {
176
179
  yield packageData;
177
180
  }
178
181
 
@@ -187,17 +190,19 @@ export class DNSService extends Base {
187
190
  };
188
191
 
189
192
  packageData.sources = [
190
- new FileContentProvider(p2 + "/", {
191
- mode: 0o644,
192
- owner: "named",
193
- group: "named"
194
- }, {
195
- mode: 0o755,
196
- owner: "named",
197
- group: "named"
198
- })[
199
- Symbol.asyncIterator
200
- ]()
193
+ new FileContentProvider(
194
+ p2 + "/",
195
+ {
196
+ mode: 0o644,
197
+ owner: "named",
198
+ group: "named"
199
+ },
200
+ {
201
+ mode: 0o755,
202
+ owner: "named",
203
+ group: "named"
204
+ }
205
+ )[Symbol.asyncIterator]()
201
206
  ];
202
207
 
203
208
  await generateZoneDefs(this, packageData);