pmcf 2.51.0 → 2.51.2
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 +2 -2
- package/src/service.mjs +1 -1
- package/src/services/dhcp.mjs +28 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "2.51.
|
|
3
|
+
"version": "2.51.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"pkg-dir": "^8.0.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@types/node": "^22.15.
|
|
54
|
+
"@types/node": "^22.15.19",
|
|
55
55
|
"ava": "^6.3.0",
|
|
56
56
|
"c8": "^10.1.3",
|
|
57
57
|
"documentation": "^14.0.3",
|
package/src/service.mjs
CHANGED
|
@@ -275,7 +275,7 @@ export class Service extends Base {
|
|
|
275
275
|
|
|
276
276
|
if (hasSVRRecords) {
|
|
277
277
|
for (const ep of this.endpoints(
|
|
278
|
-
e => e.protocol && e.networkInterface.kind !== "loopback"
|
|
278
|
+
e => e.protocol && e.networkInterface && e.networkInterface.kind !== "loopback"
|
|
279
279
|
)) {
|
|
280
280
|
records.push(
|
|
281
281
|
DNSRecord(
|
package/src/services/dhcp.mjs
CHANGED
|
@@ -77,13 +77,12 @@ export class DHCPService extends Service {
|
|
|
77
77
|
endpoints(filter) {
|
|
78
78
|
const endpoints = super.endpoints(filter);
|
|
79
79
|
|
|
80
|
-
for (const na of this.host.networkAddresses(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
new
|
|
85
|
-
|
|
86
|
-
);
|
|
80
|
+
for (const na of this.host.networkAddresses()) {
|
|
81
|
+
endpoints.push(new HTTPEndpoint(this, na, controlAgentEndpoint));
|
|
82
|
+
|
|
83
|
+
if (na.networkInterface.kind === "loopback") {
|
|
84
|
+
endpoints.push(new Endpoint(this, na, ddnsEndpoint));
|
|
85
|
+
}
|
|
87
86
|
}
|
|
88
87
|
|
|
89
88
|
endpoints.push(
|
|
@@ -122,10 +121,24 @@ export class DHCPService extends Service {
|
|
|
122
121
|
}
|
|
123
122
|
};
|
|
124
123
|
|
|
125
|
-
|
|
124
|
+
const ctrlAgentEndpoint = this.endpoint(
|
|
126
125
|
e => e.type === "kea-control-agent"
|
|
127
126
|
);
|
|
128
127
|
|
|
128
|
+
const peers = (
|
|
129
|
+
await Array.fromAsync(network.findServices({ type: "dhcp" }))
|
|
130
|
+
).map(dhcp => {
|
|
131
|
+
const ctrlAgentEndpoint = dhcp.endpoint(
|
|
132
|
+
e => e.type === "kea-control-agent"
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
return {
|
|
136
|
+
name: dhcp.host.name,
|
|
137
|
+
role: dhcp.priority < 10 ? "primary" : "standby",
|
|
138
|
+
url: ctrlAgentEndpoint?.url
|
|
139
|
+
};
|
|
140
|
+
});
|
|
141
|
+
|
|
129
142
|
const commonConfig = {
|
|
130
143
|
"lease-database": {
|
|
131
144
|
type: "memfile",
|
|
@@ -156,18 +169,7 @@ export class DHCPService extends Service {
|
|
|
156
169
|
{
|
|
157
170
|
"this-server-name": name,
|
|
158
171
|
mode: "hot-standby",
|
|
159
|
-
peers
|
|
160
|
-
{
|
|
161
|
-
name: name,
|
|
162
|
-
url: ctrlAgentEndpoint.url,
|
|
163
|
-
role: "primary"
|
|
164
|
-
} /*,
|
|
165
|
-
{
|
|
166
|
-
name: "server2",
|
|
167
|
-
url: "http://172.28.0.254:8000/",
|
|
168
|
-
role: "standby"
|
|
169
|
-
}*/
|
|
170
|
-
]
|
|
172
|
+
peers
|
|
171
173
|
}
|
|
172
174
|
]
|
|
173
175
|
}
|
|
@@ -219,10 +221,12 @@ export class DHCPService extends Service {
|
|
|
219
221
|
};
|
|
220
222
|
});
|
|
221
223
|
|
|
224
|
+
const ddnsEndpoint = this.endpoint(e => e.type === "kea-ddns");
|
|
225
|
+
|
|
222
226
|
const ddns = {
|
|
223
227
|
DhcpDdns: {
|
|
224
|
-
"ip-address":
|
|
225
|
-
port:
|
|
228
|
+
"ip-address": ddnsEndpoint.address,
|
|
229
|
+
port: ddnsEndpoint.port,
|
|
226
230
|
"control-socket": toUnix(
|
|
227
231
|
this.endpoint(e => e.type === "kea-control-ddns")
|
|
228
232
|
),
|
|
@@ -241,8 +245,8 @@ export class DHCPService extends Service {
|
|
|
241
245
|
|
|
242
246
|
const dhcpServerDdns = {
|
|
243
247
|
"enable-updates": true,
|
|
244
|
-
"
|
|
245
|
-
|
|
248
|
+
"ip-address": ddnsEndpoint.address,
|
|
249
|
+
port: ddnsEndpoint.port,
|
|
246
250
|
"max-queue-size": 64,
|
|
247
251
|
"ncr-protocol": "UDP",
|
|
248
252
|
"ncr-format": "JSON"
|