mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(server): selfhost startup (#9386)
This commit is contained in:
@@ -45,6 +45,7 @@ function loadPrivateKey() {
|
||||
}
|
||||
|
||||
async function load() {
|
||||
let isPrivateKeyFromEnv = !!process.env.AFFINE_PRIVATE_KEY;
|
||||
// Initializing AFFiNE config
|
||||
//
|
||||
// 1. load dotenv file to `process.env`
|
||||
@@ -56,6 +57,12 @@ async function load() {
|
||||
path: join(CUSTOM_CONFIG_PATH, '.env'),
|
||||
});
|
||||
|
||||
// @deprecated
|
||||
// The old AFFINE_PRIVATE_KEY in old .env is somehow not working, we should ignore it
|
||||
if (!isPrivateKeyFromEnv) {
|
||||
delete process.env.AFFINE_PRIVATE_KEY;
|
||||
}
|
||||
|
||||
// 2. generate AFFiNE default config and assign to `globalThis.AFFiNE`
|
||||
globalThis.AFFiNE = getAFFiNEConfigModifier();
|
||||
const { enablePlugin } = await import('./plugins/registry');
|
||||
|
||||
Reference in New Issue
Block a user