Skip to content

feat(alerting): Add Bark alerting provider - #1738

Open
funnyzak wants to merge 2 commits into
TwiN:masterfrom
funnyzak:master
Open

feat(alerting): Add Bark alerting provider#1738
funnyzak wants to merge 2 commits into
TwiN:masterfrom
funnyzak:master

Conversation

@funnyzak

Copy link
Copy Markdown

Summary

Closes #1325

  • Add Bark as a built-in alerting provider using the Bark V2 JSON /push API.
  • Support the official Bark service and self-hosted servers.
  • Support default alerts, endpoint group overrides, alert-level provider overrides, and resolved notifications.
  • Preserve endpoint group selector semantics when Bark overrides are marshaled and unmarshaled as YAML.
  • Validate server URLs and notification levels, prevent cross-origin credential forwarding, and redact device keys from bounded error responses.
  • Sanitize control characters and Unicode line and paragraph separators in provider errors to keep log entries on one line.
  • Add provider and configuration tests, along with setup and credential security documentation in README.md.
  • Add no new dependencies.

Testing

  • go test -count=1 ./alerting/provider/bark ./alerting/provider ./config
  • go test -race -count=1 ./alerting/provider/bark
  • go vet ./alerting/provider/bark ./alerting/provider ./config
  • make test passes for Bark and all alerting providers. The existing live DNS CNAME test under client/TestQueryDNS/test_Config_with_type_CNAME may fail because the public DNS response returns an IP address instead of the hard-coded CNAME.

Automated HTTP tests use local test servers. No live Bark device credentials were used.

Checklist

  • Tested and/or added tests to validate that the changes work as intended, if applicable.
  • Updated documentation in README.md, if applicable.

- Introduced Bark alerting provider with configuration options in README.md.
- Added Bark alert type to alerting system.
- Implemented Bark alert provider logic in a new file `bark.go`.
- Created tests for Bark alert provider functionality in `bark_test.go`.
- Updated configuration validation to include Bark provider.
- Enhanced alerting configuration tests to validate Bark settings.
@github-actions github-actions Bot added feature New feature or request area/alerting Related to alerting labels Jul 31, 2026

@TwiN TwiN left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work.

Comment thread README.md Outdated
| Parameter | Description | Default |
|:---------------------------|:----------------------------------------------------------------------------------------------------------------------------------------|:--------|
| `alerting.awsses` | Configuration for alerts of type `awsses`. <br />See [Configuring AWS SES alerts](#configuring-aws-ses-alerts). | `{}` |
| `alerting.bark` | Configuration for alerts of type `bark`. <br />See [Configuring Bark alerts](#configuring-bark-alerts). | `{}` |

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the alignment?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙂 done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/alerting Related to alerting feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new alert provider "Bark"

2 participants