115 lines
2.5 KiB
TOML
115 lines
2.5 KiB
TOML
[App]
|
||
Mode = "debug" # develop, production
|
||
|
||
[Captcha]
|
||
KeyLong = 6
|
||
ImgWidth = 240 #验证码宽度
|
||
ImgHeight = 80 # 验证码高度
|
||
OpenCaptcha = 0 # 防爆破验证码开启此数,0代表每次登录都需要验证码,其他数字代表错误密码此数,如3代表错误三次后出现验证码
|
||
OpenCaptchaTimeOut = "1h" # 防爆破验证码超时时间,单位:s(秒)
|
||
|
||
[Storage]
|
||
Driver = "local"
|
||
|
||
[Storage.Local]
|
||
Path = "./storage"
|
||
|
||
[Storage.AwsS3]
|
||
Bucket = "bucket"
|
||
Region = "region"
|
||
Endpoint = "endpoint"
|
||
DisableSSL = false
|
||
SecretID = ""
|
||
SecretKey = ""
|
||
BaseURL = ""
|
||
Path = ""
|
||
S3ForcePathStyle = false
|
||
|
||
[Storage.AliYunOSS]
|
||
Bucket = "bucket"
|
||
Region = "region"
|
||
Endpoint = "endpoint"
|
||
AccessKeyID = ""
|
||
AccessKeySecret = ""
|
||
BaseURL = ""
|
||
Path = ""
|
||
|
||
[Http]
|
||
Static = "./dist"
|
||
Https = false
|
||
HttpsCert = ""
|
||
HttpKey = ""
|
||
Port = 9800
|
||
|
||
[Http.Captcha]
|
||
KeyLong = 6
|
||
Width = 240
|
||
Height = 80
|
||
OpenCaptcha = 0
|
||
OpenCaptchaTimeout = 3600
|
||
|
||
[Http.JWT]
|
||
SigningKey = "f3a0ed18-3eea-4bc9-b440-d56c3bb77bd8"
|
||
ExpiresTime = "168h" # 7 days
|
||
BufferTime = "24h"
|
||
Issuer = "AtomFramework"
|
||
|
||
[Http.Cors]
|
||
# 跨域配置
|
||
# 需要配合 server/initialize/router.go#L32 使用
|
||
# 放行模式: Allow-all, 放行全部; whitelist, 白名单模式, 来自白名单内域名的请求添加 cors 头; strict-whitelist 严格白名单模式, 白名单外的请求一律拒绝
|
||
Mode = "strict-whitelist"
|
||
|
||
[[Http.Cors.Whitelist]]
|
||
AllowOrigin = "example1.com"
|
||
AllowHeaders = "Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id"
|
||
AllowMethods = "POST, GET"
|
||
ExposeHeaders = "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type"
|
||
AllowCredentials = true
|
||
|
||
[[Http.Cors.Whitelist]]
|
||
AllowOrigin = "example2.com"
|
||
AllowHeaders = "content-type"
|
||
AllowMethods = "GET, POST"
|
||
ExposeHeaders = "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type"
|
||
AllowCredentials = true
|
||
|
||
[Log]
|
||
Driver = "zap"
|
||
Level = "debug"
|
||
|
||
[Log.Zap]
|
||
Prefix = "[github.com/flipped-aurora/gin-vue-admin/server]"
|
||
Format = "console"
|
||
Director = "log"
|
||
EncodeLevel = "LowercaseColorLevelEncoder"
|
||
StacktraceKey = "stacktrace"
|
||
MaxAge = 0
|
||
ShowLine = true
|
||
LogInConsole = true
|
||
|
||
[Database]
|
||
Driver = "sqlite"
|
||
|
||
[Database.MySQL]
|
||
Host = "localhost"
|
||
Port = 3306
|
||
Database = "demos11"
|
||
Username = "root"
|
||
Password = "root"
|
||
Prefix = ""
|
||
Singular = false
|
||
MaxIdleConns = 10
|
||
MaxOpenConns = 200
|
||
Engine = "InnoDB"
|
||
|
||
[Database.SQLite]
|
||
File = "sqlite.db"
|
||
|
||
[Database.Redis]
|
||
Host = "localhost"
|
||
Port = 3306
|
||
Database = 0
|
||
Username = ""
|
||
Password = ""
|