mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-05-21 13:47:31 +08:00
feat: merge env
This commit is contained in:
@@ -231,6 +231,15 @@ export async function getConfig(): Promise<AdminConfig> {
|
|||||||
adminConfig = await (storage as any).getAdminConfig();
|
adminConfig = await (storage as any).getAdminConfig();
|
||||||
}
|
}
|
||||||
if (adminConfig) {
|
if (adminConfig) {
|
||||||
|
// 合并一些环境变量配置
|
||||||
|
adminConfig.SiteConfig.SiteName = process.env.SITE_NAME || 'MoonTV';
|
||||||
|
adminConfig.SiteConfig.Announcement =
|
||||||
|
process.env.ANNOUNCEMENT ||
|
||||||
|
'本网站仅提供影视信息搜索服务,所有内容均来自第三方网站。本站不存储任何视频资源,不对任何内容的准确性、合法性、完整性负责。';
|
||||||
|
adminConfig.UserConfig.AllowRegister =
|
||||||
|
process.env.NEXT_PUBLIC_ENABLE_REGISTER === 'true';
|
||||||
|
adminConfig.SiteConfig.SearchResultDefaultAggregate =
|
||||||
|
process.env.NEXT_PUBLIC_AGGREGATE_SEARCH_RESULT !== 'false';
|
||||||
cachedConfig = adminConfig;
|
cachedConfig = adminConfig;
|
||||||
} else {
|
} else {
|
||||||
// DB 无配置,执行一次初始化
|
// DB 无配置,执行一次初始化
|
||||||
|
|||||||
Reference in New Issue
Block a user