mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 09:44:26 +08:00
move the request_id_header option to the server section and the enable_two_factor option to the user section
This commit is contained in:
@@ -37,6 +37,9 @@ enable_gzip = false
|
|||||||
# Set to true to log each request and execution time
|
# Set to true to log each request and execution time
|
||||||
log_request = true
|
log_request = true
|
||||||
|
|
||||||
|
# Add X-Request-Id header to response to track user request or error, default is true
|
||||||
|
request_id_header = true
|
||||||
|
|
||||||
[mcp]
|
[mcp]
|
||||||
# Set to true to enable MCP (Model Context Protocol) server (via http / https web server) for AI/LLM access
|
# Set to true to enable MCP (Model Context Protocol) server (via http / https web server) for AI/LLM access
|
||||||
enable_mcp = false
|
enable_mcp = false
|
||||||
@@ -190,9 +193,6 @@ enable_create_scheduled_transaction = true
|
|||||||
# Used for signing, you must change it to keep your user data safe before you first run ezBookkeeping
|
# Used for signing, you must change it to keep your user data safe before you first run ezBookkeeping
|
||||||
secret_key =
|
secret_key =
|
||||||
|
|
||||||
# Set to true to enable two-factor authorization
|
|
||||||
enable_two_factor = true
|
|
||||||
|
|
||||||
# Token expired seconds (60 - 4294967295), default is 2592000 (30 days)
|
# Token expired seconds (60 - 4294967295), default is 2592000 (30 days)
|
||||||
token_expired_time = 2592000
|
token_expired_time = 2592000
|
||||||
|
|
||||||
@@ -215,9 +215,6 @@ max_failures_per_ip_per_minute = 5
|
|||||||
# Maximum count of password / token check failures (0 - 4294967295) per user per minute (use the above duplicate checker), default is 5, set to 0 to disable
|
# Maximum count of password / token check failures (0 - 4294967295) per user per minute (use the above duplicate checker), default is 5, set to 0 to disable
|
||||||
max_failures_per_user_per_minute = 5
|
max_failures_per_user_per_minute = 5
|
||||||
|
|
||||||
# Add X-Request-Id header to response to track user request or error, default is true
|
|
||||||
request_id_header = true
|
|
||||||
|
|
||||||
[user]
|
[user]
|
||||||
# Set to true to allow users to register account by themselves
|
# Set to true to allow users to register account by themselves
|
||||||
enable_register = true
|
enable_register = true
|
||||||
@@ -234,6 +231,9 @@ enable_forget_password = true
|
|||||||
# Set to true to require email must be verified when use forget password
|
# Set to true to require email must be verified when use forget password
|
||||||
forget_password_require_email_verify = false
|
forget_password_require_email_verify = false
|
||||||
|
|
||||||
|
# Set to true to enable two-factor authorization
|
||||||
|
enable_two_factor = true
|
||||||
|
|
||||||
# Set to true to allow users to upload transaction pictures
|
# Set to true to allow users to upload transaction pictures
|
||||||
enable_transaction_picture = true
|
enable_transaction_picture = true
|
||||||
|
|
||||||
|
|||||||
@@ -245,8 +245,9 @@ type Config struct {
|
|||||||
|
|
||||||
StaticRootPath string
|
StaticRootPath string
|
||||||
|
|
||||||
EnableGZip bool
|
EnableGZip bool
|
||||||
EnableRequestLog bool
|
EnableRequestLog bool
|
||||||
|
EnableRequestIdHeader bool
|
||||||
|
|
||||||
// MCP
|
// MCP
|
||||||
EnableMCPServer bool
|
EnableMCPServer bool
|
||||||
@@ -299,7 +300,6 @@ type Config struct {
|
|||||||
// Secret
|
// Secret
|
||||||
SecretKeyNoSet bool
|
SecretKeyNoSet bool
|
||||||
SecretKey string
|
SecretKey string
|
||||||
EnableTwoFactor bool
|
|
||||||
TokenExpiredTime uint32
|
TokenExpiredTime uint32
|
||||||
TokenExpiredTimeDuration time.Duration
|
TokenExpiredTimeDuration time.Duration
|
||||||
TokenMinRefreshInterval uint32
|
TokenMinRefreshInterval uint32
|
||||||
@@ -311,7 +311,6 @@ type Config struct {
|
|||||||
PasswordResetTokenExpiredTimeDuration time.Duration
|
PasswordResetTokenExpiredTimeDuration time.Duration
|
||||||
MaxFailuresPerIpPerMinute uint32
|
MaxFailuresPerIpPerMinute uint32
|
||||||
MaxFailuresPerUserPerMinute uint32
|
MaxFailuresPerUserPerMinute uint32
|
||||||
EnableRequestIdHeader bool
|
|
||||||
|
|
||||||
// User
|
// User
|
||||||
EnableUserRegister bool
|
EnableUserRegister bool
|
||||||
@@ -319,6 +318,7 @@ type Config struct {
|
|||||||
EnableUserForceVerifyEmail bool
|
EnableUserForceVerifyEmail bool
|
||||||
EnableUserForgetPassword bool
|
EnableUserForgetPassword bool
|
||||||
ForgetPasswordRequireVerifyEmail bool
|
ForgetPasswordRequireVerifyEmail bool
|
||||||
|
EnableTwoFactor bool
|
||||||
EnableTransactionPictures bool
|
EnableTransactionPictures bool
|
||||||
MaxTransactionPictureFileSize uint32
|
MaxTransactionPictureFileSize uint32
|
||||||
EnableScheduledTransaction bool
|
EnableScheduledTransaction bool
|
||||||
@@ -561,6 +561,7 @@ func loadServerConfiguration(config *Config, configFile *ini.File, sectionName s
|
|||||||
|
|
||||||
config.EnableGZip = getConfigItemBoolValue(configFile, sectionName, "enable_gzip", false)
|
config.EnableGZip = getConfigItemBoolValue(configFile, sectionName, "enable_gzip", false)
|
||||||
config.EnableRequestLog = getConfigItemBoolValue(configFile, sectionName, "log_request", false)
|
config.EnableRequestLog = getConfigItemBoolValue(configFile, sectionName, "log_request", false)
|
||||||
|
config.EnableRequestIdHeader = getConfigItemBoolValue(configFile, sectionName, "request_id_header", true)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -801,7 +802,6 @@ func loadCronConfiguration(config *Config, configFile *ini.File, sectionName str
|
|||||||
func loadSecurityConfiguration(config *Config, configFile *ini.File, sectionName string) error {
|
func loadSecurityConfiguration(config *Config, configFile *ini.File, sectionName string) error {
|
||||||
config.SecretKeyNoSet = !getConfigItemIsSet(configFile, sectionName, "secret_key")
|
config.SecretKeyNoSet = !getConfigItemIsSet(configFile, sectionName, "secret_key")
|
||||||
config.SecretKey = getConfigItemStringValue(configFile, sectionName, "secret_key", defaultSecretKey)
|
config.SecretKey = getConfigItemStringValue(configFile, sectionName, "secret_key", defaultSecretKey)
|
||||||
config.EnableTwoFactor = getConfigItemBoolValue(configFile, sectionName, "enable_two_factor", true)
|
|
||||||
|
|
||||||
config.TokenExpiredTime = getConfigItemUint32Value(configFile, sectionName, "token_expired_time", defaultTokenExpiredTime)
|
config.TokenExpiredTime = getConfigItemUint32Value(configFile, sectionName, "token_expired_time", defaultTokenExpiredTime)
|
||||||
|
|
||||||
@@ -844,8 +844,6 @@ func loadSecurityConfiguration(config *Config, configFile *ini.File, sectionName
|
|||||||
config.MaxFailuresPerIpPerMinute = getConfigItemUint32Value(configFile, sectionName, "max_failures_per_ip_per_minute", defaultMaxFailuresPerIpPerMinute)
|
config.MaxFailuresPerIpPerMinute = getConfigItemUint32Value(configFile, sectionName, "max_failures_per_ip_per_minute", defaultMaxFailuresPerIpPerMinute)
|
||||||
config.MaxFailuresPerUserPerMinute = getConfigItemUint32Value(configFile, sectionName, "max_failures_per_user_per_minute", defaultMaxFailuresPerUserPerMinute)
|
config.MaxFailuresPerUserPerMinute = getConfigItemUint32Value(configFile, sectionName, "max_failures_per_user_per_minute", defaultMaxFailuresPerUserPerMinute)
|
||||||
|
|
||||||
config.EnableRequestIdHeader = getConfigItemBoolValue(configFile, sectionName, "request_id_header", true)
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -855,6 +853,7 @@ func loadUserConfiguration(config *Config, configFile *ini.File, sectionName str
|
|||||||
config.EnableUserForceVerifyEmail = getConfigItemBoolValue(configFile, sectionName, "enable_force_email_verify", false)
|
config.EnableUserForceVerifyEmail = getConfigItemBoolValue(configFile, sectionName, "enable_force_email_verify", false)
|
||||||
config.EnableUserForgetPassword = getConfigItemBoolValue(configFile, sectionName, "enable_forget_password", false)
|
config.EnableUserForgetPassword = getConfigItemBoolValue(configFile, sectionName, "enable_forget_password", false)
|
||||||
config.ForgetPasswordRequireVerifyEmail = getConfigItemBoolValue(configFile, sectionName, "forget_password_require_email_verify", false)
|
config.ForgetPasswordRequireVerifyEmail = getConfigItemBoolValue(configFile, sectionName, "forget_password_require_email_verify", false)
|
||||||
|
config.EnableTwoFactor = getConfigItemBoolValue(configFile, sectionName, "enable_two_factor", true)
|
||||||
config.EnableTransactionPictures = getConfigItemBoolValue(configFile, sectionName, "enable_transaction_picture", false)
|
config.EnableTransactionPictures = getConfigItemBoolValue(configFile, sectionName, "enable_transaction_picture", false)
|
||||||
config.MaxTransactionPictureFileSize = getConfigItemUint32Value(configFile, sectionName, "max_transaction_picture_size", defaultTransactionPictureFileMaxSize)
|
config.MaxTransactionPictureFileSize = getConfigItemUint32Value(configFile, sectionName, "max_transaction_picture_size", defaultTransactionPictureFileMaxSize)
|
||||||
config.EnableScheduledTransaction = getConfigItemBoolValue(configFile, sectionName, "enable_scheduled_transaction", false)
|
config.EnableScheduledTransaction = getConfigItemBoolValue(configFile, sectionName, "enable_scheduled_transaction", false)
|
||||||
|
|||||||
Reference in New Issue
Block a user