UI 体验与启动优化 · 主题色 · Gitea CI/夜间预发布 · 后端安全加固

- 启动:健康检查与设置并行请求,页面按需构建并 Offstage 保活,封面按展示尺寸解码
- UI:模型卡片增加悬停动效、封面渐变遮罩、版本/作者/标签胶囊,空简介占位
- 主题:设置页新增主色调选择(预设 + 自定义 #RRGGBB),前后端持久化并实时生效
- CI:新增 PR 审核流水线(后端编译/自检、Flutter 分析测试、漏洞与密钥扫描、汇总门禁)
- CI:新增每晚 21:00(UTC 13:00)预发布流水线,prerelease 且不设为 Latest,先删旧再建新
- 安全:后端新增安全响应头、Host/Origin 校验、写入限流、请求体上限、ID 与设置白名单、错误信息脱敏
- 源:暂时只启用 Xhmcl;GitCode 实现保留但不再调用,旧配置自动迁移
This commit is contained in:
Morris committed 2026-11-17 23:50:54 +08:00
1 parent 3480cbaa5f
commit ae73eca2c4
15 files changed
+1007 -153

No files matched your search

+8 -8
View File
@@ -18,10 +18,11 @@ public sealed class SettingsService
public void Load()
{
Current = Json.Read<AppSettings>(_paths.SettingsFile) ?? new AppSettings();
if (Current.UpdateRepository.Contains("gitcode.com/2509_92447106/GC", StringComparison.OrdinalIgnoreCase))
// 暂时停用 GitCode:旧配置里的 GitCode 仓库地址统一迁到 Xhmcl。
if (Current.UpdateRepository.Contains("gitcode.com", StringComparison.OrdinalIgnoreCase))
{
Current.UpdateRepository = Current.UpdateRepository.Replace(
"2509_92447106", "Morris_1", StringComparison.OrdinalIgnoreCase);
Current.UpdateRepository = SourcePreset.Xhmcl.HomeUrl;
Save();
}
SeedDefaultSource();
@@ -29,12 +30,11 @@ public sealed class SettingsService
}
/// <summary>
/// 只允许两个内置源:Xhmcl 与 GitCode(同一份仓库的两个镜像)。
/// 不再支持用户自定义源 —— 每次加载都把 Sources 规整成这两条,
/// 老配置里的自定义源会被清理掉。
/// 当前只启用 Xhmcl 一个内置源。GitCode 的定义与下载实现保留在代码里,
/// 但不再参与测速 / 下载 / 更新;恢复时把 GitCode 加回 <see cref="SourcePreset.All"/> 即可。
/// </summary>
public const string DefaultSourceId = "gitcode";
public const string DefaultSourceUrl = "https://gitcode.com/Morris_1/GC";
public const string DefaultSourceId = "xhmcl";
public const string DefaultSourceUrl = "https://git.xhmcl.com/Morris/GC";
private void SeedDefaultSource()
{