Fix encryption not loading

This commit is contained in:
LukeGus
2025-09-26 17:17:11 -05:00
parent ab6b1e284f
commit 33aa648d28
2 changed files with 24 additions and 2 deletions

View File

@@ -76,8 +76,19 @@ class SystemCrypto {
// Check environment variable
const envKey = process.env.DATABASE_KEY;
databaseLogger.info("Checking DATABASE_KEY from environment", {
operation: "db_key_check",
hasKey: !!envKey,
keyLength: envKey?.length || 0,
meetsLengthRequirement: envKey && envKey.length >= 64
});
if (envKey && envKey.length >= 64) {
this.databaseKey = Buffer.from(envKey, 'hex');
databaseLogger.info("Using existing DATABASE_KEY from environment", {
operation: "db_key_use_existing",
keyLength: envKey.length
});
return;
}