security: redact sensitive config values and protect update endpoints
This commit is contained in:
@@ -93,7 +93,14 @@ function loadConfig() {
|
||||
loadConfig();
|
||||
|
||||
export function getPublicConfig() {
|
||||
return { ...config };
|
||||
// Create a deep copy and redact sensitive fields
|
||||
const publicConfig = JSON.parse(JSON.stringify(config));
|
||||
|
||||
// Redact sensitive values
|
||||
if (publicConfig.webuiPassword) publicConfig.webuiPassword = '********';
|
||||
if (publicConfig.apiKey) publicConfig.apiKey = '********';
|
||||
|
||||
return publicConfig;
|
||||
}
|
||||
|
||||
export function saveConfig(updates) {
|
||||
|
||||
Reference in New Issue
Block a user