Repository navigation
feat: add Discord and Telegram notification channels - #24
Merged
Merged
Conversation
Two new alert channels, routed exactly like Slack (Critical, High, Medium): - Discord (STACKDOG_DISCORD_WEBHOOK_URL): plain content messages under the webhook's own name and avatar, truncated to Discord's 2000 character limit on a UTF-8 boundary. - Telegram (STACKDOG_TELEGRAM_BOT_TOKEN + STACKDOG_TELEGRAM_CHAT_ID): plain text through the Bot API sendMessage, truncated to the 4096 character limit. No parse_mode, so alert content can never break the request by looking like markup. Both values are required; a partial config does not enable the channel. Telegram is alerts only: action notifications (bans, quarantines) are deliberately routed away from it, and the channel list documents that. Revives tests/alerting/, which tests/integration.rs never included: four files of tests never compiled or ran. Added mod alerting;, fixed the one compile error (async send without await), and cleaned the warnings the dead code had accumulated. Tests: 470+8+155 pass (was 469+8+108; +3 Discord, +3 Telegram integration tests, +1 unit test for the partial Telegram config, +44 revived). clippy -D warnings and fmt clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
STACKDOG_DISCORD_WEBHOOK_URL): routed exactly like Slack (Critical/High/Medium). Plain content messages under the webhook's own name and avatar, truncated to Discord's 2000 character limit on a UTF-8 boundary.STACKDOG_TELEGRAM_BOT_TOKEN+STACKDOG_TELEGRAM_CHAT_ID): Bot API sendMessage, plain text without parse_mode (alert content can never break the request by looking like markup), truncated to the 4096 character limit. Both values required; a partial config does not enable the channel (unit-tested)..env.sample.tests/alerting/:tests/integration.rsnever included the module, so four files of tests never compiled or ran (including all the Slack and dedup tests). Addedmod alerting;, fixed the one compile error (asyncsendwithout await), cleaned the warnings dead code had accumulated..env.samplesetup notes, quickstart snippet, CHANGELOG.