Xboard+Hysteria

安装Docker

curl -sSL https://get.docker.com | bash
systemctl enable docker
systemctl start docker

安装Xboard

docker-compose.yml文件

services:
web:
image: ghcr.io/cedar2025/xboard:new
volumes:
- ./.docker/.data/redis/:/data/
- ./.env:/www/.env
- ./.docker/.data/:/www/.docker/.data
- ./storage/logs:/www/storage/logs
- ./storage/theme:/www/storage/theme
- ./plugins:/www/plugins
environment:
- docker=true
depends_on:
- redis
# network_mode: host
command: php artisan octane:start --host=0.0.0.0 --port=7001
restart: on-failure
ports:
- 7001:7001
horizon:
image: ghcr.io/cedar2025/xboard:new
volumes:
- ./.docker/.data/redis/:/data/
- ./.env:/www/.env
- ./.docker/.data/:/www/.docker/.data
- ./storage/logs:/www/storage/logs
- ./plugins:/www/plugins
restart: on-failure
# network_mode: host
command: php artisan horizon
depends_on:
- redis
redis:
image: redis:7-alpine
command: redis-server --unixsocket /data/redis.sock --unixsocketperm 777 --save 900 1 --save 300 10 --save 60 10000
restart: unless-stopped
volumes:
- ./.docker/.data/redis:/data

安装hysteria

apt install -y vim curl socat openssl && mkdir hysteria
curl https://get.acme.sh | sh -s email=example@gmail.com
~/.acme.sh/acme.sh --upgrade --auto-upgrade
~/.acme.sh/acme.sh --issue -d 你的域名 --standalone

下发证书

mkdir /etc/hysteria/
cd /etc/hysteria/
~/.acme.sh/acme.sh --install-cert -d 你的域名 --key-file /etc/hysteria/example.com.key
~/.acme.sh/acme.sh --install-cert -d 你的域名 --fullchain-file /etc/hysteria/example.com.crt

生成server.yaml配置文件

cat > server.yaml << EOF
v2board:
apiHost: xboard域名地址
apiKey: xboard密钥
nodeID: 事先xboard平台建立的节点id
tls:
type: tls
cert: /etc/hysteria/example.com.crt
key: /etc/hysteria/example.com.key
auth:
type: v2board
trafficStats:
listen: 127.0.0.1:7653
acl:
inline:
- reject(10.0.0.0/8)
- reject(172.16.0.0/12)
- reject(192.168.0.0/16)
- reject(127.0.0.0/8)
- reject(fc00::/7)
EOF

生成docker-compose配置文件

cat > docker-compose.yml << EOF
version: '3.9'
services:
hysteria:
image: ghcr.io/cedar2025/hysteria:latest
container_name: hysteria
restart: always
network_mode: "host"
volumes:
- /etc/hysteria/server.yaml:/etc/hysteria/server.yaml
- /etc/hysteria/example.com.crt:/etc/hysteria/example.com.crt
- /etc/hysteria/example.com.key:/etc/hysteria/example.com.key
EOF

启动项目

cd /etc/hysteria/
docker compose up -d
docker compose logs -f