mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-22 06:15:24 +02:00
16 lines
371 B
TypeScript
16 lines
371 B
TypeScript
import { readSecret } from "../db/constants";
|
|
|
|
const { ENCRYPTION_KEY, ENCRYPTION_KEY_FILE } = process.env;
|
|
|
|
function resolveEncryptionSecret(): string | undefined {
|
|
if (ENCRYPTION_KEY) {
|
|
return ENCRYPTION_KEY;
|
|
}
|
|
if (ENCRYPTION_KEY_FILE) {
|
|
return readSecret(ENCRYPTION_KEY_FILE);
|
|
}
|
|
return undefined;
|
|
}
|
|
|
|
export const encryptionSecret = resolveEncryptionSecret();
|