Skip to content

Commit

Permalink
Merge pull request #508 from PBH-BTN/master
Browse files Browse the repository at this point in the history
v6.2.8
  • Loading branch information
Ghost-chu authored Sep 20, 2024
2 parents c6321cc + e1791d0 commit 429d18e
Show file tree
Hide file tree
Showing 16 changed files with 230 additions and 176 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
sed -i "s/<version>/${{ env.PBH_VERSION }}/g" pkg/deb/DEBIAN/control
mkdir -p pkg/deb/usr/lib/peerbanhelper
cp target/PeerBanHelper.jar pkg/deb/usr/lib/peerbanhelper/
cd pkg && dpkg -b deb PeerBanHelper_linux_glibc_${{ env.PBH_VERSION }}.deb
cd pkg && dpkg -b deb peerbanhelper_${{ env.PBH_VERSION }}_all.deb
# 上面那个文件名需要符合收集条件
env:
PBH_VERSION: ${{ steps.java_info.outputs.project_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jvm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["target/PeerBanHelper.jar", "target/media/PeerBanHelper_*", "target/media/*.spk"]'
asset_paths: '["target/PeerBanHelper.jar", "target/media/PeerBanHelper_*", "target/media/peerbanhelper_*", "target/media/*.spk"]'
Build_Docker:
permissions:
contents: write
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,25 @@ PeerBanHelper 使用 [Install4j multi-platform installer builder](https://www.ej

## Credit

### Backend
* [Cordelia](https://github.com/bochkov/cordelia)
* [IPAddress](https://github.com/seancfoley/IPAddress)
* [YamlConfiguration](https://github.com/bspfsystems/YamlConfiguration)
* [libby](https://github.com/AlessioDP/libby)
* [AviatorScript](https://github.com/killme2008/aviatorscript)
* [javalin](https://javalin.io/)
* [deluge-java](https://github.com/RangerRick/deluge-java)
* [jSystemThemeDetector](https://github.com/Dansoftowner/jSystemThemeDetector)
* [Methanol](https://github.com/mizosoft/methanol)
* [Flatlaf](https://github.com/JFormDesigner/FlatLaf)
* [GeoIP2](https://dev.maxmind.com/geoip)
* [ormlite](https://ormlite.com/)
* [SimpleReloadLib](https://github.com/Ghost-chu/SimpleReloadLib)
* [AtlantaFx](https://github.com/mkpaz/atlantafx)
* [FXThemes](https://github.com/dukke/FXThemes)
* [PreferencesFX](https://github.com/dlsc-software-consulting-gmbh/PreferencesFX)

### WebUI
* [Vue](https://vuejs.org/)
* [ArcoDesign](https://arco.design/)
* [ECharts](https://echarts.apache.org/en/index.html)
2 changes: 1 addition & 1 deletion pkg/deb/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: peerbanhelper
Version: <version>
Depends: java-runtime (>=21)
Depends: java-runtime (>=21),libc6
Section: universe/net
Priority: optional
Architecture: all
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.ghostchu.peerbanhelper</groupId>
<artifactId>peerbanhelper</artifactId>
<version>6.2.7</version>
<version>6.2.8</version>
<packaging>takari-jar</packaging>

<name>PeerBanHelper</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ private void watchDogHungry() {
* 启动新的一轮封禁序列
*/
public void banWave() {
rollbarErrorReporter.handleUncaughtErrors();
try {
if (!banWaveLock.tryLock(3, TimeUnit.SECONDS)) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

import static com.ghostchu.peerbanhelper.text.TextManager.tlUI;

Expand Down Expand Up @@ -161,7 +162,7 @@ public List<Torrent> getTorrents() {
}
return qbTorrent.stream().map(t -> (Torrent) t)
.filter(t-> !config.isIgnorePrivate() || !t.isPrivate())
.toList();
.collect(Collectors.toList());
}

protected void fillTorrentPrivateField(List<QBittorrentTorrent> qbTorrent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private void reloadConfig() {
bannedAddress = bannedAddress.toPrefixBlock(ipv6Prefix);
}
if (bannedAddress.contains(peerAddress)) {
return new CheckResult(getClass(), PeerAction.BAN, banDuration, new TranslationComponent(addressType), new TranslationComponent(Lang.ARB_BANNED, peerAddress.toString(), bannedPeer.getAddress().toString(), addressType));
return new CheckResult(getClass(), PeerAction.BAN, banDuration, new TranslationComponent(addressType), new TranslationComponent(Lang.ARB_BANNED, peerAddress.toString(), bannedPeer.getAddress().toString(), bannedAddress.toString(), addressType));
}
}
return pass();
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/ghostchu/peerbanhelper/wrapper/PeerAddress.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;
import java.util.Objects;

@Data
@AllArgsConstructor
Expand Down Expand Up @@ -42,6 +43,19 @@ public String toString() {
'}';
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PeerAddress that = (PeerAddress) o;
return port == that.port && Objects.equals(ip, that.ip);
}

@Override
public int hashCode() {
return Objects.hash(ip, port);
}

@Override
public int compareTo(PeerAddress o) {
int r = ip.compareTo(o.ip);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/lang/messages_fallback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ DOWNLOADER_TR_INCOMPATIBILITY_BANAPI: "当前版本存在封禁 API 的已知问
ERR_CONFIG_DIRECTORY_INCORRECT: "初始化失败:config 不是一个目录。如果您正在使用 Docker,请确保其正确挂载。"
GUI_MENU_OPEN_DATA_DIRECTORY: "打开数据文件存储位置..."
PBH_SHUTTING_DOWN: "[退出] 正在退出,请等待我们完成剩余的工作……"
ARB_BANNED: "IP 地址 {} 与另一个已封禁的 IP 地址 {} 处于同一封禁区间内,执行连锁封禁操作。"
ARB_BANNED: "IP 地址 {} 与另一个已封禁的 IP 地址 {} 处于同一封禁区间 {} 内,执行连锁封禁操作。"
DATABASE_SETUP_FAILED: "[错误] 数据库初始化失败"
DATABASE_SAVE_BUFFER_FAILED: "[错误] 刷写内存缓存的封禁日志时出现了 SQL 错误,未保存的数据已被丢弃"
WEB_BANLOGS_INTERNAL_ERROR: "[错误] 读取封禁日志时遇到非预期错误"
Expand Down
10 changes: 5 additions & 5 deletions webui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"@types/mockjs": "^1.0.10",
"@types/node": "^22.5.5",
"@types/uuid": "^10.0.0",
"@typescript-eslint/parser": "^8.5.0",
"@vitejs/plugin-vue": "^5.1.3",
"@typescript-eslint/parser": "^8.6.0",
"@vitejs/plugin-vue": "^5.1.4",
"@vue/tsconfig": "^0.5.1",
"eslint": "^9.10.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -57,9 +57,9 @@
"npm-run-all2": "^6.2.3",
"prettier": "^3.3.3",
"typescript": "~5.6.2",
"typescript-eslint": "^8.5.0",
"vite": "^5.4.5",
"vite-bundle-analyzer": "^0.10.6",
"typescript-eslint": "^8.6.0",
"vite": "^5.4.6",
"vite-bundle-analyzer": "^0.11.1",
"vite-plugin-node-polyfills": "^0.22.0",
"vite-plugin-vue-devtools": "^7.4.5",
"vue-eslint-parser": "^9.4.3",
Expand Down
Loading

0 comments on commit 429d18e

Please sign in to comment.