Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into fixTorrentSize
Browse files Browse the repository at this point in the history
  • Loading branch information
paulzzh committed Nov 20, 2024
2 parents af27196 + ea12830 commit 0b20a9e
Show file tree
Hide file tree
Showing 48 changed files with 654 additions and 564 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/jvm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
password: ${{ secrets.DOCKER_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5.5.1
uses: docker/metadata-action@v5.6.1
with:
images: ghostchu/peerbanhelper-snapshot
tags: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jvm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
password: ${{ secrets.DOCKER_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5.5.1
uses: docker/metadata-action@v5.6.1
with:
images: ghostchu/peerbanhelper
tags: |
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
password: ${{ secrets.ALIYUN_ACR_PASSWORD }}
- name: Extract metadata (tags, labels) for Aliyun ACR
id: meta-acr
uses: docker/metadata-action@v5.5.1
uses: docker/metadata-action@v5.6.1
with:
images: registry.cn-hangzhou.aliyuncs.com/ghostchu/peerbanhelper
tags: |
Expand Down
7 changes: 5 additions & 2 deletions README.EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ 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
3 changes: 2 additions & 1 deletion pkg/deb/DEBIAN/conffiles
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/etc/peerbanhelper/data/config.yml
/etc/peerbanhelper/config.yml
/etc/peerbanhelper/profile.yml
3 changes: 2 additions & 1 deletion pkg/deb/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Package: peerbanhelper
Version: <version>
Depends: java-runtime (>=21),libc6
Pre-Depends: adduser
Depends: java-runtime (>=21), libc6
Section: universe/net
Priority: optional
Architecture: all
Expand Down
1 change: 0 additions & 1 deletion pkg/deb/DEBIAN/dirs

This file was deleted.

15 changes: 10 additions & 5 deletions pkg/deb/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/sh
USER=peerbanhelper
adduser --system $USER
mkdir -p /etc/peerbanhelper
chown $USER /etc/peerbanhelper
#!/bin/sh -e

getent passwd peerbanhelper > /dev/null || adduser --quiet --system --group --home /var/lib/peerbanhelper peerbanhelper
chown -R peerbanhelper: /etc/peerbanhelper
chown -R root: /usr/lib/peerbanhelper
mkdir /var/log/peerbanhelper
chown peerbanhelper: /var/log/peerbanhelper

systemctl daemon-reload
systemctl start peerbanhelper.service
3 changes: 3 additions & 0 deletions pkg/deb/DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh -e

[ $1 = purge ] && deluser --quiet peerbanhelper && rm -rf /var/lib/peerbanhelper || true
12 changes: 12 additions & 0 deletions pkg/deb/DEBIAN/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh -e

# migrate <= 7.1.2
if getent passwd peerbanhelper | grep --quiet /nonexistent; then
deluser --quiet peerbanhelper
adduser --quiet --system --group --home /var/lib/peerbanhelper peerbanhelper
chown -R peerbanhelper: /etc/peerbanhelper
mv /etc/peerbanhelper/config/config.yml /etc/peerbanhelper/config/profile.yml /etc/peerbanhelper
rm -rf /etc/peerbanhelper/config /etc/peerbanhelper/data
mv /etc/peerbanhelper/logs /var/log/peerbanhelper
find /etc/peerbanhelper -mindepth 1 -maxdepth 1 -type d -exec mv {} /var/lib/peerbanhelper \;
fi
4 changes: 4 additions & 0 deletions pkg/deb/DEBIAN/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh -e

systemctl daemon-reload
systemctl stop peerbanhelper.service
File renamed without changes.
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 Expand Up @@ -414,4 +413,4 @@ module:
traffic-monitoring:
# 每日阈值 - 设置为 -1 以禁用,单位:bytes
# Daily threshold, set to -1 to disable, Unit: bytes
daily: -1
daily: -1
9 changes: 6 additions & 3 deletions pkg/deb/usr/lib/systemd/system/peerbanhelper.service
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[Unit]
Description=PeerBanHelper Service
After=network.target

[Service]
User=peerbanhelper
WorkingDirectory=/etc/peerbanhelper
ExecStart=/usr/bin/java -Dpbh.release=debian -Dpbh.datadir=/etc/peerbanhelper -Xmx512M -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps -jar /usr/lib/peerbanhelper/PeerBanHelper.jar
WorkingDirectory=/usr/lib/peerbanhelper
ExecStart=/usr/bin/java -Dpbh.release=debian -Dpbh.datadir=/var/lib/peerbanhelper -Dpbh.configdir=/etc/peerbanhelper -Dpbh.logsdir=/var/log/peerbanhelper -Dpbh.log.level=WARN -Xmx512M -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps -jar PeerBanHelper.jar
SuccessExitStatus=143
AmbientCapabilities=CAP_NET_ADMIN
Restart=on-failure
StandardOutput=null

[Install]
WantedBy=multi-user.target
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<version>1.18.36</version>
</path>
</annotationProcessorPaths>
</configuration>
Expand Down Expand Up @@ -266,7 +266,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<version>1.18.36</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
Expand Down Expand Up @@ -310,7 +310,7 @@
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>6.1.0</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>com.github.mizosoft.methanol</groupId>
Expand Down Expand Up @@ -366,7 +366,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>6.1.14</version>
<version>6.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.j256.ormlite/ormlite-core -->
<dependency>
Expand Down Expand Up @@ -488,7 +488,7 @@
<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf-extras</artifactId>
<version>3.0</version>
<version>3.5.2</version>
</dependency>
</dependencies>

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
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
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
12 changes: 12 additions & 0 deletions src/main/resources/profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,18 @@ 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
cloudflare-ipv4:
enabled: false
name: Cloudflare IPV4
url: https://www.cloudflare.com/ips-v4
cloudflare-ipv6:
enabled: false
name: Cloudflare IPV6
url: https://www.cloudflare.com/ips-v6
# 主动监测 - Active Monitoring
# 此功能允许 PeerBanHelper 主动记录每次请求下载器时获取到的数据到本地 SQLite 数据库中
# Allow PBH records all data that fetched from downloader and save them into SQLite database
Expand Down
4 changes: 2 additions & 2 deletions webui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pbh-fe",
"version": "2.4.1",
"version": "2.4.2",
"private": true,
"type": "module",
"scripts": {
Expand Down Expand Up @@ -55,7 +55,7 @@
"@typescript-eslint/parser": "^8.14.0",
"@vitejs/plugin-vue": "^5.2.0",
"@vue/tsconfig": "^0.6.0",
"eslint": "v9.14.0",
"eslint": "9.15.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-vue": "^9.31.0",
"husky": "^9.1.6",
Expand Down
Loading

0 comments on commit 0b20a9e

Please sign in to comment.