feat(daidai): 适配呆呆面板(Daidai Panel) - #1087
Open
linzixuanzz wants to merge 1 commit into
Open
Conversation
新增在呆呆面板(Daidai Panel,Go + Vue + SQLite 的轻量定时任务面板)中运行的支持, 整体思路与 qinglong/、baihu/ 一致:面板订阅本仓库、自动建 cron 任务、容器内装 dotnet 或下载 bilitool 二进制运行 Task;扫码登录后通过呆呆面板「原生 Open API」把 Cookie 自动 写回面板环境变量,因此 Ray_PlatformType 取值为 DaiDai。 复用青龙脚本(按作者建议,避免重复维护各任务脚本): - daidai/ 只保留一份面板专属 base(DefaultTasks/bili_task_base.sh,负责环境安装/定位); - 各任务脚本(bili_task_*.sh)由订阅钩子 daidai/copyshfile.sh 在拉库后、建任务前从 qinglong/DefaultTasks 复用拷贝,并清理 qinglong 目录; - stable 与 dev 共用同一份 base:base 用仓库根标记文件 Ray.BiliBiliTool.sln 向上定位仓库 根目录,dev/bili_dev_task_base.sh 只是 source 上一级的 base,进一步减少重复。 C# 侧(develop 为 Refit 架构,参照已合并的 Baihu 集成实现): - PlatformType 新增 DaiDai - 新增 DaiDaiOptions(AppKey/AppSecret) 与 DaiDaiConfig 绑定 - 新增 Refit 接口 IDaiDaiApi 及 DTO,对接面板原生接口 POST /api/open-api/token 与 /api/envs - LoginDomainService 新增 SaveCookieToDaiDaiAsync(先换 token 再 upsert Cookie 环境变量), 并在 PrintIfSaveCookieFailAsync 增加呆呆面板的手动添加提示 - LoginTaskAppService、BaseMultiAccountsAppService 在 PlatformType=DaiDai 时走该分支 - 测试 double 补实现新接口成员 ref RayWangQvQ#1066
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
适配呆呆面板(Daidai Panel)
呆呆面板 是一款 Go + Vue + SQLite 的轻量定时任务面板(issue #1066 提到)。本 PR 新增在呆呆面板中运行 BiliBiliToolPro 的支持。我是呆呆面板的作者,想把适配回馈到上游,方便两边用户。
做法:对齐已合并的 baihu/ 集成,复用青龙脚本
参考你在 baihu PR 里的建议(各任务脚本与青龙一致应复用、只有环境安装部分各面板自己实现):
daidai/只保留一份面板专属bili_task_base.sh(环境安装/定位);daidai/copyshfile.sh在拉库后从qinglong/DefaultTasks复用,并清理 qinglong 目录;Ray.BiliBiliTool.sln向上定位仓库根,dev base 仅 source 上一级),比 baihu 再少一层重复。Cookie 自动写回
登录后通过呆呆面板原生 Open API(
POST /api/open-api/token换 token →/api/envsupsert)把 Cookie 写回面板环境变量,Ray_PlatformType=DaiDai。C# 侧参照已合并的 Baihu(Refit)实现IDaiDaiApi/SaveCookieToDaiDaiAsync,并接入两处持久化分发点(LoginTaskAppService、BaseMultiAccountsAppService)。验证
dotnet build全绿;CharacterizationTests 通过copyshfile.sh/ 仓库根定位均已实跑验证详见
daidai/README.md。closes #1066