Config dump

This commit is contained in:
Ben Sarmiento
2024-04-26 15:00:22 +02:00
parent 755b50c82f
commit 2dbabd3ead
4 changed files with 80 additions and 40 deletions

View File

@@ -23,6 +23,16 @@ func loadV1Config(content []byte, log *logutil.Logger) (*ZurgConfigV1, error) {
if err := yaml.Unmarshal(content, &configV1); err != nil {
return nil, err
}
// don't log token and password
bufToken := configV1.Token
configV1.Token = strings.Repeat("*", len(bufToken)-4) + bufToken[len(bufToken)-4:]
bufPassword := configV1.Password
configV1.Password = strings.Repeat("*", len(bufPassword))
log.Debugf("Config dump: %+v", configV1)
configV1.Token = bufToken
configV1.Password = bufPassword
configV1.log = log
return &configV1, nil
}