chore: sync test config and update redis doc

This commit is contained in:
2026-01-17 14:23:38 +08:00
parent 549a62a975
commit 3af5b20bcc
2 changed files with 22 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ BaseURI = "http://localhost:8080"
Token = "" Token = ""
[Http] [Http]
Port = 8080 Port = 18080
[Http.Cors] [Http.Cors]
Mode = "dev" Mode = "dev"
@@ -21,16 +21,29 @@ AllowMethods = "GET,POST,PUT,PATCH,DELETE,OPTIONS"
ExposeHeaders = "*" ExposeHeaders = "*"
AllowCredentials = true AllowCredentials = true
[Http.RateLimit]
Enabled = true
Max = 5
WindowSeconds = 10
Message = "Too Many Requests"
[Http.RateLimit.Redis]
Addrs = ["127.0.0.1:6379"]
Username = ""
Password = "testpass"
DB = 2
Prefix = "rl:"
[Database] [Database]
Host = "127.0.0.1" Host = "10.1.1.2"
Port = 5432 Port = 5433
Database = "quyun_v2_test" Database = "quyun_v2"
Username = "postgres" Username = "postgres"
Password = "postgres" Password = "xixi0202"
SslMode = "disable" SslMode = "disable"
TimeZone = "Asia/Shanghai" TimeZone = "Asia/Shanghai"
MaxIdleConns = 10 MaxIdleConns = 10
MaxOpenConns = 20 MaxOpenConns = 100
ConnMaxLifetime = "1800s" ConnMaxLifetime = "1800s"
ConnMaxIdleTime = "300s" ConnMaxIdleTime = "300s"

View File

@@ -17,6 +17,9 @@ sudo -n docker run -d --name quyun-redis -p 6379:6379 docker.hub.ipao.vip/redis:
## Config sample ## Config sample
```toml ```toml
[Http]
Port = 18080 # 如果 8080 被占用,可调整端口
[Http.RateLimit] [Http.RateLimit]
Enabled = true Enabled = true
Max = 120 Max = 120