Make webhook host configurable via WEBHOOK_URL (sendkit-style domain group)
This commit is contained in:
parent
cc61adbac2
commit
e72bf51c38
4 changed files with 27 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,20 @@
|
|||
|
|
||||
*/
|
||||
|
||||
'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')),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -5,4 +5,8 @@
|
|||
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');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue