pmcf 2.50.0 → 2.51.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "2.50.0",
3
+ "version": "2.51.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "ip-utilties": "^1.3.3",
49
- "npm-pkgbuild": "^18.1.2",
49
+ "npm-pkgbuild": "^18.2.3",
50
50
  "pacc": "^3.4.2",
51
51
  "pkg-dir": "^8.0.0"
52
52
  },
@@ -55,7 +55,7 @@
55
55
  "ava": "^6.3.0",
56
56
  "c8": "^10.1.3",
57
57
  "documentation": "^14.0.3",
58
- "semantic-release": "^24.2.3",
58
+ "semantic-release": "^24.2.4",
59
59
  "typescript": "^5.8.3"
60
60
  },
61
61
  "engines": {
package/src/endpoint.mjs CHANGED
@@ -90,9 +90,21 @@ export class DomainNameEndpoint extends PortEndpoint {
90
90
  }
91
91
 
92
92
  export class HTTPEndpoint extends PortEndpoint {
93
- constructor(service, url, data) {
93
+ constructor(service, address, data) {
94
94
  super(service, data);
95
- this.url = url;
95
+
96
+ for (const name of ["path"]) {
97
+ if (data[name] !== undefined) {
98
+ this[name] = data[name];
99
+ }
100
+ }
101
+
102
+ if (typeof address === "string") {
103
+ this.url = address;
104
+ } else {
105
+ this.url = "http://" + address.address + ":" + data.port + data.path;
106
+ this.host = address.address;
107
+ }
96
108
  }
97
109
 
98
110
  get address() {
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(
@@ -5,6 +5,7 @@ import {
5
5
  ServiceTypeDefinition,
6
6
  Endpoint,
7
7
  UnixEndpoint,
8
+ HTTPEndpoint,
8
9
  serviceEndpoints,
9
10
  SUBNET_LOCALHOST_IPV4,
10
11
  SUBNET_LOCALHOST_IPV6
@@ -24,6 +25,8 @@ const DHCPServiceTypeDefinition = {
24
25
  const controlAgentEndpoint = {
25
26
  type: "kea-control-agent",
26
27
  port: 8000,
28
+ path: "/",
29
+ method: "get",
27
30
  protocol: "tcp",
28
31
  tls: false
29
32
  };
@@ -75,10 +78,12 @@ export class DHCPService extends Service {
75
78
  const endpoints = super.endpoints(filter);
76
79
 
77
80
  for (const na of this.host.networkAddresses(
78
- na => na.networkInterface.kind === "localhost"
81
+ na => na.networkInterface.kind === "loopback"
79
82
  )) {
80
- endpoints.push(new Endpoint(this, na, controlAgentEndpoint));
81
- endpoints.push(new Endpoint(this, na, ddnsEndpoint));
83
+ endpoints.push(
84
+ new HTTPEndpoint(this, na, controlAgentEndpoint),
85
+ new Endpoint(this, na, ddnsEndpoint)
86
+ );
82
87
  }
83
88
 
84
89
  endpoints.push(
@@ -117,6 +122,10 @@ export class DHCPService extends Service {
117
122
  }
118
123
  };
119
124
 
125
+ const ctrlAgentEndpoint = this.endpoint(
126
+ e => e.type === "kea-control-agent"
127
+ );
128
+
120
129
  const commonConfig = {
121
130
  "lease-database": {
122
131
  type: "memfile",
@@ -135,7 +144,35 @@ export class DHCPService extends Service {
135
144
  },
136
145
  "renew-timer": 900,
137
146
  "rebind-timer": 1800,
138
- "valid-lifetime": 3600
147
+ "valid-lifetime": 3600,
148
+ "hooks-libraries": [
149
+ {
150
+ library: "/usr/lib/kea/hooks/libdhcp_lease_cmds.so"
151
+ },
152
+ {
153
+ library: "/usr/lib/kea/hooks/libdhcp_ha.so",
154
+ parameters: {
155
+ "high-availability": [
156
+ {
157
+ "this-server-name": name,
158
+ 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
+ ]
171
+ }
172
+ ]
173
+ }
174
+ }
175
+ ]
139
176
  };
140
177
 
141
178
  const loggers = [
@@ -159,8 +196,8 @@ export class DHCPService extends Service {
159
196
 
160
197
  const ctrlAgent = {
161
198
  "Control-agent": {
162
- "http-host": "127.0.0.1",
163
- "http-port": 8000,
199
+ "http-host": ctrlAgentEndpoint?.host,
200
+ "http-port": ctrlAgentEndpoint?.port,
164
201
  "control-sockets": {
165
202
  dhcp4: toUnix(this.endpoint(e => e.type === "kea-control-dhcp4")),
166
203
  dhcp6: toUnix(this.endpoint(e => e.type === "kea-control-dhcp6")),
@@ -247,7 +284,7 @@ export class DHCPService extends Service {
247
284
 
248
285
  const subnets = [...this.subnets].filter(
249
286
  s => s !== SUBNET_LOCALHOST_IPV4 && s !== SUBNET_LOCALHOST_IPV6
250
- ); // TODO no localhost
287
+ );
251
288
  const dhcp4 = {
252
289
  Dhcp4: {
253
290
  ...commonConfig,
@@ -350,7 +350,7 @@ export class Cluster extends Host {
350
350
  get backups(): Set<any>;
351
351
  get members(): Set<any>;
352
352
  preparePackages(stagingDir: any): AsyncGenerator<{
353
- sources: AsyncIterable<import("content-entry").ContentEntry>[];
353
+ sources: AsyncIterable<import("content-entry").ContentEntry | import("content-entry").CollectionEntry>[];
354
354
  outputs: any;
355
355
  properties: {
356
356
  name: string;
@@ -15,9 +15,10 @@ export class DomainNameEndpoint extends PortEndpoint {
15
15
  get address(): any;
16
16
  }
17
17
  export class HTTPEndpoint extends PortEndpoint {
18
- constructor(service: any, url: any, data: any);
19
- url: any;
20
- get address(): any;
18
+ constructor(service: any, address: any, data: any);
19
+ url: string;
20
+ host: any;
21
+ get address(): string;
21
22
  }
22
23
  export class UnixEndpoint extends BaseEndpoint {
23
24
  constructor(service: any, path: any, data: any);