Closed vista-narvas closed 1 year ago
steps i took to reproduce
composer create-project laravel/laravel .
composer require spatie/laravel-webhook-client
php artisan vendor:publish --provider="Spatie\WebhookClient\WebhookClientServiceProvider" --tag="webhook-client-config"
php artisan vendor:publish --provider="Spatie\WebhookClient\WebhookClientServiceProvider" --tag="webhook-client-migrations"
php artisan migrate:fresh
vi routes/web.php
add Route::webhooks('webhook');
vi app/Http/Middleware/VerifyCsrfToken.php
add webhook
to $except
vi app/Http/Webhook/GiteaValidator.php
custom validator that always give true
<?php
namespace App\Http\Webhook;
use Illuminate\Http\Request; use Spatie\WebhookClient\SignatureValidator\SignatureValidator; use Spatie\WebhookClient\WebhookConfig;
class GiteaValidator implements SignatureValidator { public function isValid(Request $request, WebhookConfig $config): bool { return true; } }
9. `vi app/Jobs/Webhook.php` as minimal class that never gets reached
<?php
namespace App\Jobs;
use Spatie\WebhookClient\Jobs\ProcessWebhookJob;
class Webhook extends ProcessWebhookJob { public function __construct() { logger("yay construct"); }
public function handle(): void
{
logger("yay handle");
}
}
10. `vi config/webhook-client.php` set `'signature_validator' => App\Http\Webhook\GiteaValidator::class` and `'process_webhook_job' => App\Jobs\Webhook::class`
11. `php artisan serve`
12. send a webhook and recive a error
i did some more tests i tried the same install commands in a Ubuntu container and than everything works fine so i think im missing a php package but i dont know which package
whenever i send a webhook to the client i get the following error
the connection says
Connection refused
even touh the DB is working fine as far as i can tellif i run a insert or select using tinker it works
this is a fresh install of laravel PHP: 8.2.3 Laravel: 10.3.3