From 09644c32188f8aa6dc3d133ffe30d80f54996508 Mon Sep 17 00:00:00 2001 From: WJQSERVER Date: Wed, 15 Jan 2025 07:28:50 +0800 Subject: [PATCH] update --- .github/workflows/build-dev.yml | 4 +++- docker/dockerfile/dev/Dockerfile | 19 +++++++++---------- main.go | 2 ++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index cd94d58..e79aaeb 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -78,6 +78,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + ref: dev - name: Load VERSION run: | if [ -f DEV-VERSION ]; then @@ -106,4 +108,4 @@ jobs: push: true tags: | ${{ env.IMAGE_NAME }}:${{ env.VERSION }} - ${{ env.IMAGE_NAME }}:dev + ${{ env.IMAGE_NAME }}:dev \ No newline at end of file diff --git a/docker/dockerfile/dev/Dockerfile b/docker/dockerfile/dev/Dockerfile index 7b4f489..10750cc 100644 --- a/docker/dockerfile/dev/Dockerfile +++ b/docker/dockerfile/dev/Dockerfile @@ -16,21 +16,21 @@ RUN mkdir -p /data/${APPLICATION}/log RUN apk add --no-cache curl wget tar # 前端 -RUN wget -O /data/www/index.html https://raw.githubusercontent.com/${USER}/${REPO}/main/pages/index.html -RUN wget -O /data/www/favicon.ico https://raw.githubusercontent.com/${USER}/${REPO}/main/pages/favicon.ico +RUN wget -O /data/www/index.html https://raw.githubusercontent.com/${USER}/${REPO}/dev/pages/index.html +RUN wget -O /data/www/favicon.ico https://raw.githubusercontent.com/${USER}/${REPO}/dev/pages/favicon.ico # 后端 -RUN VERSION=$(curl -s https://raw.githubusercontent.com/${USER}/${REPO}/main/DEV-VERSION) && \ +RUN VERSION=$(curl -s https://raw.githubusercontent.com/${USER}/${REPO}/dev/DEV-VERSION) && \ wget -O /data/${APPLICATION}/${APPLICATION}-${TARGETOS}-${TARGETARCH}.tar.gz https://github.com/${USER}/${REPO}/releases/download/$VERSION/${APPLICATION}-${TARGETOS}-${TARGETARCH}.tar.gz && \ tar -zxvf /data/${APPLICATION}/${APPLICATION}-${TARGETOS}-${TARGETARCH}.tar.gz -C /data/${APPLICATION} && \ rm -rf /data/${APPLICATION}/${APPLICATION}-${TARGETOS}-${TARGETARCH}.tar.gz -RUN wget -O /usr/local/bin/init.sh https://raw.githubusercontent.com/${USER}/${REPO}/main/docker/dockerfile/dev/init.sh +RUN wget -O /usr/local/bin/init.sh https://raw.githubusercontent.com/${USER}/${REPO}/dev/docker/dockerfile/dev/init.sh # 拉取配置 -RUN wget -O /data/caddy/Caddyfile https://raw.githubusercontent.com/${USER}/${REPO}/main/caddyfile/dev/Caddyfile -RUN wget -O /data/${APPLICATION}/config.toml https://raw.githubusercontent.com/${USER}/${REPO}/main/config/config.toml -RUN wget -O /data/${APPLICATION}/blacklist.json https://raw.githubusercontent.com/${USER}/${REPO}/main/config/blacklist.json -RUN wget -O /data/${APPLICATION}/whitelist.json https://raw.githubusercontent.com/${USER}/${REPO}/main/config/whitelist.json +RUN wget -O /data/caddy/Caddyfile https://raw.githubusercontent.com/${USER}/${REPO}/devcaddyfile/dev/Caddyfile +RUN wget -O /data/${APPLICATION}/config.toml https://raw.githubusercontent.com/${USER}/${REPO}/dev/config/config.toml +RUN wget -O /data/${APPLICATION}/blacklist.json https://raw.githubusercontent.com/${USER}/${REPO}/dev/config/blacklist.json +RUN wget -O /data/${APPLICATION}/whitelist.json https://raw.githubusercontent.com/${USER}/${REPO}/dev/config/whitelist.json # 权限 RUN chmod +x /data/${APPLICATION}/${APPLICATION} @@ -49,5 +49,4 @@ COPY --from=builder /usr/local/bin/init.sh /usr/local/bin/init.sh RUN chmod +x /data/${APPLICATION}/${APPLICATION} RUN chmod +x /usr/local/bin/init.sh -CMD ["/usr/local/bin/init.sh"] - +CMD ["/usr/local/bin/init.sh"] \ No newline at end of file diff --git a/main.go b/main.go index 50de3dc..cf6c057 100644 --- a/main.go +++ b/main.go @@ -145,6 +145,8 @@ func init() { router.NoRoute(func(c *gin.Context) { proxy.NoRouteHandler(cfg, limiter, iplimiter, runMode)(c) }) + + fmt.Printf("GHProxy Version: %s\n", version) } func main() {