diff --git a/.github/workflows/jvm-ci.yml b/.github/workflows/jvm-ci.yml index 65c177d1fd..c70c7556b0 100644 --- a/.github/workflows/jvm-ci.yml +++ b/.github/workflows/jvm-ci.yml @@ -81,7 +81,7 @@ jobs: calculatedSha=$(git rev-parse --short ${{ github.sha }}) echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV - name: Run build script - run: sudo PBH_VERSION=${{ env.PBH_VERSION }} IMAGE=${{ env.IMAGE }} bash synopkg/build-script.sh + run: sudo PBH_VERSION=${{ env.PBH_VERSION }} IMAGE=${{ env.IMAGE }} bash pkg/synopkg/build-script.sh env: PBH_VERSION: ${{ steps.java_info.outputs.project_version }} IMAGE: ghostchu/peerbanhelper-snapshot:sha-${{ env.COMMIT_SHORT_SHA }} @@ -90,4 +90,31 @@ jobs: with: name: synology-spk path: | - /toolkit/build_env/ds.apollolake-7.2/image/packages/*.spk \ No newline at end of file + /toolkit/build_env/ds.apollolake-7.2/image/packages/*.spk + Build_DEB: + needs: CI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - id: get-version + uses: jactions/maven-version@v1.2.0 + - uses: actions/download-artifact@v4 + with: + name: maven-dist + path: target/ + - name: Build Deb package + id: build-deb + run: | + calculatedSha=$(git rev-parse --short ${{ github.sha }}) + echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV + sed -i "s//${{ env.PBH_VERSION }}-$calculatedSha/g" pkg/deb/DEBIAN/control + cp target/PeerBanHelper.jar pkg/deb/usr/lib/peerbanhelper + dpkg -b pkg/deb peerbanhelper.${{ env.PBH_VERSION }}_$calculatedSha.deb + env: + PBH_VERSION: ${{ steps.get-version.outputs.version }} + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: deb + path: | + peerbanhelper*.deb \ No newline at end of file diff --git a/.github/workflows/jvm-release.yml b/.github/workflows/jvm-release.yml index 24c4288693..9cf048fe57 100644 --- a/.github/workflows/jvm-release.yml +++ b/.github/workflows/jvm-release.yml @@ -173,7 +173,7 @@ jobs: calculatedSha=$(git rev-parse --short ${{ github.sha }}) echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV - name: Run build script - run: sudo PBH_VERSION=${{ env.PBH_VERSION }} IMAGE=${{ env.IMAGE }} bash synopkg/build-script.sh + run: sudo PBH_VERSION=${{ env.PBH_VERSION }} IMAGE=${{ env.IMAGE }} bash pkg/synopkg/build-script.sh env: PBH_VERSION: ${{ steps.java_info.outputs.project_version }} IMAGE: ghostchu/peerbanhelper-snapshot:sha-${{ env.COMMIT_SHORT_SHA }} @@ -188,4 +188,40 @@ jobs: GITHUB_TOKEN: ${{ github.token }} with: asset_paths: '["/toolkit/build_env/ds.apollolake-7.2/image/packages/*.spk"]' - id: project \ No newline at end of file + id: project + Build_DEB: + permissions: + contents: write + checks: write + actions: read + issues: read + packages: write + pull-requests: read + repository-projects: read + statuses: read + needs: Build_Executable + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - id: get-version + uses: jactions/maven-version@v1.2.0 + - uses: actions/download-artifact@v4 + with: + name: maven-dist + path: target/ + - name: Build Deb package + id: build-deb + run: | + calculatedSha=$(git rev-parse --short ${{ github.sha }}) + echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV + sed -i "s//${{ env.PBH_VERSION }}/g" pkg/deb/DEBIAN/control + cp target/PeerBanHelper.jar deb/usr/lib/peerbanhelper + cd pkg && dpkg -b deb peerbanhelper.${{ env.PBH_VERSION }}.deb + env: + PBH_VERSION: ${{ steps.get-version.outputs.version }} + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: deb + path: | + pkg/*.deb \ No newline at end of file diff --git a/install4j/project.install4j b/install4j/project.install4j index 28fcfd4dca..3d0e7dd558 100644 --- a/install4j/project.install4j +++ b/install4j/project.install4j @@ -661,7 +661,6 @@ return console.askYesNo(message, true); - diff --git a/pkg/deb/DEBIAN/conffiles b/pkg/deb/DEBIAN/conffiles new file mode 100644 index 0000000000..24d2d7be5a --- /dev/null +++ b/pkg/deb/DEBIAN/conffiles @@ -0,0 +1 @@ +/etc/peerbanhelper/data/config.yml diff --git a/pkg/deb/DEBIAN/control b/pkg/deb/DEBIAN/control new file mode 100644 index 0000000000..41f8f89107 --- /dev/null +++ b/pkg/deb/DEBIAN/control @@ -0,0 +1,8 @@ +Package: peerbanhelper +Version: +Depends: java-runtime (>=21) +Section: universe/net +Priority: optional +Architecture: all +Maintainer: Ghost_chu +Description: PeerBanHelper is a tool to auto ban peers on the bitorrent network diff --git a/pkg/deb/DEBIAN/dirs b/pkg/deb/DEBIAN/dirs new file mode 100644 index 0000000000..7ffedddb9e --- /dev/null +++ b/pkg/deb/DEBIAN/dirs @@ -0,0 +1 @@ +/etc/peerbanhelper \ No newline at end of file diff --git a/pkg/deb/DEBIAN/postinst b/pkg/deb/DEBIAN/postinst new file mode 100755 index 0000000000..ec1833a9bb --- /dev/null +++ b/pkg/deb/DEBIAN/postinst @@ -0,0 +1,5 @@ +#!/bin/sh +USER=peerbanhelper +adduser --system $USER +mkdir -p /etc/peerbanhelper +chown $USER /etc/peerbanhelper \ No newline at end of file diff --git a/pkg/deb/etc/peerbanhelper/data/config.yml b/pkg/deb/etc/peerbanhelper/data/config.yml new file mode 100644 index 0000000000..d315cb6dd4 --- /dev/null +++ b/pkg/deb/etc/peerbanhelper/data/config.yml @@ -0,0 +1,161 @@ +config-version: 19 +# 设置程序语言 +# Set the program language +# default 跟随操作系统 (Follow the operating system) +# en_us English (US) +# zh_cn Chinese Simplified (简体中文) +language: default +# PBH Plus 捐赠密钥 (https://afdian.com/a/Ghost_chu),如果你有的话,就填在这里吧 +# PBH Plus donation key, if you have one, please fill to there +pbh-plus-key: '' +# Http 服务器设置 +# Http Server Settings +server: + # WebUI 监听端口 + # WebUI listen port + http: 9898 + # WebUI 监听地址,如果需要从非本机访问,请修改为 0.0.0.0,本机部署建议使用 127.0.0.1 提高安全性 + # WebUI listen address, if you need access from non-localhost location, change it to 0.0.0.0. Locally deploy use 127.0.0.1 is recommended. + address: "0.0.0.0" + # 在 PBH 需要给下载器传递地址时,将使用此地址传递,请确保此地址最终可被下载器访问,请【不要】以 / 结尾 + # When PBH need pass the URL of blocklist to downloader, it will use this address as prefix, make sure this URL can be access from your downloader. DO NOT end with slash (/) + prefix: "http://127.0.0.1:9898" + # 要访问 WebUI 端点,则需要 Token。如果这里为空,PBH 在启用时将进入 OOBE 向导,指导您进行基本配置 + # To access the WebUI endpoint, token is required. If there is empty string, OOBE will start to guide you set it. + token: "" + # 允许 CORS 跨站,仅在使用外部 PBH WebUI 时才应该启用 + # Allow CORS, should be enabled when you use external WebUI only. + allow-cors: false +# 日志记录器配置 +# Logger configurer +logger: + # 是否隐藏 [完成] 已检查 XX 的 X 个活跃 Torrent 和 X 个对等体 的日志消息? + # 在 DSM 的 ContainerManager 上有助于大幅度减少日志数量,并仅记录有价值的封禁等日志条目 + # Do you want hide [Completed] spam logs? Can be enabled on DSM to avoid too many logs. + hide-finish-log: false +lookup: + # 启用 DNS 反查,能够通过 IP 反查域名,但可能增加你所使用 DNS 服务器的压力,并可能导致 DNS 服务器对你采取降低服务质量的措施 + # Enable reverse DNS lookup for IPs, however it will increase your DNS server payload, and DNS server may block your access if too many quires sent to them server. + dns-reverse-lookup: false +# 封禁列表持久化配置项 +# Data persist +persist: + # 您希望封禁日志保存多少天? + # How many days that banlogs should be keep in database? + ban-logs-keep-days: 180 + # 您是否想要持久化保存封禁列表?如果不持久化,重启 PBH 将重置封禁列表。 + # Do you want persist the banlist? If you disable it, PBH will reset the banlist when you restarting it. + banlist: true +# BitTorrent Threat Network 威胁防护网络(测试版) +# BitTorrent Threat Network (BETA) +btn: + # 启用 BTN 模块 + # 启用后,才可以使用由 BTN 提供的云规则功能 + # 为了隐私起见,此功能需要您手动启用 + # Enable BTN module, all settings below will only take effects if you turn this on. + enabled: false + # 启用数据提交 + # BTN 网络基于所有启用此功能的用户提交的数据,对 Peers 进行可信度验证 + # 通过启用此选项,您也会加入 BTN 网络并提交您的 Torrent 上的活动 + # 以下信息将被发送到 BTN 实例; + # 您的 Torrent 列表(包括:Torrent 种子摘要的二次不可逆哈希和 Torrent 大小) + # 连接到您的 Torrent 的所有 Peers (包括:IP地址、端口号、PeerID、UserAgent(ClientName),Peer协议,Peer总下载量,Peer总上传量,Peer瞬时上传速度,Peer瞬时下载速度,Peer下载进度,以及您的下载器名称) + # 封禁列表 + # Allow data submitting + # If this option is enabled (and module also enabled), PBH will generate send data to BTN server including: + # Your torrent lists (torrentIdentifier and torrent size, but not include: info hash, name) + # All peers connected to torrents (Including: IP, Port, PeerID, UserAgent, Peer Protocol, Flags, Uploaded, Downloaded, UploadRate, DownloadRate, PeerProgress, YourProgress and Downloader Name) + # Your banlist + submit: true + # 部分 BTN 实例可能要求您登录验证以确认您的身份或下发不同的配置文件。如果是这样的话,您需要在下面输入凭据信息 + # 如果 BTN 实例未要求您登录验证,则通常不需要填写 + # Some BTN instance may require your authentication, if so, you can fill the credentials here + app-id: "example-app-id" + app-secret: "example-app-secret" + # 填写实例 URL,您需要自行寻找一个 BTN 实例服务器 + # 默认使用 PBH-BTN 社区 BTN 服务器,请前往 https://btn-prod.ghostchu-services.top 注册并获取一个账号 + # The BTN instance URL, you need find a BTN instance + # By default, PBH-BTN official BTN instance will be used + config-url: "https://sparkle.ghostchu.com/ping/config" +# 封禁列表处理 +# PBH 能够除了调用 BT 客户端的封禁 API 外,还能够进行如下操作,以便适配更多其它客户端 +# Banlist invoker +# PBH can generate banlist file or execute commands when banning/unbanning peers. +banlist-invoker: + # 生成 ipfilter.dat 文件 + # Generate ipfilter.dat file + ipfilter-dat: + enabled: false + # 执行指定的系统命令 + # 所有的可用占位符都会被注册到执行的命令的进程环境变量中 + # 如果您的命令没有读取环境变量的能力,则也可以使用 {%占位符名%},这样 PBH 会在执行前替换命令中的占位符,但请注意转义问题 + # 可用占位符列表: + # Generate specific system command + # All available placeholders will injected into system env variable, you can use them like in shell + # If your command cannot parse system env variable, you also can use '{%PLACEHOLDER_NAME%}', so PBH will replace it to the placeholder. + # Full list: + #peer.ip - 对等体 IP 地址 - Peer IP Address + #peer.port - 对等体端口 - Peer port + #meta.context - 封禁模块上下文 - BanModule context + #meta.description - 封禁描述 - Ban description + #meta.banAt - 封禁时间 - Ban At + #meta.unbanAt - 解封时间 - Unban At + #meta.peer.id - PeerID + #meta.peer.clientName - UserAgent 客户端名称字符串 - Client Name + #meta.peer.uploaded - 总上传量 - Uploaded + #meta.peer.downloaded - 总下载量 - Downloaded + #meta.peer.progress - 客户端进度 - Peer Progress + #meta.torrent.id - Torrent ID + #meta.torrent.name - Torrent 名称 - Torrent Name + #meta.torrent.hash - Torrent 的 Info Hash - InfoHash (preferred) of Torrent + #meta.torrent.size - Torrent 大小 - Torrent size + command-exec: + enabled: false + reset: + - "/bin/sh -c 'ipset destroy peerbanhelper-blocklist'" + - "/bin/sh -c 'ipset create peerbanhelper-blocklist hash:ip'" + - "/bin/sh -c 'iptables -I INPUT -m set --match-set peerbanhelper-blocklist src -j DROP'" + - "/bin/sh -c 'iptables -A OUTPUT -m set --match-set peerbanhelper-blocklist dst -j DROP'" + ban: + - "/bin/sh -c 'ipset add peerbanhelper-blocklist ${peer.ip}'" + unban: + - "/bin/sh -c 'ipset remove peerbanhelper-blocklist ${peer.ip}'" +# Maxmind GeoIP/ASN 数据库 +# Maxmind GeoIP/ASN database +# https://www.maxmind.com/ +# 在您填写相关密钥信息后,PBH 将自动下载所需的数据库文件,这视为您同意 Maxmind 的最终用户许可协议:https://www.maxmind.com/en/end-user-license-agreement +# After you filled them, PBH will automatically download GeoIP database. EULA: https://www.maxmind.com/en/end-user-license-agreement +ip-database: + # 允许自动更新 Maxmind GeoIP 数据库文件 + # Allow PBH update Maxmind GeoIP database file while restarting if needed + auto-update: true + # ==== 密钥信息结束 ==== + # ==== End of license keys ==== + database-city: 'GeoLite2-City' + database-asn: 'GeoLite2-ASN' +# 代理服务器设定 +# Proxy server settings +proxy: + # 代理服务器设置 Proxy server setting + # 注意:不支持需要密码验证的代理服务器 NOTE: Authentication required proxy servers are not supported + # 0 = 不使用代理 - No proxy + # 1 = 使用系统代理 - Use system proxy + # 2 = 使用 HTTP(s) 代理 - Use HTTP(s) proxy + # 3 = 使用 socks5 代理(可能无法使用) - Use socks5 proxy (may not work well) + setting: 1 + # 代理服务器地址 - Proxy server host + host: "127.0.0.1" + # 代理服务器端口号 - Proxy server port + port: 7890 + # 代理例外地址,使用 | 分隔不同条目 - Exception list, spilt with | symbol + non-proxy-hosts: "localhost|127.*|192.168.*|10.*|172.16.*|172.17.*|172.18.*|172.19.*|172.20.*|172.21.*|172.22.*|172.23.*|172.24.*|172.25.*|172.26.*|172.27.*|172.28.*|172.29.*|172.30.*|172.31.*|*.local|*.lan" +privacy: + # 启用自动错误报告 - Enable automatic error reporting + # 错误报告信息不包含敏感信息或您的 IP 地址 + # Error reports will not contain sensitive information or your IP address. + error-reporting: true +performance: + # 启用 Windows 平台上的 EcoQoS API以节约能源消耗,作为交换,程序运行速度将降低,定时任务可能推迟 + # Enable EcoQoS API on Windows Platform for power saving, for exchange, the program performance will reduce and cronjobs may delay + # https://devblogs.microsoft.com/performance-diagnostics/introducing-ecoqos/ + windows-ecoqos-api: true \ No newline at end of file diff --git a/pkg/deb/etc/peerbanhelper/data/profile.yml b/pkg/deb/etc/peerbanhelper/data/profile.yml new file mode 100644 index 0000000000..a9bc5dc074 --- /dev/null +++ b/pkg/deb/etc/peerbanhelper/data/profile.yml @@ -0,0 +1,405 @@ +config-version: 19 +# Check interval (Timeunit: ms) +# 检查频率(单位:毫秒) +check-interval: 5000 +# 封禁持续时间(单位:毫秒) +# Ban duration (Global) (Timeunit: ms) +ban-duration: 1209600000 +# 来自这些 IP 地址的 Peers 不会被 PBH 检查,绕过所有检查规则 +# Bypass list, all peers comes from those IPs will bypass all checks +ignore-peers-from-addresses: + - "10.0.0.0/8" # 大型企业内部网络 + - "172.16.0.0/12" # 中型企业内部网络 + - "192.168.0.0/16" # 小型企业和家庭内部网络 + - "fc00::/7" # 唯一本地地址 (ULA),用于站点内部通信 + - "fd00::/8" # 本地分配的ULA + - "100.64.0.0/10" # 用于大规模NAT (CGNAT, Carrier-Grade NAT),也常被 Tailscale 使用 + - "169.254.0.0/16" # 链路本地地址 (Link-Local Address) + - "127.0.0.0/8" # 本地回环地址 + - "fe80::/10" # 链路本地地址 (Link-Local Address),用于局部链路通信 +# 功能模块 +# Feature Modules +module: + # PeerId 封禁 + # 此模块对 Transmission 不起效 + # PeerID blacklist + # The module may not work well with Transmission + peer-id-blacklist: + enabled: true + # 封禁时间,单位:毫秒,使用 default 则跟随全局设置 + # BanDuration, Timeunit: ms, use `default` to fallback to global settings + ban-duration: 259200000 + # method = 匹配方式 - Match Method + # + STARTS_WITH = 匹配开头 - Match the starts + # + ENDS_WITH = 匹配结尾 - Match the ends + # + LENGTH = 匹配字符串长度 - Match the string length + # + 支持的额外字段 - Other supported fields + # * min = 最小长度 - Min length + # * max = 最大长度 - Max length + # + CONTAINS = 匹配包含 - Match the contains + # + EQUALS = 匹配相同 - Match the equals + # + REGEX = 匹配正则表达式(大小写敏感) - Match the regex (case-sensitive) + # content = 匹配的内容(除正则外忽略大小写) - The content will be matched + # if = 表达式控制器,当 if 的表达式为 true 时,则检查此规则;否则此规则被忽略。 # if controller, `0` or `false` will skip this rule + # + if 表达式可以为 true/false, 1/0 或者一个嵌套的规则 # the return result can be `true` or `false` and `0` or `1` + # hit = 匹配成功返回的行为代码 # the behavior if matched + # + TRUE = 在 if 中代表 true,在规则中代表 BAN(封禁) # true in if controller, BAN in rule + # + FALSE = 在 if 中代表 false,在规则中代表 SKIP(排除) # false in if controller, SKIP in rule + # + DEFAULT = 在 if 中代表 true,在规则中代表 NO_ACTION(默认行为) # true in if controller, NO_ACTION in rule + # miss = 匹配失败返回的行为代码(与上相同) # the behavior if match failed, same as above + # 规则从上到下执行 + banned-peer-id: + - '{"method":"STARTS_WITH","content":"-xl"}' + - '{"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"}' + - '{"method":"STARTS_WITH","content":"-qd"}' + - '{"method":"STARTS_WITH","content":"-bn"}' + - '{"method":"STARTS_WITH","content":"-dl"}' + - '{"method":"STARTS_WITH","content":"-ts"}' + - '{"method":"STARTS_WITH","content":"-fg"}' + - '{"method":"STARTS_WITH","content":"-tt"}' + - '{"method":"STARTS_WITH","content":"-nx"}' + - '{"method":"CONTAINS","content":"cacao"}' + + # 客户端名称封禁 + # ClientName blacklist + client-name-blacklist: + enabled: true + ban-duration: 259200000 + banned-client-name: + - '{"method":"CONTAINS","content":"xunlei"}' + - '{"method":"STARTS_WITH","content":"-xl"}' + - '{"method":"STARTS_WITH","content":"hp/torrent"}' + - '{"method":"STARTS_WITH","content":"hp "}' + - '{"method":"STARTS_WITH","content":"dt/torrent"}' + - '{"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"}' + - '{"method":"STARTS_WITH","content":"xfplay"}' + - '{"method":"CONTAINS","content":"StellarPlayer"}' + - '{"method":"CONTAINS","content":"SP "}' # 不要删除尾随空格 + - '{"method":"CONTAINS","content":"flashget"}' + - '{"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 + # 注:有时这会错误的封禁部分启用“超级做种”的客户端。但在大多数情况下,此模块能够有效阻止循环下载的流量消耗器,建议启用。 + # Note: Sometimes it may incorrect ban some clients if they enabled "Super Seeding", but in most cases, it can accurately detect the cheat/bad peers. + progress-cheat-blocker: + enabled: true + # Torrent 小于此值不进行检查(单位:字节),对等体可能来不及同步正确的下载进度 + # Skip the check if torrent smaller than this value, unit: bytes, peer may have to no chance to sync the progress + minimum-size: 50000000 + # 最大差值,单位百分比(1.0 = 100% 0.5=50%); Max difference, float percentage (1.0=100%, 0.5=50%) + # PeerBanHelper 根据 BT 客户端记录的向此对等体实际上传的字节数,计算该对等体的最小下载进度 + # PeerBanHelper will use BT client recorded data to check the actual uploaded bytes, and calculate minimal progress that this peer should have + # 并与对等体汇报给 BT 客户端下载进度进行比较 + # and compare with peer reported progress + # 如果对等体汇报的总体下载进度远远低于我们上传给此对等体的数据量的比例,我们应考虑客户端正在汇报假进度 + # If peer reported progress is smaller than our calculated progress too much, we will consider it's cheating + # 默认值为:10% + # Default allowed percentage is 10% + # 即:假设我们上传了 50% 的数据量给对方,对方汇报自己的下载进度只有 39%,差值大于 10%,进行封禁 + # It will run like: if we uploaded 50% of data at least to peer, but peer reporting it only have 39%, difference ge 10%, we will ban it + # 对于自动识别迅雷、QQ旋风的变种非常有效,能够在不更新规则的情况下自动封禁报假进度的吸血客户端 + # It works well on detecting new various and cheat clients. + maximum-difference: 0.1 + # 进度倒退检测 - Progress rewind detection + # 默认:最多允许倒退 7% 的进度 - Default: Up to 7% rewind is allowed + # (考虑到有时文件片段在传输时可能因损坏而未通过校验被丢弃,我们允许客户端出现合理的进度倒退) + # (Sometimes the pisces may break during transfer, client may drop those pisces, we allow client have rewind in reasonable range) + # 设置为 -1 以禁用此检测 + # Set to -1 for disabling + rewind-maximum-difference: 0.07 + # 过量下载:禁止那些在同一个种子的累计下载量超过种子本身大小的客户端 + # Excessive download - Block peers that download even more bytes on a single torrent than the torrent itself + # 此模块对 Transmission 不起效 + # Not working with Transmission + block-excessive-clients: true + # 过量下载计算阈值 + # Calculation threshold + # 计算方式是: 是否过量下载 = 上传总大小 > (种子总大小 * excessive-threshold) + # IsExcessive = uploaded > (torrent_size * excessive-threshold) + excessive-threshold: 1.5 + # IPV4 前缀长度,前缀相同的 IP 都被视为同一个用户 + # IPV4 prefix length, same prefix will trick as a same user + # 32 = 单个 IP 地址,IPV4 资源宝贵,通常 ISP 不会分配多个 IP 地址 + # 32 = Single IP address, ISP usually only allocate single IPV4 for one user + ipv4-prefix-length: 32 + # IPV6 前缀长度,前缀相同的 IP 都被视为同一个用户 + # IPV6 prefix length, same prefix will trick as a same user + # 64 = 常见的 ISP 为单个接入用户分配的前缀长度 + # 64 = The common prefix length that ISP allocate for one user + ipv6-prefix-length: 60 + ban-duration: 2592000000 + # 启用持久化记录 + # Enable persist recording + # 启用此功能可能增加磁盘 I/O 并可能影响性能 + # May increase disk I/O and impact the performance + enable-persist: true + # 持久化数据存储时长 + # Persist duration + # 延长此值可缓解针对 PeerBanHelper 的 “缓慢失忆攻击”,但会增加磁盘 I/O 并影响性能 + # Increase this value can alleviate "Slow forgetting attack", This helps stop bad peers from taking advantage of this weakness to reset their data records. + # 缩短此值可提高性能但吸血者者可能利用这一点进行 “缓慢失忆攻击” + # Decrease this value may lead to "Slow forgetting attack" + # 单位:ms 默认值:1209600000 (14 天) + # Time unit: ms, default: 1209600000 (14 days) + persist-duration: 1209600000 + # 封禁前最长等待时间 + # Max duration before ban + # 有时由于下载器网络原因,Peer 可能无法及时同步其进度信息 + # Sometimes due the network issue, the peer may cannot sync the progress information on time + # 当 Peer 达到封禁阈值后开始计时,如果 Peer 未在给定时间内更新自己的进度到正常水平,则将被封禁 + # When a Peer reached ban condition, the timer will start and Peer will be banned after timer timed out if Peer's progress not update to excepted value on time + # 注意:这不适用于进度回退和过量下载 + # Note: This not suitable for progress rewind or over-download + max-wait-duration: 30000 + # 快速 PCB 测试启动阈值 + # Fast PCB testing start threshold + # 此选项将允许 PCB 在 Peer 下载指定量的数据后,将其短暂的封禁一段时间以便断开其连接 + # This option will allow PCB ban the Peer from downloader for disconnect it + # 这有助于快速预热进度重置检查 + # Can heat up progress reset check quickly + # 设置为 -1 以禁用 + # Set to -1 for disable it + # 百分比为浮点百分比,0.5=50%; 1.0 = 100% + # Percentage in float, 0.5=50%; 1.0 = 100% + fast-pcb-test-percentage: 0.1 + # 快速 PCB 测试断开连接持续时间 + # The disconnect duration for fast PCB test + # 更长的时间更容易使得恶意吸血者的临时记录从 LRU 缓存中逐出,以便 PBH 识别它;但也会影响正常下载者的速度和体验 + # The longer time can lead cheaters temp records be invalid and remove from LRU cache, then PBH can detect it; but it can also affect the normal peers speed and experience + # 时间单位(Time Unit): 毫秒(ms) + fast-pcb-test-block-duration: 15000 + # IP 地址/端口 封禁 + # IP address/port blacklist + ip-address-blocker: + enabled: true + # 封禁时间,单位:毫秒,使用 default 则跟随全局设置 + ban-duration: 259200000 + # 按 IP 封禁,支持 CIDR,其语法大致如下: + # Banning IP address, support CIDR, syntax example: + # ::/64 + # a:b:c:d::a:b/64 + # a:b:c:d:e:f:1.2.3.4/112 + # 1.2.3.4/16 + # 1.2.255.4/255.255.0.0 + ips: + - "0.0.0.0" + #- 8.8.8.8 + #- 9.9.9.9 + # 按端口封禁 + # Banning ports + ports: + - 0 + #- 2003 + # 按 ASN(自治系统代码)封禁(需要配置 GeoIP-ASN 数据库才能工作!) + # Banning ASN (Require config GeoIP-ASN database) + asns: + - "0" + # - 0 # 网络 ASN 号 + # 按国家或地区封禁(需要配置 GeoIP-City 数据库才能工作!) + # Banning as Country/Region code + regions: + - "0" + # 按城市/区/县封禁 + # 默认使用 Maxmind 名称,如果成功加载 GeoCN 数据库,则对在 GeoCN 数据库中的 IP 地址使用 GeoCN 写法 + # Banning as city name + # Use Maxmind name as default, or use GeoCN name for record exists in GeoCN if GeoCN is loaded + cities: + - "示例海南" + # - ISO_CODE 输入国家或地区的 ISO 代码,大小写敏感,如:CN, UK, TW, HK, JP 等 + # - ISO_CODE Enter the ISO code, case sensitive (E.g. CN, UK, TW, HK, JP, etc.) + # 按网络类型封禁(仅中国大陆地区 IP 地址有效) + # Banning as net type (only works for China Mainland IPs, Require config GeoIP database) + net-type: + # 宽带 + wideband: false + # 基站 + base-station: false + # 政企专线 + government-and-enterprise-line: false + # 业务平台 + business-platform: false + # 骨干网 + backbone-network: false + # IP 专网 + ip-private-network: false + # 网吧 + internet-cafe: false + # 物联网 + iot: false + # 数据中心 + datacenter: false + # 范围 IP 段封禁 + # 在封禁 Peer 后,被封禁的 Peer 所在 IP 地址的指定前缀长度内的其它 IP 地址都将一同封禁 + # Range Ban + # After a peer got banned, other connected peers that in same range with banned peers will also get banned. + auto-range-ban: + # 是否启用 + # Enable? + enabled: true + # 封禁时间,单位:毫秒,使用 default 则跟随全局设置 + ban-duration: 604800000 + # IPV4 前缀长度 + # IPV4 prefix length + ipv4: 30 + # IPV6 前缀长度 + # IPV6 prefix length + ipv6: 60 + # 启用来自 BTN 网络的规则 + # Enable the network rules from BTN server, only works when you configured BTN server in config.yml + btn: + enabled: true + # 封禁时间,单位:毫秒,使用 default 则跟随全局设置 + ban-duration: 259200000 + # 多拨封禁 + # Multi-dialing blocker + multi-dialing-blocker: + enabled: true + # 封禁时间,单位:毫秒,使用 default 则跟随全局设置 + ban-duration: 1296000000 + # IPV4 前缀长度 + # IPV4 prefix length + # IP地址前多少位相同的视为同一个子网,位数越少范围越大,一般不需要修改 + # The same prefix ip addresses will trick as in same subnet, usually don't need changes + subnet-mask-length: 24 + # IPv6 地址前缀长度 + # IPv6 prefix length + subnet-mask-v6-length: 60 + # 容许同一网段下载同一种子的IP数量,正整数 + # 防止DHCP重新分配IP、碰巧有同一小区的用户下载同一种子等导致的误判 + # The allowed maximum amount of ips in same subnet + # To avoid mistake bans that caused by DHCP re-allocated IPs, or multiple users in same city + tolerate-num: 5 + # 缓存持续时间(秒) + # Cache life span + # 所有连接过的peer会记入缓存,DHCP服务会定期重新分配IP,缓存时间过长会导致误杀 + # All connected peers will record into cache, DHCP may re-allocated IPs. + cache-lifespan: 86400 + # 是否追猎 + # Keep hunting + # 如果某IP已判定为多拨,无视缓存时间限制继续搜寻其同伙 + # If a specific IP flagged multi-dialing, should we ignore the caching span and keep searching other IPs in same subnet? + keep-hunting: true + # 追猎持续时间(秒) + # Hunting time + # keep-hunting为true时有效,和cache-lifespan相似,对被猎杀IP的缓存持续时间 + # Only works when keep-hunting enabled, similar as cache-lifespan + keep-hunting-time: 2592000 + # 规则引擎,支持 AviatorScript 语言 - User script, support AviatorScript + # 提供在 PBH 上自行编程编写规则的能力 - Provide programming ability on PBH + expression-engine: + # 规则列表 - Rule lists + # 在 AviatorScript 执行时,PBH 会注入以下环境变量,您可以自由使用它们: + # You can feel free use them in AviatorScript files + # peer - 一个 com.ghostchu.peerbanhelper.peer.Peer 对象,您可以使用这个对象下面的任何属性,这些是您可能用到的: + # peer - an com.ghotchu.peerbanhelper.peer.Peer instance, you can access any property under this object, these is you might will used + # peer.peerAddress.ip - 字符串型 IP 地址 - IP address in String + # peer.peerAddress.port - 整型端口号 - Port in int + # peer.peerAddress.address - IPAddress 对象,可提供高级功能 - IPAddress object + # peer.peerId - 字符串型 PeerID,在不支持的下载器上可能为空字符串,使用 isEmpty 判断 - PeerID in String, may be empty string on not supported downloader, check them with isEmpty + # peer.clientName - 客户端名称,在不支持的下载器上可能为空字符串,使用 isEmpty 判断 - PeerID in String, may be empty string on not supported downloader, check them with isEmpty + # peer.downloadSpeed - 您的下载器从该 Peer 下载数据的速率(bytes) - Download rate from Peer + # peer.uploadSpeed - 您的下载器向该 Peer 上传数据的速率(bytes) - Upload rate to Peer + # peer.downloaded - 您的下载器从该 Peer 下载的数据的累计数据量(bytes),在不支持的下载器上为 -1 - Downloaded bytes from Peer, -1 on not supported downloader + # peer.uploaded - 您的下载器从该 Peer 上传的数据的累计数据量(bytes),在不支持的下载器上为 -1 - Uploaded bytes to Peer, -1 on not supported downloader + # peer.progress - 此 Peer 汇报的自己的下载进度,浮点型数据,0.00=0%,1.00=100% - The percentage that Peer reporting, percent in float + # peer.flags - 由您的下载器汇报的此 Peer 的 Flags 状态,各下载器对其定义可能有所不同, Peer flags + # torrent - 一个 com.ghostchu.peerbanhelper.torrent.Torrent 对象,您可以使用这个对象下面的任何属性 - an com.ghotchu.peerbanhelper.torrent.Torrent instance, you can access any property under this object, these is you might will used + # torrent.id - 在您的下载器内,此 Torrent 的对应内部 ID 标识符 - Torrent Identifier in Downloader internal + # torrent.name - 此 Torrent 的名称 - Torrent name + # torrent.hash - 此 Torrent 的 InfoHash,具体是 v1 还是 v2,由您使用的下载器的偏好而定 - Torrent info hash + # torrent.progress - 您的下载器上,此 Torrent 的任务进度 - Torrent progress on your downloader + # torrent.size - 此 Torrent 的任务大小 - Torrent size + # torrent.rtUploadSpeed - 您的下载器上的此任务的当前上传速率(bytes) - Torrent task upload rate + # torrent.rtDownloadSpeed - 您的下载器上的此任务的当前下载速率(bytes) - Torrent task download rate + # torrent.hashedIdentifier - 此 Torrent 的匿名哈希标识符 - Torrent identifier (generated by PBH for privacy and BTN usage) + # peerbanhelper - PBH 主实例 (Main instance) + # HTTPUtil - 提供脚本对网络的访问能力,但请注意,脚本通常只有 1500ms 的执行时间,网络请求也包含在内 - Util for request network + # JsonUtil - 提供脚本对 JSON 内容的解析能力 - Util for parse Json + # IPAddressUtil - 提供将字符串的 IP/CIDR 转换为 IPAddress 对象的工具 - Util for processing IPAddress + # Main - 启动主类,可用于访问配置文件 - Main instance + # 对于其它的常用函数,语法等,参见 AviatorScript 文档:https://www.yuque.com/boyan-avfmj/aviatorscript/cpow90 + # For more details, check AviatorScript documentation: https://www.yuque.com/boyan-avfmj/aviatorscript/cpow90 + # 规则引擎支持 AviatorScript 的全部能力,您可以自由使用反射或者动态创建特性 + # PBH support full ability, feel free to use reflect or dynamic creating. + # + # 每个规则必须提供一个返回值,PBH 会根据您提供的返回值,决定此 Peer 是否封禁。支持的返回值如下: + # Every single rule must provide a return code, PBH will determine if we need ban this peer, supported return code listed below: + # Boolean: [false=不采取任何操作, true=封禁Peer] - Boolean [false = No action will be taken, true = Peer will be banned] + # Integer: [0=不采取任何操作,1=封禁Peer,2=跳过其它用户规则] - Integer [0 = No action will be taken, 1 = Peer will be banned, 2 = Skip other rules] + # com.ghostchu.peerbanhelper.module.PeerAction: [NO_ACTION, BAN, SKIP] + # com.ghostchu.peerbanhelper.module.BanResult + # + # 所有的脚本文件默认放置在 data/scripts 目录内,您也可以修改已有的、或者新建新的脚本文件 + # All script files will put in data/scripts, you can modify exists scripts or create your own scripts/ + # 是否启用 + enabled: true + # 封禁时间,单位:毫秒,使用 default 则跟随全局设置 + ban-duration: default + # 订阅规则 + # Rules Subscription + # 建议在 WebUI 上配置 + # Recommended configure this module on WebUI + ip-address-blocker-rules: + enabled: true + # 封禁时间,单位:毫秒,使用 default 则跟随全局设置 + ban-duration: 259200000 + # 检查间隔 + check-interval: 14400000 # 4小时检查一次 毫秒; Timeunit: ms + # 规则列表 - Rules list + rules: + # 规则ID(任意) - Rule Id(any) + all-in-one: + # 是否启用 - Enable? + enabled: true + # 显示名称 - Display Name + name: all-in-one + # 规则文件订阅地址 - Subscription Address + url: https://bcr.pbh-btn.ghorg.ghostchu-services.top/combine/all.txt + # 主动监测 - Active Monitoring + # 此功能允许 PeerBanHelper 主动记录每次请求下载器时获取到的数据到本地 SQLite 数据库中 + # Allow PBH records all data that fetched from downloader and save them into SQLite database + # 其产生的数据可被其它模块调用(如:生成图表报表等) + # The data produced by this module can be re-used by other modules + # 注意:使用 SD 卡或者 EMMC 的设备【不建议】开启此功能,此功能对于存储设备的读写压力较高,可能加快 Flash 存储芯片磨损或导致存储设备过热 + # NOTE: It is not recommended to enable this module if PBH running on SDCard or EMMC Flash chip. + # 另请注意:此功能可能还会导致本地数据库文件大小快速变大,不建议在存储空间不充足的存储设备上使用此功能 + # NOTE: This may lead database size increase quickly + active-monitoring: + # 是否启用此功能 + enabled: true + # 清理周期 + # Retention time + # 请注意:由于 SQLite 的特性,记录被删除后不会释放磁盘空间,但后续新数据记录会重新利用此部分空间 + # Note: Deleted records won't free the disk space, but new data will reuse those parts of space due SQLite internal design + # 因此请选择一个合理的记录周期 + # 时间单位:ms;默认值:5184000000 (60 天) ; default: (60 days) + data-retention-time: 5184000000 + # 清理检查周期 + # Cleanup check interval + # 每 interval 毫秒后,将进行一次数据清理任务 + # Period of cleanup task will be run + # 建议不要设置的太频繁,SQLite 是单线程数据库,无法同时执行多个 SQL 查询,慢查询可能导致 PBH 数据写入延迟/耗尽运行 RAM + # Do not set it run too frequently + # 时间单位:ms;默认值:604800000 (7 天); default: (7 days) + data-cleanup-interval: 604800000 diff --git a/pkg/deb/usr/lib/systemd/system/peerbanhelper.service b/pkg/deb/usr/lib/systemd/system/peerbanhelper.service new file mode 100644 index 0000000000..48fcc528d0 --- /dev/null +++ b/pkg/deb/usr/lib/systemd/system/peerbanhelper.service @@ -0,0 +1,11 @@ +[Unit] +Description=PeerBanHelper Service +After=network.target +[Service] +User=peerbanhelper +WorkingDirectory=/etc/peerbanhelper +ExecStart=/usr/bin/java -Xmx386M -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps -jar /usr/lib/peerbanhelper/PeerBanHelper.jar +Restart=on-failure +[Install] +WantedBy=multi-user.target + diff --git a/synopkg/PeerBanHelperPackage/INFO.sh b/pkg/synopkg/PeerBanHelperPackage/INFO.sh similarity index 100% rename from synopkg/PeerBanHelperPackage/INFO.sh rename to pkg/synopkg/PeerBanHelperPackage/INFO.sh diff --git a/synopkg/PeerBanHelperPackage/LICENSE b/pkg/synopkg/PeerBanHelperPackage/LICENSE similarity index 100% rename from synopkg/PeerBanHelperPackage/LICENSE rename to pkg/synopkg/PeerBanHelperPackage/LICENSE diff --git a/synopkg/PeerBanHelperPackage/PACKAGE_ICON.PNG b/pkg/synopkg/PeerBanHelperPackage/PACKAGE_ICON.PNG similarity index 100% rename from synopkg/PeerBanHelperPackage/PACKAGE_ICON.PNG rename to pkg/synopkg/PeerBanHelperPackage/PACKAGE_ICON.PNG diff --git a/synopkg/PeerBanHelperPackage/PACKAGE_ICON_256.PNG b/pkg/synopkg/PeerBanHelperPackage/PACKAGE_ICON_256.PNG similarity index 100% rename from synopkg/PeerBanHelperPackage/PACKAGE_ICON_256.PNG rename to pkg/synopkg/PeerBanHelperPackage/PACKAGE_ICON_256.PNG diff --git a/synopkg/PeerBanHelperPackage/README.md b/pkg/synopkg/PeerBanHelperPackage/README.md similarity index 100% rename from synopkg/PeerBanHelperPackage/README.md rename to pkg/synopkg/PeerBanHelperPackage/README.md diff --git a/synopkg/PeerBanHelperPackage/SynoBuildConf/build b/pkg/synopkg/PeerBanHelperPackage/SynoBuildConf/build similarity index 100% rename from synopkg/PeerBanHelperPackage/SynoBuildConf/build rename to pkg/synopkg/PeerBanHelperPackage/SynoBuildConf/build diff --git a/synopkg/PeerBanHelperPackage/SynoBuildConf/depends b/pkg/synopkg/PeerBanHelperPackage/SynoBuildConf/depends similarity index 100% rename from synopkg/PeerBanHelperPackage/SynoBuildConf/depends rename to pkg/synopkg/PeerBanHelperPackage/SynoBuildConf/depends diff --git a/synopkg/PeerBanHelperPackage/SynoBuildConf/install b/pkg/synopkg/PeerBanHelperPackage/SynoBuildConf/install similarity index 100% rename from synopkg/PeerBanHelperPackage/SynoBuildConf/install rename to pkg/synopkg/PeerBanHelperPackage/SynoBuildConf/install diff --git a/synopkg/PeerBanHelperPackage/WIZARD_UIFILES/install_uifile b/pkg/synopkg/PeerBanHelperPackage/WIZARD_UIFILES/install_uifile similarity index 100% rename from synopkg/PeerBanHelperPackage/WIZARD_UIFILES/install_uifile rename to pkg/synopkg/PeerBanHelperPackage/WIZARD_UIFILES/install_uifile diff --git a/synopkg/PeerBanHelperPackage/conf/privilege b/pkg/synopkg/PeerBanHelperPackage/conf/privilege similarity index 100% rename from synopkg/PeerBanHelperPackage/conf/privilege rename to pkg/synopkg/PeerBanHelperPackage/conf/privilege diff --git a/synopkg/PeerBanHelperPackage/conf/resource b/pkg/synopkg/PeerBanHelperPackage/conf/resource similarity index 100% rename from synopkg/PeerBanHelperPackage/conf/resource rename to pkg/synopkg/PeerBanHelperPackage/conf/resource diff --git a/synopkg/PeerBanHelperPackage/etc/installer-variables b/pkg/synopkg/PeerBanHelperPackage/etc/installer-variables similarity index 100% rename from synopkg/PeerBanHelperPackage/etc/installer-variables rename to pkg/synopkg/PeerBanHelperPackage/etc/installer-variables diff --git a/synopkg/PeerBanHelperPackage/scripts/functions b/pkg/synopkg/PeerBanHelperPackage/scripts/functions similarity index 100% rename from synopkg/PeerBanHelperPackage/scripts/functions rename to pkg/synopkg/PeerBanHelperPackage/scripts/functions diff --git a/synopkg/PeerBanHelperPackage/scripts/installer b/pkg/synopkg/PeerBanHelperPackage/scripts/installer similarity index 100% rename from synopkg/PeerBanHelperPackage/scripts/installer rename to pkg/synopkg/PeerBanHelperPackage/scripts/installer diff --git a/synopkg/PeerBanHelperPackage/scripts/postinst b/pkg/synopkg/PeerBanHelperPackage/scripts/postinst similarity index 100% rename from synopkg/PeerBanHelperPackage/scripts/postinst rename to pkg/synopkg/PeerBanHelperPackage/scripts/postinst diff --git a/synopkg/PeerBanHelperPackage/scripts/postuninst b/pkg/synopkg/PeerBanHelperPackage/scripts/postuninst similarity index 100% rename from synopkg/PeerBanHelperPackage/scripts/postuninst rename to pkg/synopkg/PeerBanHelperPackage/scripts/postuninst diff --git a/synopkg/PeerBanHelperPackage/scripts/postupgrade b/pkg/synopkg/PeerBanHelperPackage/scripts/postupgrade similarity index 100% rename from synopkg/PeerBanHelperPackage/scripts/postupgrade rename to pkg/synopkg/PeerBanHelperPackage/scripts/postupgrade diff --git a/synopkg/PeerBanHelperPackage/scripts/preinst b/pkg/synopkg/PeerBanHelperPackage/scripts/preinst similarity index 100% rename from synopkg/PeerBanHelperPackage/scripts/preinst rename to pkg/synopkg/PeerBanHelperPackage/scripts/preinst diff --git a/synopkg/PeerBanHelperPackage/scripts/preuninst b/pkg/synopkg/PeerBanHelperPackage/scripts/preuninst similarity index 100% rename from synopkg/PeerBanHelperPackage/scripts/preuninst rename to pkg/synopkg/PeerBanHelperPackage/scripts/preuninst diff --git a/synopkg/PeerBanHelperPackage/scripts/preupgrade b/pkg/synopkg/PeerBanHelperPackage/scripts/preupgrade similarity index 100% rename from synopkg/PeerBanHelperPackage/scripts/preupgrade rename to pkg/synopkg/PeerBanHelperPackage/scripts/preupgrade diff --git a/synopkg/PeerBanHelperPackage/scripts/service-setup b/pkg/synopkg/PeerBanHelperPackage/scripts/service-setup similarity index 100% rename from synopkg/PeerBanHelperPackage/scripts/service-setup rename to pkg/synopkg/PeerBanHelperPackage/scripts/service-setup diff --git a/synopkg/PeerBanHelperPackage/scripts/start-stop-status b/pkg/synopkg/PeerBanHelperPackage/scripts/start-stop-status similarity index 100% rename from synopkg/PeerBanHelperPackage/scripts/start-stop-status rename to pkg/synopkg/PeerBanHelperPackage/scripts/start-stop-status diff --git a/synopkg/PeerBanHelperPackage/target/app/docker-compose.yaml b/pkg/synopkg/PeerBanHelperPackage/target/app/docker-compose.yaml similarity index 100% rename from synopkg/PeerBanHelperPackage/target/app/docker-compose.yaml rename to pkg/synopkg/PeerBanHelperPackage/target/app/docker-compose.yaml diff --git a/synopkg/PeerBanHelperPackage/target/ui/config b/pkg/synopkg/PeerBanHelperPackage/target/ui/config similarity index 100% rename from synopkg/PeerBanHelperPackage/target/ui/config rename to pkg/synopkg/PeerBanHelperPackage/target/ui/config diff --git a/synopkg/PeerBanHelperPackage/target/ui/images/128.png b/pkg/synopkg/PeerBanHelperPackage/target/ui/images/128.png similarity index 100% rename from synopkg/PeerBanHelperPackage/target/ui/images/128.png rename to pkg/synopkg/PeerBanHelperPackage/target/ui/images/128.png diff --git a/synopkg/PeerBanHelperPackage/target/ui/images/16.png b/pkg/synopkg/PeerBanHelperPackage/target/ui/images/16.png similarity index 100% rename from synopkg/PeerBanHelperPackage/target/ui/images/16.png rename to pkg/synopkg/PeerBanHelperPackage/target/ui/images/16.png diff --git a/synopkg/PeerBanHelperPackage/target/ui/images/24.png b/pkg/synopkg/PeerBanHelperPackage/target/ui/images/24.png similarity index 100% rename from synopkg/PeerBanHelperPackage/target/ui/images/24.png rename to pkg/synopkg/PeerBanHelperPackage/target/ui/images/24.png diff --git a/synopkg/PeerBanHelperPackage/target/ui/images/256.png b/pkg/synopkg/PeerBanHelperPackage/target/ui/images/256.png similarity index 100% rename from synopkg/PeerBanHelperPackage/target/ui/images/256.png rename to pkg/synopkg/PeerBanHelperPackage/target/ui/images/256.png diff --git a/synopkg/PeerBanHelperPackage/target/ui/images/32.png b/pkg/synopkg/PeerBanHelperPackage/target/ui/images/32.png similarity index 100% rename from synopkg/PeerBanHelperPackage/target/ui/images/32.png rename to pkg/synopkg/PeerBanHelperPackage/target/ui/images/32.png diff --git a/synopkg/PeerBanHelperPackage/target/ui/images/48.png b/pkg/synopkg/PeerBanHelperPackage/target/ui/images/48.png similarity index 100% rename from synopkg/PeerBanHelperPackage/target/ui/images/48.png rename to pkg/synopkg/PeerBanHelperPackage/target/ui/images/48.png diff --git a/synopkg/PeerBanHelperPackage/target/ui/images/64.png b/pkg/synopkg/PeerBanHelperPackage/target/ui/images/64.png similarity index 100% rename from synopkg/PeerBanHelperPackage/target/ui/images/64.png rename to pkg/synopkg/PeerBanHelperPackage/target/ui/images/64.png diff --git a/synopkg/PeerBanHelperPackage/target/ui/images/72.png b/pkg/synopkg/PeerBanHelperPackage/target/ui/images/72.png similarity index 100% rename from synopkg/PeerBanHelperPackage/target/ui/images/72.png rename to pkg/synopkg/PeerBanHelperPackage/target/ui/images/72.png diff --git a/synopkg/PeerBanHelperPackage/target/ui/images/96.png b/pkg/synopkg/PeerBanHelperPackage/target/ui/images/96.png similarity index 100% rename from synopkg/PeerBanHelperPackage/target/ui/images/96.png rename to pkg/synopkg/PeerBanHelperPackage/target/ui/images/96.png diff --git a/synopkg/PeerBanHelperPackage/target/ui/texts/cht/strings b/pkg/synopkg/PeerBanHelperPackage/target/ui/texts/cht/strings similarity index 100% rename from synopkg/PeerBanHelperPackage/target/ui/texts/cht/strings rename to pkg/synopkg/PeerBanHelperPackage/target/ui/texts/cht/strings diff --git a/synopkg/PeerBanHelperPackage/target/ui/texts/enu/strings b/pkg/synopkg/PeerBanHelperPackage/target/ui/texts/enu/strings similarity index 100% rename from synopkg/PeerBanHelperPackage/target/ui/texts/enu/strings rename to pkg/synopkg/PeerBanHelperPackage/target/ui/texts/enu/strings diff --git a/synopkg/build-script.sh b/pkg/synopkg/build-script.sh similarity index 100% rename from synopkg/build-script.sh rename to pkg/synopkg/build-script.sh