mirror of
https://github.com/spacebarchat/server.git
synced 2026-07-13 07:19:03 +00:00
Add JWT keypair init hooks to various services
This commit is contained in:
+14
-1
@@ -22,7 +22,19 @@ import morgan from "morgan";
|
||||
import { Server, ServerOptions } from "lambert-server/Server";
|
||||
import { red } from "picocolors";
|
||||
import { getDatabase, initDatabase, Message } from "@spacebar/database";
|
||||
import { Config, ConnectionConfig, ConnectionLoader, Email, JSONReplacer, WebAuthn, initEvent, registerRoutes, getRevInfoOrFail, pendingPolls } from "@spacebar/util";
|
||||
import {
|
||||
Config,
|
||||
ConnectionConfig,
|
||||
ConnectionLoader,
|
||||
Email,
|
||||
JSONReplacer,
|
||||
WebAuthn,
|
||||
initEvent,
|
||||
registerRoutes,
|
||||
getRevInfoOrFail,
|
||||
pendingPolls,
|
||||
JwtKeypairManager,
|
||||
} from "@spacebar/util";
|
||||
import { ProcessLifecycle } from "../util/util/ProcessLifecycle";
|
||||
import { Monitoring } from "../util/monitoring/Monitoring";
|
||||
import { BcryptWorkerPool } from "../util/util/workers/bcrypt/BcryptWorkerPool";
|
||||
@@ -63,6 +75,7 @@ export class SpacebarServer extends Server {
|
||||
await Email.init();
|
||||
await ConnectionConfig.init();
|
||||
await initInstance();
|
||||
await JwtKeypairManager.init();
|
||||
WebAuthn.init();
|
||||
// await BcryptWorkerPool.Init(8); // TODO: make configurable
|
||||
await GifProviderManager.init();
|
||||
|
||||
@@ -21,7 +21,7 @@ import { setInterval } from "node:timers";
|
||||
import ws from "ws";
|
||||
import { initDatabase } from "@spacebar/database";
|
||||
import { Random } from "@spacebar/extensions";
|
||||
import { checkToken, Config, initEvent, Rights } from "@spacebar/util";
|
||||
import { checkToken, Config, initEvent, JwtKeypairManager, Rights } from "@spacebar/util";
|
||||
import { ProcessLifecycle } from "../util/util/ProcessLifecycle";
|
||||
import { Monitoring } from "../util/monitoring/Monitoring";
|
||||
import { Connection, openConnections } from "./events/Connection";
|
||||
@@ -182,6 +182,7 @@ export class Server {
|
||||
await initEvent();
|
||||
// temporary fix
|
||||
await cleanupOnStartup();
|
||||
await JwtKeypairManager.init();
|
||||
|
||||
if (!this.server.listening) {
|
||||
this.server.listen(this.port);
|
||||
|
||||
@@ -20,7 +20,7 @@ import http from "node:http";
|
||||
import ws from "ws";
|
||||
import { green, yellow } from "picocolors";
|
||||
import { initDatabase } from "@spacebar/database";
|
||||
import { Config, initEvent } from "@spacebar/util";
|
||||
import { Config, initEvent, JwtKeypairManager } from "@spacebar/util";
|
||||
import { ProcessLifecycle } from "../util/util/ProcessLifecycle";
|
||||
import { Monitoring } from "../util/monitoring/Monitoring";
|
||||
import { Connection } from "./events/Connection";
|
||||
@@ -68,6 +68,7 @@ export class Server {
|
||||
await initDatabase();
|
||||
await Config.init();
|
||||
await initEvent();
|
||||
await JwtKeypairManager.init();
|
||||
|
||||
// try to load webrtc library, if failed just don't start webrtc endpoint
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user