mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2025-12-10 06:42:07 +01:00
Feature/improve server config non privacy safe setting handling (#1794)
* Move the "group" arg at the second position after "protoNumber" To make it consistent for all settings * Improve server config non privacy safe setting handling --------- Co-authored-by: Mitchell Syer <Syer10@users.noreply.github.com>
This commit is contained in:
@@ -178,6 +178,23 @@ open class ConfigManager {
|
||||
userConfigFile.writeText(newUserConfigDoc.render())
|
||||
getUserConfig().entrySet().forEach { internalConfig = internalConfig.withValue(it.key, it.value) }
|
||||
}
|
||||
|
||||
fun getRedactedConfig(nonPrivacySafeKeys: List<String>): Config {
|
||||
val entries =
|
||||
config.entrySet().associate { entry ->
|
||||
val key = entry.key
|
||||
val value =
|
||||
if (nonPrivacySafeKeys.any { key.split(".").getOrNull(1) == it }) {
|
||||
"[REDACTED]"
|
||||
} else {
|
||||
entry.value.unwrapped()
|
||||
}
|
||||
|
||||
key to value
|
||||
}
|
||||
|
||||
return ConfigFactory.parseMap(entries)
|
||||
}
|
||||
}
|
||||
|
||||
object GlobalConfigManager : ConfigManager()
|
||||
|
||||
Reference in New Issue
Block a user