[Middleware] [Middleware.Recovery] Skip = 3 [Middleware.CORS] Enable = false AllowOrigins = ["*"] AllowMethods = ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"] AllowHeaders = ["*"] MaxAge = 86400 AllowWildcard = true AllowWebSockets = true AllowFiles = true [Middleware.Trace] RequestHeaderKey = "X-Request-Id" ResponseTraceKey = "X-Trace-Id" [Middleware.Logger] MaxOutputRequestBodyLen = 4096 # bytes MaxOutputResponseBodyLen = 4096 # bytes [Middleware.CopyBody] MaxContentLen = 134217728 # 128MB [Middleware.Auth] Disable = true SkippedPathPrefixes = ["/api/v1/captcha/", "/api/v1/login"] SigningMethod = "HS512" # HS256/HS384/HS512 SigningKey = "XnEsT0S@" # Secret key OldSigningKey = "" # Old secret key (For change secret key) Expired = 86400 # seconds [Middleware.Auth.Store] Type = "redis" # memory/badger/redis Delimiter = ":" [Middleware.Auth.Store.Memory] CleanupInterval = 60 # seconds [Middleware.Auth.Store.Badger] Path = "data/auth" [Middleware.Auth.Store.Redis] Addr = "115.239.217.220:6379" # If empty, then use the same configuration as Storage.Cache.Redis Username = "" Password = "123456" DB = 5 [Middleware.RateLimiter] Enable = false Period = 10 # seconds MaxRequestsPerIP = 1000 MaxRequestsPerUser = 500 [Middleware.RateLimiter.Store] Type = "memory" # memory/redis [Middleware.RateLimiter.Store.Memory] Expiration = 3600 CleanupInterval = 60 [Middleware.RateLimiter.Store.Redis] Addr = "115.239.217.220:6379" # If empty, then use the same configuration as Storage.Cache.Redis Username = "" Password = "123456" DB = 4 [Middleware.Casbin] Disable = true SkippedPathPrefixes = ["/api/v1/captcha/", "/api/v1/login", "/api/v1/current/"] LoadThread = 2 AutoLoadInterval = 3 # seconds ModelFile = "rbac_model.conf" GenPolicyFile = "gen_rbac_policy.csv"