Merge pull request #67 from router-for-me/plus

v6.6.54
This commit is contained in:
Luis Pater
2025-12-25 21:07:45 +08:00
committed by GitHub
3 changed files with 15 additions and 7 deletions
+3
View File
@@ -39,6 +39,9 @@ api-keys:
# Enable debug logging # Enable debug logging
debug: false debug: false
# When true, disable high-overhead HTTP middleware features to reduce per-request memory usage under high concurrency.
commercial-mode: false
# Open OAuth URLs in incognito/private browser mode. # Open OAuth URLs in incognito/private browser mode.
# Useful when you want to login with a different account without logging out from your current session. # Useful when you want to login with a different account without logging out from your current session.
# Default: false (but Kiro auth defaults to true for multi-account support) # Default: false (but Kiro auth defaults to true for multi-account support)
+2
View File
@@ -209,6 +209,7 @@ func NewServer(cfg *config.Config, authManager *auth.Manager, accessManager *sdk
// Resolve logs directory relative to the configuration file directory. // Resolve logs directory relative to the configuration file directory.
var requestLogger logging.RequestLogger var requestLogger logging.RequestLogger
var toggle func(bool) var toggle func(bool)
if !cfg.CommercialMode {
if optionState.requestLoggerFactory != nil { if optionState.requestLoggerFactory != nil {
requestLogger = optionState.requestLoggerFactory(cfg, configFilePath) requestLogger = optionState.requestLoggerFactory(cfg, configFilePath)
} }
@@ -218,6 +219,7 @@ func NewServer(cfg *config.Config, authManager *auth.Manager, accessManager *sdk
toggle = setter.SetEnabled toggle = setter.SetEnabled
} }
} }
}
engine.Use(corsMiddleware()) engine.Use(corsMiddleware())
wd, err := os.Getwd() wd, err := os.Getwd()
+3
View File
@@ -39,6 +39,9 @@ type Config struct {
// Debug enables or disables debug-level logging and other debug features. // Debug enables or disables debug-level logging and other debug features.
Debug bool `yaml:"debug" json:"debug"` Debug bool `yaml:"debug" json:"debug"`
// CommercialMode disables high-overhead HTTP middleware features to minimize per-request memory usage.
CommercialMode bool `yaml:"commercial-mode" json:"commercial-mode"`
// LoggingToFile controls whether application logs are written to rotating files or stdout. // LoggingToFile controls whether application logs are written to rotating files or stdout.
LoggingToFile bool `yaml:"logging-to-file" json:"logging-to-file"` LoggingToFile bool `yaml:"logging-to-file" json:"logging-to-file"`