Files
Wormhole/README.md
T
renjue 4a25b16d74
CI / docker (push) Failing after 1m22s
feat: 适配 Gitea CI 并整理开源仓库结构
移除本地 Docker 推送脚本,Dockerfile 对接通用 Gitea Actions 工作流;补充 LICENSE、优化 gitignore,并从版本库移除前端构建产物。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 16:14:58 +08:00

102 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Wormhole
内网穿透 + 反向代理网关(Go + Vue),SQLite 持久化 + 内存缓存。服务端与客户端为**同一二进制**,配置在 Web 管理台完成。
## 功能
- 客户端管理(Agent 注册、在线状态、verify_key
- 域名解析(HTTP/HTTPS Host 反代)
- TCP/UDP 隧道
- IP 安全:精确/CIDR/正则白黑名单、请求 IP 监控、一键拉黑
- 统一登录 + 账号管理(admin/user
- 资源级访问验证(Basic / 表单 / 回调)
- 仪表盘:流量与请求 IP 统计
## 快速开始
```bash
make install
make build
# 启动服务端(无需配置文件,默认 admin/admin
make run
# 或: ./bin/wormhole server
# 在管理台「系统设置」中调整端口等参数
# 启动客户端 Agent(仅需命令行参数)
./bin/wormhole agent -server 127.0.0.1:8528 -key <verify_key>
```
管理界面:http://127.0.0.1:8529(首次启动默认端口,可在系统设置中修改)
## Docker
镜像由 [Gitea Actions](.gitea/workflows/ci.yml) 在 push 到 `main`/`master` 或打 `v*` 标签时自动构建并推送到 Gitea Container Registry。详见 [.gitea/README.md](.gitea/README.md)。
```bash
# 将 <gitea-host>、<owner> 替换为你的 Gitea 域名与仓库所有者
IMAGE=<gitea-host>/<owner>/wormhole:latest
# 服务端
docker run -d --name wormhole \
-p 8529:8529 -p 8528:8528 -p 8081:8081 -p 8443:8443 \
-v wormhole-data:/app/data \
"$IMAGE"
# Agent(同一镜像;务必加 --restart,服务端重启后 Agent 会自动重连)
docker run -d --name wormhole-agent \
--restart=unless-stopped \
--network host \
"$IMAGE" \
agent -server <服务端IP>:8528 -key <verify_key>
```
本地自行构建(与 CI 参数一致):
```bash
docker buildx build --platform linux/amd64 \
--build-arg IMAGE_PREFIX=docker.1panel.live/library/ \
--build-arg GOPROXY=https://goproxy.cn,direct \
-f Dockerfile -t wormhole:local .
```
> **注意**Agent 容器必须与 Server 分开部署。更新 Server 镜像时不要用同一 compose 重建 AgentAgent 需 `--restart=unless-stopped`,否则收到 `SIGTERM` 后容器会保持 `Exited` 状态。
## 命令
| 命令 | 说明 |
|------|------|
| `wormhole server` | 启动服务端 |
| `wormhole agent -server <地址> -key <verify_key>` | 启动 Agent |
数据与配置存储在 `./data/wormhole.db`SQLite)。
## 默认端口
| 端口 | 用途 |
|------|------|
| 8529 | 管理 API + Web UI |
| 8528 | Agent Bridge |
| 8081 | HTTP 域名反代 |
| 8443 | HTTPS 域名反代 |
可在管理台 **系统设置** 中修改(监听端口变更需重启服务)。
## 默认账号
- 用户名:`admin`
- 密码:`admin`
## 开发与 CI
| 路径 | 说明 |
|------|------|
| [`.gitea/workflows/ci.yml`](.gitea/workflows/ci.yml) | Go 测试 + Docker 多架构构建/推送 |
| [`.gitea/README.md`](.gitea/README.md) | Runner、Registry、Variables 配置说明 |
| [`.gitea/act-runner/`](.gitea/act-runner/) | act_runner 部署参考(可选) |
## License
[MIT](LICENSE)