Skip to content

feat: 自更新支持 GitHub 加速代理与 CNB 镜像,WebUI 可配置 - #9

Merged
MimoKit merged 1 commit into
MimoKit:masterfrom
yiwuerxin:feat/github-proxy
Jul 25, 2026
Merged

feat: 自更新支持 GitHub 加速代理与 CNB 镜像,WebUI 可配置#9
MimoKit merged 1 commit into
MimoKit:masterfrom
yiwuerxin:feat/github-proxy

Conversation

@yiwuerxin

@yiwuerxin yiwuerxin commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

概述

本 PR 包含三个功能,均已在 NoneBot2 + Python 3.11 环境实测通过(78 个单元测试全绿,ruff check/format 通过):

1. GitHub 加速与镜像源配置

  • 概览页新增「GitHub 加速」卡片,内置 4 个 gh-proxy 加速前缀、CNB 镜像https://cnb.cool/MimokitStudio/nonebot-plugin-mimo-console)以及自定义镜像仓库地址
  • 支持一键连通性测试;配置写入 .envMIMO_CONSOLE_GITHUB_PROXY)并热更新,无需重启
  • 版本检测走代理前缀获取 pyproject.toml,解决国内网络下「GitHub 暂无发布版本,无法检测更新」的问题

2. CNB 镜像版本检测

  • CNB 无匿名 raw 直链(/-/raw 返回 SPA 页面),改用 git 浅克隆读取版本号:git clone --depth 1 --filter=blob:none --sparse + sparse-checkout set --no-cone /pyproject.toml
  • 镜像源连通性测试使用 git ls-remote
  • 已实测真实 CNB 镜像可正确返回版本号

3. 插件中心禁用/启用插件

  • 插件卡片与详情抽屉显示「运行中 / 已禁用」徽标,详情抽屉内可一键禁用/启用
  • 基于 run_preprocessor 抛出 IgnoredException响应器级拦截事件:禁用后该插件的 matcher 不再响应消息,后台已调度任务不受影响
  • 禁用列表持久化于 localstore 的 disabled_plugins.json,重启后仍生效
  • 控制台自身禁止禁用

其他

  • 版本号 0.1.2 → 0.1.5
  • 新增 tests/test_version.pytests/test_disabled.py 共 20+ 测试用例

注:分支历史已整理为单个提交,便于审阅。

- 新增配置项 MIMO_CONSOLE_GITHUB_PROXY:空为直连,支持 gh-proxy 风格前缀、
  CNB 镜像仓库地址及自定义地址;写入 .env 并热更新内存配置,保存立即生效
- 版本检测与自更新按该配置解析实际拉取地址(resolve_git_url/resolve_version_url)
- 概览页新增「GitHub 加速」卡片:内置 4 个加速前缀 + CNB 镜像 + 自定义,
  支持一键测试连通性(返回延迟);长 URL 选项自适应换行
- 版本号 0.1.2 → 0.1.3
@MimoKit
MimoKit merged commit 261f647 into MimoKit:master Jul 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants