mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-06-15 16:27: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
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) {
|
||||
sizeLimit := cfg.Server.SizeLimit
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"MaxResponseBodySize": sizeLimit,
|
||||
}))
|
||||
}
|
||||
|
||||
func WhiteListStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"Whitelist": cfg.Whitelist.Enabled,
|
||||
}))
|
||||
}
|
||||
|
||||
func BlackListStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"Blacklist": cfg.Blacklist.Enabled,
|
||||
}))
|
||||
}
|
||||
|
||||
func CorsStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"Cors": cfg.Server.Cors,
|
||||
}))
|
||||
}
|
||||
|
||||
func HealthcheckHandler(c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"Status": "OK",
|
||||
"Repo": "WJQSERVER-STUDIO/GHProxy",
|
||||
"Author": "WJQSERVER-STUDIO",
|
||||
|
|
@ -89,7 +89,7 @@ func HealthcheckHandler(c *touka.Context) {
|
|||
|
||||
func VersionHandler(c *touka.Context, version string) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"Version": version,
|
||||
"Repo": "WJQSERVER-STUDIO/GHProxy",
|
||||
"Author": "WJQSERVER-STUDIO",
|
||||
|
|
@ -98,35 +98,35 @@ func VersionHandler(c *touka.Context, version string) {
|
|||
|
||||
func RateLimitStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"RateLimit": cfg.RateLimit.Enabled,
|
||||
}))
|
||||
}
|
||||
|
||||
func RateLimitLimitHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"RatePerMinute": cfg.RateLimit.RatePerMinute,
|
||||
}))
|
||||
}
|
||||
|
||||
func SmartGitStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"enabled": cfg.GitClone.Mode == "cache",
|
||||
}))
|
||||
}
|
||||
|
||||
func shellNestStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"enabled": cfg.Shell.Editor,
|
||||
}))
|
||||
}
|
||||
|
||||
func ociProxyStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"enabled": cfg.Docker.Enabled,
|
||||
"target": cfg.Docker.Target,
|
||||
}))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue