Revert "rector: arrrrr"

This reverts commit 16c0cd10d8.
This commit is contained in:
Andras Bacsai
2025-01-07 15:31:43 +01:00
parent da07b4fdcf
commit 1fe4dd722b
349 changed files with 3689 additions and 4184 deletions

View File

@@ -2,7 +2,6 @@
namespace App\Events;
use Exception;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
@@ -21,7 +20,7 @@ class ApplicationStatusChanged implements ShouldBroadcast
$teamId = auth()->user()->currentTeam()->id ?? null;
}
if (is_null($teamId)) {
throw new Exception('Team id is null');
throw new \Exception('Team id is null');
}
$this->teamId = $teamId;
}

View File

@@ -2,7 +2,6 @@
namespace App\Events;
use Exception;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
@@ -21,7 +20,7 @@ class BackupCreated implements ShouldBroadcast
$teamId = auth()->user()->currentTeam()->id ?? null;
}
if (is_null($teamId)) {
throw new Exception('Team id is null');
throw new \Exception('Team id is null');
}
$this->teamId = $teamId;
}

View File

@@ -2,7 +2,6 @@
namespace App\Events;
use Exception;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
@@ -21,7 +20,7 @@ class CloudflareTunnelConfigured implements ShouldBroadcast
$teamId = auth()->user()->currentTeam()->id ?? null;
}
if (is_null($teamId)) {
throw new Exception('Team id is null');
throw new \Exception('Team id is null');
}
$this->teamId = $teamId;
}

View File

@@ -2,7 +2,6 @@
namespace App\Events;
use Exception;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
@@ -22,7 +21,7 @@ class DatabaseProxyStopped implements ShouldBroadcast
$teamId = Auth::user()?->currentTeam()?->id ?? null;
}
if (is_null($teamId)) {
throw new Exception('Team id is null');
throw new \Exception('Team id is null');
}
$this->teamId = $teamId;
}

View File

@@ -13,7 +13,7 @@ class DatabaseStatusChanged implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $userId;
public $userId = null;
public function __construct($userId = null)
{
@@ -21,7 +21,7 @@ class DatabaseStatusChanged implements ShouldBroadcast
$userId = Auth::id() ?? null;
}
if (is_null($userId)) {
return;
return false;
}
$this->userId = $userId;

View File

@@ -2,7 +2,6 @@
namespace App\Events;
use Exception;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
@@ -18,7 +17,7 @@ class FileStorageChanged implements ShouldBroadcast
public function __construct($teamId = null)
{
if (is_null($teamId)) {
throw new Exception('Team id is null');
throw new \Exception('Team id is null');
}
$this->teamId = $teamId;
}

View File

@@ -2,7 +2,6 @@
namespace App\Events;
use Exception;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
@@ -21,7 +20,7 @@ class ProxyStatusChanged implements ShouldBroadcast
$teamId = auth()->user()->currentTeam()->id ?? null;
}
if (is_null($teamId)) {
throw new Exception('Team id is null');
throw new \Exception('Team id is null');
}
$this->teamId = $teamId;
}

View File

@@ -17,15 +17,18 @@ class RestoreJobFinished
$tmpPath = data_get($data, 'tmpPath');
$container = data_get($data, 'container');
$serverId = data_get($data, 'serverId');
if (filled($scriptPath) && filled($tmpPath) && filled($container) && filled($serverId) && (str($tmpPath)->startsWith('/tmp/')
&& str($scriptPath)->startsWith('/tmp/')
&& ! str($tmpPath)->contains('..')
&& ! str($scriptPath)->contains('..')
&& strlen($tmpPath) > 5 // longer than just "/tmp/"
&& strlen($scriptPath) > 5)) {
$commands[] = "docker exec {$container} sh -c 'rm {$scriptPath}'";
$commands[] = "docker exec {$container} sh -c 'rm {$tmpPath}'";
instant_remote_process($commands, Server::query()->find($serverId), throwError: true);
if (filled($scriptPath) && filled($tmpPath) && filled($container) && filled($serverId)) {
if (str($tmpPath)->startsWith('/tmp/')
&& str($scriptPath)->startsWith('/tmp/')
&& ! str($tmpPath)->contains('..')
&& ! str($scriptPath)->contains('..')
&& strlen($tmpPath) > 5 // longer than just "/tmp/"
&& strlen($scriptPath) > 5
) {
$commands[] = "docker exec {$container} sh -c 'rm {$scriptPath}'";
$commands[] = "docker exec {$container} sh -c 'rm {$tmpPath}'";
instant_remote_process($commands, Server::find($serverId), throwError: true);
}
}
}
}

View File

@@ -2,7 +2,6 @@
namespace App\Events;
use Exception;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
@@ -21,7 +20,7 @@ class ScheduledTaskDone implements ShouldBroadcast
$teamId = auth()->user()->currentTeam()->id ?? null;
}
if (is_null($teamId)) {
throw new Exception('Team id is null');
throw new \Exception('Team id is null');
}
$this->teamId = $teamId;
}

View File

@@ -21,7 +21,7 @@ class ServiceStatusChanged implements ShouldBroadcast
$userId = Auth::id() ?? null;
}
if (is_null($userId)) {
return;
return false;
}
$this->userId = $userId;
}