Use environment variables for secret keys in dev and backend
Set fixed secret keys for JWT and WebUI in development environment via environment variables. Updated backend to use NAPCAT_WEBUI_SECRET_KEY and NAPCAT_WEBUI_JWT_SECRET_KEY from environment if available, improving configurability and security.
This commit is contained in:
1 parent
a2837974fe
commit
3957d7af5a
3 files changed
+5
-3
No files matched your search
@@ -2,7 +2,7 @@ import crypto from 'crypto';
|
||||
import store from 'napcat-common/src/store';
|
||||
import type { WebUiCredentialJson, WebUiCredentialInnerJson } from '@/napcat-webui-backend/src/types';
|
||||
export class AuthHelper {
|
||||
private static readonly secretKey = Math.random().toString(36).slice(2);
|
||||
private static readonly secretKey = process.env['NAPCAT_WEBUI_JWT_SECRET_KEY'] || Math.random().toString(36).slice(2);
|
||||
|
||||
/**
|
||||
* 签名凭证方法。
|
||||
|
||||
Reference in new issue
Block a user