feat: 自动生成JWT_SECRET和ADMIN_PASSWORD并持久化到secrets.json
This commit is contained in:
@@ -42,14 +42,7 @@ export function validateConfig(): ValidationError[] {
|
||||
}
|
||||
|
||||
// ─── Cookie Encryption ───
|
||||
if (!process.env.COOKIE_ENCRYPTION_KEY) {
|
||||
errors.push({
|
||||
key: 'COOKIE_ENCRYPTION_KEY',
|
||||
message: '未设置网盘 Cookie 加密密钥!Cookie 将以明文存储。生产环境强烈建议设置。\n' +
|
||||
'生成: openssl rand -hex 32',
|
||||
severity: 'warn',
|
||||
});
|
||||
}
|
||||
// Key is auto-generated and persisted to encryption.key if COOKIE_ENCRYPTION_KEY is not set
|
||||
|
||||
// ─── Port conflict check (best-effort) ───
|
||||
if (config.port < 1024 && (process as any).getuid?.() !== 0) {
|
||||
|
||||
Reference in New Issue
Block a user