Ntfy: anonymise token if url points to ntfy.sh

This commit is contained in:
andig 2023-03-09 18:30:18 +01:00
parent 1f689bfb59
commit 1ae60cd823

View file

@ -37,8 +37,13 @@ func NewNtfyFromConfig(other map[string]interface{}) (Messenger, error) {
return nil, errors.New("missing uri")
}
log := util.NewLogger("ntfy")
if token, ok := strings.CutPrefix(cc.URI, "https://ntfy.sh/"); ok {
log = log.Redact(token)
}
m := &Ntfy{
log: util.NewLogger("ntfy"),
log: log,
uri: cc.URI,
priority: cc.Priority,
tags: cc.Tags,