mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-12-22 17:14:22 +00:00
Add API endpoint to retrieve sanitized server configuration
This commit is contained in:
@@ -610,3 +610,20 @@ func getDefaultConfigLocations() []string {
|
||||
|
||||
return locations
|
||||
}
|
||||
|
||||
// SanitizedCopy returns a copy of the AppConfig with sensitive information removed
|
||||
func (cfg *AppConfig) SanitizedCopy() AppConfig {
|
||||
// Create a copy of the config
|
||||
sanitized := *cfg
|
||||
|
||||
// Clear sensitive information
|
||||
sanitized.Auth.InferenceKeys = []string{}
|
||||
sanitized.Auth.ManagementKeys = []string{}
|
||||
|
||||
for nodeName, node := range sanitized.Nodes {
|
||||
node.APIKey = ""
|
||||
sanitized.Nodes[nodeName] = node
|
||||
}
|
||||
|
||||
return sanitized
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user