fix: 校验控制面板更新结果#5193
Open
eyaeya wants to merge 1 commit into
Open
Conversation
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.
背景
更新 Zashboard / Metacubexd 控制面板时,当前脚本只校验 zip 可解压以及预期顶层目录存在;复制到最终目录后没有验证
index.html和入口静态资源是否完整。这样在以下场景中可能出现“日志显示下载成功,但控制面板无法正常访问”:现场验证显示当前远端 zashboard/metacubexd 包本身层级正常,但 OpenClash 的成功判定和替换流程存在通用健壮性问题,不是单台路由器环境特有问题。
修改
index.html存在,并校验其本地src/href引用的 JS/CSS 文件非空;同时要求至少发现并验证一个本地 JS 入口。index.html、缺入口资源、单双引号引用、单行多资源引用、正常 Zashboard / Metacubexd 安装和 staging 目录位置。验证
bash tests/openclash_download_dashboard_test.shbash -n luci-app-openclash/root/usr/share/openclash/openclash_download_dashboard.shbash -n tests/openclash_download_dashboard_test.shgit diff --check -- luci-app-openclash/root/usr/share/openclash/openclash_download_dashboard.sh tests/openclash_download_dashboard_test.shindex.htmlmd5 未变化,无.openclash_dashboard_*残留,关键静态资源 HTTP 200。