[PR #680] Support Webhook #1176

Open
opened 2026-03-14 11:50:59 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anonaddy/anonaddy/pull/680
Author: @gerynugrh
Created: 9/15/2024
Status: 🔄 Open

Base: masterHead: support-webhook


📝 Commits (3)

📊 Changes

15 files changed (+556 additions, -56 deletions)

View changed files

📝 app/Http/Controllers/SettingController.php (+2 -0)
app/Http/Controllers/WebhookController.php (+18 -0)
app/Http/Requests/UpdateWebhookRequest.php (+31 -0)
app/Listeners/SendEmailPendingWebhook.php (+21 -0)
app/Listeners/SendEmailSentWebhook.php (+21 -0)
app/Listeners/SendFailedWebhookNotification.php (+21 -0)
📝 app/Models/User.php (+2 -0)
📝 app/Providers/EventServiceProvider.php (+10 -0)
📝 composer.json (+1 -0)
📝 composer.lock (+135 -1)
config/webhook-server.php (+83 -0)
database/migrations/2024_09_15_101300_add_webhook_columns_to_user_table.php (+34 -0)
📝 postfix/composer.lock (+56 -55)
📝 resources/js/Pages/Settings/General.vue (+118 -0)
📝 routes/web.php (+3 -0)

📄 Description

RFC

To Clarify:

  1. When will we send webhook? For each email being received by addy, or for any outgoing email as well?
  2. Depending on (1) should we do both incoming and outgoing in a single PR or should we split it?
  3. Is there an existing design for the webhook payload?
  4. Should we be sending an email for every failed webhook? This would be quite spammy, I guess it's okay if we limit to only send it once a day? Benchmarking from other services, they usually have circuit breaker to stop the service from sending any webhook if it keeps responding with failure

Todo:

  • Webhook sending portion
  • Use spatie for signature and flow control (see more)

To consider:

  1. Which queue should we use, is internal queue okay or should we opt for external one, e.g Redis? I notice we already have an existing queue backed by redis, I will follow the existing implementation
  2. Should we allow both http and https or only https?

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anonaddy/anonaddy/pull/680 **Author:** [@gerynugrh](https://github.com/gerynugrh) **Created:** 9/15/2024 **Status:** 🔄 Open **Base:** `master` ← **Head:** `support-webhook` --- ### 📝 Commits (3) - [`4467de2`](https://github.com/anonaddy/anonaddy/commit/4467de27cd06614d15ac5b04ff7b725c696aad6f) controller for webhook - [`a081042`](https://github.com/anonaddy/anonaddy/commit/a0810427bf791eabf933b91e1b05d1e1ce084f01) only allow http and https - [`e72eab9`](https://github.com/anonaddy/anonaddy/commit/e72eab90d42bece1814061e5e30928ff6217a386) base code to handle webhook ### 📊 Changes **15 files changed** (+556 additions, -56 deletions) <details> <summary>View changed files</summary> 📝 `app/Http/Controllers/SettingController.php` (+2 -0) ➕ `app/Http/Controllers/WebhookController.php` (+18 -0) ➕ `app/Http/Requests/UpdateWebhookRequest.php` (+31 -0) ➕ `app/Listeners/SendEmailPendingWebhook.php` (+21 -0) ➕ `app/Listeners/SendEmailSentWebhook.php` (+21 -0) ➕ `app/Listeners/SendFailedWebhookNotification.php` (+21 -0) 📝 `app/Models/User.php` (+2 -0) 📝 `app/Providers/EventServiceProvider.php` (+10 -0) 📝 `composer.json` (+1 -0) 📝 `composer.lock` (+135 -1) ➕ `config/webhook-server.php` (+83 -0) ➕ `database/migrations/2024_09_15_101300_add_webhook_columns_to_user_table.php` (+34 -0) 📝 `postfix/composer.lock` (+56 -55) 📝 `resources/js/Pages/Settings/General.vue` (+118 -0) 📝 `routes/web.php` (+3 -0) </details> ### 📄 Description # RFC To Clarify: 1. When will we send webhook? For each email being received by addy, or for any outgoing email as well? 2. Depending on (1) should we do both incoming and outgoing in a single PR or should we split it? 3. Is there an existing design for the webhook payload? 4. Should we be sending an email for every failed webhook? This would be quite spammy, I guess it's okay if we limit to only send it once a day? Benchmarking from other services, they usually have circuit breaker to stop the service from sending any webhook if it keeps responding with failure Todo: - [ ] Webhook sending portion - [ ] Use spatie for signature and flow control ([see more](https://github.com/spatie/laravel-webhook-server)) To consider: 1. ~~Which queue should we use, is internal queue okay or should we opt for external one, e.g Redis?~~ I notice we already have an existing queue backed by redis, I will follow the existing implementation 2. Should we allow both http and https or only https? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/anonaddy#1176
No description provided.