@@ 33,7 33,7 @@ import (
var version = "dev"
-var MAX_NTFY_ACTIONS = 3
+var maxNTFYActions = 3
type bridge struct {
cfg *config.Config
@@ 362,18 362,18 @@ func (br *bridge) publish(n *notification) error {
}
nActions := len(actions)
- if nActions > MAX_NTFY_ACTIONS {
- br.logger.Warn(fmt.Sprintf("Publish: Too many actions (%d), ntfy only supports up to %d - removing surplus actions.", nActions, MAX_NTFY_ACTIONS))
+ if nActions > maxNTFYActions {
+ br.logger.Warn(fmt.Sprintf("Publish: Too many actions (%d), ntfy only supports up to %d - removing surplus actions.", nActions, maxNTFYActions))
br.logger.Debug("Action list",
slog.Any("actions", actions))
- actions = actions[:MAX_NTFY_ACTIONS]
+ actions = actions[:maxNTFYActions]
}
req.Header.Set("Actions", strings.Join(actions, ";"))
configFingerprint := br.cfg.Ntfy.CertFingerprint
if configFingerprint != "" {
tlsCfg := &tls.Config{}
- tlsCfg.VerifyPeerCertificate = func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error {
+ tlsCfg.VerifyPeerCertificate = func(rawCerts [][]byte, _ [][]*x509.Certificate) error {
for _, rawCert := range rawCerts {
hash := sha512.Sum512(rawCert)
if hex.EncodeToString(hash[:]) == configFingerprint {