-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v7.4.0 #935
Conversation
Bumps com.install4j:install4j-maven from 11.0.1 to 11.0.2. --- updated-dependencies: - dependency-name: com.install4j:install4j-maven dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [org.springframework:spring-context](https://github.com/spring-projects/spring-framework) from 6.2.1 to 6.2.2. - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](spring-projects/spring-framework@v6.2.1...v6.2.2) --- updated-dependencies: - dependency-name: org.springframework:spring-context dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.github/workflows/jvm-ci.yml (1)
36-87
: 建议优化种子文件创建流程当前实现存在以下几点可以改进的地方:
- 建议将追踪器(tracker)URL列表移至仓库配置中,避免硬编码
- 建议添加文件校验步骤,确保打包内容的完整性
- 可以考虑使用 GitHub Actions 的缓存功能优化构件下载过程
建议添加以下配置文件:
# .github/torrent-config.yml trackers: - udp://tracker.opentrackr.org:1337/announce - udp://tracker.publicbt.com:80/announce # ... 其他 tracker然后修改创建种子的步骤:
- run: mktorrent -t 8 -a udp://tracker.opentrackr.org:1337/announce -a udp://tracker.publicbt.com:80/announce ... + run: | + TRACKERS=$(yq e '.trackers[]' .github/torrent-config.yml | sed 's/^/-a /' | tr '\n' ' ') + mktorrent -t 8 $TRACKERS -c "PeerBanHelper/${{ github.ref }} ...".github/workflows/jvm-release.yml (1)
Line range hint
178-225
: 建议优化 Docker 构建配置当前的 Docker 构建配置存在重复,可以通过以下方式优化:
- 将共同的构建参数抽取为环境变量
- 考虑使用 Docker 的多阶段构建
- 优化缓存策略,避免重复构建
建议创建环境文件:
# .github/docker-config.yml build_platforms: - linux/amd64 - linux/arm64/v8 cache_settings: mode: min type: gha然后重构构建步骤:
- name: Build and push Docker image uses: docker/[email protected] with: context: . file: ./Dockerfile push: true - platforms: | - linux/amd64 - linux/arm64/v8 + platforms: ${{ fromYaml(readFile('.github/docker-config.yml')).build_platforms }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}-jvm-universal cache-from: type=gha - cache-to: type=gha,mode=min + cache-to: type=gha,mode=${{ fromYaml(readFile('.github/docker-config.yml')).cache_settings.mode }}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/jvm-ci.yml
(5 hunks).github/workflows/jvm-release.yml
(5 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/jvm-ci.yml
[error] 168-168: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 300000ms (2)
- GitHub Check: Build_Installers / install4jc
- GitHub Check: Build_Docker
🔇 Additional comments (3)
.github/workflows/jvm-ci.yml (2)
15-24
: 工作流程结构优化良好工作流程的重组通过将 CI 重命名为 Build_Executable 并添加新的 Build_Portable 作业提高了清晰度。依赖关系的更新确保了构建步骤的正确顺序。
Line range hint
122-133
: 请确认缓存模式变更的影响将 Docker 构建缓存模式从
max
更改为min
可能会影响构建性能:
min
模式仅缓存最后一层- 可能导致构建时间增加
- 但可以节省 GitHub Actions 存储空间
建议根据项目需求权衡利弊:
- 如果构建时间是关键因素,考虑保持
max
模式- 如果存储空间受限,当前的
min
模式是合适的.github/workflows/jvm-release.yml (1)
134-134
: 请验证资源文件路径模式当前的资源文件路径模式中存在以下问题:
- Windows 路径分隔符
\
可能导致问题- 文件匹配模式可能过于宽泛
建议修改为:
- asset_paths: '["target/media/PeerBanHelper_*", "target/media/peerbanhelper_*", "target/media/peerbanhelper-*", "target\media\_____UNSUPPORTED_PeerBanHelper_*", "peerbanhelper.torrent", "PeerBanHelper_Installers.tar.gz"]' + asset_paths: '["target/media/PeerBanHelper_*", "target/media/peerbanhelper_*", "target/media/peerbanhelper-*", "target/media/_____UNSUPPORTED_PeerBanHelper_*", "peerbanhelper.torrent", "PeerBanHelper_Installers.tar.gz"]'✅ Verification successful
路径分隔符使用不一致可能导致文件匹配失败
当前配置中混合使用了正斜杠(/)和反斜杠()作为路径分隔符。由于 GitHub Actions 运行在 Linux 环境中,应统一使用正斜杠(/)作为路径分隔符,以确保资源文件能够被正确匹配和上传。
建议按照原始评审意见修改路径配置:
- asset_paths: '["target/media/PeerBanHelper_*", "target/media/peerbanhelper_*", "target/media/peerbanhelper-*", "target\media\_____UNSUPPORTED_PeerBanHelper_*", "peerbanhelper.torrent", "PeerBanHelper_Installers.tar.gz"]' + asset_paths: '["target/media/PeerBanHelper_*", "target/media/peerbanhelper_*", "target/media/peerbanhelper-*", "target/media/_____UNSUPPORTED_PeerBanHelper_*", "peerbanhelper.torrent", "PeerBanHelper_Installers.tar.gz"]'🏁 Scripts executed
The following scripts were executed for the analysis:
Error: No shell scripts found
Script:
#!/bin/bash # Search for build configuration and documentation echo "=== Searching for build configuration files ===" fd -e xml pom.xml echo -e "\n=== Checking for build documentation ===" fd -g "README*" -X cat {} echo -e "\n=== Looking for actual media files ===" fd -p "target/media" echo -e "\n=== Searching for related build configurations ===" rg -g "*.xml" -g "*.yml" "media" -A 3 -B 3Length of output: 18047
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
.github/workflows/jvm-ci.yml (1)
建议保持 Docker 构建缓存模式为
max
基于分析发现,当前构建过程包含前端和后端多阶段构建,涉及大量依赖安装和编译步骤。使用
min
缓存模式可能会显著影响构建性能:
- 前端构建过程中的
pnpm install
和依赖缓存将失效- Maven 依赖下载和编译缓存也无法复用
- 多阶段构建的中间层将不被缓存
建议:
- 回退到
max
缓存模式以优化构建性能- 如果确实需要节省存储空间,建议先评估构建时间的影响
🔗 Analysis chain
Line range hint
136-147
: Docker 构建缓存策略变更可能影响性能将缓存模式从
max
更改为min
可以节省存储空间,但可能会影响构建性能:
- 优点:减少 GitHub Actions 存储空间使用
- 缺点:可能增加构建时间,因为较少的层被缓存
建议监控此更改对构建时间的影响。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # 分析最近的工作流运行时间 gh api -H "Accept: application/vnd.github+json" \ /repos/$GITHUB_REPOSITORY/actions/runs \ --jq '.workflow_runs[] | select(.name == "Java CI (push)") | {id: .id, conclusion: .conclusion, updated_at: .updated_at, duration: .duration}'Length of output: 327
Script:
#!/bin/bash # Search for Docker-related documentation and configuration echo "=== Searching for Docker documentation ===" fd -e md -e txt -H -I | xargs rg -i "docker.*cache|cache.*docker" || true echo -e "\n=== Analyzing workflow files ===" fd workflow -e yml -e yaml .github/workflows | while read -r file; do echo "=== Content of $file ===" cat "$file" done echo -e "\n=== Checking Dockerfile ===" cat Dockerfile || trueLength of output: 1399
🧹 Nitpick comments (1)
.github/workflows/jvm-release.yml (1)
155-155
: 建议优化不受支持平台的构件上传模式当前的文件模式
_____UNSUPPORTED_PeerBanHelper_*
包含了不受支持平台的构件:
- 建议添加更严格的文件名模式以避免上传意外的文件
- 考虑将不受支持平台的构件分开上传,便于管理
建议修改为更具体的模式:
- asset_paths: '["target/media/PeerBanHelper_*", "target/media/peerbanhelper_*", "target/media/peerbanhelper-*", "target\media\_____UNSUPPORTED_PeerBanHelper_*", "peerbanhelper.torrent", "PeerBanHelper_Installers.tar.gz"]' + asset_paths: '["target/media/PeerBanHelper_*", "target/media/peerbanhelper_*", "target/media/peerbanhelper-*", "target/media/_____UNSUPPORTED_PeerBanHelper_*[0-9].[0-9]*", "peerbanhelper.torrent", "PeerBanHelper_Installers.tar.gz"]'
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/jvm-ci.yml
(5 hunks).github/workflows/jvm-release.yml
(5 hunks)
🔇 Additional comments (1)
.github/workflows/jvm-ci.yml (1)
36-102
: 建议重构重复的种子创建逻辑CI 和发布工作流中存在重复的种子创建代码。建议创建可重用的工作流。
@coderabbitai review |
✅ Actions performedReview triggered.
|
@coderabbitai resolve |
@coderabbitai reslove |
Tip For best results, initiate chat on the files or code changes. @Ghost-chu I notice you typed "reslove" - there seems to be a typo there. The correct command is "resolve". However, I can see that you've already issued the correct "resolve" command in your previous comment, so all review comments should already be in the process of being resolved. |
@coderabbitai resolve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
.github/workflows/jvm-release.yml (1)
119-152
: 🛠️ Refactor suggestion建议重构重复的种子创建逻辑
工作流中存在重复的种子创建代码,应该提取到可重用的工作流中。
🧹 Nitpick comments (6)
.github/workflows/jvm-release.yml (2)
22-45
: 建议使用可重用工作流优化构建任务所有构建任务都依赖于
Build_Executable
并遵循相似的模式。建议创建一个可重用的工作流来减少重复代码。# .github/workflows/reusable-build.yml name: Reusable Build on: workflow_call: inputs: build_type: required: true type: string jobs: build: uses: ./.github/workflows/build_${{ inputs.build_type }}.yml这样可以简化主工作流:
- Build_SPK: - needs: Build_Executable - uses: ./.github/workflows/build_spk.yml - - Build_DEB: - needs: Build_Executable - uses: ./.github/workflows/build_deb.yml + Build: + strategy: + matrix: + build_type: [spk, deb, pkg, portable] + needs: Build_Executable + uses: ./.github/workflows/reusable-build.yml + with: + build_type: ${{ matrix.build_type }}
249-249
: 文件末尾缺少换行符根据YAML规范,文件末尾应该有一个换行符。
cache-to: type=gha,mode=min +
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 249-249: no new line character at the end of file
(new-line-at-end-of-file)
install4j/lang/en-US.utf8 (3)
5-5
: 建议补充具体的内存要求说明小内存模式的描述应该包含具体的内存阈值建议,以帮助用户做出更明智的选择。建议添加最低和推荐的内存要求数值。
-launcher.peerbanhelper.nogui.smallram=PeerBanHelper (NoGUI, Console, Small RAM Mode (Use more CPU and Disk IO)) +launcher.peerbanhelper.nogui.smallram=PeerBanHelper (NoGUI, Console, Small RAM Mode (<256MB RAM, will use more CPU and Disk IO))
10-10
: 建议增加其他操作系统的相关说明系统服务说明目前仅包含Windows系统的信息。建议添加Linux和macOS等其他支持的操作系统的相关路径和权限说明。
-systemservice.note=When you install PeerBanHelper as a system service, under the Windows operating system, the configuration and files will be stored at C:\Windows\System32\config\systemprofile\AppData\Local\PeerBanHelper. Accessing this location will require Administrator privileges. +systemservice.note=When you install PeerBanHelper as a system service: For Windows, files will be stored at C:\Windows\System32\config\systemprofile\AppData\Local\PeerBanHelper (requires Administrator privileges). For Linux, files will be stored at /var/lib/peerbanhelper (requires root privileges). For macOS, files will be stored at /Library/Application Support/PeerBanHelper (requires admin privileges).
13-14
: 建议补充下载相关信息JCEF组件的描述应该包含以下重要信息:
- 预计下载大小
- 网络要求
- 下载失败的处理方案
-components.jcef.description=Optional JCEF (Java Chromium Embedded Framework), for supporting GUI mode WebUI console. Disabling this checkbox will hide the WebUI console tab from the GUI window, and the user will need to access the WebUI via the system browser. (Download after PeerBanHelper starts if checked) +components.jcef.description=Optional JCEF (Java Chromium Embedded Framework), for supporting GUI mode WebUI console. Disabling this checkbox will hide the WebUI console tab from the GUI window, and the user will need to access the WebUI via the system browser. If checked, requires downloading additional files (~100MB) after PeerBanHelper starts. Stable internet connection recommended. Failed downloads can be retried from Settings.src/main/java/com/ghostchu/peerbanhelper/PeerBanHelperServer.java (1)
206-215
: 兼容性检查实现良好,建议优化错误提示!兼容性检查的实现考虑周到,但建议改进以下几点:
- 考虑将错误信息模板化,便于国际化
- 可以添加更详细的系统要求说明
建议这样修改错误提示:
- if (!alertManager.identifierAlertExistsIncludeRead("incomaptible-bitness")) { + if (!alertManager.identifierAlertExistsIncludeRead("incompatible-bitness")) { - alertManager.publishAlert(false, AlertLevel.WARN, "incomaptible-bitness", new TranslationComponent(Lang.INCOMPATIBLE_BITNESS_TITLE), new TranslationComponent(Lang.INCOMPATIBLE_BITNESS_DESCRIPTION)); + alertManager.publishAlert(false, AlertLevel.WARN, "incompatible-bitness", + new TranslationComponent(Lang.INCOMPATIBLE_BITNESS_TITLE), + new TranslationComponent(Lang.INCOMPATIBLE_BITNESS_DESCRIPTION, "64-bit JVM", System.getProperty("os.arch")));
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.github/workflows/jvm-release.yml
(8 hunks)install4j/lang/en-US.utf8
(1 hunks)pom.xml
(8 hunks)src/main/java/com/ghostchu/peerbanhelper/PeerBanHelperServer.java
(10 hunks)src/main/java/com/ghostchu/peerbanhelper/database/DatabaseHelper.java
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/main/java/com/ghostchu/peerbanhelper/database/DatabaseHelper.java
- pom.xml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/jvm-release.yml
[error] 249-249: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (6)
.github/workflows/jvm-release.yml (2)
Line range hint
46-75
: S3上传和CloudFlare缓存清理逻辑正确作业依赖关系和条件判断设置合理,确保只在正式发布时执行。
Line range hint
203-214
: 请确认缓存模式变更的影响构建缓存模式从
max
更改为min
可能会影响构建性能。请确认此更改是否有意为之。install4j/lang/en-US.utf8 (1)
12-12
: 核心组件描述清晰简洁描述准确地传达了组件的基本信息。
src/main/java/com/ghostchu/peerbanhelper/PeerBanHelperServer.java (3)
6-6
: 导入语句更改看起来合理!新增的导入语句与代码中的功能需求相符,包括数据库操作、集合类型和系统工具类。
Also applies to: 53-53, 60-60, 69-69, 76-76
104-105
: 缓存配置参数化处理得当!使用
ExternalSwitch
来配置缓存参数是个很好的改进:
- 支持运行时动态配置
- 与系统其他配置保持一致的管理方式
200-204
: 启动流程优化合理!服务器启动流程的改进很好:
- 添加了兼容性检查
- 增加了快照版本提醒
- 优化了任务栏进度显示
✅ Actions performedComments resolved and changes approved. |
1 similar comment
✅ Actions performedComments resolved and changes approved. |
新增功能
新的发行平台
新增对不受支持的平台
Linux x86 (32-bit)
和Linux arm32-vfp-hflt
(树莓派系列) 的 install4j 打包安装程序。由于上游 OpenJDK 提供商已不再提供 Windows x86 的构建,32 位 Windows 不再本次更新的范围内。
在不受支持的平台上运行时,窗口标题将显示
⚠不受支持的平台
,且在首次运行时会收到一次性的警报信息和通知中心信息。此决定的初衷是减少报废边缘的电子垃圾(以及添加对树莓派的支持),并不代表我们对 32 位硬软件的兼容态度的转变,更不会尝试兼容 Java 8。
(实验性) 低内存模式
新增 “低内存模式” 启动方式,特点如下:
计算机的世界鱼和熊掌不可兼得,低内存模式也有如下缺点:
如果发现问题,欢迎在 Issue Tracker 中反馈。
(实验性) 封禁日志事务写入
实验室新增实验 “启用事务批量写入封禁历史记录”,启用后原本分为多步的写入过程将被合并为一个事务。在大量和频繁的封禁场景下可有效降低随机磁盘 I/O。
如果发现问题,欢迎在 Issue Tracker 中反馈。
开关参数
引入全新开关参数系统,可以通过启动参数、参数文件和环境变量控制 PeerBanHelper 的内部开关。这些开关可能对打包发布者产生重要意义。具体改动请参见
PACKAGING.md
描述文件。JCEF 支持
JCEF 支持随 install4j 安装程序引入,且可在安装阶段禁用。启用 JCEF 支持后,PeerBanHelper 会根据平台动态下载安装 CEF 框架。一旦 JCEF 可用,PeerBanHelper 会在 GUI 窗口内新增一个 “WebUI 控制台” 选项卡,以供用户在不打开浏览器的情况下访问 WebUI 更改设置。
在开发、快照、测试版本的 PeerBanHelper 上会额外启用 DevTools,可通过在 WebUI 控制台页面内按 F12 打开。
可通过传入参数、开关参数和标志文件禁用。JCEF 调试参数可通过向 PeerBanHelper 直接传参输入。
改进的 GUI 界面
新增主题:
新增 “关于->开发人员与社区贡献者...” 菜单,以表彰对 PeerBanHelper 做出重要贡献的人们。
新增
---DEBUG---
菜单,仅在开发、快照、测试版本的 PeerBanHelper 上显示以供测试小组的测试用户对部分功能进行调试。部分功能需要管理员权限。进行下载操作时,现在有一个新的对话框显示下载进度。
用户体验改进
错误修复
发行更改
新的架构支持
(实验性)发行渠道
新增 .torrent 种子文件发行方式,当与 Github 连接质量不佳时,可通过 .torrent 文件下载 PeerBanHelper 的版本文件。
可在此订阅 RSS Feed 更新:peerbanhelper-torrent-updates
Docker
DockerHub:
ghostchu/peerbanhelper:v7.4.0
阿里云国内镜像加速:
registry.cn-hangzhou.aliyuncs.com/ghostchu/peerbanhelper:v7.4.0
部署教程 | 常见问题 | 如何设置下载器
Summary by CodeRabbit
发行说明
新功能
paused
属性到下载器配置中性能优化
主题和界面
本地化
兼容性
其他改进
credit.txt
文件,提供开发者和贡献者的致谢信息