pmcf 1.80.2 → 1.81.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 +1 -1
- package/src/dns.mjs +0 -11
- package/src/owner.mjs +10 -1
- package/src/service.mjs +23 -17
- package/types/owner.d.mts +1 -0
package/package.json
CHANGED
package/src/dns.mjs
CHANGED
|
@@ -197,17 +197,6 @@ async function generateZoneDefs(dns, targetDir) {
|
|
|
197
197
|
|
|
198
198
|
let maxKeyLength;
|
|
199
199
|
|
|
200
|
-
if (isLocalDomain) {
|
|
201
|
-
for (const mail of dns.owner.findServices({
|
|
202
|
-
type: "smtp",
|
|
203
|
-
priority: "<10"
|
|
204
|
-
})) {
|
|
205
|
-
records.add(
|
|
206
|
-
DNSRecord("@", "MX", mail.priority, dnsFullName(mail.domainName))
|
|
207
|
-
);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
200
|
console.log(`${nameService} ${domain}`, nameService.ipAddressOrDomainName);
|
|
212
201
|
//console.log(dns.owner.fullName, domain, nameService.domainName, rname);
|
|
213
202
|
const reverseZones = new Map();
|
package/src/owner.mjs
CHANGED
|
@@ -382,7 +382,6 @@ export class Owner extends Base {
|
|
|
382
382
|
return this.#domain || this.owner?.domain;
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
|
|
386
385
|
get domains() {
|
|
387
386
|
let domains = new Set();
|
|
388
387
|
|
|
@@ -408,4 +407,14 @@ export class Owner extends Base {
|
|
|
408
407
|
return domains;
|
|
409
408
|
}
|
|
410
409
|
*/
|
|
410
|
+
|
|
411
|
+
get domainNames() {
|
|
412
|
+
let names = new Set();
|
|
413
|
+
|
|
414
|
+
for (const host of this.hosts()) {
|
|
415
|
+
names = names.union(new Set(host.domainNames));
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
return names;
|
|
419
|
+
}
|
|
411
420
|
}
|
package/src/service.mjs
CHANGED
|
@@ -21,8 +21,8 @@ const ServiceTypes = {
|
|
|
21
21
|
dnsRecord: { type: "HTTPS", parameters: { alpn: "h2" } }
|
|
22
22
|
},
|
|
23
23
|
http3: {
|
|
24
|
-
protocol: "tcp",
|
|
25
24
|
type: "https",
|
|
25
|
+
protocol: "tcp",
|
|
26
26
|
port: 443,
|
|
27
27
|
tls: true,
|
|
28
28
|
dnsRecord: {
|
|
@@ -31,7 +31,7 @@ const ServiceTypes = {
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
rtsp: { protocol: "tcp", port: 554, tls: false },
|
|
34
|
-
smtp: { protocol: "tcp", port: 25, tls: false },
|
|
34
|
+
smtp: { protocol: "tcp", port: 25, tls: false, dnsRecord: { type: "MX" } },
|
|
35
35
|
ssh: { protocol: "tcp", port: 22, tls: false },
|
|
36
36
|
imap: { protocol: "tcp", port: 143, tls: false },
|
|
37
37
|
imaps: { protocol: "tcp", port: 993, tls: true },
|
|
@@ -221,25 +221,31 @@ export class Service extends Base {
|
|
|
221
221
|
if (dnsRecord) {
|
|
222
222
|
let parameters = dnsRecord.parameters;
|
|
223
223
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
if (parameters) {
|
|
225
|
+
for (const service of this.findServices()) {
|
|
226
|
+
if (service !== this) {
|
|
227
|
+
const r = ServiceTypes[service.type]?.dnsRecord;
|
|
227
228
|
|
|
228
|
-
|
|
229
|
-
|
|
229
|
+
if (r?.type === dnsRecord.type) {
|
|
230
|
+
parameters = dnsMergeParameters(parameters, r.parameters);
|
|
231
|
+
}
|
|
230
232
|
}
|
|
231
233
|
}
|
|
232
|
-
}
|
|
233
234
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
235
|
+
records.push(
|
|
236
|
+
DNSRecord(
|
|
237
|
+
dnsFullName(domainName),
|
|
238
|
+
dnsRecord.type,
|
|
239
|
+
this.priority,
|
|
240
|
+
".",
|
|
241
|
+
dnsFormatParameters(parameters)
|
|
242
|
+
)
|
|
243
|
+
);
|
|
244
|
+
} else {
|
|
245
|
+
records.push(
|
|
246
|
+
DNSRecord("@", dnsRecord.type, this.priority, dnsFullName(domainName))
|
|
247
|
+
);
|
|
248
|
+
}
|
|
243
249
|
}
|
|
244
250
|
|
|
245
251
|
return records;
|