fix: Build errors after cleanup

This commit is contained in:
LukeGus
2025-10-31 21:14:21 -05:00
parent a9709f3877
commit b481405fd8
5 changed files with 3374 additions and 2165 deletions

View File

@@ -1,4 +1,4 @@
/import Database from "better-sqlite3";
import Database from "better-sqlite3";
import fs from "fs";
import path from "path";
import { databaseLogger } from "./logger.js";

View File

@@ -23,22 +23,12 @@ class SystemCrypto {
const envSecret = process.env.JWT_SECRET;
if (envSecret && envSecret.length >= 64) {
this.jwtSecret = envSecret;
databaseLogger.info("JWT secret loaded from environment variable", {
operation: "jwt_init_from_env",
secretLength: envSecret.length,
secretPrefix: envSecret.substring(0, 8) + "...",
});
return;
}
const dataDir = process.env.DATA_DIR || "./db/data";
const envPath = path.join(dataDir, ".env");
databaseLogger.info("Attempting to load JWT secret from .env file", {
operation: "jwt_init_from_file",
envPath,
});
try {
const envContent = await fs.readFile(envPath, "utf8");
const jwtMatch = envContent.match(/^JWT_SECRET=(.+)$/m);