diff --git a/.gitignore b/.gitignore index 0e09003..1b8c310 100755 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ go.work.sum todo.md -.*.swp \ No newline at end of file +.*.swp +.aider* diff --git a/.gitmodules b/.gitmodules index 310c773..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "frontend"] - path = frontend - url = https://github.com/yusing/go-proxy-frontend diff --git a/README.md b/README.md index d06bc8d..50f4d26 100755 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ A lightweight, easy-to-use, and [performant](docs/benchmark_result.md) reverse p - [Environment variables](#environment-variables) - [Use JSON Schema in VSCode](#use-json-schema-in-vscode) - [Config File](#config-file) - - [Provider File](#provider-file) + - [Include Files](#include-files) - [Showcase](#showcase) - [idlesleeper](#idlesleeper) - [Build it yourself](#build-it-yourself) @@ -34,13 +34,14 @@ A lightweight, easy-to-use, and [performant](docs/benchmark_result.md) reverse p - Effortless configuration - Simple multi-node setup - Error messages is clear and detailed, easy troubleshooting -- Auto certificate obtaining and renewal (See [Supported DNS Challenge Providers](docs/dns_providers.md)) +- Auto SSL cert management (See [Supported DNS Challenge Providers](docs/dns_providers.md)) - Auto configuration for docker containers - Auto hot-reload on container state / config file changes - **idlesleeper**: stop containers on idle, wake it up on traffic _(optional, see [showcase](#idlesleeper))_ - HTTP(s) reserve proxy - TCP and UDP port forwarding - Web UI for configuration and monitoring (See [screenshots](https://github.com/yusing/go-proxy-frontend?tab=readme-ov-file#screenshots)) +- Supports linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v6 multi-platform - Written in **[Go](https://go.dev)** [🔼Back to top](#table-of-content) @@ -85,7 +86,7 @@ A lightweight, easy-to-use, and [performant](docs/benchmark_result.md) reverse p | `ls-config` | list config and exit | `go-proxy ls-config \| jq` | | `ls-route` | list proxy entries and exit | `go-proxy ls-route \| jq` | -**run with `docker exec /app/go-proxy `** +**run with `docker exec go-proxy /app/go-proxy `** ### Environment variables @@ -129,7 +130,9 @@ providers: [🔼Back to top](#table-of-content) -### Provider File +### Include Files + +These are files that include standalone proxy entries See [Fields](docs/docker.md#fields) diff --git a/README_CHT.md b/README_CHT.md index 32affdc..8bd589d 100644 --- a/README_CHT.md +++ b/README_CHT.md @@ -17,10 +17,6 @@ - [重點](#重點) - [入門指南](#入門指南) - [安裝](#安裝) - - [命令行參數](#命令行參數) - - [環境變量](#環境變量) - - [VSCode 中使用 JSON Schema](#vscode-中使用-json-schema) - - [配置文件](#配置文件) - [透過文件配置](#透過文件配置) - [展示](#展示) - [idlesleeper](#idlesleeper) @@ -30,14 +26,16 @@ - 易用 - 不需花費太多時間就能輕鬆配置 + - 支持多個docker節點 - 除錯簡單 -- 自動處理 HTTPS 證書(參見[可用的 DNS 供應商](docs/dns_providers.md)) +- 自動配置 SSL 證書(參見[可用的 DNS 供應商](docs/dns_providers.md)) - 透過 Docker 容器自動配置 - 容器狀態變更時自動熱重載 - 容器閒置時自動暫停/停止,入站時自動喚醒 -- HTTP(s)反向代理 +- HTTP(s) 反向代理 - TCP/UDP 端口轉發 - 用於配置和監控的前端 Web 面板([截圖](https://github.com/yusing/go-proxy-frontend?tab=readme-ov-file#screenshots)) +- 支持 linux/amd64、linux/arm64、linux/arm/v7、linux/arm/v6 多平台 - 使用 **[Go](https://go.dev)** 編寫 [🔼 返回頂部](#目錄) @@ -46,16 +44,29 @@ ### 安裝 -1. 設置 DNS 記錄,例如: +1. 抓取Docker鏡像 + + ```shell + docker pull ghcr.io/yusing/go-proxy:latest + ``` + +2. 建立新的目錄,並切換到該目錄,並執行 + + ```shell + docker run --rm -v .:/setup ghcr.io/yusing/go-proxy /app/go-proxy setup + ``` + +3. 設置 DNS 記錄,例如: - A 記錄: `*.y.z` -> `10.0.10.1` - AAAA 記錄: `*.y.z` -> `::ffff:a00:a01` -2. 安裝 `go-proxy` [參見這裡](docs/docker.md) +4. 配置 `docker-socket-proxy` 其他 Docker 節點(如有) (參見 [範例](docs/docker_socket_proxy.md)) 然後加到 `config.yml` 中 -3. 配置 `go-proxy` +5. 大功告成,你可以做一些額外的配置 - 使用文本編輯器 (推薦 Visual Studio Code [參見 VSCode 使用 schema](#vscode-中使用-json-schema)) - 或通過 `http://gp.y.z` 使用網頁配置編輯器 + - 詳情請參閱 [docker.md](docs/docker.md) [🔼 返回頂部](#目錄) @@ -69,7 +80,7 @@ | `ls-config` | 列出配置並退出 | `go-proxy ls-config \| jq` | | `ls-route` | 列出路由並退出 | `go-proxy ls-route \| jq` | -**使用 `docker exec <容器名稱> /app/go-proxy <參數>` 運行** +**使用 `docker exec go-proxy /app/go-proxy <參數>` 運行** ### 環境變量 diff --git a/frontend b/frontend deleted file mode 160000 index 441fd70..0000000 --- a/frontend +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 441fd708dbed89c59bf72a742431a78ff2f02bc3 diff --git a/src/proxy/provider/docker_provider.go b/src/proxy/provider/docker.go similarity index 100% rename from src/proxy/provider/docker_provider.go rename to src/proxy/provider/docker.go diff --git a/src/proxy/provider/docker_provider_test.go b/src/proxy/provider/docker_test.go similarity index 100% rename from src/proxy/provider/docker_provider_test.go rename to src/proxy/provider/docker_test.go diff --git a/src/proxy/provider/file_provider.go b/src/proxy/provider/file.go similarity index 100% rename from src/proxy/provider/file_provider.go rename to src/proxy/provider/file.go diff --git a/src/route/http_route.go b/src/route/http.go similarity index 100% rename from src/route/http_route.go rename to src/route/http.go diff --git a/src/route/stream_route.go b/src/route/stream.go similarity index 100% rename from src/route/stream_route.go rename to src/route/stream.go diff --git a/src/route/tcp_route.go b/src/route/tcp.go similarity index 100% rename from src/route/tcp_route.go rename to src/route/tcp.go diff --git a/src/route/udp_route.go b/src/route/udp.go similarity index 100% rename from src/route/udp_route.go rename to src/route/udp.go