pmcf 2.35.3 → 2.35.5
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
CHANGED
package/src/service.mjs
CHANGED
|
@@ -316,7 +316,11 @@ export function serviceEndpoints(sources, options = {}) {
|
|
|
316
316
|
.map(service => service.endpoints(options.endpoints))
|
|
317
317
|
.flat();
|
|
318
318
|
|
|
319
|
-
const res = new Set(options.select ? all.map(options.select) : all);
|
|
319
|
+
const res = [...new Set(options.select ? all.map(options.select) : all)];
|
|
320
320
|
|
|
321
|
-
|
|
321
|
+
if(options.limit < res.length) {
|
|
322
|
+
res.length = options.limit;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return options.join ? res.join(options.join) : res;
|
|
322
326
|
}
|
package/src/services/dns.mjs
CHANGED
|
@@ -211,10 +211,11 @@ export class DNSService extends ExtraSourceService {
|
|
|
211
211
|
|
|
212
212
|
const forwarders = serviceEndpoints(this.source, {
|
|
213
213
|
services: { type: "dns", priority: ">=20" },
|
|
214
|
-
select: e => e.address
|
|
214
|
+
select: e => e.address,
|
|
215
|
+
limit: 5
|
|
215
216
|
});
|
|
216
217
|
|
|
217
|
-
if (forwarders.
|
|
218
|
+
if (forwarders.length) {
|
|
218
219
|
await writeLines(
|
|
219
220
|
join(p1, "etc/named/options"),
|
|
220
221
|
`forwarders.conf`,
|
|
@@ -234,7 +235,7 @@ export class DNSService extends ExtraSourceService {
|
|
|
234
235
|
if (acls.length) {
|
|
235
236
|
await writeLines(join(p1, "etc/named"), `0-acl-${name}.conf`, acls);
|
|
236
237
|
}
|
|
237
|
-
if (forwarders.
|
|
238
|
+
if (forwarders.length || acls.length) {
|
|
238
239
|
yield packageData;
|
|
239
240
|
}
|
|
240
241
|
|
|
@@ -42,7 +42,8 @@ export class SystemdResolvedService extends ExtraSourceService {
|
|
|
42
42
|
services: { type: "dns", priority },
|
|
43
43
|
endpoints: e => e.networkInterface.kind !== "loopback",
|
|
44
44
|
select: endpoint => endpoint.address,
|
|
45
|
-
join: " "
|
|
45
|
+
join: " ",
|
|
46
|
+
limit: 5
|
|
46
47
|
};
|
|
47
48
|
};
|
|
48
49
|
|
package/types/service.d.mts
CHANGED
|
@@ -247,8 +247,8 @@ export class SystemdResolvedService extends ExtraSourceService {
|
|
|
247
247
|
systemdConfig(name: any): {
|
|
248
248
|
name: string;
|
|
249
249
|
content: (string | {
|
|
250
|
-
DNS: string |
|
|
251
|
-
FallbackDNS: string |
|
|
250
|
+
DNS: string | any[];
|
|
251
|
+
FallbackDNS: string | any[];
|
|
252
252
|
Domains: string;
|
|
253
253
|
DNSSEC: string;
|
|
254
254
|
MulticastDNS: string;
|