2025-08-12 21:50:58 +08:00
|
|
|
|
export interface AdminConfig {
|
2025-08-13 13:20:58 +08:00
|
|
|
|
ConfigSubscribtion: {
|
|
|
|
|
|
URL: string;
|
|
|
|
|
|
AutoUpdate: boolean;
|
|
|
|
|
|
LastCheck: string;
|
|
|
|
|
|
};
|
2025-08-13 00:30:31 +08:00
|
|
|
|
ConfigFile: string;
|
2025-08-12 21:50:58 +08:00
|
|
|
|
SiteConfig: {
|
|
|
|
|
|
SiteName: string;
|
|
|
|
|
|
Announcement: string;
|
|
|
|
|
|
SearchDownstreamMaxPage: number;
|
|
|
|
|
|
SiteInterfaceCacheTime: number;
|
|
|
|
|
|
DoubanProxyType: string;
|
|
|
|
|
|
DoubanProxy: string;
|
|
|
|
|
|
DoubanImageProxyType: string;
|
|
|
|
|
|
DoubanImageProxy: string;
|
|
|
|
|
|
DisableYellowFilter: boolean;
|
2025-08-17 17:32:42 +08:00
|
|
|
|
FluidSearch: boolean;
|
2025-12-02 01:00:42 +08:00
|
|
|
|
// 弹幕配置
|
|
|
|
|
|
DanmakuApiBase: string;
|
|
|
|
|
|
DanmakuApiToken: string;
|
2025-12-14 22:15:38 +08:00
|
|
|
|
// TMDB配置
|
|
|
|
|
|
TMDBApiKey?: string;
|
2025-12-20 22:11:34 +08:00
|
|
|
|
TMDBProxy?: string;
|
2025-12-27 22:08:23 +08:00
|
|
|
|
BannerDataSource?: string; // 轮播图数据源:TMDB 或 TX
|
2025-12-27 23:45:34 +08:00
|
|
|
|
RecommendationDataSource?: string; // 更多推荐数据源:Douban、TMDB、Mixed、MixedSmart
|
2025-12-23 00:47:24 +08:00
|
|
|
|
// Pansou配置
|
|
|
|
|
|
PansouApiUrl?: string;
|
|
|
|
|
|
PansouUsername?: string;
|
|
|
|
|
|
PansouPassword?: string;
|
2025-12-03 18:20:34 +08:00
|
|
|
|
// 评论功能开关
|
|
|
|
|
|
EnableComments: boolean;
|
2025-12-04 22:14:48 +08:00
|
|
|
|
// 自定义去广告代码
|
|
|
|
|
|
CustomAdFilterCode?: string;
|
|
|
|
|
|
CustomAdFilterVersion?: number; // 代码版本号(时间戳)
|
2025-12-13 13:03:46 +08:00
|
|
|
|
// 注册相关配置
|
|
|
|
|
|
EnableRegistration?: boolean; // 开启注册
|
|
|
|
|
|
RegistrationRequireTurnstile?: boolean; // 注册启用Cloudflare Turnstile
|
|
|
|
|
|
LoginRequireTurnstile?: boolean; // 登录启用Cloudflare Turnstile
|
|
|
|
|
|
TurnstileSiteKey?: string; // Cloudflare Turnstile Site Key
|
|
|
|
|
|
TurnstileSecretKey?: string; // Cloudflare Turnstile Secret Key
|
|
|
|
|
|
DefaultUserTags?: string[]; // 新注册用户的默认用户组
|
2025-12-13 15:11:14 +08:00
|
|
|
|
// OIDC配置
|
|
|
|
|
|
EnableOIDCLogin?: boolean; // 启用OIDC登录
|
|
|
|
|
|
EnableOIDCRegistration?: boolean; // 启用OIDC注册
|
|
|
|
|
|
OIDCIssuer?: string; // OIDC Issuer URL (用于自动发现)
|
|
|
|
|
|
OIDCAuthorizationEndpoint?: string; // 授权端点
|
|
|
|
|
|
OIDCTokenEndpoint?: string; // Token端点
|
|
|
|
|
|
OIDCUserInfoEndpoint?: string; // 用户信息端点
|
|
|
|
|
|
OIDCClientId?: string; // OIDC Client ID
|
|
|
|
|
|
OIDCClientSecret?: string; // OIDC Client Secret
|
2025-12-13 17:36:57 +08:00
|
|
|
|
OIDCButtonText?: string; // OIDC登录按钮文字
|
2025-12-26 16:57:08 +08:00
|
|
|
|
OIDCMinTrustLevel?: number; // 最低信任等级(仅LinuxDo网站有效,为0时不判断)
|
2025-08-12 21:50:58 +08:00
|
|
|
|
};
|
|
|
|
|
|
UserConfig: {
|
|
|
|
|
|
Users: {
|
|
|
|
|
|
username: string;
|
|
|
|
|
|
role: 'user' | 'admin' | 'owner';
|
|
|
|
|
|
banned?: boolean;
|
2025-08-21 13:05:46 +08:00
|
|
|
|
enabledApis?: string[]; // 优先级高于tags限制
|
|
|
|
|
|
tags?: string[]; // 多 tags 取并集限制
|
|
|
|
|
|
}[];
|
|
|
|
|
|
Tags?: {
|
|
|
|
|
|
name: string;
|
|
|
|
|
|
enabledApis: string[];
|
2025-08-12 21:50:58 +08:00
|
|
|
|
}[];
|
|
|
|
|
|
};
|
|
|
|
|
|
SourceConfig: {
|
|
|
|
|
|
key: string;
|
|
|
|
|
|
name: string;
|
|
|
|
|
|
api: string;
|
|
|
|
|
|
detail?: string;
|
|
|
|
|
|
from: 'config' | 'custom';
|
|
|
|
|
|
disabled?: boolean;
|
2025-12-28 21:01:49 +08:00
|
|
|
|
proxyMode?: boolean; // 代理模式开关:启用后由服务器代理m3u8和ts分片
|
2025-08-12 21:50:58 +08:00
|
|
|
|
}[];
|
|
|
|
|
|
CustomCategories: {
|
|
|
|
|
|
name?: string;
|
|
|
|
|
|
type: 'movie' | 'tv';
|
|
|
|
|
|
query: string;
|
|
|
|
|
|
from: 'config' | 'custom';
|
|
|
|
|
|
disabled?: boolean;
|
|
|
|
|
|
}[];
|
2025-08-24 00:26:48 +08:00
|
|
|
|
LiveConfig?: {
|
|
|
|
|
|
key: string;
|
|
|
|
|
|
name: string;
|
|
|
|
|
|
url: string; // m3u 地址
|
|
|
|
|
|
ua?: string;
|
|
|
|
|
|
epg?: string; // 节目单
|
|
|
|
|
|
from: 'config' | 'custom';
|
|
|
|
|
|
channelNumber?: number;
|
|
|
|
|
|
disabled?: boolean;
|
|
|
|
|
|
}[];
|
2025-12-12 18:06:34 +08:00
|
|
|
|
ThemeConfig?: {
|
|
|
|
|
|
enableBuiltInTheme: boolean; // 是否启用内置主题
|
|
|
|
|
|
builtInTheme: string; // 内置主题名称
|
|
|
|
|
|
customCSS: string; // 自定义CSS
|
|
|
|
|
|
enableCache: boolean; // 是否启用浏览器缓存
|
|
|
|
|
|
cacheMinutes: number; // 缓存时间(分钟)
|
|
|
|
|
|
cacheVersion: number; // CSS版本号(用于缓存控制)
|
2025-12-28 12:12:11 +08:00
|
|
|
|
loginBackgroundImage?: string; // 登录界面背景图
|
|
|
|
|
|
registerBackgroundImage?: string; // 注册界面背景图
|
2025-12-12 18:06:34 +08:00
|
|
|
|
};
|
2025-12-22 00:42:27 +08:00
|
|
|
|
OpenListConfig?: {
|
2025-12-22 23:08:03 +08:00
|
|
|
|
Enabled: boolean; // 是否启用私人影库功能
|
2025-12-22 00:42:27 +08:00
|
|
|
|
URL: string; // OpenList 服务器地址
|
2025-12-22 21:38:51 +08:00
|
|
|
|
Username: string; // 账号(用于登录获取Token)
|
|
|
|
|
|
Password: string; // 密码(用于登录获取Token)
|
2025-12-22 00:42:27 +08:00
|
|
|
|
RootPath: string; // 根目录路径,默认 "/"
|
2025-12-28 14:55:35 +08:00
|
|
|
|
OfflineDownloadPath: string; // 离线下载目录,默认 "/"
|
2025-12-22 00:42:27 +08:00
|
|
|
|
LastRefreshTime?: number; // 上次刷新时间戳
|
|
|
|
|
|
ResourceCount?: number; // 资源数量
|
2025-12-22 22:28:54 +08:00
|
|
|
|
ScanInterval?: number; // 定时扫描间隔(分钟),0表示关闭,最低60分钟
|
2026-01-01 20:57:44 +08:00
|
|
|
|
ScanMode?: 'torrent' | 'name' | 'hybrid'; // 扫描模式:torrent=种子库匹配,name=名字匹配,hybrid=混合模式(默认)
|
2025-12-22 00:42:27 +08:00
|
|
|
|
};
|
2025-12-29 14:41:59 +08:00
|
|
|
|
AIConfig?: {
|
|
|
|
|
|
Enabled: boolean; // 是否启用AI问片功能
|
|
|
|
|
|
Provider: 'openai' | 'claude' | 'custom'; // AI服务提供商
|
|
|
|
|
|
// OpenAI配置
|
|
|
|
|
|
OpenAIApiKey?: string;
|
|
|
|
|
|
OpenAIBaseURL?: string; // 自定义API地址(如Azure、国内代理等)
|
|
|
|
|
|
OpenAIModel?: string; // 模型名称,如gpt-4, gpt-3.5-turbo
|
|
|
|
|
|
// Claude配置
|
|
|
|
|
|
ClaudeApiKey?: string;
|
|
|
|
|
|
ClaudeModel?: string; // 模型名称,如claude-3-opus-20240229
|
|
|
|
|
|
// 自定义配置(兼容OpenAI格式的API)
|
|
|
|
|
|
CustomApiKey?: string;
|
|
|
|
|
|
CustomBaseURL?: string;
|
|
|
|
|
|
CustomModel?: string;
|
|
|
|
|
|
// 决策模型配置
|
|
|
|
|
|
EnableDecisionModel: boolean; // 是否启用决策模型(用AI判断是否需要联网/数据源)
|
|
|
|
|
|
DecisionProvider?: 'openai' | 'claude' | 'custom'; // 决策模型提供商
|
|
|
|
|
|
DecisionOpenAIApiKey?: string;
|
|
|
|
|
|
DecisionOpenAIBaseURL?: string;
|
|
|
|
|
|
DecisionOpenAIModel?: string;
|
|
|
|
|
|
DecisionClaudeApiKey?: string;
|
|
|
|
|
|
DecisionClaudeModel?: string;
|
|
|
|
|
|
DecisionCustomApiKey?: string;
|
|
|
|
|
|
DecisionCustomBaseURL?: string;
|
|
|
|
|
|
DecisionCustomModel?: string;
|
|
|
|
|
|
// 联网搜索配置
|
|
|
|
|
|
EnableWebSearch: boolean; // 是否启用联网搜索
|
|
|
|
|
|
WebSearchProvider?: 'tavily' | 'serper' | 'serpapi'; // 搜索服务提供商
|
|
|
|
|
|
TavilyApiKey?: string; // Tavily API密钥
|
|
|
|
|
|
SerperApiKey?: string; // Serper.dev API密钥
|
|
|
|
|
|
SerpApiKey?: string; // SerpAPI密钥
|
|
|
|
|
|
// 功能开关
|
|
|
|
|
|
EnableHomepageEntry: boolean; // 首页入口开关
|
|
|
|
|
|
EnableVideoCardEntry: boolean; // VideoCard入口开关
|
|
|
|
|
|
EnablePlayPageEntry: boolean; // 播放页入口开关
|
2025-12-29 15:12:40 +08:00
|
|
|
|
// 权限控制
|
|
|
|
|
|
AllowRegularUsers: boolean; // 是否允许普通用户使用AI问片(关闭后仅站长和管理员可用)
|
2025-12-29 14:41:59 +08:00
|
|
|
|
// 高级设置
|
|
|
|
|
|
Temperature?: number; // AI温度参数(0-2),默认0.7
|
|
|
|
|
|
MaxTokens?: number; // 最大回复token数,默认1000
|
|
|
|
|
|
SystemPrompt?: string; // 自定义系统提示词
|
|
|
|
|
|
};
|
2025-08-12 21:50:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface AdminConfigResult {
|
|
|
|
|
|
Role: 'owner' | 'admin';
|
|
|
|
|
|
Config: AdminConfig;
|
|
|
|
|
|
}
|