mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-29 20:31:56 +08:00
Feat: sign http request / read running mode from config file
This commit is contained in:
@@ -18,8 +18,11 @@ type database struct {
|
||||
|
||||
// system 系统通用配置
|
||||
type system struct {
|
||||
Mode string `validate:"eq=master|eq=slave"`
|
||||
Listen string `validate:"required"`
|
||||
Debug bool
|
||||
SessionSecret string
|
||||
SlaveSecret string `validate:"omitempty,gte=64"`
|
||||
}
|
||||
|
||||
// captcha 验证码配置
|
||||
@@ -84,7 +87,7 @@ func Init(path string) {
|
||||
for sectionName, sectionStruct := range sections {
|
||||
err = mapSection(sectionName, sectionStruct)
|
||||
if err != nil {
|
||||
util.Log().Warning("配置文件 %s 分区解析失败: %s", sectionName, err)
|
||||
util.Log().Panic("配置文件 %s 分区解析失败: %s", sectionName, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,9 @@ var DatabaseConfig = &database{
|
||||
|
||||
// SystemConfig 系统公用配置
|
||||
var SystemConfig = &system{
|
||||
Debug: false,
|
||||
Debug: false,
|
||||
Mode: "master",
|
||||
Listen: ":5000",
|
||||
}
|
||||
|
||||
// CaptchaConfig 验证码配置
|
||||
|
||||
Reference in New Issue
Block a user