1268 字
6 分钟

Hentai@Home (H@H) 完整部署指南:从注册到 Docker 运行与监控

什么是Hentai@Home#

Hentai@Home(简称 H@H)是 E站e-hentai.org)推出的开源 P2P 图库分发系统,类似于 PC 端 PCDN,用于减轻服务器压力,同时为用户提供带宽奖励和下载能力。通过参与 H@H,你可以:

  • 提供上传带宽给其他用户,提高画廊下载速度
  • 获得奖励点数(Hath、C 点、GP 点),用于购买浏览和下载容量

⚠️ 提示:家用宽带如果带宽不高,跑 H@H 可能会触发运营商限速甚至封禁 IP,不建议在普通家宽上长时间运行。

更详细的介绍可参考:E站 Hentai@Home 客户端研究笔记

使用的项目#

james58899
/
hath-rust
Waiting for api.github.com...
00K
0K
0K
Waiting...

Read the Wiki

运行Hentai@Home能获得什么?#

就像PT站一样,按规则运行即可获得HathC点GP点,这些都可以相互兑换,购买浏览及下载容量。

Hentai@Home (H@H) 客户端要求说明#

要求说明
Java运行时环境版本必须为 8-11,也可以使用 JDK。
80+ Mbit/s 测量速度至少 2000 kB/s 必须专用于 H@H,同时适用于上传和下载。
1000 MB/小时带宽用户可以限制每小时使用的带宽(SSL 开销不计算在内)。
10GB 以上专用硬盘空间SSD 是理想选择;写入耐久性不是问题。
推荐每 0.2 Mbit/s 至少 1 GB,以实现最佳静态区间分配。
请确保客户端能够长期维持速度和磁盘 I/O。
一个开放的 TCP 端口推荐使用 443 端口,否则必须在 1024-65534 之间。
推荐使用未注册的 IANA 端口或 UNIX 内核端口作为内网端口。查看此列表,避免潜在端口冲突。有些端口是不允许的。
一个独立的 IPv4 IP 地址每个客户端应有一个不同的静态 IPv4 地址。
正常运行时间单个客户端在 6 个月内应保持约 75-80% 的在线时间。

注册客户端#

前往官方地址(需要登录 e-hentai 帐号):

🔗 https://e-hentai.org/hentaiathome.php

一般来说你没跑过的话第一次需要提交申请,你需要预先填写你的最大上传,服务器存储,带宽情况,需要提交speedtest-cli的链接

客户端注册示意图

网站设置#

申请通过后,在My Home > Hentai @ Home中会显示,此时只会显示最左边的自定义名称,点击名称会进入设置,可以自定义端口等,建议在配置客户端前设置好:

在网站端可配置:

  1. Port for Incoming Connections - 客户端监听端口
  2. Maximum Burst Speed - 最大突发上传速度
  3. Maximum Disk Cache Size - 最大缓存占用

复制 Client IDClient Key,用于客户端配置。

客户端 Key 示例

部署#

准备一台安装好docker的服务器(建议亚太和中国)

创建目录

Terminal window
mkdir hath-rust && cd hath-rust

Docker-compose.yaml#

这里的7777是我设置的服务端要起的端口,你根据自己的端口来设置

version: '3.8'
services:
hath:
image: ghcr.io/james58899/hath-rust
container_name: hath
working_dir: /hath
network_mode: host
restart: unless-stopped
stop_grace_period: 600s
tty: true
stdin_open: true
volumes:
- ./data:/hath/data
- ./cache:/hath/cache
- ./download:/hath/download
- ./log:/hath/log
- ./tmp:/hath/tmp
command: >
--port 7777
--force-background-scan
--enable-metrics

启动#

因为第一次启动这个还没有绑定你的客户端,所以需要额外设置,具体可以看下面的日志

Terminal window
docker compose up -d
docker exec -it hath hath-rust

image-20251007163538412

这里红色框框选中的区域是你上面所获得的ID和 Key

image-20251007163726490

完成后你只需要重启一次这个容器就可以后台自动运行本项目了。

TIP

注意,这次重启会比较久,因为设置了延迟 600s —stop-timeout 600 (如果要快速可以自行修改)

image-20251007163907815

验证#

回到之前的网页端 ,发现机器online就算成功。

image-20251007164126403

高级监控#

可以使用 Prometheus + Grafana 对客户端进行监控,查看上传/下载速度、缓存占用等。

https://github.com/james58899/hath-rust/wiki/Monitoring

Terminal window
services:
prometheus:
image: prom/prometheus
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- type: bind
source: ./prometheus.yml
target: /etc/prometheus/prometheus.yml
- promethous:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.size=30GB" # Modify to your available disk space
grafana:
image: grafana/grafana
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- grafana:/var/lib/grafana
# Uncomment the following section if you want to change Grafana settings (for example, enable anonymous access).
# environment:
# GF_AUTH_ANONYMOUS_ENABLED: "true"
# GF_AUTH_ANONYMOUS_HIDE_VERSION: "true"
volumes:
# Modify this section if you want to change the storage location.
promethous:
grafana:

这个Yaml会部署 prometheus 和 grafana 容器,分别运行在 9090 和 3000端口

如果你本来就有相关的监控就没必要再部署这个。直接修改 prometheus.yml 配置即可。

prometheus.yml

global:
scrape_interval: 5s # Increase this if Prometheus uses too much storage.
scrape_configs:
- job_name: hath
scheme: https
tls_config:
insecure_skip_verify: true # Because H@H uses dynamic hostnames, disabling certificate verification is needed.
static_configs:
- targets: ["202.6.204.44:7777"] # Modify to hath-rust address.
labels:
instance: "Hentai@Home" # The instance label is used for selection and display. It must be unique.

Dashboard example: H@H Status.json

下载导入面板

image-20251007164806711

image-20251007164823182

image-20251007164838718

image-20251007164854186

其他注意事项#

  1. 带宽管理:家庭网络带宽有限时,务必限制 H@H 上传速度,避免影响日常使用。
  2. 长时间运行:推荐服务器稳定、独立 IP,保持在线率高。
  3. 存储空间:缓存区建议使用 SSD,以保证速度和耐久性。
  4. 安全:若使用公网端口,注意防火墙和端口安全。
Hentai@Home (H@H) 完整部署指南:从注册到 Docker 运行与监控
https://catcat.blog/docker-install-hentaihome.html
作者
猫猫博客
发布于
2025-10-07
许可协议
CC BY-NC-SA 4.0