Sign inSign up

baone/hox

By baone

•Updated 1 day ago

HOX public relay and management server

Image
0

45

baone/hox repository overview

⁠HOX-By:Ashengge

公开镜像,Linux x86_64,无需 Docker Hub 登录。

默认后台账号 admin,默认密码 Admin@123。首次启动自动初始化;改密、权限和限速设置持久保存。

将下面内容保存为 compose.yaml,修改顶部域名,解析到服务器后执行:

docker compose up -d

打开 https://你的域名/。需要开放 21110/TCP、21110/UDP、80/TCP、443/TCP。

name: hox

# 公网部署只需修改这里的域名,并把 DNS 指向服务器。
x-hox-environment: &hox-environment
  HOX_DOMAIN: nat.gzgfwl.com.cn

services:
  admin:
    image: baone/hox:admin-0.2.21-server.2
    container_name: hox-admin
    environment:
      <<: *hox-environment
      YCCT_RELAY_CONTAINER: hox-relay
    ports:
      - "127.0.0.1:21112:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - admin-data:/data
      - relay-policy:/data/relay-policy
    read_only: true
    cap_drop: [ALL]
    security_opt: [no-new-privileges:true]
    mem_limit: 96m
    pids_limit: 64
    restart: unless-stopped
    logging:
      driver: json-file
      options: {max-size: "2m", max-file: "2"}
    healthcheck:
      test: ["CMD", "python", "-c", "import urllib.request; assert urllib.request.urlopen('http://127.0.0.1:8080/', timeout=3).status == 200"]
      interval: 10s
      timeout: 5s
      retries: 6
      start_period: 10s
  relay:
    image: baone/hox:relay-2.6.4-hox.1
    container_name: hox-relay
    network_mode: host
    command: ["--config-file", "/etc/ycct/relay.toml", "--rpc-portal", "127.0.0.1:21111", "--console-log-level", "error"]
    volumes:
      - relay-policy:/etc/ycct:ro
    depends_on:
      admin: {condition: service_healthy}
    cap_drop: [ALL]
    security_opt: [no-new-privileges:true]
    read_only: true
    tmpfs: [/tmp:size=16m]
    mem_limit: 192m
    pids_limit: 128
    restart: unless-stopped
    logging:
      driver: json-file
      options: {max-size: "5m", max-file: "2"}
    healthcheck:
      test: ["CMD-SHELL", "easytier-cli -p 127.0.0.1:21111 node >/dev/null 2>&1"]
      interval: 10s
      timeout: 5s
      retries: 6
      start_period: 10s
  https:
    image: caddy:2.10.2-alpine
    container_name: hox-https
    network_mode: host
    environment: *hox-environment
    command:
      - /bin/sh
      - -ec
      - 'exec caddy reverse-proxy --from "$$HOX_DOMAIN" --to 127.0.0.1:21112 --header-up "X-Real-IP: {remote_host}" --header-down "Strict-Transport-Security: max-age=31536000"'
    volumes:
      - tls-data:/data
    read_only: true
    tmpfs: [/config:size=16m, /tmp:size=16m]
    cap_drop: [ALL]
    cap_add: [NET_BIND_SERVICE]
    security_opt: [no-new-privileges:true]
    mem_limit: 128m
    pids_limit: 128
    restart: unless-stopped
    depends_on:
      admin: {condition: service_healthy}
    logging:
      driver: json-file
      options: {max-size: "2m", max-file: "2"}

volumes:
  admin-data:
  relay-policy:
  tls-data:


已有 Nginx/宝塔占用 80/443 时,使用 docker compose up -d admin relay,再将自己的 HTTPS 站点转发到 127.0.0.1:21112。

默认每个共享 ID 网络的双向中转合计 2 Mbps,可在后台修改,可只允许指定 ID 使用中转;P2P 流量不受公网中转限速影响。日志自动轮转。docker compose down 保留数据,down -v 删除账号、配置和证书。

Windows 客户端继续使用 HOX v0.2.21。完整交付同时提供中文部署说明及包含三个镜像的离线包,可在本地局域网不连接仓库部署。

中转为未修改的 EasyTier v2.6.4(GNU LGPL v3),对应源码与许可证:https://github.com/EasyTier/EasyTier/tree/v2.6.4⁠

Tag summary

Content type

Image

Digest

sha256:ebc182447…

Size

22.1 MB

Last updated

1 day ago

docker pull baone/hox:admin-0.2.21-server.2