mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-06-13 15:47:37 +08:00
chore: update dependencies and CI actions
- Update Go dependencies to latest versions
- Bump Go version from 1.25.1 to 1.26
- Modernize code: interface{} -> any, strings.Split -> strings.SplitSeq
- Update GitHub Actions to latest versions:
- actions/checkout: v3/v4 -> v6
- actions/setup-go: v3 -> v6 (use go-version-file)
- actions/upload-artifact: v4 -> v7
- docker/setup-qemu-action: v3 -> v4
- docker/setup-buildx-action: v3 -> v4
- docker/login-action: v3 -> v4
- docker/build-push-action: v6 -> v7
- Remove hardcoded GO_VERSION env var, read from go.mod
This commit is contained in:
parent
32baca85db
commit
9f6e4b9714
7 changed files with 76 additions and 78 deletions
37
.github/workflows/build-dev.yml
vendored
37
.github/workflows/build-dev.yml
vendored
|
|
@ -12,7 +12,7 @@ jobs:
|
||||||
prepare:
|
prepare:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v6
|
||||||
- name: 加载版本号
|
- name: 加载版本号
|
||||||
run: |
|
run: |
|
||||||
if [ -f DEV-VERSION ]; then
|
if [ -f DEV-VERSION ]; then
|
||||||
|
|
@ -21,7 +21,7 @@ jobs:
|
||||||
echo "DEV-VERSION file not found!" && exit 1
|
echo "DEV-VERSION file not found!" && exit 1
|
||||||
fi
|
fi
|
||||||
- name: 输出版本号
|
- name: 输出版本号
|
||||||
run: |
|
run: |
|
||||||
echo "Version: ${{ env.VERSION }}"
|
echo "Version: ${{ env.VERSION }}"
|
||||||
- name: 预先创建Pre-release
|
- name: 预先创建Pre-release
|
||||||
id: create_release
|
id: create_release
|
||||||
|
|
@ -46,10 +46,9 @@ jobs:
|
||||||
goarch: [amd64, arm64]
|
goarch: [amd64, arm64]
|
||||||
env:
|
env:
|
||||||
OUTPUT_BINARY: ghproxy
|
OUTPUT_BINARY: ghproxy
|
||||||
GO_VERSION: 1.25
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: dev
|
ref: dev
|
||||||
- name: 加载版本号
|
- name: 加载版本号
|
||||||
|
|
@ -63,11 +62,11 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
sudo git clone https://github.com/WJQSERVER-STUDIO/GHProxy-Frontend.git pages
|
sudo git clone https://github.com/WJQSERVER-STUDIO/GHProxy-Frontend.git pages
|
||||||
sudo rm -rf pages/.git/
|
sudo rm -rf pages/.git/
|
||||||
|
|
||||||
- name: 安装 Go
|
- name: 安装 Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
go-version-file: go.mod
|
||||||
- name: 编译
|
- name: 编译
|
||||||
env:
|
env:
|
||||||
GOOS: ${{ matrix.goos }}
|
GOOS: ${{ matrix.goos }}
|
||||||
|
|
@ -83,7 +82,7 @@ jobs:
|
||||||
tar -czf ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}.tar.gz -C ghproxyd .
|
tar -czf ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}.tar.gz -C ghproxyd .
|
||||||
ls
|
ls
|
||||||
- name: 上传Artifact
|
- name: 上传Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}
|
name: ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}
|
||||||
path: |
|
path: |
|
||||||
|
|
@ -100,8 +99,8 @@ jobs:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
body: ${{ env.VERSION }}
|
body: ${{ env.VERSION }}
|
||||||
env:
|
env:
|
||||||
export PATH: $PATH:/usr/local/go/bin
|
export PATH: $PATH:/usr/local/go/bin
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
|
|
@ -109,10 +108,10 @@ jobs:
|
||||||
IMAGE_NAME: wjqserver/ghproxy
|
IMAGE_NAME: wjqserver/ghproxy
|
||||||
DOCKERFILE: docker/dockerfile/dev/Dockerfile
|
DOCKERFILE: docker/dockerfile/dev/Dockerfile
|
||||||
DOCKERFILE_PATH: docker/dockerfile/dev
|
DOCKERFILE_PATH: docker/dockerfile/dev
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: dev
|
ref: dev
|
||||||
- name: Load VERSION
|
- name: Load VERSION
|
||||||
|
|
@ -121,26 +120,26 @@ jobs:
|
||||||
echo "VERSION=$(cat DEV-VERSION)" >> $GITHUB_ENV
|
echo "VERSION=$(cat DEV-VERSION)" >> $GITHUB_ENV
|
||||||
else
|
else
|
||||||
echo "DEV-VERSION file not found!" && exit 1
|
echo "DEV-VERSION file not found!" && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: 构建镜像
|
- name: 构建镜像
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with:
|
||||||
file: ./${{ env.DOCKERFILE }}
|
file: ./${{ env.DOCKERFILE }}
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
|
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
|
||||||
${{ env.IMAGE_NAME }}:dev
|
${{ env.IMAGE_NAME }}:dev
|
||||||
|
|
|
||||||
41
.github/workflows/build.yml
vendored
41
.github/workflows/build.yml
vendored
|
|
@ -12,8 +12,8 @@ jobs:
|
||||||
prepare:
|
prepare:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
- name: 加载版本号
|
- name: 加载版本号
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -23,7 +23,7 @@ jobs:
|
||||||
echo "VERSION file not found!" && exit 1
|
echo "VERSION file not found!" && exit 1
|
||||||
fi
|
fi
|
||||||
- name: 输出版本号
|
- name: 输出版本号
|
||||||
run: |
|
run: |
|
||||||
echo "Version: ${{ env.VERSION }}"
|
echo "Version: ${{ env.VERSION }}"
|
||||||
- name: 预先创建release
|
- name: 预先创建release
|
||||||
id: create_release
|
id: create_release
|
||||||
|
|
@ -40,17 +40,16 @@ jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: prepare # 确保这个作业在 prepare 作业完成后运行
|
needs: prepare
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
goos: [linux, darwin, freebsd]
|
goos: [linux, darwin, freebsd]
|
||||||
goarch: [amd64, arm64]
|
goarch: [amd64, arm64]
|
||||||
env:
|
env:
|
||||||
OUTPUT_BINARY: ghproxy
|
OUTPUT_BINARY: ghproxy
|
||||||
GO_VERSION: 1.25
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
- name: 加载版本号
|
- name: 加载版本号
|
||||||
|
|
@ -64,11 +63,11 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
sudo git clone https://github.com/WJQSERVER-STUDIO/GHProxy-Frontend.git pages
|
sudo git clone https://github.com/WJQSERVER-STUDIO/GHProxy-Frontend.git pages
|
||||||
sudo rm -rf pages/.git/
|
sudo rm -rf pages/.git/
|
||||||
|
|
||||||
- name: 安装 Go
|
- name: 安装 Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
go-version-file: go.mod
|
||||||
- name: 编译
|
- name: 编译
|
||||||
env:
|
env:
|
||||||
GOOS: ${{ matrix.goos }}
|
GOOS: ${{ matrix.goos }}
|
||||||
|
|
@ -83,11 +82,11 @@ jobs:
|
||||||
cp LICENSE ./ghproxyd/
|
cp LICENSE ./ghproxyd/
|
||||||
tar -czf ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}.tar.gz -C ghproxyd .
|
tar -czf ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}.tar.gz -C ghproxyd .
|
||||||
- name: 上传Artifact
|
- name: 上传Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}
|
name: ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}
|
||||||
path: |
|
path: |
|
||||||
./${{ env.OUTPUT_BINARY }}*
|
./${{ env.OUTPUT_BINARY }}*
|
||||||
- name: 上传至Release
|
- name: 上传至Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
|
|
@ -103,14 +102,14 @@ jobs:
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build # 确保这个作业在 build 作业完成后运行
|
needs: build
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME: wjqserver/ghproxy # 定义镜像名称变量
|
IMAGE_NAME: wjqserver/ghproxy
|
||||||
DOCKERFILE: docker/dockerfile/release/Dockerfile # 定义 Dockerfile 路径变量
|
DOCKERFILE: docker/dockerfile/release/Dockerfile
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
- name: Load VERSION
|
- name: Load VERSION
|
||||||
|
|
@ -122,26 +121,26 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: 构建镜像
|
- name: 构建镜像
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with:
|
||||||
file: ./${{ env.DOCKERFILE }}
|
file: ./${{ env.DOCKERFILE }}
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
|
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
|
||||||
${{ env.IMAGE_NAME }}:v4
|
${{ env.IMAGE_NAME }}:v4
|
||||||
${{ env.IMAGE_NAME }}:latest
|
${{ env.IMAGE_NAME }}:latest
|
||||||
wjqserver/ghproxy-touka:latest
|
wjqserver/ghproxy-touka:latest
|
||||||
wjqserver/ghproxy-touka:${{ env.VERSION }}
|
wjqserver/ghproxy-touka:${{ env.VERSION }}
|
||||||
|
|
|
||||||
22
api/api.go
22
api/api.go
|
|
@ -52,35 +52,35 @@ func InitHandleRouter(cfg *config.Config, r *touka.Engine, version string) {
|
||||||
func SizeLimitHandler(cfg *config.Config, c *touka.Context) {
|
func SizeLimitHandler(cfg *config.Config, c *touka.Context) {
|
||||||
sizeLimit := cfg.Server.SizeLimit
|
sizeLimit := cfg.Server.SizeLimit
|
||||||
c.SetHeader("Content-Type", "application/json")
|
c.SetHeader("Content-Type", "application/json")
|
||||||
c.JSON(200, (map[string]interface{}{
|
c.JSON(200, (map[string]any{
|
||||||
"MaxResponseBodySize": sizeLimit,
|
"MaxResponseBodySize": sizeLimit,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func WhiteListStatusHandler(cfg *config.Config, c *touka.Context) {
|
func WhiteListStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||||
c.SetHeader("Content-Type", "application/json")
|
c.SetHeader("Content-Type", "application/json")
|
||||||
c.JSON(200, (map[string]interface{}{
|
c.JSON(200, (map[string]any{
|
||||||
"Whitelist": cfg.Whitelist.Enabled,
|
"Whitelist": cfg.Whitelist.Enabled,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func BlackListStatusHandler(cfg *config.Config, c *touka.Context) {
|
func BlackListStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||||
c.SetHeader("Content-Type", "application/json")
|
c.SetHeader("Content-Type", "application/json")
|
||||||
c.JSON(200, (map[string]interface{}{
|
c.JSON(200, (map[string]any{
|
||||||
"Blacklist": cfg.Blacklist.Enabled,
|
"Blacklist": cfg.Blacklist.Enabled,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func CorsStatusHandler(cfg *config.Config, c *touka.Context) {
|
func CorsStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||||
c.SetHeader("Content-Type", "application/json")
|
c.SetHeader("Content-Type", "application/json")
|
||||||
c.JSON(200, (map[string]interface{}{
|
c.JSON(200, (map[string]any{
|
||||||
"Cors": cfg.Server.Cors,
|
"Cors": cfg.Server.Cors,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func HealthcheckHandler(c *touka.Context) {
|
func HealthcheckHandler(c *touka.Context) {
|
||||||
c.SetHeader("Content-Type", "application/json")
|
c.SetHeader("Content-Type", "application/json")
|
||||||
c.JSON(200, (map[string]interface{}{
|
c.JSON(200, (map[string]any{
|
||||||
"Status": "OK",
|
"Status": "OK",
|
||||||
"Repo": "WJQSERVER-STUDIO/GHProxy",
|
"Repo": "WJQSERVER-STUDIO/GHProxy",
|
||||||
"Author": "WJQSERVER-STUDIO",
|
"Author": "WJQSERVER-STUDIO",
|
||||||
|
|
@ -89,7 +89,7 @@ func HealthcheckHandler(c *touka.Context) {
|
||||||
|
|
||||||
func VersionHandler(c *touka.Context, version string) {
|
func VersionHandler(c *touka.Context, version string) {
|
||||||
c.SetHeader("Content-Type", "application/json")
|
c.SetHeader("Content-Type", "application/json")
|
||||||
c.JSON(200, (map[string]interface{}{
|
c.JSON(200, (map[string]any{
|
||||||
"Version": version,
|
"Version": version,
|
||||||
"Repo": "WJQSERVER-STUDIO/GHProxy",
|
"Repo": "WJQSERVER-STUDIO/GHProxy",
|
||||||
"Author": "WJQSERVER-STUDIO",
|
"Author": "WJQSERVER-STUDIO",
|
||||||
|
|
@ -98,35 +98,35 @@ func VersionHandler(c *touka.Context, version string) {
|
||||||
|
|
||||||
func RateLimitStatusHandler(cfg *config.Config, c *touka.Context) {
|
func RateLimitStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||||
c.SetHeader("Content-Type", "application/json")
|
c.SetHeader("Content-Type", "application/json")
|
||||||
c.JSON(200, (map[string]interface{}{
|
c.JSON(200, (map[string]any{
|
||||||
"RateLimit": cfg.RateLimit.Enabled,
|
"RateLimit": cfg.RateLimit.Enabled,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func RateLimitLimitHandler(cfg *config.Config, c *touka.Context) {
|
func RateLimitLimitHandler(cfg *config.Config, c *touka.Context) {
|
||||||
c.SetHeader("Content-Type", "application/json")
|
c.SetHeader("Content-Type", "application/json")
|
||||||
c.JSON(200, (map[string]interface{}{
|
c.JSON(200, (map[string]any{
|
||||||
"RatePerMinute": cfg.RateLimit.RatePerMinute,
|
"RatePerMinute": cfg.RateLimit.RatePerMinute,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func SmartGitStatusHandler(cfg *config.Config, c *touka.Context) {
|
func SmartGitStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||||
c.SetHeader("Content-Type", "application/json")
|
c.SetHeader("Content-Type", "application/json")
|
||||||
c.JSON(200, (map[string]interface{}{
|
c.JSON(200, (map[string]any{
|
||||||
"enabled": cfg.GitClone.Mode == "cache",
|
"enabled": cfg.GitClone.Mode == "cache",
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func shellNestStatusHandler(cfg *config.Config, c *touka.Context) {
|
func shellNestStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||||
c.SetHeader("Content-Type", "application/json")
|
c.SetHeader("Content-Type", "application/json")
|
||||||
c.JSON(200, (map[string]interface{}{
|
c.JSON(200, (map[string]any{
|
||||||
"enabled": cfg.Shell.Editor,
|
"enabled": cfg.Shell.Editor,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func ociProxyStatusHandler(cfg *config.Config, c *touka.Context) {
|
func ociProxyStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||||
c.SetHeader("Content-Type", "application/json")
|
c.SetHeader("Content-Type", "application/json")
|
||||||
c.JSON(200, (map[string]interface{}{
|
c.JSON(200, (map[string]any{
|
||||||
"enabled": cfg.Docker.Enabled,
|
"enabled": cfg.Docker.Enabled,
|
||||||
"target": cfg.Docker.Target,
|
"target": cfg.Docker.Target,
|
||||||
}))
|
}))
|
||||||
|
|
|
||||||
18
go.mod
18
go.mod
|
|
@ -1,26 +1,26 @@
|
||||||
module ghproxy
|
module ghproxy
|
||||||
|
|
||||||
go 1.25.1
|
go 1.26
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/BurntSushi/toml v1.5.0
|
github.com/BurntSushi/toml v1.6.0
|
||||||
github.com/WJQSERVER-STUDIO/httpc v0.8.2
|
github.com/WJQSERVER-STUDIO/httpc v0.9.0
|
||||||
golang.org/x/net v0.44.0
|
golang.org/x/net v0.52.0
|
||||||
golang.org/x/time v0.13.0
|
golang.org/x/time v0.15.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/WJQSERVER-STUDIO/go-utils/iox v0.0.2
|
github.com/WJQSERVER-STUDIO/go-utils/iox v0.0.2
|
||||||
github.com/WJQSERVER-STUDIO/go-utils/limitreader v0.0.2
|
github.com/WJQSERVER-STUDIO/go-utils/limitreader v0.0.2
|
||||||
github.com/WJQSERVER/wanf v0.0.0-20250810023226-e51d9d0737ee
|
github.com/WJQSERVER/wanf v0.0.8
|
||||||
github.com/fenthope/bauth v0.0.1
|
github.com/fenthope/bauth v0.0.1
|
||||||
github.com/fenthope/ikumi v0.0.2
|
github.com/fenthope/ikumi v0.0.2
|
||||||
github.com/fenthope/ipfilter v0.0.1
|
github.com/fenthope/ipfilter v0.0.1
|
||||||
github.com/fenthope/reco v0.0.4
|
github.com/fenthope/reco v0.0.5
|
||||||
github.com/fenthope/record v0.0.4
|
github.com/fenthope/record v0.0.4
|
||||||
github.com/go-json-experiment/json v0.0.0-20250813233538-9b1f9ea2e11b
|
github.com/go-json-experiment/json v0.0.0-20260214004413-d219187c3433
|
||||||
github.com/hashicorp/golang-lru/v2 v2.0.7
|
github.com/hashicorp/golang-lru/v2 v2.0.7
|
||||||
github.com/infinite-iroha/touka v0.3.7
|
github.com/infinite-iroha/touka v0.5.1
|
||||||
github.com/wjqserver/modembed v0.0.1
|
github.com/wjqserver/modembed v0.0.1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
32
go.sum
32
go.sum
|
|
@ -1,34 +1,34 @@
|
||||||
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
|
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
|
||||||
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||||
github.com/WJQSERVER-STUDIO/go-utils/iox v0.0.2 h1:AiIHXP21LpK7pFfqUlUstgQEWzjbekZgxOuvVwiMfyM=
|
github.com/WJQSERVER-STUDIO/go-utils/iox v0.0.2 h1:AiIHXP21LpK7pFfqUlUstgQEWzjbekZgxOuvVwiMfyM=
|
||||||
github.com/WJQSERVER-STUDIO/go-utils/iox v0.0.2/go.mod h1:mCLqYU32bTmEE6dpj37MKKiZgz70Jh/xyK9vVbq6pok=
|
github.com/WJQSERVER-STUDIO/go-utils/iox v0.0.2/go.mod h1:mCLqYU32bTmEE6dpj37MKKiZgz70Jh/xyK9vVbq6pok=
|
||||||
github.com/WJQSERVER-STUDIO/go-utils/limitreader v0.0.2 h1:8bBkKk6E2Zr+I5szL7gyc5f0DK8N9agIJCpM1Cqw2NE=
|
github.com/WJQSERVER-STUDIO/go-utils/limitreader v0.0.2 h1:8bBkKk6E2Zr+I5szL7gyc5f0DK8N9agIJCpM1Cqw2NE=
|
||||||
github.com/WJQSERVER-STUDIO/go-utils/limitreader v0.0.2/go.mod h1:yPX8xuZH+py7eLJwOYj3VVI/4/Yuy5+x8Mhq8qezcPg=
|
github.com/WJQSERVER-STUDIO/go-utils/limitreader v0.0.2/go.mod h1:yPX8xuZH+py7eLJwOYj3VVI/4/Yuy5+x8Mhq8qezcPg=
|
||||||
github.com/WJQSERVER-STUDIO/httpc v0.8.2 h1:PFPLodV0QAfGEP6915J57vIqoKu9cGuuiXG/7C9TNUk=
|
github.com/WJQSERVER-STUDIO/httpc v0.9.0 h1:MpXcQQqukrSLHH/2tTfnXrhqD6nEDHB/gbzehXaS8o4=
|
||||||
github.com/WJQSERVER-STUDIO/httpc v0.8.2/go.mod h1:8WhHVRO+olDFBSvL5PC/bdMkb6U3vRdPJ4p4pnguV5Y=
|
github.com/WJQSERVER-STUDIO/httpc v0.9.0/go.mod h1:filzryrl4eAtFVyl4oVHcJqx1SpNFbrCn+ddQPLlCSg=
|
||||||
github.com/WJQSERVER/wanf v0.0.0-20250810023226-e51d9d0737ee h1:tJ31DNBn6UhWkk8fiikAQWqULODM+yBcGAEar1tzdZc=
|
github.com/WJQSERVER/wanf v0.0.8 h1:1Ri9d7nKhu22hGxP8O9B9rXnYym6DYGKgi6WRVx3VF8=
|
||||||
github.com/WJQSERVER/wanf v0.0.0-20250810023226-e51d9d0737ee/go.mod h1:q2Pyg+G+s1acMWxrbI4CwS/Yk76/BzLREEdZ8iFwUNE=
|
github.com/WJQSERVER/wanf v0.0.8/go.mod h1:R0Zw/1skEMVlQ9m5atbkmanlW+9h2bkdq7+wbPY+F/8=
|
||||||
github.com/fenthope/bauth v0.0.1 h1:+4UIQshGx3mYD4L3f2S4MLZOi5PWU7fU5GK3wsZvwzE=
|
github.com/fenthope/bauth v0.0.1 h1:+4UIQshGx3mYD4L3f2S4MLZOi5PWU7fU5GK3wsZvwzE=
|
||||||
github.com/fenthope/bauth v0.0.1/go.mod h1:1fveTpgfR1p+WXQ8MXm9BfBCeNYi55j23jxCOGOvBSA=
|
github.com/fenthope/bauth v0.0.1/go.mod h1:1fveTpgfR1p+WXQ8MXm9BfBCeNYi55j23jxCOGOvBSA=
|
||||||
github.com/fenthope/ikumi v0.0.2 h1:5oaSTf/Msp7M2O3o/X20omKWEQbFhX4KV0CVF21oCdk=
|
github.com/fenthope/ikumi v0.0.2 h1:5oaSTf/Msp7M2O3o/X20omKWEQbFhX4KV0CVF21oCdk=
|
||||||
github.com/fenthope/ikumi v0.0.2/go.mod h1:IYbxzOGndZv/yRrbVMyV6dxh06X2wXCbfxrTRM1IruU=
|
github.com/fenthope/ikumi v0.0.2/go.mod h1:IYbxzOGndZv/yRrbVMyV6dxh06X2wXCbfxrTRM1IruU=
|
||||||
github.com/fenthope/ipfilter v0.0.1 h1:HrYAyixCMvsDAz36GRyFfyCNtrgYwzrhMcY0XV7fGcM=
|
github.com/fenthope/ipfilter v0.0.1 h1:HrYAyixCMvsDAz36GRyFfyCNtrgYwzrhMcY0XV7fGcM=
|
||||||
github.com/fenthope/ipfilter v0.0.1/go.mod h1:QfY0GrpG0D82HROgdH4c9eog4js42ghLIfl/iM4MvvY=
|
github.com/fenthope/ipfilter v0.0.1/go.mod h1:QfY0GrpG0D82HROgdH4c9eog4js42ghLIfl/iM4MvvY=
|
||||||
github.com/fenthope/reco v0.0.4 h1:yo2g3aWwdoMpaZWZX4SdZOW7mCK82RQIU/YI8ZUQThM=
|
github.com/fenthope/reco v0.0.5 h1:Z/bOunFf4LSgYP/IxG9fe2pTrIq7bPsDflflbNR5Agw=
|
||||||
github.com/fenthope/reco v0.0.4/go.mod h1:eMyS8HpdMVdJ/2WJt6Cvt8P1EH9Igzj5lSJrgc+0jeg=
|
github.com/fenthope/reco v0.0.5/go.mod h1:nd5gMkuJHN2+2Iwwt3xy+HSqRaROauIjHNkmQWRsHyM=
|
||||||
github.com/fenthope/record v0.0.4 h1:/1JHNCxiXGLL/qCh4LEGaAvhj4CcKsb6siTxjLmjdO4=
|
github.com/fenthope/record v0.0.4 h1:/1JHNCxiXGLL/qCh4LEGaAvhj4CcKsb6siTxjLmjdO4=
|
||||||
github.com/fenthope/record v0.0.4/go.mod h1:G0a6KCiCDyX2SsC3nfzSN651fJKxH482AyJvzlnvAJU=
|
github.com/fenthope/record v0.0.4/go.mod h1:G0a6KCiCDyX2SsC3nfzSN651fJKxH482AyJvzlnvAJU=
|
||||||
github.com/go-json-experiment/json v0.0.0-20250813233538-9b1f9ea2e11b h1:6Q4zRHXS/YLOl9Ng1b1OOOBWMidAQZR3Gel0UKPC/KU=
|
github.com/go-json-experiment/json v0.0.0-20260214004413-d219187c3433 h1:vymEbVwYFP/L05h5TKQxvkXoKxNvTpjxYKdF1Nlwuao=
|
||||||
github.com/go-json-experiment/json v0.0.0-20250813233538-9b1f9ea2e11b/go.mod h1:TiCD2a1pcmjd7YnhGH0f/zKNcCD06B029pHhzV23c2M=
|
github.com/go-json-experiment/json v0.0.0-20260214004413-d219187c3433/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
|
||||||
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
|
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
|
||||||
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
|
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
|
||||||
github.com/infinite-iroha/touka v0.3.7 h1:bIIZW5Weh7lVpyOWh4FmyR9UOfb5FOt+cR9yQ30FJLA=
|
github.com/infinite-iroha/touka v0.5.1 h1:t4D1FmTL4noo9PsSG8i/pswIROpZHkAhQrQYS1ZGoSA=
|
||||||
github.com/infinite-iroha/touka v0.3.7/go.mod h1:uwkF1gTrNEgQ4P/Gwtk6WLbERehq3lzB8x1FMedyrfE=
|
github.com/infinite-iroha/touka v0.5.1/go.mod h1:RJmpIpGslbQIZ0M5xJHIqTTd1RSBH6TwRQmREcF76pA=
|
||||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||||
github.com/wjqserver/modembed v0.0.1 h1:8ZDz7t9M5DLrUFlYgBUUmrMzxWsZPmHvOazkr/T2jEs=
|
github.com/wjqserver/modembed v0.0.1 h1:8ZDz7t9M5DLrUFlYgBUUmrMzxWsZPmHvOazkr/T2jEs=
|
||||||
github.com/wjqserver/modembed v0.0.1/go.mod h1:sYbQJMAjSBsdYQrUsuHY380XXE1CuRh8g9yyCztTXOQ=
|
github.com/wjqserver/modembed v0.0.1/go.mod h1:sYbQJMAjSBsdYQrUsuHY380XXE1CuRh8g9yyCztTXOQ=
|
||||||
golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I=
|
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
|
||||||
golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
|
golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
|
||||||
golang.org/x/time v0.13.0 h1:eUlYslOIt32DgYD6utsuUeHs4d7AsEYLuIAdg7FlYgI=
|
golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U=
|
||||||
golang.org/x/time v0.13.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
|
golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno=
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ func newProxyDial(proxyUrls string) proxy.Dialer {
|
||||||
var proxyDialer proxy.Dialer = proxy.Direct // 初始为直接连接,不使用代理
|
var proxyDialer proxy.Dialer = proxy.Direct // 初始为直接连接,不使用代理
|
||||||
|
|
||||||
// 支持多个代理 URL(以逗号分隔)
|
// 支持多个代理 URL(以逗号分隔)
|
||||||
for _, proxyUrl := range strings.Split(proxyUrls, ",") {
|
for proxyUrl := range strings.SplitSeq(proxyUrls, ",") {
|
||||||
proxyUrl = strings.TrimSpace(proxyUrl) // 去除首尾空格
|
proxyUrl = strings.TrimSpace(proxyUrl) // 去除首尾空格
|
||||||
if proxyUrl == "" { // 跳过空的代理 URL
|
if proxyUrl == "" { // 跳过空的代理 URL
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,7 @@ func getParsedTemplate() (*template.Template, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// htmlTemplateRender 修改为使用缓存的模板。
|
// htmlTemplateRender 修改为使用缓存的模板。
|
||||||
func htmlTemplateRender(data interface{}) ([]byte, error) {
|
func htmlTemplateRender(data any) ([]byte, error) {
|
||||||
tmpl, err := getParsedTemplate()
|
tmpl, err := getParsedTemplate()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to get parsed template: %w", err)
|
return nil, fmt.Errorf("failed to get parsed template: %w", err)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue