mirror of
https://github.com/syncthing/syncthing.git
synced 2025-12-23 14:08:06 -05:00
fix(api): redact device encryption passwords in support bundle config (#10359)
* fix(api): redact device encryption passwords in support bundle config Signed-off-by: Tommy van der Vorst <tommy@pixelspark.nl> * Update lib/api/support_bundle.go Signed-off-by: Jakob Borg <jakob@kastelo.net> --------- Signed-off-by: Tommy van der Vorst <tommy@pixelspark.nl> Signed-off-by: Jakob Borg <jakob@kastelo.net> Co-authored-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
committed by
GitHub
parent
42db6280e6
commit
9e262d84de
@@ -23,6 +23,15 @@ func getRedactedConfig(s *service) config.Configuration {
|
||||
if rawConf.GUI.User != "" {
|
||||
rawConf.GUI.User = "REDACTED"
|
||||
}
|
||||
|
||||
for folderIdx, folderCfg := range rawConf.Folders {
|
||||
for deviceIdx, deviceCfg := range folderCfg.Devices {
|
||||
if deviceCfg.EncryptionPassword != "" {
|
||||
rawConf.Folders[folderIdx].Devices[deviceIdx].EncryptionPassword = "REDACTED"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rawConf
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user