Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

Make webhook host configurable via WEBHOOK_URL (sendkit-style domain group)

Paulo Castellanoe72bf51c38fb
diff --git a/.env.example b/.env.example
index dd9e2b17e..dc13c3bb9 100644
--- a/.env.example
+++ b/.env.example
@@ -4,6 +4,10 @@ APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
+# Public base URL inbound webhooks (e.g. Telegram) are registered on.
+# Defaults to APP_URL; set a tunnel URL (e.g. ngrok) for local development.
+WEBHOOK_URL=
+
# Self-hosted mode (skips payment requirements)
SELF_HOSTED=true
diff --git a/config/app.php b/config/app.php
index 997df9a80..e8080f34f 100644
--- a/config/app.php
+++ b/config/app.php
@@ -54,7 +54,20 @@ return [
|
*/
- 'url' => env('APP_URL', 'https://trypost.it'),
+ 'url' => env('APP_URL', 'https://app.trypost.it'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Webhook URL
+ |--------------------------------------------------------------------------
+ |
+ | Public base URL that inbound provider webhooks (e.g. Telegram) are
+ | registered on. Defaults to the app URL; override it (for example with a
+ | tunnel like ngrok) when the app URL isn't reachable from the internet.
+ |
+ */
+
+ 'webhook_url' => env('WEBHOOK_URL', env('APP_URL', 'https://app.trypost.it')),
/*
|--------------------------------------------------------------------------
diff --git a/docker/.env.docker.example b/docker/.env.docker.example
index 706b63dfc..0c31fd1ac 100644
--- a/docker/.env.docker.example
+++ b/docker/.env.docker.example
@@ -4,6 +4,10 @@ APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost:8000
+# Public base URL inbound webhooks (e.g. Telegram) are registered on.
+# Defaults to APP_URL; set a tunnel URL (e.g. ngrok) for local development.
+WEBHOOK_URL=
+
# Self-hosted mode (skips payment requirements)
SELF_HOSTED=true
diff --git a/routes/webhook.php b/routes/webhook.php
index ecd2fee89..0f0c5d2bb 100644
--- a/routes/webhook.php
+++ b/routes/webhook.php
@@ -5,4 +5,8 @@ declare(strict_types=1);
use App\Http\Controllers\Webhooks\TelegramWebhookController;
use Illuminate\Support\Facades\Route;
-Route::post('telegram/webhook', [TelegramWebhookController::class, 'handle'])->name('telegram.webhook');
+Route::group([
+ 'domain' => parse_url(config('app.webhook_url'), PHP_URL_HOST) ?: config('app.webhook_url'),
+], function () {
+ Route::post('telegram/webhook', [TelegramWebhookController::class, 'handle'])->name('telegram.webhook');
+});