mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 00:01:10 +08:00
1.5.0
This commit is contained in:
parent
6dc20398ae
commit
7fabd3c3e2
4 changed files with 43 additions and 34 deletions
11
CHANGELOG.md
11
CHANGELOG.md
|
|
@ -1,5 +1,16 @@
|
|||
# 更新日志
|
||||
|
||||
v1.5.0
|
||||
---
|
||||
- CHANGE: 优化代码结构,提升性能
|
||||
- CHANGE: 改进核心部分,即proxy模块的转发部分,对请求体处理与响应体处理进行优化
|
||||
- CHANGE: 配置文件格式由yaml切换至toml,使其具备更好的可读性
|
||||
- ADD: 黑白名单引入通配符支持,支持完全屏蔽或放行某个用户,例如`onwer/*`表示匹配`owner`的所有仓库
|
||||
- ADD: 新增API模块,新增配置开关状态接口,以在前端指示功能状态
|
||||
- CHANGE: 由于API变动,对前端进行相应调整
|
||||
- ADD: 日志模块引入日志级别,排障更加直观
|
||||
- CHANGE: 改进黑白名单机制,若禁用相关功能,则不对相关模块进行初始化
|
||||
|
||||
24w15d
|
||||
---
|
||||
- PRE-RELEASE: 此版本是v1.5.0的预发布版本,请勿在生产环境中使用
|
||||
|
|
|
|||
58
README.md
58
README.md
|
|
@ -16,7 +16,7 @@
|
|||
- 支持Docker部署
|
||||
- 支持速率限制
|
||||
- 支持用户鉴权
|
||||
- 支持自定义黑名单
|
||||
- 支持自定义黑名单/白名单
|
||||
- 符合[RFC 7234](https://httpwg.org/specs/rfc7234.html)的HTTP Cache
|
||||
- 使用Caddy作为Web Server
|
||||
- 基于[WJQSERVER-STUDIO/golang-temp](https://github.com/WJQSERVER-STUDIO/golang-temp)模板构建,具有标准化的日志记录与构建流程
|
||||
|
|
@ -60,39 +60,33 @@ docker run -p 7210:80 -v ./ghproxy/log/run:/data/ghproxy/log -v ./ghproxy/log/ca
|
|||
|
||||
### 外部配置文件
|
||||
|
||||
本项目采用config.yaml作为外部配置,默认配置如下
|
||||
使用Docker部署时,慎重修改config.yaml,以免造成不必要的麻烦
|
||||
本项目采用`config.toml`作为外部配置,默认配置如下
|
||||
使用Docker部署时,慎重修改`config.toml`,以免造成不必要的麻烦
|
||||
|
||||
```yaml
|
||||
# 核心配置
|
||||
server:
|
||||
port: 8080 # 监听端口(小白请勿修改)
|
||||
host: "127.0.0.1" # 监听地址(小白请勿修改)
|
||||
sizelimit: 131072000 # 125MB
|
||||
```toml
|
||||
[server]
|
||||
host = "127.0.0.1" # 监听地址(小白请勿修改)
|
||||
port = 8080 #监听端口(小白请勿修改)
|
||||
sizelimit = 131072000 # 125MB
|
||||
|
||||
# 日志配置
|
||||
logger:
|
||||
logfilepath: "/data/ghproxy/log/ghproxy.log" # 日志文件路径(小白请勿修改)
|
||||
maxlogsize: 5 # MB
|
||||
[log]
|
||||
logfilepath = "/data/ghproxy/log/ghproxy.log" # 日志文件路径(小白请勿修改)
|
||||
maxlogsize = 5 # MB
|
||||
|
||||
# CORS 配置
|
||||
cors:
|
||||
enabled: true # 是否开启CORS
|
||||
[cors]
|
||||
enabled = true # 是否开启CORS
|
||||
|
||||
# 鉴权配置
|
||||
auth:
|
||||
enabled: false # 是否开启鉴权
|
||||
authtoken: "test" # 鉴权Token
|
||||
[auth]
|
||||
authtoken = "test" # 鉴权Token
|
||||
enabled = false # 是否开启鉴权
|
||||
|
||||
# 黑名单配置
|
||||
blacklist:
|
||||
enabled: true # 是否开启黑名单
|
||||
blacklistfile: "/data/ghproxy/config/blacklist.json"
|
||||
[blacklist]
|
||||
blacklistfile = "/data/ghproxy/config/blacklist.json" # 黑名单文件路径
|
||||
enabled = false # 是否开启黑名单
|
||||
|
||||
# 白名单配置
|
||||
whitelist:
|
||||
enabled: false # 是否开启白名单
|
||||
whitelistfile: "/data/ghproxy/config/whitelist.json"
|
||||
[whitelist]
|
||||
enabled = false # 是否开启白名单
|
||||
whitelistfile = "/data/ghproxy/config/whitelist.json" # 白名单文件路径
|
||||
|
||||
```
|
||||
|
||||
|
|
@ -105,7 +99,7 @@ whitelist:
|
|||
"blacklist": [
|
||||
"test/test1",
|
||||
"example/repo2",
|
||||
"another/repo3"
|
||||
"another/*"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
|
@ -119,7 +113,7 @@ whitelist:
|
|||
"whitelist": [
|
||||
"test/test1",
|
||||
"example/repo2",
|
||||
"another/repo3"
|
||||
"another/*"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
|
@ -139,6 +133,10 @@ example.com {
|
|||
}
|
||||
```
|
||||
|
||||
### 前端页面
|
||||
|
||||

|
||||
|
||||
## TODO & DEV
|
||||
|
||||
### TODO
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ RUN wget -O /usr/local/bin/init.sh https://raw.githubusercontent.com/${USER}/${R
|
|||
|
||||
# 拉取配置
|
||||
RUN wget -O /data/caddy/Caddyfile https://raw.githubusercontent.com/${USER}/${REPO}/main/caddyfile/release/Caddyfile
|
||||
RUN wget -O /data/${APPLICATION}/config.yaml https://raw.githubusercontent.com/${USER}/${REPO}/main/config/config.yaml
|
||||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -14,13 +14,13 @@ if [ ! -f /data/${APPLICATION}/config/whitelist.json ]; then
|
|||
cp /data/${APPLICATION}/whitelist.json /data/${APPLICATION}/config/whitelist.json
|
||||
fi
|
||||
|
||||
if [ ! -f /data/${APPLICATION}/config/config.yaml ]; then
|
||||
cp /data/${APPLICATION}/config.yaml /data/${APPLICATION}/config/config.yaml
|
||||
if [ ! -f /data/${APPLICATION}/config/config.toml ]; then
|
||||
cp /data/${APPLICATION}/config.toml /data/${APPLICATION}/config/config.toml
|
||||
fi
|
||||
|
||||
/data/caddy/caddy run --config /data/caddy/config/Caddyfile > /data/${APPLICATION}/log/caddy.log 2>&1 &
|
||||
|
||||
/data/${APPLICATION}/${APPLICATION} -cfg /data/${APPLICATION}/config/config.yaml > /data/${APPLICATION}/log/run.log 2>&1 &
|
||||
/data/${APPLICATION}/${APPLICATION} -cfg /data/${APPLICATION}/config/config.toml > /data/${APPLICATION}/log/run.log 2>&1 &
|
||||
|
||||
while true; do
|
||||
sleep 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue