mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
enhance: escalate ProxyHeader as a global config
This commit is contained in:
@@ -26,7 +26,8 @@ type system struct {
|
||||
Debug bool
|
||||
SessionSecret string
|
||||
HashIDSalt string
|
||||
GracePeriod int `validate:"gte=0"`
|
||||
GracePeriod int `validate:"gte=0"`
|
||||
ProxyHeader string `validate:"required_with=Listen"`
|
||||
}
|
||||
|
||||
type ssl struct {
|
||||
@@ -36,9 +37,8 @@ type ssl struct {
|
||||
}
|
||||
|
||||
type unix struct {
|
||||
Listen string
|
||||
ProxyHeader string `validate:"required_with=Listen"`
|
||||
Perm uint32
|
||||
Listen string
|
||||
Perm uint32
|
||||
}
|
||||
|
||||
// slave 作为slave存储端配置
|
||||
|
||||
@@ -18,9 +18,10 @@ var DatabaseConfig = &database{
|
||||
|
||||
// SystemConfig 系统公用配置
|
||||
var SystemConfig = &system{
|
||||
Debug: false,
|
||||
Mode: "master",
|
||||
Listen: ":5212",
|
||||
Debug: false,
|
||||
Mode: "master",
|
||||
Listen: ":5212",
|
||||
ProxyHeader: "X-Forwarded-For",
|
||||
}
|
||||
|
||||
// CORSConfig 跨域配置
|
||||
@@ -47,8 +48,7 @@ var SSLConfig = &ssl{
|
||||
}
|
||||
|
||||
var UnixConfig = &unix{
|
||||
Listen: "",
|
||||
ProxyHeader: "X-Forwarded-For",
|
||||
Listen: "",
|
||||
}
|
||||
|
||||
var OptionOverwrite = map[string]interface{}{}
|
||||
|
||||
Reference in New Issue
Block a user