only show asterisks for passwords with values in startup config output
This commit is contained in:
+31
-9
@@ -162,20 +162,42 @@ func getConfigWithoutSensitiveData(config *settings.Config) *settings.Config {
|
|||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
|
||||||
clonedConfig.DatabaseConfig.DatabasePassword = "****"
|
if clonedConfig.DatabaseConfig.DatabasePassword != "" {
|
||||||
clonedConfig.SMTPConfig.SMTPPasswd = "****"
|
clonedConfig.DatabaseConfig.DatabasePassword = "****"
|
||||||
clonedConfig.MinIOConfig.SecretAccessKey = "****"
|
}
|
||||||
clonedConfig.SecretKey = "****"
|
|
||||||
clonedConfig.AmapApplicationSecret = "****"
|
|
||||||
|
|
||||||
if clonedConfig.WebDAVConfig != nil {
|
if clonedConfig.SMTPConfig.SMTPPasswd != "" {
|
||||||
|
clonedConfig.SMTPConfig.SMTPPasswd = "****"
|
||||||
|
}
|
||||||
|
|
||||||
|
if clonedConfig.MinIOConfig.SecretAccessKey != "" {
|
||||||
|
clonedConfig.MinIOConfig.SecretAccessKey = "****"
|
||||||
|
}
|
||||||
|
|
||||||
|
if clonedConfig.SecretKey != "" {
|
||||||
|
clonedConfig.SecretKey = "****"
|
||||||
|
}
|
||||||
|
|
||||||
|
if clonedConfig.AmapApplicationSecret != "" {
|
||||||
|
clonedConfig.AmapApplicationSecret = "****"
|
||||||
|
}
|
||||||
|
|
||||||
|
if clonedConfig.WebDAVConfig != nil && clonedConfig.WebDAVConfig.Password != "" {
|
||||||
clonedConfig.WebDAVConfig.Password = "****"
|
clonedConfig.WebDAVConfig.Password = "****"
|
||||||
}
|
}
|
||||||
|
|
||||||
if clonedConfig.ReceiptImageRecognitionLLMConfig != nil {
|
if clonedConfig.ReceiptImageRecognitionLLMConfig != nil {
|
||||||
clonedConfig.ReceiptImageRecognitionLLMConfig.OpenAIAPIKey = "****"
|
if clonedConfig.ReceiptImageRecognitionLLMConfig.OpenAIAPIKey != "" {
|
||||||
clonedConfig.ReceiptImageRecognitionLLMConfig.OpenAICompatibleAPIKey = "****"
|
clonedConfig.ReceiptImageRecognitionLLMConfig.OpenAIAPIKey = "****"
|
||||||
clonedConfig.ReceiptImageRecognitionLLMConfig.OpenRouterAPIKey = "****"
|
}
|
||||||
|
|
||||||
|
if clonedConfig.ReceiptImageRecognitionLLMConfig.OpenAICompatibleAPIKey != "" {
|
||||||
|
clonedConfig.ReceiptImageRecognitionLLMConfig.OpenAICompatibleAPIKey = "****"
|
||||||
|
}
|
||||||
|
|
||||||
|
if clonedConfig.ReceiptImageRecognitionLLMConfig.OpenRouterAPIKey != "" {
|
||||||
|
clonedConfig.ReceiptImageRecognitionLLMConfig.OpenRouterAPIKey = "****"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return clonedConfig
|
return clonedConfig
|
||||||
|
|||||||
Reference in New Issue
Block a user