pmcf 1.101.2 → 1.102.0
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/services/dns.mjs +4 -3
- package/src/utils.mjs +5 -0
- package/types/utils.d.mts +1 -0
package/package.json
CHANGED
package/src/services/dns.mjs
CHANGED
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
writeLines,
|
|
6
6
|
isIPv6Address,
|
|
7
7
|
normalizeIPAddress,
|
|
8
|
-
isLinkLocal
|
|
8
|
+
isLinkLocal,
|
|
9
|
+
isLocalhost
|
|
9
10
|
} from "../utils.mjs";
|
|
10
11
|
import { DNSRecord, dnsFullName } from "../dns-utils.mjs";
|
|
11
12
|
import { addType } from "../types.mjs";
|
|
@@ -157,7 +158,7 @@ export class DNSService extends Service {
|
|
|
157
158
|
DNS: serviceAddresses(this, {
|
|
158
159
|
...DNS_SERVICE_FILTER,
|
|
159
160
|
priority: "<10"
|
|
160
|
-
}).join(" "),
|
|
161
|
+
}).filter(a=>!isLocalhost(a)).join(" "),
|
|
161
162
|
FallbackDNS: serviceAddresses(this, {
|
|
162
163
|
...DNS_SERVICE_FILTER,
|
|
163
164
|
priority: ">=10"
|
|
@@ -301,7 +302,7 @@ async function generateZoneDefs(dns, location, packageData) {
|
|
|
301
302
|
};
|
|
302
303
|
configs.push(config);
|
|
303
304
|
|
|
304
|
-
const locationRecord = DNSRecord("location", "TXT",
|
|
305
|
+
const locationRecord = DNSRecord("location", "TXT", locationName);
|
|
305
306
|
|
|
306
307
|
const zone = {
|
|
307
308
|
id: domain,
|
package/src/utils.mjs
CHANGED
|
@@ -94,6 +94,11 @@ export function isLinkLocal(address) {
|
|
|
94
94
|
return address.startsWith("fe80");
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
export function isLocalhost(address) {
|
|
98
|
+
const eaddr = encodeIP(address);
|
|
99
|
+
return eaddr === IPV4_LOCALHOST || eaddr === IPV6_LOCALHOST;
|
|
100
|
+
}
|
|
101
|
+
|
|
97
102
|
export function normalizeIPAddress(address) {
|
|
98
103
|
address = address.replace(/\/\d+$/, "");
|
|
99
104
|
if (isIPv4Address(address)) {
|
package/types/utils.d.mts
CHANGED
|
@@ -9,6 +9,7 @@ export function isIPv4Address(address: any): boolean;
|
|
|
9
9
|
export function generateEU64(mac: any): void;
|
|
10
10
|
export function isIPv6Address(address: any): boolean;
|
|
11
11
|
export function isLinkLocal(address: any): any;
|
|
12
|
+
export function isLocalhost(address: any): boolean;
|
|
12
13
|
export function normalizeIPAddress(address: any): any;
|
|
13
14
|
export function _encode(definition: any, address: any): bigint;
|
|
14
15
|
export function decodeIPv6(address: any, length: any): string;
|