mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
websocket allowed origins implementation
This commit is contained in:
@@ -90,6 +90,7 @@ PUSHER_APP_CLUSTER=mt1
|
|||||||
PUSHER_APP_HOST=
|
PUSHER_APP_HOST=
|
||||||
PUSHER_APP_PORT=
|
PUSHER_APP_PORT=
|
||||||
PUSHER_APP_TLS=true
|
PUSHER_APP_TLS=true
|
||||||
|
PUSHER_APP_ALLOWED_ORIGIN=
|
||||||
|
|
||||||
IS_ADMIN_VUEFILEMANAGER_BAR=true
|
IS_ADMIN_VUEFILEMANAGER_BAR=true
|
||||||
IS_SETUP_WIZARD_DEMO=false
|
IS_SETUP_WIZARD_DEMO=false
|
||||||
|
|||||||
@@ -46,8 +46,7 @@ return [
|
|||||||
* This array contains the hosts of which you want to allow incoming requests.
|
* This array contains the hosts of which you want to allow incoming requests.
|
||||||
* Leave this empty if you want to accept requests from all hosts.
|
* Leave this empty if you want to accept requests from all hosts.
|
||||||
*/
|
*/
|
||||||
'allowed_origins' => [
|
'allowed_origins' => explode(',', env('PUSHER_APP_ALLOWED_ORIGIN', '')),
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The maximum request size in kilobytes that is allowed for an incoming WebSocket request.
|
* The maximum request size in kilobytes that is allowed for an incoming WebSocket request.
|
||||||
|
|||||||
48
src/App/Console/Commands/SetupWebsocketEnvironment.php
Normal file
48
src/App/Console/Commands/SetupWebsocketEnvironment.php
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class SetupWebsocketEnvironment extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*/
|
||||||
|
protected $signature = 'websockets:install';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Set up websocket production environment';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*/
|
||||||
|
public function handle(): void
|
||||||
|
{
|
||||||
|
// Get allowed origins
|
||||||
|
$origins = $this->ask('Type host of which you want to allow incoming requests. If you want to accept multiple hosts, separate them with comma(,)');
|
||||||
|
|
||||||
|
// Store origins to the .env file
|
||||||
|
setEnvironmentValue([
|
||||||
|
'PUSHER_APP_ALLOWED_ORIGIN' => $origins,
|
||||||
|
'APP_ENV' => 'production',
|
||||||
|
'APP_DEBUG' => 'false',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->info('Your host/s was stored successfully.');
|
||||||
|
|
||||||
|
// Generate new app key
|
||||||
|
$this->call('key:generate', [
|
||||||
|
'--force' => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Clear cache
|
||||||
|
$this->call('config:clear');
|
||||||
|
|
||||||
|
$this->info('Everything is done, congratulations! 🥳🥳🥳');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace App\Console;
|
namespace App\Console;
|
||||||
|
|
||||||
|
use App\Console\Commands\SetupWebsocketEnvironment;
|
||||||
use Illuminate\Console\Scheduling\Schedule;
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
use App\Console\Commands\SetupDevEnvironment;
|
use App\Console\Commands\SetupDevEnvironment;
|
||||||
use App\Console\Commands\SetupProdEnvironment;
|
use App\Console\Commands\SetupProdEnvironment;
|
||||||
@@ -25,6 +26,7 @@ class Kernel extends ConsoleKernel
|
|||||||
// Basic demo content generator
|
// Basic demo content generator
|
||||||
SetupDevEnvironment::class,
|
SetupDevEnvironment::class,
|
||||||
SetupProdEnvironment::class,
|
SetupProdEnvironment::class,
|
||||||
|
SetupWebsocketEnvironment::class,
|
||||||
|
|
||||||
// Subscription demo generator
|
// Subscription demo generator
|
||||||
GenerateDemoSubscriptionContentCommand::class,
|
GenerateDemoSubscriptionContentCommand::class,
|
||||||
|
|||||||
Reference in New Issue
Block a user