getRedactedConfig redacting some parts of config
(s *service)
| 15 | |
| 16 | // getRedactedConfig redacting some parts of config |
| 17 | func getRedactedConfig(s *service) config.Configuration { |
| 18 | rawConf := s.cfg.RawCopy() |
| 19 | rawConf.GUI.APIKey = "REDACTED" |
| 20 | if rawConf.GUI.Password != "" { |
| 21 | rawConf.GUI.Password = "REDACTED" |
| 22 | } |
| 23 | if rawConf.GUI.User != "" { |
| 24 | rawConf.GUI.User = "REDACTED" |
| 25 | } |
| 26 | |
| 27 | for folderIdx, folderCfg := range rawConf.Folders { |
| 28 | for deviceIdx, deviceCfg := range folderCfg.Devices { |
| 29 | if deviceCfg.EncryptionPassword != "" { |
| 30 | rawConf.Folders[folderIdx].Devices[deviceIdx].EncryptionPassword = "REDACTED" |
| 31 | } |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | return rawConf |
| 36 | } |
| 37 | |
| 38 | // writeZip writes a zip file containing the given entries |
| 39 | func writeZip(writer io.Writer, files []fileEntry) error { |
no test coverage detected