mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Refactor: move thumbnail config from ini file to database
This commit is contained in:
@@ -45,21 +45,6 @@ type slave struct {
|
||||
SignatureTTL int `validate:"omitempty,gte=1"`
|
||||
}
|
||||
|
||||
// captcha 验证码配置
|
||||
type captcha struct {
|
||||
Height int `validate:"gte=0"`
|
||||
Width int `validate:"gte=0"`
|
||||
Mode int `validate:"gte=0,lte=3"`
|
||||
ComplexOfNoiseText int `validate:"gte=0,lte=2"`
|
||||
ComplexOfNoiseDot int `validate:"gte=0,lte=2"`
|
||||
IsShowHollowLine bool
|
||||
IsShowNoiseDot bool
|
||||
IsShowNoiseText bool
|
||||
IsShowSlimeLine bool
|
||||
IsShowSineLine bool
|
||||
CaptchaLen int `validate:"gt=0"`
|
||||
}
|
||||
|
||||
// redis 配置
|
||||
type redis struct {
|
||||
Network string
|
||||
@@ -68,17 +53,6 @@ type redis struct {
|
||||
DB string
|
||||
}
|
||||
|
||||
// 缩略图 配置
|
||||
type thumb struct {
|
||||
MaxWidth uint
|
||||
MaxHeight uint
|
||||
FileSuffix string `validate:"min=1"`
|
||||
MaxTaskCount int
|
||||
EncodeMethod string `validate:"eq=jpg|eq=png"`
|
||||
EncodeQuality int `validate:"gte=1,lte=100"`
|
||||
GCAfterGen bool
|
||||
}
|
||||
|
||||
// 跨域配置
|
||||
type cors struct {
|
||||
AllowOrigins []string
|
||||
@@ -132,7 +106,6 @@ func Init(path string) {
|
||||
"SSL": SSLConfig,
|
||||
"UnixSocket": UnixConfig,
|
||||
"Redis": RedisConfig,
|
||||
"Thumbnail": ThumbConfig,
|
||||
"CORS": CORSConfig,
|
||||
"Slave": SlaveConfig,
|
||||
}
|
||||
|
||||
@@ -32,17 +32,6 @@ var CORSConfig = &cors{
|
||||
ExposeHeaders: nil,
|
||||
}
|
||||
|
||||
// ThumbConfig 缩略图配置
|
||||
var ThumbConfig = &thumb{
|
||||
MaxWidth: 400,
|
||||
MaxHeight: 300,
|
||||
FileSuffix: "._thumb",
|
||||
MaxTaskCount: -1,
|
||||
EncodeMethod: "jpg",
|
||||
GCAfterGen: false,
|
||||
EncodeQuality: 85,
|
||||
}
|
||||
|
||||
// SlaveConfig 从机配置
|
||||
var SlaveConfig = &slave{
|
||||
CallbackTimeout: 20,
|
||||
|
||||
Reference in New Issue
Block a user