Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 972baee564 | |||
| a281d4c779 | |||
| e4252d0596 |
+3
-1
@@ -1 +1,3 @@
|
|||||||
demo.toml
|
demo.toml
|
||||||
|
dev
|
||||||
|
*.log
|
||||||
@@ -1,5 +1,20 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
25w01d
|
||||||
|
---
|
||||||
|
- PRE-RELEASE: 此版本是v1.8.0的预发布版本,请勿在生产环境中使用
|
||||||
|
- CHANGE: 尝试修复部分问题
|
||||||
|
|
||||||
|
25w01c
|
||||||
|
---
|
||||||
|
- PRE-RELEASE: 此版本是v1.8.0的预发布版本,请勿在生产环境中使用
|
||||||
|
- CHANGE: 改进token参数透传功能
|
||||||
|
|
||||||
|
25w01b
|
||||||
|
---
|
||||||
|
- PRE-RELEASE: 此版本是v1.8.0的预发布版本,请勿在生产环境中使用
|
||||||
|
- CHANGE: 将底包更新至`v2.9.0`
|
||||||
|
|
||||||
25w01a
|
25w01a
|
||||||
---
|
---
|
||||||
- PRE-RELEASE: 此版本是v1.8.0的预发布版本,请勿在生产环境中使用; 同时,这也是2025年的第一个pre-release版本,祝各位新年快乐! (同时,请注意版本号的变化)
|
- PRE-RELEASE: 此版本是v1.8.0的预发布版本,请勿在生产环境中使用; 同时,这也是2025年的第一个pre-release版本,祝各位新年快乐! (同时,请注意版本号的变化)
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
25w01a
|
25w01d
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM wjqserver/caddy:v24.12.20-alpine AS builder
|
FROM wjqserver/caddy:2.9.0-alpine AS builder
|
||||||
|
|
||||||
ARG USER=WJQSERVER-STUDIO
|
ARG USER=WJQSERVER-STUDIO
|
||||||
ARG REPO=ghproxy
|
ARG REPO=ghproxy
|
||||||
@@ -36,7 +36,7 @@ RUN wget -O /data/${APPLICATION}/whitelist.json https://raw.githubusercontent.co
|
|||||||
RUN chmod +x /data/${APPLICATION}/${APPLICATION}
|
RUN chmod +x /data/${APPLICATION}/${APPLICATION}
|
||||||
RUN chmod +x /usr/local/bin/init.sh
|
RUN chmod +x /usr/local/bin/init.sh
|
||||||
|
|
||||||
FROM wjqserver/caddy:v24.12.20-alpine
|
FROM wjqserver/caddy:2.9.0-alpine
|
||||||
|
|
||||||
RUN apk add --no-cache curl
|
RUN apk add --no-cache curl
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM wjqserver/caddy:v24.12.20-alpine AS builder
|
FROM wjqserver/caddy:2.9.0-alpine AS builder
|
||||||
|
|
||||||
ARG USER=WJQSERVER-STUDIO
|
ARG USER=WJQSERVER-STUDIO
|
||||||
ARG REPO=ghproxy
|
ARG REPO=ghproxy
|
||||||
@@ -36,7 +36,7 @@ RUN wget -O /data/${APPLICATION}/whitelist.json https://raw.githubusercontent.co
|
|||||||
RUN chmod +x /data/${APPLICATION}/${APPLICATION}
|
RUN chmod +x /data/${APPLICATION}/${APPLICATION}
|
||||||
RUN chmod +x /usr/local/bin/init.sh
|
RUN chmod +x /usr/local/bin/init.sh
|
||||||
|
|
||||||
FROM wjqserver/caddy:v24.12.20-alpine
|
FROM wjqserver/caddy:2.9.0-alpine
|
||||||
|
|
||||||
RUN apk add --no-cache curl
|
RUN apk add --no-cache curl
|
||||||
|
|
||||||
|
|||||||
@@ -179,6 +179,7 @@ func ProxyRequest(c *gin.Context, u string, cfg *config.Config, mode string, run
|
|||||||
// 发送HEAD请求, 预获取Content-Length
|
// 发送HEAD请求, 预获取Content-Length
|
||||||
headReq := client.R()
|
headReq := client.R()
|
||||||
setRequestHeaders(c, headReq)
|
setRequestHeaders(c, headReq)
|
||||||
|
authPassThrough(c, cfg, headReq)
|
||||||
|
|
||||||
headResp, err := headReq.Head(u)
|
headResp, err := headReq.Head(u)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -286,6 +287,9 @@ func authPassThrough(c *gin.Context, cfg *config.Config, req *req.Request) {
|
|||||||
req.SetHeader("Authorization", "token "+token)
|
req.SetHeader("Authorization", "token "+token)
|
||||||
} else {
|
} else {
|
||||||
logWarning("%s %s %s %s %s Auth-Error: Conflict Auth Method", c.ClientIP(), c.Request.Method, c.Request.URL.String(), c.Request.Header.Get("User-Agent"), c.Request.Proto)
|
logWarning("%s %s %s %s %s Auth-Error: Conflict Auth Method", c.ClientIP(), c.Request.Method, c.Request.URL.String(), c.Request.Header.Get("User-Agent"), c.Request.Proto)
|
||||||
|
// 500 Internal Server Error
|
||||||
|
c.JSON(http.StatusInternalServerError, gin.H{"error": "Conflict Auth Method"})
|
||||||
|
return
|
||||||
}
|
}
|
||||||
case "header":
|
case "header":
|
||||||
if cfg.Auth.Enabled {
|
if cfg.Auth.Enabled {
|
||||||
@@ -293,6 +297,9 @@ func authPassThrough(c *gin.Context, cfg *config.Config, req *req.Request) {
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
logWarning("%s %s %s %s %s Invalid Auth Method / Auth Method is not be set", c.ClientIP(), c.Request.Method, c.Request.URL.String(), c.Request.Header.Get("User-Agent"), c.Request.Proto)
|
logWarning("%s %s %s %s %s Invalid Auth Method / Auth Method is not be set", c.ClientIP(), c.Request.Method, c.Request.URL.String(), c.Request.Header.Get("User-Agent"), c.Request.Proto)
|
||||||
|
// 500 Internal Server Error
|
||||||
|
c.JSON(http.StatusInternalServerError, gin.H{"error": "Invalid Auth Method / Auth Method is not be set"})
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user