If you want to send notifications from your (self-hosted) Duplicati instance to Discord, then you can deploy this Cloudflare worker to your Cloudflare account. When called, it modifies the incoming Duplicati notification data and sends an embedded message to a Discord webhook URL.
-
Press the Deploy to Cloudflare button above and complete all steps. Make sure that the worker is successfully deployed.
-
Create a webhook URL for a given Discord channel
It will be in the following format:
https://discord.com/api/webhooks/123/abcdef
Copy the
123/abcdef
portion to your clipboard. -
Open your Duplicati dashboard and select "Edit" on the backup you wish to receive notifications for. Navigate to "Options" and under "Advanced options" click the three dots to "Edit as text".
Add the
--send-http-json-urls
flag with your URL as following:--send-http-json-urls=https://url-to-your-worker.com/123/abcdef
-
Save the backup configuration. Run a backup and check if it's working.
Optional: To only receive notifications when a backup results in a warning or error, add this under "Advanced options" as well (on a separate row):
--send-http-level=Warning,Error,Fatal
If you want to send notifications to a Discord thread or to a post inside a forum channel, you need to pass a thread_id
to the Cloudflare worker. Here's how you can do that:
-
Navigate to the thread / forum post, right-click it, and choose "Copy Link".
It will be in the following format:
https://discord.com/channels/123/456
The
456
is yourthread_id
. -
Adjust the URL you're passing to the
--send-http-json-urls
flag by adding?thread_id=<your-thread-id>
to the end of it:- --send-http-json-urls=https://url-to-your-worker.com/123/abcdef + --send-http-json-urls=https://url-to-your-worker.com/123/abcdef?thread_id=456