Skip to content

Commit

Permalink
Merge pull request #777 from PBH-BTN/master
Browse files Browse the repository at this point in the history
v7.1.5
  • Loading branch information
Ghost-chu authored Nov 26, 2024
2 parents d8e39ae + bc95c7d commit 18c1ef3
Show file tree
Hide file tree
Showing 25 changed files with 638 additions and 548 deletions.
31 changes: 17 additions & 14 deletions README.EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Automatically block unwanted, leeches and abnormal BT peers with support for cus

Following function are provided by PeerBanHelper:

- [PeerID Blacklist](https://docs.pbh-btn.com/docs/module/peer-id)
- [Client Name Blacklist](https://docs.pbh-btn.com/docs/module/client-name)
- [IP/GeoIP/IP type Blacklist](https://docs.pbh-btn.com/docs/module/ip-address-blocker)
- [Fake progress checker (heuristic client detection)](https://docs.pbh-btn.com/docs/module/progress-cheat-blocker)
- [Auto range ban](https://docs.pbh-btn.com/docs/module/auto-range-ban)
- [Multi-dail ban](https://docs.pbh-btn.com/docs/module/multi-dial)
- Peer ID/Client Name camouflage check, powered by [AviatorScript Engine](https://docs.pbh-btn.com/docs/module/expression-engine)
- [Active monitoring(data analysis)](https://docs.pbh-btn.com/docs/module/active-monitoring)
- [IP set subscribe](https://docs.pbh-btn.com/docs/module/ip-address-blocker-rules)
- [PeerID Blacklist](https://docs.pbh-btn.com/en/docs/module/peer-id)
- [Client Name Blacklist](https://docs.pbh-btn.com/en/docs/module/client-name)
- [IP/GeoIP/IP type Blacklist](https://docs.pbh-btn.com/en/docs/module/ip-address-blocker)
- [Fake progress checker (heuristic client detection)](https://docs.pbh-btn.com/en/docs/module/progress-cheat-blocker)
- [Auto range ban](https://docs.pbh-btn.com/en/docs/module/auto-range-ban)
- [Multi-dail ban](https://docs.pbh-btn.com/en/docs/module/multi-dial)
- Peer ID/Client Name camouflage check, powered by [AviatorScript Engine](https://docs.pbh-btn.com/en/docs/module/expression-engine)
- [Active monitoring(data analysis)](https://docs.pbh-btn.com/en/docs/module/active-monitoring)
- [IP set subscribe](https://docs.pbh-btn.com/en/docs/module/ip-address-blocker-rules)
- a mordern WebUI

In addition, PeerBanHelper downloads the GeoIP library at startup, and supports the following functions once it successful loaded:
Expand All @@ -25,7 +25,7 @@ In addition, PeerBanHelper downloads the GeoIP library at startup, and supports
- View GeoIP statistics

> [!TIP]
> For best results, it is recommended to work with the IP rule [PBH-BTN/BTN-Collected-Rules](https://github.com/PBH-BTN/BTN-Collected-Rules) and [BTN Network](https://docs.pbh-btn.com/docs/btn/intro) , but this is completely optional.
> For best results, it is recommended to work with the IP rule [PBH-BTN/BTN-Collected-Rules](https://github.com/PBH-BTN/BTN-Collected-Rules) and [BTN Network](https://docs.pbh-btn.com/en/docs/btn/intro) , but this is completely optional.

## Supported clients
Expand All @@ -46,20 +46,23 @@ In addition, PeerBanHelper downloads the GeoIP library at startup, and supports

## Install

Please read the [docs](https://docs.pbh-btn.com/docs/category/%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2)
Please read the [docs](https://docs.pbh-btn.com/en/docs/category/%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2)


## FAQ

Before submit issue, please read the [FAQ](https://docs.pbh-btn.com/docs/faq)
Before submit issue, please read the [FAQ](https://docs.pbh-btn.com/en/docs/faq)

## Support
Consider join our [Telegram](https://t.me/+_t3Nt5GZ6bJmYjBl) group.

## Declaration

Illegal websites and black and grey industries should not initiate any kind of manual service request to our organization's development or support staff; it is strictly prohibited to use any services or products of PBH-BTN team to engage in any illegal activities such as violating the law, endangering national security, committing or helping others to commit telecommunication crimes, and other illegal activities.
Users are not allowed to carry out any activities that harm the interests of other individuals or organizations through any services or products of PBH-BTN Team. The use of any PBH-BTN Team services or products in violation of the rights and interests of any individual or organization is not permitted.
**Using this software means you agree to the following statement:**

Illegal websites and black-grey production, DO NOT initiate any form of manual service requests to our organization's development or support staff; it is strictly forbidden to use any results of the PBH-BTN team (including but not limited to code, images, programs, BTN rule sets, etc.) to engage in any illegal activities such as violating laws and regulations, endangering national security, implementing or assisting others in implementing telecommunications crimes.
Users may not use any results of the PBH-BTN team (including but not limited to code, images, programs, BTN rule sets, etc.) to carry out any activities that harm the interests of other individuals or organizations. The use of any services or products of the PBH-BTN team in any case that violates the rights of individuals or organizations is not allowed.
Any consequences caused by the user's use of this software are borne by the user and have nothing to do with the software developer."

## Star History

Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ PeerBanHelper 主要由以下几个功能模块组成:

## 声明

违法网站和黑灰产请勿向我组织开发或支持人员发起任何形式的人工服务请求;严禁使用 PBH-BTN 团队的任何服务、产品从事任何违法违规、危害国家安全、实施或帮助他人实施电信犯罪等非法活动。
用户不得通过 PBH-BTN 团队的任何服务、产品进行任何损害其它个人或组织的利益的活动。在任何违反个人或组织权益的情况下使用 PBH-BTN 团队的任何服务、产品均不被允许。
**使用本软件意味着你同意以下声明:**

违法网站和黑灰产请勿向我组织开发或支持人员发起任何形式的人工服务请求;严禁使用 PBH-BTN 团队的任何成果(包括但不限于代码,镜像,程序,BTN规则集等)从事任何违法违规、危害国家安全、实施或帮助他人实施电信犯罪等非法活动。
用户不得通过 PBH-BTN 团队的任何成果(包括但不限于代码,镜像,程序,BTN规则集等)进行任何损害其它个人或组织的利益的活动。在任何违反个人或组织权益的情况下使用 PBH-BTN 团队的任何服务、产品均不被允许。
用户使用本软件造成的任何后果,由用户自行承担,与本软件开发者无关。

## Star History

Expand Down
2 changes: 1 addition & 1 deletion install4j/project.install4j
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<executable name="PeerBanHelper-NoGUI" iconSet="true" executableDir="." redirectStderr="false" executableMode="console" singleInstance="true" checkConsoleParameter="true">
<versionInfo include="true" fileDescription="${i18n:peerbanhelper.description}" legalCopyright="PBH-BTN Community - Licensed under GPLv3 licenses. https://www.gnu.org/licenses/quick-guide-gplv3.en.html" internalName="peerbanhelper" />
</executable>
<java mainClass="com.ghostchu.peerbanhelper.MainJumpLoader" vmParameters="-Xmx512M -Xss512k -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps -Dfile.encoding=UTF-8 -Dpbh.usePlatformConfigLocation=true -Dpbh.release=install4j" arguments="nogui">
<java mainClass="com.ghostchu.peerbanhelper.MainJumpLoader" vmParameters="-Xmx512M -Xss512k -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps -Dfile.encoding=UTF-8 -Dpbh.usePlatformConfigLocation=true -Dpbh.release=install4j -Djava.awt.headless=true" arguments="nogui">
<classPath>
<scanDirectory location="libraries" failOnError="false" />
<archive location="PeerBanHelper.jar" failOnError="false" />
Expand Down
9 changes: 4 additions & 5 deletions pkg/deb/etc/peerbanhelper/data/profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ module:
- '{"method":"STARTS_WITH","content":"-hp"}'
- '{"method":"STARTS_WITH","content":"-xm"}'
- '{"method":"STARTS_WITH","content":"-dt"}'
- '{"method":"STARTS_WITH","content":"-gt0002"}'
- '{"method":"STARTS_WITH","content":"-gt0003"}'
- '{"method":"CONTAINS","content":"-rn0.0.0"}'
- '{"method":"STARTS_WITH","content":"-sd"}'
- '{"method":"STARTS_WITH","content":"-xf"}'
Expand All @@ -81,7 +79,6 @@ module:
- '{"method":"STARTS_WITH","content":"dt "}'
- '{"method":"STARTS_WITH","content":"xm/torrent"}'
- '{"method":"STARTS_WITH","content":"xm "}'
- '{"method":"STARTS_WITH","content":"go.torrent"}'
- '{"method":"STARTS_WITH","content":"taipei-torrent"}'
- '{"method":"CONTAINS","content":"rain 0.0.0"}'
- '{"method":"CONTAINS","content":"gopeed dev"}'
Expand All @@ -92,11 +89,9 @@ module:
- '{"method":"CONTAINS","content":"tudou"}'
- '{"method":"CONTAINS","content":"torrentstorm"}'
- '{"method":"CONTAINS","content":"qqdownload"}'
- '{"method":"CONTAINS","content":"anacrolix/torrent"}'
- '{"method":"STARTS_WITH","content":"qbittorrent/3.3.15"}'
- '{"method":"STARTS_WITH","content":"github.com/thank423/trafficconsume"}'
- '{"method":"STARTS_WITH","content":"ޭ__"}' # 0xde-0xad-0xbe-0xef
- '{"method":"STARTS_WITH","content":"ljyun.cn/hangzhou/monitoring"}'
- '{"method":"STARTS_WITH","content":"taipei-torrent"}'
- '{"method":"STARTS_WITH","content":"-XL"}'
# 进度作弊检查器:Progress Cheat Blocker
Expand Down Expand Up @@ -381,6 +376,10 @@ module:
name: all-in-one
# 规则文件订阅地址 - Subscription Address
url: https://bcr.pbh-btn.ghorg.ghostchu-services.top/combine/all.txt
tor-exit-nodes:
enabled: false
name: Tor Exit Nodes
url: https://cdn.jsdelivr.net/gh/platformcosmo/Tor-IP-Addresses/tor-exit-nodes.lst
# 主动监测 - Active Monitoring
# 此功能允许 PeerBanHelper 主动记录每次请求下载器时获取到的数据到本地 SQLite 数据库中
# Allow PBH records all data that fetched from downloader and save them into SQLite database
Expand Down
2 changes: 1 addition & 1 deletion pkg/portable/3) 以控制台模式启动.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off
chcp 65001
title PeerBanHelper
start ./jre/bin/java.exe -Xmx512M -Xss512k -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps -Dpbh.release=portable -Dfile.encoding=UTF-8 -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8 -Dconsole.encoding=UTF-8 -jar PeerBanHelper.jar nogui
start ./jre/bin/java.exe -Xmx512M -Xss512k -XX:+UseG1GC -XX:+UseStringDeduplication -Djava.awt.headless=true -XX:+ShrinkHeapInSteps -Dpbh.release=portable -Dfile.encoding=UTF-8 -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8 -Dconsole.encoding=UTF-8 -jar PeerBanHelper.jar nogui
pause
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>7.1.4</version>
<version>7.1.5</version>
<packaging>jar</packaging>

<name>PeerBanHelper</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public BiglyBT(String name, Config config, AlertManager alertManager) {
.connectTimeout(Duration.of(10, ChronoUnit.SECONDS))
.headersTimeout(Duration.of(10, ChronoUnit.SECONDS))
.readTimeout(Duration.of(30, ChronoUnit.SECONDS))
.requestTimeout(Duration.of(30, ChronoUnit.SECONDS))
.cookieHandler(cm);
if (!config.isVerifySsl() && HTTPUtil.getIgnoreSslContext() != null) {
builder.sslContext(HTTPUtil.getIgnoreSslContext());
Expand Down Expand Up @@ -164,7 +163,7 @@ public List<Torrent> getTorrents() {
}
List<DownloadRecord> torrentDetail = JsonUtil.getGson().fromJson(request.body(), new TypeToken<List<DownloadRecord>>() {
}.getType());
List<Torrent> torrents = new LinkedList<>();
List<Torrent> torrents = new ArrayList<>();
for (DownloadRecord detail : torrentDetail) {
if (config.isIgnorePrivate() && detail.getTorrent().isPrivateTorrent()) {
continue;
Expand Down Expand Up @@ -215,7 +214,7 @@ public List<Peer> getPeers(Torrent torrent) {
throw new IllegalStateException(tlUI(Lang.DOWNLOADER_BIGLYBT_FAILED_REQUEST_PEERS_LIST_IN_TORRENT, resp.statusCode(), resp.body()));
}
PeerManagerRecord peerManagerRecord = JsonUtil.getGson().fromJson(resp.body(), PeerManagerRecord.class);
List<Peer> peersList = new LinkedList<>();
List<Peer> peersList = new ArrayList<>();
for (PeerRecord peer : peerManagerRecord.getPeers()) {
var peerId = new String(ByteUtil.hexToByteArray(peer.getPeerId()), StandardCharsets.ISO_8859_1);
if (peerId.length() > 8) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ public BitComet(String name, Config config, AlertManager alertManager) {
.followRedirects(HttpClient.Redirect.ALWAYS)
.connectTimeout(Duration.of(15, ChronoUnit.SECONDS))
.headersTimeout(Duration.of(15, ChronoUnit.SECONDS))
.readTimeout(Duration.of(30, ChronoUnit.SECONDS))
.requestTimeout(Duration.of(30, ChronoUnit.SECONDS));
.readTimeout(Duration.of(30, ChronoUnit.SECONDS));
if (!config.isVerifySsl() && HTTPUtil.getIgnoreSslContext() != null) {
builder.sslContext(HTTPUtil.getIgnoreSslContext());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ public AbstractQbittorrent(String name, QBittorrentConfig config, AlertManager a
.version(HttpClient.Version.valueOf(config.getHttpVersion()))
.followRedirects(HttpClient.Redirect.ALWAYS)
.connectTimeout(Duration.of(10, ChronoUnit.SECONDS))
.headersTimeout(Duration.of(10, ChronoUnit.SECONDS))
.headersTimeout(Duration.of(30, ChronoUnit.SECONDS))
.readTimeout(Duration.of(30, ChronoUnit.SECONDS))
.requestTimeout(Duration.of(30, ChronoUnit.SECONDS))
.authenticator(new Authenticator() {
@Override
public PasswordAuthentication requestPasswordAuthenticationInstance(String host, InetAddress addr, int port, String protocol, String prompt, String scheme, URL url, RequestorType reqType) {
Expand Down Expand Up @@ -243,7 +242,7 @@ public List<Peer> getPeers(Torrent torrent) {

JsonObject object = JsonParser.parseString(resp.body()).getAsJsonObject();
JsonObject peers = object.getAsJsonObject("peers");
List<Peer> peersList = new LinkedList<>();
List<Peer> peersList = new ArrayList<>();
for (String s : peers.keySet()) {
JsonObject singlePeerObject = peers.getAsJsonObject(s);
QBittorrentPeer qbPeer = JsonUtil.getGson().fromJson(singlePeerObject.toString(), QBittorrentPeer.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public ConsoleGuiImpl(String[] args) {

@Override
public void setup() {
// do nothing
System.setProperty("java.awt.headless", "true");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class ExpressionRule extends AbstractRuleFeatureModule implements Reloada
private final long maxScriptExecuteTime = 1500;
private final JavalinWebContainer javalinWebContainer;
private final ScriptEngine scriptEngine;
private final List<CompiledScript> scripts = Collections.synchronizedList(new LinkedList<>());
private final List<CompiledScript> scripts = Collections.synchronizedList(new ArrayList<>());
private final ScriptStorageDao scriptStorageDao;
private long banDuration;

Expand Down
1 change: 0 additions & 1 deletion src/main/java/cordelia/client/TrClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public TrClient(String url, String user, String password, boolean verifySSL, Htt
.connectTimeout(Duration.of(10, ChronoUnit.SECONDS))
.headersTimeout(Duration.of(10, ChronoUnit.SECONDS))
.readTimeout(Duration.of(15, ChronoUnit.SECONDS))
.requestTimeout(Duration.of(15, ChronoUnit.SECONDS))
.authenticator(new Authenticator() {
@Override
public PasswordAuthentication requestPasswordAuthenticationInstance(String host, InetAddress addr, int port, String protocol, String prompt, String scheme, URL url, RequestorType reqType) {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/raccoonfink/deluge/DelugeServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public DelugeServer(final String url, final String password, boolean verifySSL,
.followRedirects(HttpClient.Redirect.ALWAYS)
.defaultHeader("Accept", "application/json")
.defaultHeader("Content-Type", "application/json")
.requestTimeout(Duration.of(15, ChronoUnit.SECONDS))
.connectTimeout(Duration.of(10, ChronoUnit.SECONDS))
.headersTimeout(Duration.of(10, ChronoUnit.SECONDS))
.readTimeout(Duration.of(15, ChronoUnit.SECONDS))
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@ module:
name: all-in-one
# 规则文件订阅地址 - Subscription Address
url: https://bcr.pbh-btn.ghorg.ghostchu-services.top/combine/all.txt
tor-exit-nodes:
enabled: false
name: Tor Exit Nodes
url: https://cdn.jsdelivr.net/gh/platformcosmo/Tor-IP-Addresses/tor-exit-nodes.lst
# 主动监测 - Active Monitoring
# 此功能允许 PeerBanHelper 主动记录每次请求下载器时获取到的数据到本地 SQLite 数据库中
# Allow PBH records all data that fetched from downloader and save them into SQLite database
Expand Down
22 changes: 11 additions & 11 deletions webui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"normalize.css": "^8.0.1",
"pinia": "^2.2.6",
"url-join": "^5.0.0",
"uuid": "^11.0.2",
"vue": "^3.5.12",
"uuid": "^11.0.3",
"vue": "^3.5.13",
"vue-echarts": "^7.0.3",
"vue-i18n": "^10.0.4",
"vue-request": "^2.0.4",
Expand All @@ -52,24 +52,24 @@
"@types/markdown-it": "^14.1.2",
"@types/node": "^22.9.0",
"@types/uuid": "^10.0.0",
"@typescript-eslint/parser": "^8.13.0",
"@vitejs/plugin-vue": "^5.1.4",
"@vue/tsconfig": "^0.5.1",
"eslint": "^9.14.0",
"@typescript-eslint/parser": "^8.14.0",
"@vitejs/plugin-vue": "^5.2.0",
"@vue/tsconfig": "^0.6.0",
"eslint": "v9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-vue": "^9.30.0",
"eslint-plugin-vue": "^9.31.0",
"husky": "^9.1.6",
"less": "^4.2.0",
"monaco-editor": "^0.52.0",
"npm-run-all2": "^7.0.1",
"prettier": "^3.3.3",
"typescript": "~5.6.3",
"typescript-eslint": "^8.13.0",
"vite": "^5.4.10",
"vite-bundle-analyzer": "^0.13.0",
"typescript-eslint": "^8.14.0",
"vite": "^5.4.11",
"vite-bundle-analyzer": "^0.13.1",
"vite-plugin-node-polyfills": "^0.22.0",
"vite-plugin-remove-console": "^2.2.0",
"vite-plugin-vue-devtools": "^7.6.2",
"vite-plugin-vue-devtools": "^7.6.4",
"vue-eslint-parser": "^9.4.3",
"vue-tsc": "^2.1.10"
},
Expand Down
Loading

0 comments on commit 18c1ef3

Please sign in to comment.