From 1ae60cd823375db102da0712e8010c8fcc1aa789 Mon Sep 17 00:00:00 2001 From: andig Date: Thu, 9 Mar 2023 18:30:18 +0100 Subject: [PATCH] Ntfy: anonymise token if url points to ntfy.sh --- push/ntfy.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/push/ntfy.go b/push/ntfy.go index da83736e0..c024ab5a5 100644 --- a/push/ntfy.go +++ b/push/ntfy.go @@ -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,