- 新增 RateLimit 中间件:golang.org/x/time/rate 令牌桶,超出返回 429 - server.rate_limit_qps 配置(默认 0 不限制,突发 10),公网部署建议开启 - 业务路由统一接入 限流 → 鉴权 中间件链;/healthz 与静态资源不限流 - X-Forwarded-For 优先取真实客户端 IP(反代场景),visitor 表定时清理防泄漏 - config.yaml 补齐 protect_all 与 rate_limit_qps 配置项(此前仅存在于代码)
44 lines
1.5 KiB
AMPL
44 lines
1.5 KiB
AMPL
module fanqie
|
|
|
|
go 1.25.0
|
|
|
|
require (
|
|
github.com/PuerkitoBio/goquery v1.8.1
|
|
github.com/fsnotify/fsnotify v1.7.0
|
|
github.com/google/uuid v1.4.0
|
|
github.com/jackc/pgx/v5 v5.11.0
|
|
github.com/mattn/go-sqlite3 v1.14.18
|
|
github.com/redis/go-redis/v9 v9.22.0
|
|
github.com/spf13/viper v1.18.2
|
|
golang.org/x/time v0.5.0
|
|
)
|
|
|
|
require (
|
|
github.com/andybalholm/cascadia v1.3.1 // indirect
|
|
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
|
github.com/google/go-cmp v0.7.0 // indirect
|
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
|
github.com/jackc/pgpassfile v1.0.0 // indirect
|
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
|
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
|
github.com/magiconair/properties v1.8.7 // indirect
|
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
|
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
|
github.com/sagikazarmark/locafero v0.4.0 // indirect
|
|
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
|
github.com/sourcegraph/conc v0.3.0 // indirect
|
|
github.com/spf13/afero v1.11.0 // indirect
|
|
github.com/spf13/cast v1.6.0 // indirect
|
|
github.com/spf13/pflag v1.0.5 // indirect
|
|
github.com/subosito/gotenv v1.6.0 // indirect
|
|
go.uber.org/atomic v1.11.0 // indirect
|
|
go.uber.org/multierr v1.9.0 // indirect
|
|
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
|
golang.org/x/net v0.46.0 // indirect
|
|
golang.org/x/sync v0.17.0 // indirect
|
|
golang.org/x/sys v0.37.0 // indirect
|
|
golang.org/x/text v0.30.0 // indirect
|
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
|
)
|