Merge branch 'coollabsio:main' into fix-#2546-deletion-issues
This commit is contained in:
@@ -4,6 +4,8 @@ namespace App\Actions\Server;
|
||||
|
||||
use App\Models\InstanceSettings;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Lorisleiva\Actions\Concerns\AsAction;
|
||||
|
||||
class UpdateCoolify
|
||||
@@ -25,6 +27,11 @@ class UpdateCoolify
|
||||
return;
|
||||
}
|
||||
CleanupDocker::dispatch($this->server, false)->onQueue('high');
|
||||
$response = Http::retry(3, 1000)->get('https://cdn.coollabs.io/coolify/versions.json');
|
||||
if ($response->successful()) {
|
||||
$versions = $response->json();
|
||||
File::put(base_path('versions.json'), json_encode($versions, JSON_PRETTY_PRINT));
|
||||
}
|
||||
$this->latestVersion = get_latest_version_of_coolify();
|
||||
$this->currentVersion = config('version');
|
||||
if (! $manual_update) {
|
||||
@@ -39,6 +46,8 @@ class UpdateCoolify
|
||||
}
|
||||
}
|
||||
$this->update();
|
||||
$settings->new_version_available = false;
|
||||
$settings->save();
|
||||
} catch (\Throwable $e) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -43,15 +43,15 @@ class ServerCheckJob implements ShouldBeEncrypted, ShouldQueue
|
||||
|
||||
public function __construct(public Server $server) {}
|
||||
|
||||
public function middleware(): array
|
||||
{
|
||||
return [(new WithoutOverlapping($this->server->uuid))];
|
||||
}
|
||||
// public function middleware(): array
|
||||
// {
|
||||
// return [(new WithoutOverlapping($this->server->uuid))];
|
||||
// }
|
||||
|
||||
public function uniqueId(): int
|
||||
{
|
||||
return $this->server->uuid;
|
||||
}
|
||||
// public function uniqueId(): int
|
||||
// {
|
||||
// return $this->server->uuid;
|
||||
// }
|
||||
|
||||
public function handle()
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ class SettingsBackup extends Component
|
||||
|
||||
public $s3s;
|
||||
|
||||
public StandalonePostgresql|null|array $database = [];
|
||||
public ?StandalonePostgresql $database = null;
|
||||
|
||||
public ScheduledDatabaseBackup|null|array $backup = [];
|
||||
|
||||
@@ -43,19 +43,19 @@ class SettingsBackup extends Component
|
||||
{
|
||||
if (isInstanceAdmin()) {
|
||||
$settings = InstanceSettings::get();
|
||||
$database = StandalonePostgresql::whereName('coolify-db')->first();
|
||||
$this->database = StandalonePostgresql::whereName('coolify-db')->first();
|
||||
$s3s = S3Storage::whereTeamId(0)->get() ?? [];
|
||||
if ($database) {
|
||||
if ($database->status !== 'running') {
|
||||
$database->status = 'running';
|
||||
$database->save();
|
||||
if ($this->database) {
|
||||
if ($this->database->status !== 'running') {
|
||||
$this->database->status = 'running';
|
||||
$this->database->save();
|
||||
}
|
||||
$this->database = $database;
|
||||
$this->backup = $this->database->scheduledBackups->first();
|
||||
$this->executions = $this->backup->executions;
|
||||
}
|
||||
$this->settings = $settings;
|
||||
$this->s3s = $s3s;
|
||||
$this->backup = $this->database?->scheduledBackups?->first() ?? null;
|
||||
$this->executions = $this->backup?->executions ?? [];
|
||||
|
||||
} else {
|
||||
return redirect()->route('dashboard');
|
||||
}
|
||||
|
||||
@@ -715,8 +715,8 @@ $schema://$host {
|
||||
}
|
||||
|
||||
return [
|
||||
'containers' => $containers ?? collect([]),
|
||||
'containerReplicates' => $containerReplicates ?? collect([]),
|
||||
'containers' => collect($containers) ?? collect([]),
|
||||
'containerReplicates' => collect($containerReplicates) ?? collect([]),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user