Setting up notifiers
Notifications explains what each notifier sends and who gets the key. This page is about getting the URL, token or address each one needs in the first place.
Send a test message
Section titled “Send a test message”Once a notifier is set up, serve a tiny file from stdin to try it without a torrent:
echo hello | deaddrop serve - --name test.txt --notify slack=https://hooks.slack.com/services/...Bad settings are rejected at startup. Once the ticket is ready, the server
prints notify: sent to <notifier> on stderr for each one that worked, or
notify: warning: <notifier> failed: <error>, and keeps serving either way.
Press Ctrl-C when you’re done.
Discord
Section titled “Discord”-
In the channel’s settings, open Integrations → Webhooks → New Webhook.
-
Name it, then Copy Webhook URL.
-
Use it as
--notify discord=<URL>, or:[[serve.notify]]type = "discord"url = "https://discord.com/api/webhooks/<id>/<token>"
- Create an app at api.slack.com/apps (From scratch), in your workspace.
- Under Incoming Webhooks, turn them on, then Add New Webhook to Workspace and pick the channel.
- Copy the webhook URL (
https://hooks.slack.com/services/…) and use it as--notify slack=<URL>, ortype = "slack"withurl.
Mattermost
Section titled “Mattermost”- A system admin must allow incoming webhooks (System Console → Integrations → Integration Management).
- In your team, open Integrations → Incoming Webhooks → Add Incoming Webhook, and pick the channel.
- Copy the URL (
https://<server>/hooks/<key>) and use it as--notify mattermost=<URL>, ortype = "mattermost"withurl.
Rocket.Chat
Section titled “Rocket.Chat”- As an admin, open Administration → Workspace → Integrations → New → Incoming.
- Turn it on, set the channel (like
#drops) and the user to post as, and save. - Copy the Webhook URL (
https://<server>/hooks/<id>/<token>) and use it as--notify rocketchat=<URL>, ortype = "rocketchat"withurl.
Telegram
Section titled “Telegram”-
Message @BotFather, send
/newbot, and follow the prompts. It replies with the bot token, like123456789:AAE…. -
Add the bot to the chat it should post in. For a channel, make it an admin that can post messages. For a private chat with yourself, just send the bot a message.
-
Find the chat id. For a public channel it’s
@channelname. Otherwise, send a message in the chat, then openhttps://api.telegram.org/bot<token>/getUpdatesand look for"chat":{"id":…}. Groups and channels have negative ids, like-1001234567890. -
Use them as
--notify telegram=<bot_token>@<chat_id>, or:[[serve.notify]]type = "telegram"bot_token = "123456789:AAE_token_from_BotFather"chat_id = -1001234567890 # or "@channelname"# thread_id = 42 # a forum topic in the group# api_url = "http://localhost:8081" # a self-hosted Bot API server
For a public channel on the command line, the chat id keeps its @:
telegram=<bot_token>@@channelname.
- Pick a topic name. On the public ntfy.sh, anyone who
knows it can read it, so make it long and random, e.g.
openssl rand -hex 16. - Subscribe to it in the ntfy app (Android, iOS or the web app).
- Use the topic URL as
--notify ntfy=https://ntfy.sh/<topic>, ortype = "ntfy"withurl.
For a protected topic on your own server (or a reserved one on ntfy.sh),
create an access token (on a self-hosted server, ntfy token add <user>) and
set it as token, or put user:pass@ in the URL:
[[serve.notify]]type = "ntfy"url = "https://ntfy.example.com/drops"token = "tk_..."priority = 4 # 1 (min) to 5 (max); ntfy's default is 3Send the key (include_key) only to a protected topic or your own server.
Email (SMTP)
Section titled “Email (SMTP)”-
Get your mail provider’s SMTP server and port, and a user name and password. Many providers (Gmail, iCloud, Fastmail and others) want an app password here rather than your normal one.
-
Pick the scheme from the port:
smtps://for 465 (TLS from the start),smtp://for 587 (STARTTLS). -
Percent-encode
@,:and/in the user name or password (@is%40). -
Use it as:
[[serve.notify]]type = "email"url = "smtps://me%40example.com:[email protected]"from = "deaddrop <[email protected]>"Or on one line:
'email=smtps://user:[email protected][email protected]&[email protected]'(quote it:&is a shell metacharacter).
For a local relay without TLS (like a Postfix on the same machine), use
smtp://localhost?tls=none. deaddrop refuses to send a password without TLS
unless the server is on localhost. ?tls=opportunistic allows a server that
doesn’t offer STARTTLS.
SMS (Twilio)
Section titled “SMS (Twilio)”-
In the Twilio Console, copy the Account SID (
AC…) and Auth Token. -
Get a sender: a Twilio phone number, an alphanumeric sender id like
Deaddrop(only in countries that allow them), or a Messaging Service (MG…). -
Write the recipient in E.164 form, like
+15552223333. A trial account can only text numbers you’ve verified in the console. -
Use them as
--notify twilio=<account_sid>:<auth_token>@<from>/<to>, or:[[serve.notify]]type = "twilio"account_sid = "AC0123456789abcdef0123456789abcdef"auth_token = "<auth token>"from = "+15550001111"to = "+15552223333"# api_key = "SK..." # log in with an API key; auth_token is then its secret# api_url = "https://api.dublin.ie1.twilio.com"
One notifier texts one number: add a [[serve.notify]] table per recipient.
SMS isn’t end-to-end encrypted, so prefer another notifier for the key.
Generic webhook
Section titled “Generic webhook”Anything that accepts a JSON POST: your own service, a home automation
hook, or an automation platform. Use --notify webhook=<URL>, and see the
webhook payload reference for the body.