@entity-access/server-pages 1.1.567 → 1.1.569
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/dist/Content.d.ts.map +1 -1
- package/dist/Content.js +2 -2
- package/dist/Content.js.map +1 -1
- package/dist/Page.d.ts.map +1 -1
- package/dist/Page.js +5 -1
- package/dist/Page.js.map +1 -1
- package/dist/ServerPages.d.ts +9 -0
- package/dist/ServerPages.d.ts.map +1 -1
- package/dist/ServerPages.js +27 -18
- package/dist/ServerPages.js.map +1 -1
- package/dist/core/FileLock.d.ts.map +1 -1
- package/dist/core/FileLock.js +2 -1
- package/dist/core/FileLock.js.map +1 -1
- package/dist/core/Http2IPCProxyReceiver.d.ts.map +1 -1
- package/dist/core/Http2IPCProxyReceiver.js +2 -1
- package/dist/core/Http2IPCProxyReceiver.js.map +1 -1
- package/dist/core/HttpIPCProxyReceiver.d.ts.map +1 -1
- package/dist/core/HttpIPCProxyReceiver.js +3 -2
- package/dist/core/HttpIPCProxyReceiver.js.map +1 -1
- package/dist/core/ServerLogger.d.ts +20 -0
- package/dist/core/ServerLogger.d.ts.map +1 -0
- package/dist/core/ServerLogger.js +35 -0
- package/dist/core/ServerLogger.js.map +1 -0
- package/dist/core/TimeoutTracker.d.ts.map +1 -1
- package/dist/core/TimeoutTracker.js +2 -1
- package/dist/core/TimeoutTracker.js.map +1 -1
- package/dist/core/Wrapped.d.ts.map +1 -1
- package/dist/core/Wrapped.js +2 -1
- package/dist/core/Wrapped.js.map +1 -1
- package/dist/decorators/Prepare.d.ts.map +1 -1
- package/dist/decorators/Prepare.js +4 -3
- package/dist/decorators/Prepare.js.map +1 -1
- package/dist/services/AuthorizationService.d.ts.map +1 -1
- package/dist/services/AuthorizationService.js +2 -1
- package/dist/services/AuthorizationService.js.map +1 -1
- package/dist/socket/SocketNamespace.d.ts.map +1 -1
- package/dist/socket/SocketNamespace.js +3 -2
- package/dist/socket/SocketNamespace.js.map +1 -1
- package/dist/socket/SocketService.d.ts.map +1 -1
- package/dist/socket/SocketService.js +2 -1
- package/dist/socket/SocketService.js.map +1 -1
- package/dist/ssl/AcmeCertificateService.d.ts.map +1 -1
- package/dist/ssl/AcmeCertificateService.js +2 -2
- package/dist/ssl/AcmeCertificateService.js.map +1 -1
- package/dist/ssl/ChallengeServer.d.ts.map +1 -1
- package/dist/ssl/ChallengeServer.js +2 -1
- package/dist/ssl/ChallengeServer.js.map +1 -1
- package/dist/ssl/SecureContextService.d.ts.map +1 -1
- package/dist/ssl/SecureContextService.js +2 -1
- package/dist/ssl/SecureContextService.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/Content.tsx +2 -2
- package/src/Page.tsx +5 -1
- package/src/ServerPages.ts +33 -19
- package/src/core/FileLock.ts +2 -1
- package/src/core/Http2IPCProxyReceiver.ts +2 -1
- package/src/core/HttpIPCProxyReceiver.ts +3 -2
- package/src/core/ServerLogger.ts +28 -0
- package/src/core/TimeoutTracker.ts +3 -1
- package/src/core/Wrapped.ts +2 -1
- package/src/decorators/Prepare.ts +4 -3
- package/src/services/AuthorizationService.ts +2 -1
- package/src/socket/SocketNamespace.ts +3 -2
- package/src/socket/SocketService.ts +2 -1
- package/src/ssl/AcmeCertificateService.ts +2 -2
- package/src/ssl/ChallengeServer.ts +2 -1
- package/src/ssl/SecureContextService.ts +2 -1
package/src/ServerPages.ts
CHANGED
|
@@ -26,6 +26,7 @@ import { Http2SecureServer, Http2ServerRequest, Http2ServerResponse } from "node
|
|
|
26
26
|
import { Socket } from "node:net";
|
|
27
27
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
28
28
|
import sleep from "./sleep.js";
|
|
29
|
+
import ServerLogger from "./core/ServerLogger.js";
|
|
29
30
|
|
|
30
31
|
export const wsData = Symbol("wsData");
|
|
31
32
|
|
|
@@ -47,6 +48,7 @@ const sensitiveRoutes = (name: string) => name;
|
|
|
47
48
|
export default class ServerPages {
|
|
48
49
|
|
|
49
50
|
serverID: any;
|
|
51
|
+
logger: ServerLogger;
|
|
50
52
|
|
|
51
53
|
|
|
52
54
|
public static create(globalServiceProvider: ServiceProvider = new ServiceProvider()) {
|
|
@@ -195,7 +197,7 @@ export default class ServerPages {
|
|
|
195
197
|
});
|
|
196
198
|
|
|
197
199
|
httpServer.on("clientError", (err, socket: Socket) => {
|
|
198
|
-
|
|
200
|
+
this.reportError({ error: err });
|
|
199
201
|
// if (err.code === "ERR_HTTP_REQUEST_TIMEOUT") {
|
|
200
202
|
// try {
|
|
201
203
|
// if (!socket.destroyed) {
|
|
@@ -219,11 +221,14 @@ export default class ServerPages {
|
|
|
219
221
|
throw new Error(`Unknown protocol ${protocol}`);
|
|
220
222
|
}
|
|
221
223
|
|
|
222
|
-
httpServer.on("error",
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
httpServer.on("error", (error: any) => this.reportError({
|
|
225
|
+
url: "error",
|
|
226
|
+
error
|
|
227
|
+
}));
|
|
228
|
+
httpServer.on("sessionError" ,(error: any) => this.reportError({
|
|
229
|
+
url: "error",
|
|
230
|
+
error
|
|
231
|
+
}));
|
|
227
232
|
|
|
228
233
|
await new Promise<void>((resolve, reject) => {
|
|
229
234
|
|
|
@@ -273,9 +278,11 @@ export default class ServerPages {
|
|
|
273
278
|
}
|
|
274
279
|
}
|
|
275
280
|
|
|
281
|
+
this.logger = ServiceProvider.resolve(this, ServerLogger);
|
|
282
|
+
|
|
276
283
|
return httpServer;
|
|
277
284
|
} catch (error) {
|
|
278
|
-
|
|
285
|
+
this.reportError(error);
|
|
279
286
|
}
|
|
280
287
|
return null;
|
|
281
288
|
}
|
|
@@ -337,7 +344,7 @@ export default class ServerPages {
|
|
|
337
344
|
// ":status": 200
|
|
338
345
|
// });
|
|
339
346
|
} catch (error) {
|
|
340
|
-
|
|
347
|
+
this.reportError(error);
|
|
341
348
|
}
|
|
342
349
|
}
|
|
343
350
|
|
|
@@ -375,7 +382,7 @@ export default class ServerPages {
|
|
|
375
382
|
let sent = false;
|
|
376
383
|
const user = scope.resolve(SessionUser);
|
|
377
384
|
user.resp = resp;
|
|
378
|
-
user.ipAddress = req.remoteIPAddress;
|
|
385
|
+
const ip = user.ipAddress = req.remoteIPAddress;
|
|
379
386
|
|
|
380
387
|
const authService = scope.resolve(AuthorizationService);
|
|
381
388
|
|
|
@@ -384,6 +391,9 @@ export default class ServerPages {
|
|
|
384
391
|
|
|
385
392
|
const hostName = req.hostName;
|
|
386
393
|
|
|
394
|
+
const userAgent = req.headers["user-agent"];
|
|
395
|
+
|
|
396
|
+
|
|
387
397
|
|
|
388
398
|
try {
|
|
389
399
|
|
|
@@ -423,31 +433,30 @@ export default class ServerPages {
|
|
|
423
433
|
// we will not log this error
|
|
424
434
|
return;
|
|
425
435
|
}
|
|
426
|
-
if (this.serverID) {
|
|
427
|
-
console.error(`Failed: ${this.serverID}: ${req.URL}`);
|
|
428
|
-
} else {
|
|
429
|
-
console.error(`Failed: ${req.URL}`);
|
|
430
|
-
}
|
|
431
436
|
if (!sent) {
|
|
432
437
|
try {
|
|
433
438
|
|
|
434
439
|
if (acceptJson || error.errorModel) {
|
|
435
440
|
|
|
436
|
-
await Content.nativeJson({
|
|
441
|
+
const jsonError = await Content.nativeJson({
|
|
437
442
|
details: error.stack ?? error,
|
|
438
443
|
... error.errorModel ?? {},
|
|
439
444
|
message: error.message ?? error,
|
|
440
|
-
}, { status: error.errorModel?.status ?? 500})
|
|
441
|
-
|
|
445
|
+
}, { status: error.errorModel?.status ?? 500});
|
|
446
|
+
jsonError.suppressLog = true;
|
|
447
|
+
await jsonError.send(resp, user);
|
|
448
|
+
this.reportError({ url, error, info: error.errorModel, userAgent, ip });
|
|
442
449
|
return;
|
|
443
450
|
}
|
|
444
451
|
|
|
445
452
|
const content = Content.html(`<!DOCTYPE html>\n<html><body><pre>Server Error for ${req.url}\r\n${error?.stack ?? error}</pre></body></html>`,
|
|
446
453
|
{ status: 500});
|
|
454
|
+
content.suppressLog = true;
|
|
447
455
|
await content.send(resp, user);
|
|
456
|
+
this.reportError({ url, error, userAgent, ip });
|
|
448
457
|
} catch (e1) {
|
|
449
458
|
e1 = e1.stack ?? e1.toString();
|
|
450
|
-
|
|
459
|
+
this.reportError({ url, error: e1, userAgent, ip });
|
|
451
460
|
try {
|
|
452
461
|
await resp.sendReader(500, {}, Readable.from([ e1]), true);
|
|
453
462
|
} catch {
|
|
@@ -456,9 +465,14 @@ export default class ServerPages {
|
|
|
456
465
|
}
|
|
457
466
|
return;
|
|
458
467
|
}
|
|
459
|
-
|
|
468
|
+
this.reportError({ url, error, userAgent, ip });
|
|
460
469
|
}
|
|
461
470
|
|
|
462
471
|
}
|
|
463
472
|
|
|
473
|
+
reportError({ url = void 0, error = void 0, info = void 0, userAgent = void 0, ip = void 0}) {
|
|
474
|
+
|
|
475
|
+
this.logger.reportError({ url, serverID: this.serverID, error, info, userAgent, ip });
|
|
476
|
+
}
|
|
477
|
+
|
|
464
478
|
}
|
package/src/core/FileLock.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { existsSync, mkdirSync, openSync, constants, writeSync, closeSync, unlin
|
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
5
5
|
import * as os from "node:os";
|
|
6
6
|
import sleep from "../sleep.js";
|
|
7
|
+
import ServerLogger from "./ServerLogger.js";
|
|
7
8
|
|
|
8
9
|
const tmpdir = process.env.SOCIAL_MAIL_TMP_PATH || os.tmpdir();
|
|
9
10
|
|
|
@@ -86,7 +87,7 @@ class LockFile implements Disposable {
|
|
|
86
87
|
unlinkSync(this.lockFile);
|
|
87
88
|
} catch (error) {
|
|
88
89
|
// ignore error...
|
|
89
|
-
|
|
90
|
+
ServerLogger.reportError({ error });
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
|
|
@@ -3,6 +3,7 @@ import { createServer, Socket, Server as SocketServer } from "net";
|
|
|
3
3
|
import { remoteAddressSymbol } from "./remoteAddressSymbol.js";
|
|
4
4
|
import { Readable } from "stream";
|
|
5
5
|
import EventEmitterPromise from "./EventEmitterPromise.js";
|
|
6
|
+
import ServerLogger from "./ServerLogger.js";
|
|
6
7
|
|
|
7
8
|
const endSocket = (s: Socket) => {
|
|
8
9
|
try {
|
|
@@ -52,7 +53,7 @@ export default class Http2IPCProxyReceiver {
|
|
|
52
53
|
socket.setKeepAlive(false);
|
|
53
54
|
|
|
54
55
|
socket.on("error", (error) => {
|
|
55
|
-
|
|
56
|
+
ServerLogger.error(error);
|
|
56
57
|
endSocket(socket);
|
|
57
58
|
});
|
|
58
59
|
|
|
@@ -4,6 +4,7 @@ import { createServer, Socket, Server as SocketServer } from "net";
|
|
|
4
4
|
import { remoteAddressSymbol } from "./remoteAddressSymbol.js";
|
|
5
5
|
import { Readable, Stream } from "stream";
|
|
6
6
|
import EventEmitterPromise from "./EventEmitterPromise.js";
|
|
7
|
+
import ServerLogger from "./ServerLogger.js";
|
|
7
8
|
|
|
8
9
|
const endSocket = (s: Socket) => {
|
|
9
10
|
try {
|
|
@@ -68,7 +69,7 @@ export default class HttpIPCProxyReceiver {
|
|
|
68
69
|
try {
|
|
69
70
|
|
|
70
71
|
socket.on("error", (error) => {
|
|
71
|
-
|
|
72
|
+
ServerLogger.error(error);
|
|
72
73
|
endSocket(socket);
|
|
73
74
|
});
|
|
74
75
|
|
|
@@ -102,7 +103,7 @@ export default class HttpIPCProxyReceiver {
|
|
|
102
103
|
private forward1: http.Server
|
|
103
104
|
) {
|
|
104
105
|
this.server = createServer({ keepAlive: true, keepAliveInitialDelay: 5000, noDelay: true }, this.onConnection);
|
|
105
|
-
this.server.on("error",
|
|
106
|
+
this.server.on("error", ServerLogger.error);
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
listen(port, listener?: any) {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RegisterSingleton } from "@entity-access/entity-access/dist/di/di.js";
|
|
2
|
+
|
|
3
|
+
@RegisterSingleton
|
|
4
|
+
export default class ServerLogger {
|
|
5
|
+
|
|
6
|
+
static error = (error) => ServerLogger.reportError({ error });
|
|
7
|
+
|
|
8
|
+
static reportError({ url = void 0, serverID = void 0, error = void 0, info = void 0}) {
|
|
9
|
+
const { instance } = ServerLogger;
|
|
10
|
+
if (instance) {
|
|
11
|
+
return instance.reportError({ url, serverID, error, info });
|
|
12
|
+
}
|
|
13
|
+
const cause = error.cause?.stack ?? error.cause?.toString();
|
|
14
|
+
console.error(JSON.stringify({ url, serverID, error, cause, info }));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
private static instance: ServerLogger;
|
|
18
|
+
|
|
19
|
+
constructor() {
|
|
20
|
+
ServerLogger.instance = this;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
reportError({ url, serverID = void 0, error = void 0, info = void 0, userAgent = void 0, ip = void 0}) {
|
|
24
|
+
const cause = error.cause?.stack ?? error.cause?.toString();
|
|
25
|
+
console.error(JSON.stringify({ url, serverID, error: error.stack ?? error.toString(), cause, info }));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import ServerLogger from "./ServerLogger.js";
|
|
2
|
+
|
|
1
3
|
export default class TimeoutTracker implements Disposable {
|
|
2
4
|
|
|
3
5
|
static create(fx: () => any) {
|
|
@@ -11,7 +13,7 @@ export default class TimeoutTracker implements Disposable {
|
|
|
11
13
|
this.timer = void 0;
|
|
12
14
|
const p = tracker();
|
|
13
15
|
if (p?.catch) {
|
|
14
|
-
p.catch(
|
|
16
|
+
p.catch(ServerLogger.error);
|
|
15
17
|
}
|
|
16
18
|
}, time);
|
|
17
19
|
}
|
package/src/core/Wrapped.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { CacheProperty } from "./CacheProperty.js";
|
|
|
10
10
|
import Compression from "./Compression.js";
|
|
11
11
|
import { remoteAddressSymbol } from "./remoteAddressSymbol.js";
|
|
12
12
|
import { pipeline } from "stream/promises";
|
|
13
|
+
import ServerLogger from "./ServerLogger.js";
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
type UnwrappedRequest = IncomingMessage | Http2ServerRequest;
|
|
@@ -387,7 +388,7 @@ const extendResponse = (A: (new() => ServerResponse) | (new () => Http2ServerRes
|
|
|
387
388
|
await lf.writeTo(this, start, end);
|
|
388
389
|
return;
|
|
389
390
|
} catch (error) {
|
|
390
|
-
|
|
391
|
+
ServerLogger.reportError({ error });
|
|
391
392
|
if (sent) {
|
|
392
393
|
return;
|
|
393
394
|
}
|
|
@@ -7,6 +7,7 @@ import { ServiceProvider } from "@entity-access/entity-access/dist/di/di.js";
|
|
|
7
7
|
import { SessionUser } from "../core/SessionUser.js";
|
|
8
8
|
import Content, { StatusResult } from "../Content.js";
|
|
9
9
|
import EntityAccessError from "@entity-access/entity-access/dist/common/EntityAccessError.js";
|
|
10
|
+
import ServerLogger from "../core/ServerLogger.js";
|
|
10
11
|
|
|
11
12
|
export const prepareSymbol = Symbol("Parse");
|
|
12
13
|
|
|
@@ -150,7 +151,7 @@ const parseForm = (page?): any => {
|
|
|
150
151
|
}
|
|
151
152
|
});
|
|
152
153
|
const tasks = [];
|
|
153
|
-
bb.on("error",
|
|
154
|
+
bb.on("error", ServerLogger.error);
|
|
154
155
|
await new Promise((resolve, reject) => {
|
|
155
156
|
|
|
156
157
|
bb.on("field", (name, value) => {
|
|
@@ -166,7 +167,7 @@ const parseForm = (page?): any => {
|
|
|
166
167
|
file.on("limit", () => lastError = new EntityAccessError(`File size exceeded`));
|
|
167
168
|
tasks.push(tf.writeAll(file).then(() => {
|
|
168
169
|
result.files.push(tf);
|
|
169
|
-
},
|
|
170
|
+
}, ServerLogger.error));
|
|
170
171
|
});
|
|
171
172
|
bb.on("filesLimit", () => lastError = new EntityAccessError(`File size exceeded`) );
|
|
172
173
|
bb.on("error", reject);
|
|
@@ -186,7 +187,7 @@ const parseForm = (page?): any => {
|
|
|
186
187
|
tempFolder[Symbol.dispose]();
|
|
187
188
|
} catch (error) {
|
|
188
189
|
// delete folder
|
|
189
|
-
|
|
190
|
+
ServerLogger.error(error);
|
|
190
191
|
}
|
|
191
192
|
|
|
192
193
|
return Content.text(lastError.stack ?? lastError, { status: 500, contentType: "text/plain"})
|
|
@@ -5,6 +5,7 @@ import type { IAuthorizationCookie } from "./IAuthorizationCookie.js";
|
|
|
5
5
|
import type { SerializeOptions } from "cookie";
|
|
6
6
|
import KeyProvider, { IAuthKey } from "./KeyProvider.js";
|
|
7
7
|
import { createCipheriv, createDecipheriv, privateDecrypt, publicEncrypt } from "node:crypto";
|
|
8
|
+
import ServerLogger from "../core/ServerLogger.js";
|
|
8
9
|
|
|
9
10
|
const secure = (process.env["SOCIAL_MAIL_AUTH_COOKIE_SECURE"] ?? "true") === "true";
|
|
10
11
|
|
|
@@ -27,7 +28,7 @@ export default class AuthorizationService {
|
|
|
27
28
|
try {
|
|
28
29
|
await this.loadUserSessionFromCookie(cookie, user);
|
|
29
30
|
} catch (error) {
|
|
30
|
-
|
|
31
|
+
ServerLogger.error(error);
|
|
31
32
|
(user as any).isAuthorized = false;
|
|
32
33
|
}
|
|
33
34
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { ServiceProvider, injectServiceKeysSymbol } from "@entity-access/entity-access/dist/di/di.js";
|
|
3
3
|
import { Namespace, Socket } from "socket.io";
|
|
4
4
|
import { IClassOf } from "@entity-access/entity-access/dist/decorators/IClassOf.js";
|
|
5
|
+
import ServerLogger from "../core/ServerLogger.js";
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
export function Receive(target, key) {
|
|
@@ -23,11 +24,11 @@ export function Send(target: SocketNamespace, key) {
|
|
|
23
24
|
try {
|
|
24
25
|
const socketRoom = this.server.to(room);
|
|
25
26
|
if (!socketRoom) {
|
|
26
|
-
|
|
27
|
+
ServerLogger.error(`No room for ${room}`);
|
|
27
28
|
}
|
|
28
29
|
return socketRoom.emit(key, ... args);
|
|
29
30
|
} catch (error) {
|
|
30
|
-
|
|
31
|
+
ServerLogger.error(error);
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
34
|
return {
|
|
@@ -7,6 +7,7 @@ import SocketNamespace, { SocketNamespaceClient } from "./SocketNamespace.js";
|
|
|
7
7
|
import { camelToChain } from "../core/camelToChain.js";
|
|
8
8
|
import AuthorizationService from "../services/AuthorizationService.js";
|
|
9
9
|
import { SessionUser } from "../core/SessionUser.js";
|
|
10
|
+
import ServerLogger from "../core/ServerLogger.js";
|
|
10
11
|
|
|
11
12
|
export default abstract class SocketService {
|
|
12
13
|
|
|
@@ -85,7 +86,7 @@ export default abstract class SocketService {
|
|
|
85
86
|
}
|
|
86
87
|
await c[methodName](... args);
|
|
87
88
|
} catch (error) {
|
|
88
|
-
|
|
89
|
+
ServerLogger.error(error);
|
|
89
90
|
} finally {
|
|
90
91
|
scope.dispose();
|
|
91
92
|
}
|
|
@@ -8,6 +8,7 @@ import Inject, { RegisterSingleton } from "@entity-access/entity-access/dist/di/
|
|
|
8
8
|
import ChallengeStore from "./AcmeChallengeStore.js";
|
|
9
9
|
import CertificateStore from "./CertificateStore.js";
|
|
10
10
|
import { FileLock } from "../core/FileLock.js";
|
|
11
|
+
import ServerLogger from "../core/ServerLogger.js";
|
|
11
12
|
|
|
12
13
|
export interface IAcmeOptions {
|
|
13
14
|
sslMode?: string,
|
|
@@ -116,8 +117,7 @@ export default class AcmeCertificateService {
|
|
|
116
117
|
|
|
117
118
|
return { cert, key };
|
|
118
119
|
} catch (error) {
|
|
119
|
-
|
|
120
|
-
console.error(error);
|
|
120
|
+
ServerLogger.reportError({ error, info: logs.join("\n") });
|
|
121
121
|
throw error;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as http from "node:http";
|
|
2
2
|
import Inject, { RegisterSingleton } from "@entity-access/entity-access/dist/di/di.js";
|
|
3
3
|
import AcmeChallengeStore from "./AcmeChallengeStore.js";
|
|
4
|
+
import ServerLogger from "../core/ServerLogger.js";
|
|
4
5
|
|
|
5
6
|
@RegisterSingleton
|
|
6
7
|
export default class ChallengeServer {
|
|
@@ -24,7 +25,7 @@ export default class ChallengeServer {
|
|
|
24
25
|
await new Promise<void>((resolve) => res.end(resolve));
|
|
25
26
|
|
|
26
27
|
} catch (error) {
|
|
27
|
-
|
|
28
|
+
ServerLogger.error(error);
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
31
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Inject, { RegisterSingleton } from "@entity-access/entity-access/dist/di/di.js";
|
|
2
2
|
import { createSecureContext, SecureContext } from "tls";
|
|
3
3
|
import AcmeCertificateService, { IAcmeOptions } from "./AcmeCertificateService.js";
|
|
4
|
+
import ServerLogger from "../core/ServerLogger.js";
|
|
4
5
|
|
|
5
6
|
@RegisterSingleton
|
|
6
7
|
export default class SecureContextService {
|
|
@@ -18,7 +19,7 @@ export default class SecureContextService {
|
|
|
18
19
|
this.getSecureContext(servername)
|
|
19
20
|
.then((c) => cb(null, c))
|
|
20
21
|
.catch((error) => {
|
|
21
|
-
|
|
22
|
+
ServerLogger.error(error);
|
|
22
23
|
cb(error);
|
|
23
24
|
});
|
|
24
25
|
|