mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 04:42:33 +02:00
164 lines
5.7 KiB
Markdown
164 lines
5.7 KiB
Markdown
<div align="center">
|
||
|
||
# GoDoxy
|
||
|
||
[](https://sonarcloud.io/summary/new_code?id=yusing_go-proxy)
|
||

|
||
[](https://sonarcloud.io/summary/new_code?id=yusing_go-proxy)
|
||
[](https://discord.gg/umReR62nRd)
|
||
|
||
輕量、易用、 [高效能](https://github.com/yusing/godoxy/wiki/Benchmarks),且帶有主頁和配置面板的反向代理
|
||
|
||
完整文檔請查閱 **[Wiki](https://github.com/yusing/godoxy/wiki)**(暫未有中文翻譯)
|
||
|
||
<!-- [](https://sonarcloud.io/summary/new_code?id=yusing_go-proxy)
|
||
[](https://sonarcloud.io/summary/new_code?id=yusing_go-proxy)
|
||
[](https://sonarcloud.io/summary/new_code?id=yusing_go-proxy) -->
|
||
|
||
<a href="README.md">EN</a> | **中文**
|
||
|
||
<img src="https://github.com/user-attachments/assets/4bb371f4-6e4c-425c-89b2-b9e962bdd46f" style="max-width: 650">
|
||
|
||
</div>
|
||
|
||
## 目錄
|
||
|
||
<!-- TOC -->
|
||
|
||
- [GoDoxy](#godoxy)
|
||
- [目錄](#目錄)
|
||
- [主要特點](#主要特點)
|
||
- [前置需求](#前置需求)
|
||
- [安裝](#安裝)
|
||
- [手動安裝](#手動安裝)
|
||
- [資料夾結構](#資料夾結構)
|
||
- [截圖](#截圖)
|
||
- [閒置休眠](#閒置休眠)
|
||
- [監控](#監控)
|
||
- [自行編譯](#自行編譯)
|
||
|
||
## 主要特點
|
||
|
||
- 容易使用
|
||
- 輕鬆配置
|
||
- 簡單的多節點設置
|
||
- 錯誤訊息清晰詳細,易於排除故障
|
||
- 自動 SSL 憑證管理(參見 [支援的 DNS-01 驗證提供商](https://github.com/yusing/godoxy/wiki/Supported-DNS%E2%80%9001-Providers))
|
||
- 自動配置 Docker 容器
|
||
- 容器狀態/配置文件變更時自動熱重載
|
||
- **閒置休眠**:在閒置時停止容器,有流量時喚醒(_可選,參見[截圖](#閒置休眠)_)
|
||
- OpenID Connect:輕鬆實現單點登入
|
||
- HTTP(s) 反向代理和TCP 和 UDP 埠轉發
|
||
- [HTTP 中介軟體](https://github.com/yusing/godoxy/wiki/Middlewares) 和 [自定義錯誤頁面](https://github.com/yusing/godoxy/wiki/Middlewares#custom-error-pages)
|
||
- **網頁介面,具有應用儀表板和配置編輯器**
|
||
- 支援 linux/amd64、linux/arm64
|
||
- 使用 **[Go](https://go.dev)** 編寫
|
||
|
||
[🔼回到頂部](#目錄)
|
||
|
||
## 前置需求
|
||
|
||
設置 DNS 記錄指向運行 `GoDoxy` 的機器,例如:
|
||
|
||
- A 記錄:`*.y.z` -> `10.0.10.1`
|
||
- AAAA 記錄:`*.y.z` -> `::ffff:a00:a01`
|
||
|
||
## 安裝
|
||
|
||
**注意:** GoDoxy 設計為(且僅在)`host` 網路模式下運作,請勿更改。如需更改監聽埠,請修改 `.env`。
|
||
|
||
1. 準備一個新目錄用於 docker compose 和配置文件。
|
||
|
||
2. 在目錄內運行安裝腳本,或[手動安裝](#手動安裝)
|
||
|
||
```shell
|
||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/yusing/godoxy/main/scripts/setup.sh)"
|
||
```
|
||
|
||
3. 啟動容器 `docker compose up -d` 並等待就緒
|
||
|
||
4. 現在可以在 WebUI `https://godoxy.yourdomain.com` 進行額外配置
|
||
|
||
[🔼回到頂部](#目錄)
|
||
|
||
### 手動安裝
|
||
|
||
1. 建立 `config` 目錄,然後將 `config.example.yml` 下載到 `config/config.yml`
|
||
|
||
`mkdir -p config && wget https://raw.githubusercontent.com/yusing/godoxy/main/config.example.yml -O config/config.yml`
|
||
|
||
2. 將 `.env.example` 下載到 `.env`
|
||
|
||
`wget https://raw.githubusercontent.com/yusing/godoxy/main/.env.example -O .env`
|
||
|
||
3. 將 `compose.example.yml` 下載到 `compose.yml`
|
||
|
||
`wget https://raw.githubusercontent.com/yusing/godoxy/main/compose.example.yml -O compose.yml`
|
||
|
||
### 資料夾結構
|
||
|
||
```shell
|
||
├── certs
|
||
│ ├── cert.crt
|
||
│ └── priv.key
|
||
├── compose.yml
|
||
├── config
|
||
│ ├── config.yml
|
||
│ ├── middlewares
|
||
│ │ ├── middleware1.yml
|
||
│ │ ├── middleware2.yml
|
||
│ ├── provider1.yml
|
||
│ └── provider2.yml
|
||
├── data
|
||
│ ├── metrics # metrics data
|
||
│ │ ├── uptime.json
|
||
│ │ └── system_info.json
|
||
└── .env
|
||
```
|
||
|
||
## 截圖
|
||
|
||
### 閒置休眠
|
||
|
||

|
||
|
||
[🔼回到頂部](#目錄)
|
||
|
||
### 監控
|
||
|
||
<div align="center">
|
||
<table>
|
||
<tr>
|
||
<td align="center"><img src="screenshots/uptime.png" alt="Uptime Monitor" width="250"/></td>
|
||
<td align="center"><img src="screenshots/docker-logs.jpg" alt="Docker Logs" width="250"/></td>
|
||
<td align="center"><img src="screenshots/docker.jpg" alt="Server Overview" width="250"/></td>
|
||
</tr>
|
||
<tr>
|
||
<td align="center"><b>運行時間監控</b></td>
|
||
<td align="center"><b>Docker 日誌</b></td>
|
||
<td align="center"><b>伺服器概覽</b></td>
|
||
</tr>
|
||
<tr>
|
||
<td align="center"><img src="screenshots/system-monitor.jpg" alt="System Monitor" width="250"/></td>
|
||
<td align="center"><img src="screenshots/system-info-graphs.jpg" alt="Graphs" width="250"/></td>
|
||
</tr>
|
||
<tr>
|
||
<td align="center"><b>系統監控</b></td>
|
||
<td align="center"><b>圖表</b></td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
## 自行編譯
|
||
|
||
1. 克隆儲存庫 `git clone https://github.com/yusing/godoxy --depth=1`
|
||
|
||
2. 如果尚未安裝,請安裝/升級 [go (>=1.22)](https://go.dev/doc/install) 和 `make`
|
||
|
||
3. 如果之前編譯過(go < 1.22),請使用 `go clean -cache` 清除快取
|
||
|
||
4. 使用 `make get` 獲取依賴
|
||
|
||
5. 使用 `make build` 編譯二進制檔案
|
||
|
||
[🔼回到頂部](#目錄)
|