Commit 8ec37422 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Refactor WhatsApp: instances call manager hub instead of Meta directly

Instances no longer hold WhatsApp API credentials. They send messages
via the el-captain-manager messaging hub API using MESSAGING_HUB_URL
and MESSAGING_HUB_KEY env vars. The hub handles Meta Graph API calls,
rate limiting, and delivery tracking centrally.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent effca1ea
...@@ -42,4 +42,9 @@ ...@@ -42,4 +42,9 @@
'webhook_verify_token' => env('WHATSAPP_WEBHOOK_VERIFY_TOKEN', ''), 'webhook_verify_token' => env('WHATSAPP_WEBHOOK_VERIFY_TOKEN', ''),
], ],
'messaging_hub' => [
'url' => env('MESSAGING_HUB_URL', ''),
'key' => env('MESSAGING_HUB_KEY', ''),
],
]; ];
...@@ -17,7 +17,7 @@ chmod -R 775 storage bootstrap/cache ...@@ -17,7 +17,7 @@ chmod -R 775 storage bootstrap/cache
# Build .env from Docker env vars (CapRover passes them as container env) # Build .env from Docker env vars (CapRover passes them as container env)
: > .env : > .env
env | grep -E "^(APP_|DB_|LOG_|SESSION_|CACHE_|QUEUE_|FILESYSTEM_|BROADCAST_|MAIL_|TRUSTED_|BCRYPT_|PLATFORM_|ADMIN_|ACADEMY_|RUN_|WHATSAPP_)" | sort | sed 's/=\(.*\)/="\1"/' >> .env env | grep -E "^(APP_|DB_|LOG_|SESSION_|CACHE_|QUEUE_|FILESYSTEM_|BROADCAST_|MAIL_|TRUSTED_|BCRYPT_|PLATFORM_|ADMIN_|ACADEMY_|RUN_|WHATSAPP_|MESSAGING_)" | sort | sed 's/=\(.*\)/="\1"/' >> .env
# Ensure APP_KEY line exists (key:generate needs it to write to) # Ensure APP_KEY line exists (key:generate needs it to write to)
if ! grep -q '^APP_KEY=' .env 2>/dev/null; then if ! grep -q '^APP_KEY=' .env 2>/dev/null; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment