From 8e1444eaa7b7d98a3fcbb1616904c01d4a629203 Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Thu, 31 Oct 2024 17:44:01 +0100 Subject: [PATCH] Get rid of many useless blank lines --- app/Actions/CoolifyTask/RunRemoteProcess.php | 1 - app/Actions/Proxy/StartProxy.php | 1 - app/Actions/Server/ConfigureCloudflared.php | 1 - app/Console/Commands/CleanupDatabase.php | 1 - app/Console/Commands/CleanupRedis.php | 1 - app/Console/Commands/CleanupStuckedResources.php | 1 - app/Console/Commands/CloudCleanupSubscriptions.php | 2 -- app/Console/Commands/Dev.php | 1 - app/Console/Commands/Init.php | 2 -- app/Console/Commands/OpenApi.php | 1 - app/Http/Controllers/Api/ApplicationsController.php | 8 -------- app/Http/Controllers/Api/DatabasesController.php | 4 ---- app/Http/Controllers/Api/ProjectController.php | 1 - app/Http/Controllers/Api/ServicesController.php | 1 - app/Http/Controllers/Webhook/Gitea.php | 1 - app/Jobs/CheckHelperImageJob.php | 1 - app/Jobs/DatabaseBackupJob.php | 1 - app/Jobs/PushServerUpdateJob.php | 2 -- app/Jobs/ScheduledTaskJob.php | 1 - app/Jobs/ServerCheckJob.php | 2 -- app/Jobs/ServerCleanupMux.php | 2 -- app/Jobs/ServerStorageCheckJob.php | 2 -- app/Jobs/UpdateCoolifyJob.php | 1 - app/Livewire/Project/Database/Import.php | 1 - app/Livewire/Project/Database/Keydb/General.php | 1 - app/Livewire/Project/Database/Mariadb/General.php | 1 - app/Livewire/Project/Database/Mongodb/General.php | 1 - app/Livewire/Project/New/PublicGitRepository.php | 1 - app/Livewire/Project/Resource/Create.php | 1 - app/Livewire/Project/Service/Index.php | 1 - app/Livewire/Project/Shared/ExecuteContainerCommand.php | 3 --- app/Livewire/Project/Shared/Logs.php | 2 -- app/Livewire/Project/Shared/ResourceOperations.php | 1 - app/Livewire/Project/Shared/Storages/Add.php | 3 --- app/Livewire/Project/Shared/Terminal.php | 1 - app/Livewire/Project/Shared/UploadConfig.php | 1 - app/Livewire/Server/Charts.php | 1 - app/Livewire/Server/Form.php | 2 -- app/Livewire/Server/LogDrains.php | 2 -- app/Livewire/Server/Proxy.php | 1 - app/Livewire/SettingsEmail.php | 1 - app/Livewire/Source/Github/Change.php | 1 - app/Livewire/Upgrade.php | 2 -- app/Livewire/VerifyEmail.php | 1 - app/Models/Environment.php | 1 - app/Models/EnvironmentVariable.php | 1 - app/Models/InstanceSettings.php | 1 - app/Models/LocalFileVolume.php | 1 - app/Models/Service.php | 2 -- app/Notifications/ScheduledTask/TaskFailed.php | 1 - bootstrap/helpers/api.php | 2 -- bootstrap/helpers/docker.php | 2 -- bootstrap/helpers/proxy.php | 1 - bootstrap/helpers/shared.php | 4 ---- ...2023_08_22_071051_add_stripe_plan_to_subscriptions.php | 1 - .../migrations/2023_08_22_071054_add_stripe_reasons.php | 1 - .../2023_08_22_071059_add_stripe_trial_ended.php | 1 - .../2023_08_22_071060_change_invitation_link_length.php | 1 - .../2023_09_20_082541_update_services_table.php | 1 - ...23_09_20_083549_update_environment_variables_table.php | 1 - ...9_23_111809_remove_destination_from_services_table.php | 1 - .../migrations/2023_09_23_111819_add_server_emails.php | 1 - database/migrations/2023_11_16_220647_add_log_drains.php | 1 - .../migrations/2023_12_13_110214_add_soft_deletes.php | 1 - ..._17_155616_add_custom_docker_compose_start_command.php | 1 - ...24_04_09_095517_make_custom_docker_commands_longer.php | 1 - ..._073615_add_docker_network_to_application_settings.php | 1 - ...024_05_23_091713_add_gitea_webhook_to_applications.php | 1 - ...add_server_cleanup_fields_to_server_settings_table.php | 1 - .../2024_09_16_111428_encrypt_existing_private_keys.php | 1 - database/seeders/ProductionSeeder.php | 2 -- routes/api.php | 1 - 72 files changed, 103 deletions(-) diff --git a/app/Actions/CoolifyTask/RunRemoteProcess.php b/app/Actions/CoolifyTask/RunRemoteProcess.php index c75a30ae8..51c5a1f9e 100644 --- a/app/Actions/CoolifyTask/RunRemoteProcess.php +++ b/app/Actions/CoolifyTask/RunRemoteProcess.php @@ -39,7 +39,6 @@ class RunRemoteProcess */ public function __construct(Activity $activity, bool $hide_from_output = false, bool $ignore_errors = false, $call_event_on_finish = null, $call_event_data = null) { - if ($activity->getExtraProperty('type') !== ActivityTypes::INLINE->value && $activity->getExtraProperty('type') !== ActivityTypes::COMMAND->value) { throw new \RuntimeException('Incompatible Activity to run a remote command.'); } diff --git a/app/Actions/Proxy/StartProxy.php b/app/Actions/Proxy/StartProxy.php index 2a6ec7d03..8b584833f 100644 --- a/app/Actions/Proxy/StartProxy.php +++ b/app/Actions/Proxy/StartProxy.php @@ -70,6 +70,5 @@ class StartProxy return 'OK'; } - } } diff --git a/app/Actions/Server/ConfigureCloudflared.php b/app/Actions/Server/ConfigureCloudflared.php index 0819da07a..fc04e67a4 100644 --- a/app/Actions/Server/ConfigureCloudflared.php +++ b/app/Actions/Server/ConfigureCloudflared.php @@ -50,7 +50,6 @@ class ConfigureCloudflared 'rm -fr /tmp/cloudflared', ]); instant_remote_process($commands, $server); - } } } diff --git a/app/Console/Commands/CleanupDatabase.php b/app/Console/Commands/CleanupDatabase.php index 6f130626b..0b2b766f4 100644 --- a/app/Console/Commands/CleanupDatabase.php +++ b/app/Console/Commands/CleanupDatabase.php @@ -64,6 +64,5 @@ class CleanupDatabase extends Command if ($this->option('yes')) { $webhooks->delete(); } - } } diff --git a/app/Console/Commands/CleanupRedis.php b/app/Console/Commands/CleanupRedis.php index ed0740d34..5fc2b4e61 100644 --- a/app/Console/Commands/CleanupRedis.php +++ b/app/Console/Commands/CleanupRedis.php @@ -26,6 +26,5 @@ class CleanupRedis extends Command collect($queueOverlaps)->each(function ($key) { Redis::connection()->del($key); }); - } } diff --git a/app/Console/Commands/CleanupStuckedResources.php b/app/Console/Commands/CleanupStuckedResources.php index da757c99f..9d36ce9b8 100644 --- a/app/Console/Commands/CleanupStuckedResources.php +++ b/app/Console/Commands/CleanupStuckedResources.php @@ -36,7 +36,6 @@ class CleanupStuckedResources extends Command private function cleanup_stucked_resources() { - try { $servers = Server::all()->filter(function ($server) { return $server->isFunctional(); diff --git a/app/Console/Commands/CloudCleanupSubscriptions.php b/app/Console/Commands/CloudCleanupSubscriptions.php index 5054d125c..8bb420ab8 100644 --- a/app/Console/Commands/CloudCleanupSubscriptions.php +++ b/app/Console/Commands/CloudCleanupSubscriptions.php @@ -73,7 +73,6 @@ class CloudCleanupSubscriptions extends Command } } } - } catch (\Exception $e) { $this->error($e->getMessage()); @@ -95,6 +94,5 @@ class CloudCleanupSubscriptions extends Command ]); } } - } } diff --git a/app/Console/Commands/Dev.php b/app/Console/Commands/Dev.php index 20a2667c3..f5f1233fe 100644 --- a/app/Console/Commands/Dev.php +++ b/app/Console/Commands/Dev.php @@ -25,7 +25,6 @@ class Dev extends Command return; } - } public function generateOpenApi() diff --git a/app/Console/Commands/Init.php b/app/Console/Commands/Init.php index 8f68966a5..ccb864e1f 100644 --- a/app/Console/Commands/Init.php +++ b/app/Console/Commands/Init.php @@ -32,7 +32,6 @@ class Init extends Command $this->servers = Server::all(); if (isCloud()) { - } else { $this->send_alive_signal(); get_public_ips(); @@ -120,7 +119,6 @@ class Init extends Command } catch (\Throwable $e) { echo "Error in cleaning up unnecessary dynamic proxy configuration: {$e->getMessage()}\n"; } - } } diff --git a/app/Console/Commands/OpenApi.php b/app/Console/Commands/OpenApi.php index e8d73ef47..e248aa2c0 100644 --- a/app/Console/Commands/OpenApi.php +++ b/app/Console/Commands/OpenApi.php @@ -21,6 +21,5 @@ class OpenApi extends Command $error = preg_replace('/^\h*\v+/m', '', $error); echo $error; echo $process->output(); - } } diff --git a/app/Http/Controllers/Api/ApplicationsController.php b/app/Http/Controllers/Api/ApplicationsController.php index 46dd8120e..5c0024af1 100644 --- a/app/Http/Controllers/Api/ApplicationsController.php +++ b/app/Http/Controllers/Api/ApplicationsController.php @@ -1213,7 +1213,6 @@ class ApplicationsController extends Controller } return response()->json(['message' => 'Invalid type.'], 400); - } #[OA\Get( @@ -1869,18 +1868,15 @@ class ApplicationsController extends Controller return response()->json($this->removeSensitiveData($env))->setStatusCode(201); } else { - return response()->json([ 'message' => 'Environment variable not found.', ], 404); - } } return response()->json([ 'message' => 'Something is not okay. Are you okay?', ], 500); - } #[OA\Patch( @@ -2225,14 +2221,12 @@ class ApplicationsController extends Controller return response()->json([ 'uuid' => $env->uuid, ])->setStatusCode(201); - } } return response()->json([ 'message' => 'Something went wrong.', ], 500); - } #[OA\Delete( @@ -2580,7 +2574,6 @@ class ApplicationsController extends Controller 'deployment_uuid' => $deployment_uuid->toString(), ], ); - } #[OA\Post( @@ -2746,7 +2739,6 @@ class ApplicationsController extends Controller 'custom_labels' => 'The custom_labels should be base64 encoded.', ], ], 422); - } } if ($request->has('domains') && $server->isProxyShouldRun()) { diff --git a/app/Http/Controllers/Api/DatabasesController.php b/app/Http/Controllers/Api/DatabasesController.php index 65873f818..ce658d2a2 100644 --- a/app/Http/Controllers/Api/DatabasesController.php +++ b/app/Http/Controllers/Api/DatabasesController.php @@ -471,7 +471,6 @@ class DatabasesController extends Controller $request->offsetSet('mysql_conf', $mysqlConf); } break; - } $extraFields = array_diff(array_keys($request->all()), $allowedFields); if ($validator->fails() || ! empty($extraFields)) { @@ -506,7 +505,6 @@ class DatabasesController extends Controller return response()->json([ 'message' => 'Database updated.', ]); - } #[OA\Post( @@ -1165,7 +1163,6 @@ class DatabasesController extends Controller } return response()->json(serializeApiResponse($payload))->setStatusCode(201); - } elseif ($type === NewDatabaseTypes::MARIADB) { $allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'mariadb_conf', 'mariadb_root_password', 'mariadb_user', 'mariadb_password', 'mariadb_database']; $validator = customApiValidator($request->all(), [ @@ -1826,6 +1823,5 @@ class DatabasesController extends Controller ], 200 ); - } } diff --git a/app/Http/Controllers/Api/ProjectController.php b/app/Http/Controllers/Api/ProjectController.php index f1958de2c..491179d5d 100644 --- a/app/Http/Controllers/Api/ProjectController.php +++ b/app/Http/Controllers/Api/ProjectController.php @@ -356,7 +356,6 @@ class ProjectController extends Controller 'name' => $project->name, 'description' => $project->description, ])->setStatusCode(201); - } #[OA\Delete( diff --git a/app/Http/Controllers/Api/ServicesController.php b/app/Http/Controllers/Api/ServicesController.php index 89418517b..91595adb8 100644 --- a/app/Http/Controllers/Api/ServicesController.php +++ b/app/Http/Controllers/Api/ServicesController.php @@ -1238,6 +1238,5 @@ class ServicesController extends Controller ], 200 ); - } } diff --git a/app/Http/Controllers/Webhook/Gitea.php b/app/Http/Controllers/Webhook/Gitea.php index 3689ca7b3..cc53f2034 100644 --- a/app/Http/Controllers/Webhook/Gitea.php +++ b/app/Http/Controllers/Webhook/Gitea.php @@ -174,7 +174,6 @@ class Gitea extends Controller 'pull_request_html_url' => $pull_request_html_url, ]); } - } queue_application_deployment( application: $application, diff --git a/app/Jobs/CheckHelperImageJob.php b/app/Jobs/CheckHelperImageJob.php index d62ad601f..6abb8a150 100644 --- a/app/Jobs/CheckHelperImageJob.php +++ b/app/Jobs/CheckHelperImageJob.php @@ -31,7 +31,6 @@ class CheckHelperImageJob implements ShouldBeEncrypted, ShouldQueue $settings->update(['helper_version' => $latest_version]); } } - } catch (\Throwable $e) { send_internal_notification('CheckHelperImageJob failed with: '.$e->getMessage()); throw $e; diff --git a/app/Jobs/DatabaseBackupJob.php b/app/Jobs/DatabaseBackupJob.php index 196af2a83..fcfe2fe3d 100644 --- a/app/Jobs/DatabaseBackupJob.php +++ b/app/Jobs/DatabaseBackupJob.php @@ -129,7 +129,6 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue if ($this->postgres_password) { $this->postgres_password = str($this->postgres_password)->after('POSTGRES_PASSWORD=')->value(); } - } elseif (str($databaseType)->contains('mysql')) { $this->container_name = "{$this->database->name}-$serviceUuid"; $this->directory_name = $serviceName.'-'.$this->container_name; diff --git a/app/Jobs/PushServerUpdateJob.php b/app/Jobs/PushServerUpdateJob.php index 74ab8fa40..24f8d1e6b 100644 --- a/app/Jobs/PushServerUpdateJob.php +++ b/app/Jobs/PushServerUpdateJob.php @@ -167,7 +167,6 @@ class PushServerUpdateJob implements ShouldBeEncrypted, ShouldQueue $this->foundServiceDatabaseIds->push($subId); $this->updateServiceSubStatus($serviceId, $subType, $subId, $containerStatus); } - } else { $uuid = $labels->get('com.docker.compose.service'); $type = $labels->get('coolify.type'); @@ -265,7 +264,6 @@ class PushServerUpdateJob implements ShouldBeEncrypted, ShouldQueue instant_remote_process($connectProxyToDockerNetworks, $this->server, false); } } - } private function updateDatabaseStatus(string $databaseUuid, string $containerStatus, bool $tcpProxy = false) diff --git a/app/Jobs/ScheduledTaskJob.php b/app/Jobs/ScheduledTaskJob.php index b2788a351..c68b02c59 100644 --- a/app/Jobs/ScheduledTaskJob.php +++ b/app/Jobs/ScheduledTaskJob.php @@ -68,7 +68,6 @@ class ScheduledTaskJob implements ShouldQueue public function handle(): void { - try { $this->task_log = ScheduledTaskExecution::create([ 'scheduled_task_id' => $this->task->id, diff --git a/app/Jobs/ServerCheckJob.php b/app/Jobs/ServerCheckJob.php index 553796e87..26cb3c4f5 100644 --- a/app/Jobs/ServerCheckJob.php +++ b/app/Jobs/ServerCheckJob.php @@ -94,11 +94,9 @@ class ServerCheckJob implements ShouldBeEncrypted, ShouldQueue } } } - } catch (\Throwable $e) { return handleError($e); } - } private function checkLogDrainContainer() diff --git a/app/Jobs/ServerCleanupMux.php b/app/Jobs/ServerCleanupMux.php index 70ea59752..b793c3eca 100644 --- a/app/Jobs/ServerCleanupMux.php +++ b/app/Jobs/ServerCleanupMux.php @@ -33,10 +33,8 @@ class ServerCleanupMux implements ShouldBeEncrypted, ShouldQueue return 'Server is not reachable or not ready.'; } SshMultiplexingHelper::removeMuxFile($this->server); - } catch (\Throwable $e) { return handleError($e); } - } } diff --git a/app/Jobs/ServerStorageCheckJob.php b/app/Jobs/ServerStorageCheckJob.php index 32737cc47..cc838c77f 100644 --- a/app/Jobs/ServerStorageCheckJob.php +++ b/app/Jobs/ServerStorageCheckJob.php @@ -58,10 +58,8 @@ class ServerStorageCheckJob implements ShouldBeEncrypted, ShouldQueue } else { RateLimiter::hit('high-disk-usage:'.$this->server->id, 600); } - } catch (\Throwable $e) { return handleError($e); } - } } diff --git a/app/Jobs/UpdateCoolifyJob.php b/app/Jobs/UpdateCoolifyJob.php index 2cc705e4a..1e5197b6f 100644 --- a/app/Jobs/UpdateCoolifyJob.php +++ b/app/Jobs/UpdateCoolifyJob.php @@ -41,7 +41,6 @@ class UpdateCoolifyJob implements ShouldBeEncrypted, ShouldQueue $settings->update(['new_version_available' => false]); Log::info('Coolify update completed successfully.'); - } catch (\Throwable $e) { Log::error('UpdateCoolifyJob failed: '.$e->getMessage()); // Consider implementing a notification to administrators diff --git a/app/Livewire/Project/Database/Import.php b/app/Livewire/Project/Database/Import.php index 39db28d9b..663e7a6d7 100644 --- a/app/Livewire/Project/Database/Import.php +++ b/app/Livewire/Project/Database/Import.php @@ -88,7 +88,6 @@ class Import extends Component public function runImport() { - if ($this->filename === '') { $this->dispatch('error', 'Please select a file to import.'); diff --git a/app/Livewire/Project/Database/Keydb/General.php b/app/Livewire/Project/Database/Keydb/General.php index f976e1edd..df04f70d7 100644 --- a/app/Livewire/Project/Database/Keydb/General.php +++ b/app/Livewire/Project/Database/Keydb/General.php @@ -51,7 +51,6 @@ class General extends Component $this->db_url = $this->database->internal_db_url; $this->db_url_public = $this->database->external_db_url; $this->server = data_get($this->database, 'destination.server'); - } public function instantSaveAdvanced() diff --git a/app/Livewire/Project/Database/Mariadb/General.php b/app/Livewire/Project/Database/Mariadb/General.php index 12d4882f3..c9d473223 100644 --- a/app/Livewire/Project/Database/Mariadb/General.php +++ b/app/Livewire/Project/Database/Mariadb/General.php @@ -57,7 +57,6 @@ class General extends Component $this->db_url = $this->database->internal_db_url; $this->db_url_public = $this->database->external_db_url; $this->server = data_get($this->database, 'destination.server'); - } public function instantSaveAdvanced() diff --git a/app/Livewire/Project/Database/Mongodb/General.php b/app/Livewire/Project/Database/Mongodb/General.php index ac40e7dfa..e19895dae 100644 --- a/app/Livewire/Project/Database/Mongodb/General.php +++ b/app/Livewire/Project/Database/Mongodb/General.php @@ -55,7 +55,6 @@ class General extends Component $this->db_url = $this->database->internal_db_url; $this->db_url_public = $this->database->external_db_url; $this->server = data_get($this->database, 'destination.server'); - } public function instantSaveAdvanced() diff --git a/app/Livewire/Project/New/PublicGitRepository.php b/app/Livewire/Project/New/PublicGitRepository.php index 49f017270..bd35dccef 100644 --- a/app/Livewire/Project/New/PublicGitRepository.php +++ b/app/Livewire/Project/New/PublicGitRepository.php @@ -99,7 +99,6 @@ class PublicGitRepository extends Component $this->base_directory = '/'.$this->base_directory; } } - } public function updatedDockerComposeLocation() diff --git a/app/Livewire/Project/Resource/Create.php b/app/Livewire/Project/Resource/Create.php index 5c6a37d6d..9266a57fc 100644 --- a/app/Livewire/Project/Resource/Create.php +++ b/app/Livewire/Project/Resource/Create.php @@ -100,7 +100,6 @@ class Create extends Component 'is_preview' => false, ]); } - }); } $service->parse(isNew: true); diff --git a/app/Livewire/Project/Service/Index.php b/app/Livewire/Project/Service/Index.php index 0a7b6ec90..ba4ebe2fc 100644 --- a/app/Livewire/Project/Service/Index.php +++ b/app/Livewire/Project/Service/Index.php @@ -48,7 +48,6 @@ class Index extends Component } catch (\Throwable $e) { return handleError($e, $this); } - } public function generateDockerCompose() diff --git a/app/Livewire/Project/Shared/ExecuteContainerCommand.php b/app/Livewire/Project/Shared/ExecuteContainerCommand.php index 574dfa969..621ab1bac 100644 --- a/app/Livewire/Project/Shared/ExecuteContainerCommand.php +++ b/app/Livewire/Project/Shared/ExecuteContainerCommand.php @@ -132,7 +132,6 @@ class ExecuteContainerCommand extends Component } }); } - } if ($this->containers->count() > 0) { $this->container = $this->containers->first(); @@ -155,7 +154,6 @@ class ExecuteContainerCommand extends Component data_get($this->server, 'name'), data_get($this->server, 'uuid') ); - } catch (\Throwable $e) { return handleError($e, $this); } @@ -185,7 +183,6 @@ class ExecuteContainerCommand extends Component data_get($container, 'container.Names'), data_get($container, 'server.uuid') ); - } catch (\Throwable $e) { return handleError($e, $this); } diff --git a/app/Livewire/Project/Shared/Logs.php b/app/Livewire/Project/Shared/Logs.php index e2b57aab3..12022b1ee 100644 --- a/app/Livewire/Project/Shared/Logs.php +++ b/app/Livewire/Project/Shared/Logs.php @@ -109,9 +109,7 @@ class Logs extends Component $this->containers = $this->containers->filter(function ($container) { return str_contains($container, $this->query['pull_request_id']); }); - } - } catch (\Exception $e) { return handleError($e, $this); } diff --git a/app/Livewire/Project/Shared/ResourceOperations.php b/app/Livewire/Project/Shared/ResourceOperations.php index 414ebba03..e67df6aa9 100644 --- a/app/Livewire/Project/Shared/ResourceOperations.php +++ b/app/Livewire/Project/Shared/ResourceOperations.php @@ -147,7 +147,6 @@ class ResourceOperations extends Component return redirect()->to($route); } - } public function moveTo($environment_id) diff --git a/app/Livewire/Project/Shared/Storages/Add.php b/app/Livewire/Project/Shared/Storages/Add.php index afa27a6bd..6e250bd90 100644 --- a/app/Livewire/Project/Shared/Storages/Add.php +++ b/app/Livewire/Project/Shared/Storages/Add.php @@ -100,7 +100,6 @@ class Add extends Component } catch (\Throwable $e) { return handleError($e, $this); } - } public function submitFileStorageDirectory() @@ -127,7 +126,6 @@ class Add extends Component } catch (\Throwable $e) { return handleError($e, $this); } - } public function submitPersistentVolume() @@ -144,7 +142,6 @@ class Add extends Component 'mount_path' => $this->mount_path, 'host_path' => $this->host_path, ]); - } catch (\Throwable $e) { return handleError($e, $this); } diff --git a/app/Livewire/Project/Shared/Terminal.php b/app/Livewire/Project/Shared/Terminal.php index 916db650f..5af8f057e 100644 --- a/app/Livewire/Project/Shared/Terminal.php +++ b/app/Livewire/Project/Shared/Terminal.php @@ -26,7 +26,6 @@ class Terminal extends Component #[On('send-terminal-command')] public function sendTerminalCommand($isContainer, $identifier, $serverUuid) { - $server = Server::ownedByCurrentTeam()->whereUuid($serverUuid)->firstOrFail(); if ($isContainer) { diff --git a/app/Livewire/Project/Shared/UploadConfig.php b/app/Livewire/Project/Shared/UploadConfig.php index 3859b387a..1b10f588b 100644 --- a/app/Livewire/Project/Shared/UploadConfig.php +++ b/app/Livewire/Project/Shared/UploadConfig.php @@ -37,7 +37,6 @@ class UploadConfig extends Component return; } - } public function render() diff --git a/app/Livewire/Server/Charts.php b/app/Livewire/Server/Charts.php index d879de65d..d0db87f57 100644 --- a/app/Livewire/Server/Charts.php +++ b/app/Livewire/Server/Charts.php @@ -49,7 +49,6 @@ class Charts extends Component $this->dispatch("refreshChartData-{$this->chartId}-memory", [ 'seriesData' => $memoryMetrics, ]); - } catch (\Throwable $e) { return handleError($e, $this); } diff --git a/app/Livewire/Server/Form.php b/app/Livewire/Server/Form.php index 697c7b76f..740421373 100644 --- a/app/Livewire/Server/Form.php +++ b/app/Livewire/Server/Form.php @@ -86,7 +86,6 @@ class Form extends Component $this->server = $server; $this->timezones = collect(timezone_identifiers_list())->sort()->values()->toArray(); $this->wildcard_domain = $this->server->settings->wildcard_domain; - } public function checkSyncStatus() @@ -169,7 +168,6 @@ class Form extends Component public function instantSave() { try { - $this->validate(); refresh_server_connection($this->server->privateKey); $this->validateServer(false); diff --git a/app/Livewire/Server/LogDrains.php b/app/Livewire/Server/LogDrains.php index 2bc24eff8..fb8ef329f 100644 --- a/app/Livewire/Server/LogDrains.php +++ b/app/Livewire/Server/LogDrains.php @@ -51,7 +51,6 @@ class LogDrains extends Component public function syncData(bool $toModel = false) { - if ($toModel) { $this->validate(); $this->server->settings->is_logdrain_newrelic_enabled = $this->isLogDrainNewRelicEnabled; @@ -78,7 +77,6 @@ class LogDrains extends Component $this->logDrainCustomConfig = $this->server->settings->logdrain_custom_config; $this->logDrainCustomConfigParser = $this->server->settings->logdrain_custom_config_parser; } - } public function instantSave() diff --git a/app/Livewire/Server/Proxy.php b/app/Livewire/Server/Proxy.php index 55d0c4966..94ea3509a 100644 --- a/app/Livewire/Server/Proxy.php +++ b/app/Livewire/Server/Proxy.php @@ -99,7 +99,6 @@ class Proxy extends Component } else { $this->dispatch('traefikDashboardAvailable', false); } - } catch (\Throwable $e) { return handleError($e, $this); } diff --git a/app/Livewire/SettingsEmail.php b/app/Livewire/SettingsEmail.php index 2b515bf68..fe329f270 100644 --- a/app/Livewire/SettingsEmail.php +++ b/app/Livewire/SettingsEmail.php @@ -47,7 +47,6 @@ class SettingsEmail extends Component } else { return redirect()->route('dashboard'); } - } public function submitFromFields() diff --git a/app/Livewire/Source/Github/Change.php b/app/Livewire/Source/Github/Change.php index 22cabcd0b..07cef54f9 100644 --- a/app/Livewire/Source/Github/Change.php +++ b/app/Livewire/Source/Github/Change.php @@ -140,7 +140,6 @@ class Change extends Component } catch (\Throwable $e) { return handleError($e, $this); } - } public function submit() diff --git a/app/Livewire/Upgrade.php b/app/Livewire/Upgrade.php index dfbd945f5..88ed88cb7 100644 --- a/app/Livewire/Upgrade.php +++ b/app/Livewire/Upgrade.php @@ -23,11 +23,9 @@ class Upgrade extends Component try { $this->latestVersion = get_latest_version_of_coolify(); $this->isUpgradeAvailable = data_get(InstanceSettings::get(), 'new_version_available', false); - } catch (\Throwable $e) { return handleError($e, $this); } - } public function upgrade() diff --git a/app/Livewire/VerifyEmail.php b/app/Livewire/VerifyEmail.php index 9d1fdab98..fab3265b6 100644 --- a/app/Livewire/VerifyEmail.php +++ b/app/Livewire/VerifyEmail.php @@ -15,7 +15,6 @@ class VerifyEmail extends Component $this->rateLimit(1, 300); auth()->user()->sendVerificationEmail(); $this->dispatch('success', 'Email verification link sent!'); - } catch (\Exception $e) { return handleError($e, $this); } diff --git a/app/Models/Environment.php b/app/Models/Environment.php index d0bb5d2a6..71e8bbd21 100644 --- a/app/Models/Environment.php +++ b/app/Models/Environment.php @@ -29,7 +29,6 @@ class Environment extends Model foreach ($shared_variables as $shared_variable) { $shared_variable->delete(); } - }); } diff --git a/app/Models/EnvironmentVariable.php b/app/Models/EnvironmentVariable.php index f9e09941d..08f23d7ab 100644 --- a/app/Models/EnvironmentVariable.php +++ b/app/Models/EnvironmentVariable.php @@ -162,7 +162,6 @@ class EnvironmentVariable extends Model $environment_variable = trim($environment_variable); $sharedEnvsFound = str($environment_variable)->matchAll('/{{(.*?)}}/'); if ($sharedEnvsFound->isEmpty()) { - return $environment_variable; } diff --git a/app/Models/InstanceSettings.php b/app/Models/InstanceSettings.php index 339daed2a..eeb803925 100644 --- a/app/Models/InstanceSettings.php +++ b/app/Models/InstanceSettings.php @@ -36,7 +36,6 @@ class InstanceSettings extends Model implements SendsEmail }); } }); - } public function fqdn(): Attribute diff --git a/app/Models/LocalFileVolume.php b/app/Models/LocalFileVolume.php index 97a1e4cbb..2c223be77 100644 --- a/app/Models/LocalFileVolume.php +++ b/app/Models/LocalFileVolume.php @@ -72,7 +72,6 @@ class LocalFileVolume extends BaseModel if ($path && $path != '/' && $path != '.' && $path != '..') { if ($isFile === 'OK') { $commands->push("rm -rf $path > /dev/null 2>&1 || true"); - } elseif ($isDir === 'OK') { $commands->push("rm -rf $path > /dev/null 2>&1 || true"); $commands->push("rmdir $path > /dev/null 2>&1 || true"); diff --git a/app/Models/Service.php b/app/Models/Service.php index c4f4c2d3c..fe2ebcbd6 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -1095,7 +1095,6 @@ class Service extends BaseModel } $fields->put('MariaDB', $data->toArray()); break; - } } @@ -1304,7 +1303,6 @@ class Service extends BaseModel } else { return collect([]); } - } public function networks() diff --git a/app/Notifications/ScheduledTask/TaskFailed.php b/app/Notifications/ScheduledTask/TaskFailed.php index 2cc33f2ba..c3501a8eb 100644 --- a/app/Notifications/ScheduledTask/TaskFailed.php +++ b/app/Notifications/ScheduledTask/TaskFailed.php @@ -30,7 +30,6 @@ class TaskFailed extends Notification implements ShouldQueue public function via(object $notifiable): array { - return setNotificationChannels($notifiable, 'scheduled_tasks'); } diff --git a/bootstrap/helpers/api.php b/bootstrap/helpers/api.php index d7c16b607..a1dae612c 100644 --- a/bootstrap/helpers/api.php +++ b/bootstrap/helpers/api.php @@ -28,7 +28,6 @@ function serializeApiResponse($data) if ($created_at) { unset($d['created_at']); $d['created_at'] = $created_at; - } if ($updated_at) { unset($d['updated_at']); @@ -59,7 +58,6 @@ function serializeApiResponse($data) if ($created_at) { unset($d['created_at']); $d['created_at'] = $created_at; - } if ($updated_at) { unset($d['updated_at']); diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.php index 77070128d..f262b3cd8 100644 --- a/bootstrap/helpers/docker.php +++ b/bootstrap/helpers/docker.php @@ -581,7 +581,6 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview redirect_direction: $application->redirect )); } - } } else { if (data_get($preview, 'fqdn')) { @@ -633,7 +632,6 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview is_stripprefix_enabled: $application->isStripprefixEnabled() )); } - } return $labels->all(); diff --git a/bootstrap/helpers/proxy.php b/bootstrap/helpers/proxy.php index 496017217..8da537807 100644 --- a/bootstrap/helpers/proxy.php +++ b/bootstrap/helpers/proxy.php @@ -21,7 +21,6 @@ function collectProxyDockerNetworksByServer(Server $server) })->flatten()->unique(); return $networks; - } function collectDockerNetworksByServer(Server $server) { diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index 67ce353d2..273dd8c55 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -3188,7 +3188,6 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int 'is_build_time' => false, 'is_preview' => false, ]); - } else { $value = generateEnvValue($command, $resource); $resource->environment_variables()->where('key', $key->value())->where($nameOfId, $resource->id)->firstOrCreate([ @@ -3616,7 +3615,6 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int 'is_required' => $isRequired, ]); } - } } if ($isApplication) { @@ -3980,7 +3978,6 @@ function convertComposeEnvironmentToArray($environment) } return $convertedServiceVariables; - } function instanceSettings() { @@ -3989,7 +3986,6 @@ function instanceSettings() function loadConfigFromGit(string $repository, string $branch, string $base_directory, int $server_id, int $team_id) { - $server = Server::find($server_id)->where('team_id', $team_id)->first(); if (! $server) { return; diff --git a/database/migrations/2023_08_22_071051_add_stripe_plan_to_subscriptions.php b/database/migrations/2023_08_22_071051_add_stripe_plan_to_subscriptions.php index 3da187320..a04eaf983 100644 --- a/database/migrations/2023_08_22_071051_add_stripe_plan_to_subscriptions.php +++ b/database/migrations/2023_08_22_071051_add_stripe_plan_to_subscriptions.php @@ -13,7 +13,6 @@ return new class extends Migration { Schema::table('subscriptions', function (Blueprint $table) { $table->string('stripe_plan_id')->nullable()->after('stripe_cancel_at_period_end'); - }); } diff --git a/database/migrations/2023_08_22_071054_add_stripe_reasons.php b/database/migrations/2023_08_22_071054_add_stripe_reasons.php index efd611aac..6ffe37e98 100644 --- a/database/migrations/2023_08_22_071054_add_stripe_reasons.php +++ b/database/migrations/2023_08_22_071054_add_stripe_reasons.php @@ -14,7 +14,6 @@ return new class extends Migration Schema::table('subscriptions', function (Blueprint $table) { $table->string('stripe_feedback')->nullable()->after('stripe_cancel_at_period_end'); $table->string('stripe_comment')->nullable()->after('stripe_feedback'); - }); } diff --git a/database/migrations/2023_08_22_071059_add_stripe_trial_ended.php b/database/migrations/2023_08_22_071059_add_stripe_trial_ended.php index c22317e6b..61fcbda6b 100644 --- a/database/migrations/2023_08_22_071059_add_stripe_trial_ended.php +++ b/database/migrations/2023_08_22_071059_add_stripe_trial_ended.php @@ -13,7 +13,6 @@ return new class extends Migration { Schema::table('subscriptions', function (Blueprint $table) { $table->boolean('stripe_trial_already_ended')->default(false)->after('stripe_cancel_at_period_end'); - }); } diff --git a/database/migrations/2023_08_22_071060_change_invitation_link_length.php b/database/migrations/2023_08_22_071060_change_invitation_link_length.php index 4efb03351..9d14c3f26 100644 --- a/database/migrations/2023_08_22_071060_change_invitation_link_length.php +++ b/database/migrations/2023_08_22_071060_change_invitation_link_length.php @@ -13,7 +13,6 @@ return new class extends Migration { Schema::table('team_invitations', function (Blueprint $table) { $table->text('link')->change(); - }); } diff --git a/database/migrations/2023_09_20_082541_update_services_table.php b/database/migrations/2023_09_20_082541_update_services_table.php index 8c6b350f7..c70cd28f7 100644 --- a/database/migrations/2023_09_20_082541_update_services_table.php +++ b/database/migrations/2023_09_20_082541_update_services_table.php @@ -16,7 +16,6 @@ return new class extends Migration $table->longText('description')->nullable(); $table->longText('docker_compose_raw'); $table->longText('docker_compose')->nullable(); - }); } diff --git a/database/migrations/2023_09_20_083549_update_environment_variables_table.php b/database/migrations/2023_09_20_083549_update_environment_variables_table.php index 40eb6aa44..a96d096bb 100644 --- a/database/migrations/2023_09_20_083549_update_environment_variables_table.php +++ b/database/migrations/2023_09_20_083549_update_environment_variables_table.php @@ -13,7 +13,6 @@ return new class extends Migration { Schema::table('environment_variables', function (Blueprint $table) { $table->foreignId('service_id')->nullable(); - }); } diff --git a/database/migrations/2023_09_23_111809_remove_destination_from_services_table.php b/database/migrations/2023_09_23_111809_remove_destination_from_services_table.php index 920f44a72..729146a4a 100644 --- a/database/migrations/2023_09_23_111809_remove_destination_from_services_table.php +++ b/database/migrations/2023_09_23_111809_remove_destination_from_services_table.php @@ -14,7 +14,6 @@ return new class extends Migration Schema::table('services', function (Blueprint $table) { $table->dropColumn('destination_type'); $table->dropColumn('destination_id'); - }); } diff --git a/database/migrations/2023_09_23_111819_add_server_emails.php b/database/migrations/2023_09_23_111819_add_server_emails.php index 03c1e6bd2..775e82010 100644 --- a/database/migrations/2023_09_23_111819_add_server_emails.php +++ b/database/migrations/2023_09_23_111819_add_server_emails.php @@ -26,6 +26,5 @@ return new class extends Migration $table->dropColumn('unreachable_email_sent'); $table->integer('unreachable_count')->default(0); }); - } }; diff --git a/database/migrations/2023_11_16_220647_add_log_drains.php b/database/migrations/2023_11_16_220647_add_log_drains.php index 05b1ed054..f5161b3d7 100644 --- a/database/migrations/2023_11_16_220647_add_log_drains.php +++ b/database/migrations/2023_11_16_220647_add_log_drains.php @@ -22,7 +22,6 @@ return new class extends Migration $table->boolean('is_logdrain_axiom_enabled')->default(false); $table->string('logdrain_axiom_dataset_name')->nullable(); $table->string('logdrain_axiom_api_key')->nullable(); - }); } diff --git a/database/migrations/2023_12_13_110214_add_soft_deletes.php b/database/migrations/2023_12_13_110214_add_soft_deletes.php index ab7b562b4..72350b77f 100644 --- a/database/migrations/2023_12_13_110214_add_soft_deletes.php +++ b/database/migrations/2023_12_13_110214_add_soft_deletes.php @@ -66,6 +66,5 @@ return new class extends Migration Schema::table('service_databases', function (Blueprint $table) { $table->dropSoftDeletes(); }); - } }; diff --git a/database/migrations/2023_12_17_155616_add_custom_docker_compose_start_command.php b/database/migrations/2023_12_17_155616_add_custom_docker_compose_start_command.php index eeb2769fe..f28b2670e 100644 --- a/database/migrations/2023_12_17_155616_add_custom_docker_compose_start_command.php +++ b/database/migrations/2023_12_17_155616_add_custom_docker_compose_start_command.php @@ -14,7 +14,6 @@ return new class extends Migration Schema::table('applications', function (Blueprint $table) { $table->string('docker_compose_custom_start_command')->nullable(); $table->string('docker_compose_custom_build_command')->nullable(); - }); } diff --git a/database/migrations/2024_04_09_095517_make_custom_docker_commands_longer.php b/database/migrations/2024_04_09_095517_make_custom_docker_commands_longer.php index 7df53ec06..b3f2c1920 100644 --- a/database/migrations/2024_04_09_095517_make_custom_docker_commands_longer.php +++ b/database/migrations/2024_04_09_095517_make_custom_docker_commands_longer.php @@ -13,7 +13,6 @@ return new class extends Migration { Schema::table('applications', function (Blueprint $table) { $table->text('custom_docker_run_options')->nullable()->change(); - }); } diff --git a/database/migrations/2024_04_25_073615_add_docker_network_to_application_settings.php b/database/migrations/2024_04_25_073615_add_docker_network_to_application_settings.php index aeae6f77d..bea410eab 100644 --- a/database/migrations/2024_04_25_073615_add_docker_network_to_application_settings.php +++ b/database/migrations/2024_04_25_073615_add_docker_network_to_application_settings.php @@ -13,7 +13,6 @@ return new class extends Migration { Schema::table('application_settings', function (Blueprint $table) { $table->boolean('connect_to_docker_network')->default(false); - }); } diff --git a/database/migrations/2024_05_23_091713_add_gitea_webhook_to_applications.php b/database/migrations/2024_05_23_091713_add_gitea_webhook_to_applications.php index 716f1f44c..b46a07203 100644 --- a/database/migrations/2024_05_23_091713_add_gitea_webhook_to_applications.php +++ b/database/migrations/2024_05_23_091713_add_gitea_webhook_to_applications.php @@ -13,7 +13,6 @@ return new class extends Migration { Schema::table('applications', function (Blueprint $table) { $table->string('manual_webhook_secret_gitea')->nullable(); - }); } diff --git a/database/migrations/2024_08_09_215659_add_server_cleanup_fields_to_server_settings_table.php b/database/migrations/2024_08_09_215659_add_server_cleanup_fields_to_server_settings_table.php index b5300c905..e3bdc68c6 100644 --- a/database/migrations/2024_08_09_215659_add_server_cleanup_fields_to_server_settings_table.php +++ b/database/migrations/2024_08_09_215659_add_server_cleanup_fields_to_server_settings_table.php @@ -30,7 +30,6 @@ class AddServerCleanupFieldsToServerSettingsTable extends Migration $serverSetting->docker_cleanup_threshold = $serverSetting->cleanup_after_percentage; $serverSetting->save(); } - } /** diff --git a/database/migrations/2024_09_16_111428_encrypt_existing_private_keys.php b/database/migrations/2024_09_16_111428_encrypt_existing_private_keys.php index 19274ad9b..e16181ac7 100644 --- a/database/migrations/2024_09_16_111428_encrypt_existing_private_keys.php +++ b/database/migrations/2024_09_16_111428_encrypt_existing_private_keys.php @@ -20,6 +20,5 @@ class EncryptExistingPrivateKeys extends Migration echo 'Encrypting private keys failed.'; echo $e->getMessage(); } - } } diff --git a/database/seeders/ProductionSeeder.php b/database/seeders/ProductionSeeder.php index 90b9d46ff..3e820a162 100644 --- a/database/seeders/ProductionSeeder.php +++ b/database/seeders/ProductionSeeder.php @@ -126,7 +126,6 @@ class ProductionSeeder extends Seeder echo "Your localhost connection won't work until then."; } } - } if (config('coolify.is_windows_docker_desktop')) { PrivateKey::updateOrCreate( @@ -187,6 +186,5 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA== $this->call(OauthSettingSeeder::class); $this->call(PopulateSshKeysDirectorySeeder::class); $this->call(SentinelSeeder::class); - } } diff --git a/routes/api.php b/routes/api.php index b63fde871..572325810 100644 --- a/routes/api.php +++ b/routes/api.php @@ -128,7 +128,6 @@ Route::group([ Route::match(['get', 'post'], '/services/{uuid}/start', [ServicesController::class, 'action_deploy'])->middleware([IgnoreReadOnlyApiToken::class]); Route::match(['get', 'post'], '/services/{uuid}/restart', [ServicesController::class, 'action_restart'])->middleware([IgnoreReadOnlyApiToken::class]); Route::match(['get', 'post'], '/services/{uuid}/stop', [ServicesController::class, 'action_stop'])->middleware([IgnoreReadOnlyApiToken::class]); - }); Route::group([