feat(webhook): add Apprise webhook support and rename bot-webhook to discord-webhook

- Rename the Discord webhook endpoint from `/bot-webhook/` to `/discord-webhook/` for better clarity.
- Add new routes and controller methods (`receiveApprise`, `receiveAppriseNotify`) to support Apprise integrations.
- Implement `mapApprisePayload` in TalkService to map Apprise JSON format (title, body, type, attachments) to Talk message format.
- Update the settings UI to generate and display URLs for both Discord and Apprise webhooks.
- Update `INSTALL.md` and `README.md` documentation to reflect the new webhook paths and Apprise support.
- Refactor token revocation logic to revoke all tokens for a room at once.
This commit is contained in:
kyle
2026-06-12 16:40:53 -07:00
parent 6453715bf0
commit 42fa70491d
6 changed files with 411 additions and 52 deletions
+28 -3
View File
@@ -36,10 +36,10 @@ Go to **Settings → Admin → NCdiscordhook**:
### 5. Point your services at the webhook URLs
Each configured room gets a webhook URL:
Each configured room gets **two** webhook URLs (Discord and Apprise formats):
```
https://your-server.com/apps/ncdiscordhook/bot-webhook/<room-token>/<auth-token>
https://your-server.com/apps/ncdiscordhook/discord-webhook/<room-token>/<auth-token>
```
Copy the auth token from the app settings for each room.
@@ -92,7 +92,7 @@ Copy the auth token from the app settings for each room.
Each room gets its own webhook URL with a unique auth token:
```
/bot-webhook/<room-token>/<auth-token>
/discord-webhook/<room-token>/<auth-token>
```
- **Room token** — identifies which Talk room to post to (from `occ talk:room:list`)
@@ -100,6 +100,31 @@ Each room gets its own webhook URL with a unique auth token:
Multiple auth tokens can be created per room — useful if you need to rotate keys or share the webhook across multiple services.
### Apprise webhook
For Apprise integrations, each room also gets an Apprise webhook URL:
```
https://your-server.com/apps/ncdiscordhook/apprise-webhook/<room-token>/notify/<auth-token>
```
Note: the `notify` segment is required — Apprise's `apprises://` URL scheme inserts it in the path.
Apprise sends a different JSON format. Supported fields:
```json
{
"title": "Build #1234",
"body": "Successfully deployed to production",
"type": "info",
"attachments": [
{ "url": "https://example.com/screenshot.png" }
]
}
```
The apprise webhook maps `title`, `body`, and `attachments` to the same Talk message format as the Discord endpoint, so images and formatting work the same way.
## Image management
- Images are uploaded to the bot user's files at `/NCdiscordhook-images/<room-token>/`