From 447878ca4d8d585753983c688874f310e1598d52 Mon Sep 17 00:00:00 2001 From: Dumitru Botezatu Date: Wed, 30 Oct 2024 12:41:09 +0200 Subject: [PATCH 1/2] added reverb --- .env.example | 17 +++- app/Providers/BroadcastServiceProvider.php | 3 + app/Providers/EventServiceProvider.php | 9 +-- composer.json | 18 +++-- config/app.php | 2 +- config/reverb.php | 92 ++++++++++++++++++++++ 6 files changed, 123 insertions(+), 18 deletions(-) create mode 100644 config/reverb.php diff --git a/.env.example b/.env.example index ebaf256..656ff61 100644 --- a/.env.example +++ b/.env.example @@ -49,4 +49,19 @@ AWS_DEFAULT_REGION= AWS_BUCKET= # Sentry -SENTRY_LARAVEL_DSN=null \ No newline at end of file +SENTRY_LARAVEL_DSN=null + +# Broadcasting +BROADCAST_DRIVER=null + +REVERB_APP_ID= +REVERB_APP_KEY= +REVERB_APP_SECRET= +REVERB_HOST="example.com" +REVERB_PORT=80 +REVERB_SCHEME=https + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 \ No newline at end of file diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 2be04f5..2076855 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -3,6 +3,7 @@ namespace App\Providers; use Illuminate\Support\Facades\Broadcast; +use Inovector\Mixpost\Broadcast as MixpostBroadcast; use Illuminate\Support\ServiceProvider; class BroadcastServiceProvider extends ServiceProvider @@ -14,6 +15,8 @@ public function boot(): void { Broadcast::routes(); + MixpostBroadcast::routes(); + require base_path('routes/channels.php'); } } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 2d65aac..ad1c1cc 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -2,10 +2,7 @@ namespace App\Providers; -use Illuminate\Auth\Events\Registered; -use Illuminate\Auth\Listeners\SendEmailVerificationNotification; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -use Illuminate\Support\Facades\Event; class EventServiceProvider extends ServiceProvider { @@ -14,11 +11,7 @@ class EventServiceProvider extends ServiceProvider * * @var array> */ - protected $listen = [ - Registered::class => [ - SendEmailVerificationNotification::class, - ], - ]; + protected $listen = []; /** * Register any events for your application. diff --git a/composer.json b/composer.json index aa853a3..d2f5c29 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "inovector/mixpost-enterprise-app", "type": "project", - "description": "Standalone application with Mixpost Enterprise's Laravel package pre-installed and configured", + "description": "Standalone application with Mixpost Enterprise's Laravel package pre-installed and configured.", "keywords": ["inovector", "mixpost", "mixpost-enterpsie", "mixpost-saas"], "repositories": [ { @@ -10,21 +10,23 @@ } ], "require": { - "php": "^8.1", - "doctrine/dbal": "^3.6", + "php": "^8.2", "guzzlehttp/guzzle": "^7.2", - "inovector/mixpost-enterprise": "^3.0", - "laravel/framework": "^10.8", + "inovector/mixpost-enterprise": "dev-v4-next", + "inovector/mixpost-pro-team": "dev-v3-next", + "laravel/framework": "^11.0", "laravel/horizon": "^5.15", + "laravel/reverb": "^1.0", "laravel/tinker": "^2.8", - "sentry/sentry-laravel": "^3.8", + "sentry/sentry-laravel": "^4.9", "league/flysystem-aws-s3-v3": "^3.0", - "league/flysystem-sftp-v3": "^3.0" + "league/flysystem-sftp-v3": "^3.0", + "pusher/pusher-php-server": "^7.2" }, "require-dev": { "fakerphp/faker": "^1.9.1", "mockery/mockery": "^1.4.4", - "nunomaduro/collision": "^7.0", + "nunomaduro/collision": "^8.1", "phpunit/phpunit": "^10.1", "spatie/laravel-ignition": "^2.0" }, diff --git a/config/app.php b/config/app.php index 7710c31..8ed5296 100644 --- a/config/app.php +++ b/config/app.php @@ -165,7 +165,7 @@ */ App\Providers\AppServiceProvider::class, App\Providers\AuthServiceProvider::class, - // App\Providers\BroadcastServiceProvider::class, + App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, App\Providers\HorizonServiceProvider::class, App\Providers\RouteServiceProvider::class, diff --git a/config/reverb.php b/config/reverb.php new file mode 100644 index 0000000..3fead53 --- /dev/null +++ b/config/reverb.php @@ -0,0 +1,92 @@ + env('REVERB_SERVER', 'reverb'), + + /* + |-------------------------------------------------------------------------- + | Reverb Servers + |-------------------------------------------------------------------------- + | + | Here you may define details for each of the supported Reverb servers. + | Each server has its own configuration options that are defined in + | the array below. You should ensure all the options are present. + | + */ + + 'servers' => [ + + 'reverb' => [ + 'host' => env('REVERB_SERVER_HOST', '0.0.0.0'), + 'port' => env('REVERB_SERVER_PORT', 8080), + 'hostname' => env('REVERB_HOST'), + 'options' => [ + 'tls' => [], + ], + 'max_request_size' => env('REVERB_MAX_REQUEST_SIZE', 10_000), + 'scaling' => [ + 'enabled' => env('REVERB_SCALING_ENABLED', false), + 'channel' => env('REVERB_SCALING_CHANNEL', 'reverb'), + 'server' => [ + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'port' => env('REDIS_PORT', '6379'), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), + 'database' => env('REDIS_DB', '0'), + ], + ], + 'pulse_ingest_interval' => env('REVERB_PULSE_INGEST_INTERVAL', 15), + 'telescope_ingest_interval' => env('REVERB_TELESCOPE_INGEST_INTERVAL', 15), + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Reverb Applications + |-------------------------------------------------------------------------- + | + | Here you may define how Reverb applications are managed. If you choose + | to use the "config" provider, you may define an array of apps which + | your server will support, including their connection credentials. + | + */ + + 'apps' => [ + + 'provider' => 'config', + + 'apps' => [ + [ + 'key' => env('REVERB_APP_KEY'), + 'secret' => env('REVERB_APP_SECRET'), + 'app_id' => env('REVERB_APP_ID'), + 'options' => [ + 'host' => env('REVERB_HOST'), + 'port' => env('REVERB_PORT', 443), + 'scheme' => env('REVERB_SCHEME', 'https'), + 'useTLS' => env('REVERB_SCHEME', 'https') === 'https', + ], + 'allowed_origins' => ['*'], + 'ping_interval' => env('REVERB_APP_PING_INTERVAL', 60), + 'activity_timeout' => env('REVERB_APP_ACTIVITY_TIMEOUT', 30), + 'max_message_size' => env('REVERB_APP_MAX_MESSAGE_SIZE', 10_000), + ], + ], + + ], + +]; From 461cfdb748585d12da449bb074d34e375091c877 Mon Sep 17 00:00:00 2001 From: Dumitru Botezatu Date: Wed, 30 Oct 2024 15:31:43 +0200 Subject: [PATCH 2/2] set inovector/mixpost-enterprise ^4.0 --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index d2f5c29..199969e 100644 --- a/composer.json +++ b/composer.json @@ -12,8 +12,7 @@ "require": { "php": "^8.2", "guzzlehttp/guzzle": "^7.2", - "inovector/mixpost-enterprise": "dev-v4-next", - "inovector/mixpost-pro-team": "dev-v3-next", + "inovector/mixpost-enterprise": "^4.0", "laravel/framework": "^11.0", "laravel/horizon": "^5.15", "laravel/reverb": "^1.0",