From 0e5122ede91efa49aa13253b00f0aab12197778f Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Thu, 3 Apr 2025 14:01:56 +0200 Subject: [PATCH 1/5] chore(versions): bump version to 405 --- config/constants.php | 2 +- other/nightly/versions.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/constants.php b/config/constants.php index a265e0026..3f23a191b 100644 --- a/config/constants.php +++ b/config/constants.php @@ -2,7 +2,7 @@ return [ 'coolify' => [ - 'version' => '4.0.0-beta.404', + 'version' => '4.0.0-beta.405', 'helper_version' => '1.0.8', 'realtime_version' => '1.0.6', 'self_hosted' => env('SELF_HOSTED', true), diff --git a/other/nightly/versions.json b/other/nightly/versions.json index 38ae7c427..a24146fa8 100644 --- a/other/nightly/versions.json +++ b/other/nightly/versions.json @@ -1,10 +1,10 @@ { "coolify": { "v4": { - "version": "4.0.0-beta.404" + "version": "4.0.0-beta.405" }, "nightly": { - "version": "4.0.0-beta.405" + "version": "4.0.0-beta.406" }, "helper": { "version": "1.0.8" From 34699129f4cf7628b331b38f179763ee89b214b9 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Thu, 3 Apr 2025 14:07:11 +0200 Subject: [PATCH 2/5] fix(api): used ssh keys can be deleted --- .../Controllers/Api/SecurityController.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/app/Http/Controllers/Api/SecurityController.php b/app/Http/Controllers/Api/SecurityController.php index fdd46b100..55a6cd9f4 100644 --- a/app/Http/Controllers/Api/SecurityController.php +++ b/app/Http/Controllers/Api/SecurityController.php @@ -368,6 +368,20 @@ class SecurityController extends Controller response: 404, description: 'Private Key not found.', ), + new OA\Response( + response: 422, + description: 'Private Key is in use and cannot be deleted.', + content: [ + new OA\MediaType( + mediaType: 'application/json', + schema: new OA\Schema( + type: 'object', + properties: [ + 'message' => ['type' => 'string', 'example' => 'Private Key is in use and cannot be deleted.'], + ] + ) + ), + ]), ] )] public function delete_key(Request $request) @@ -384,6 +398,14 @@ class SecurityController extends Controller if (is_null($key)) { return response()->json(['message' => 'Private Key not found.'], 404); } + + if ($key->isInUse()) { + return response()->json([ + 'message' => 'Private Key is in use and cannot be deleted.', + 'details' => 'This private key is currently being used by servers, applications, or Git integrations.', + ], 422); + } + $key->forceDelete(); return response()->json([ From 185eef05337a172b9fe18d983b79e52c1a90d36a Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Thu, 3 Apr 2025 15:02:04 +0200 Subject: [PATCH 3/5] fix(email): transactional emails not sending --- app/Livewire/SettingsEmail.php | 2 +- app/Notifications/TransactionalEmails/InvitationLink.php | 3 +-- app/Notifications/TransactionalEmails/ResetPassword.php | 3 +-- app/Notifications/TransactionalEmails/Test.php | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/Livewire/SettingsEmail.php b/app/Livewire/SettingsEmail.php index 4426c7812..b2394d7b0 100644 --- a/app/Livewire/SettingsEmail.php +++ b/app/Livewire/SettingsEmail.php @@ -225,7 +225,7 @@ class SettingsEmail extends Component 'test-email:'.$this->team->id, $perMinute = 0, function () { - $this->team?->notify(new Test($this->testEmailAddress, 'email')); + $this->team?->notify(new Test($this->testEmailAddress)); $this->dispatch('success', 'Test Email sent.'); }, $decaySeconds = 10, diff --git a/app/Notifications/TransactionalEmails/InvitationLink.php b/app/Notifications/TransactionalEmails/InvitationLink.php index fce3eb948..9bfb54798 100644 --- a/app/Notifications/TransactionalEmails/InvitationLink.php +++ b/app/Notifications/TransactionalEmails/InvitationLink.php @@ -16,10 +16,9 @@ class InvitationLink extends CustomEmailNotification return [TransactionalEmailChannel::class]; } - public function __construct(public User $user, public bool $isTransactionalEmail) + public function __construct(public User $user, public bool $isTransactionalEmail = true) { $this->onQueue('high'); - $this->isTransactionalEmail = true; } public function toMail(): MailMessage diff --git a/app/Notifications/TransactionalEmails/ResetPassword.php b/app/Notifications/TransactionalEmails/ResetPassword.php index 031a2d95a..179c8d948 100644 --- a/app/Notifications/TransactionalEmails/ResetPassword.php +++ b/app/Notifications/TransactionalEmails/ResetPassword.php @@ -17,11 +17,10 @@ class ResetPassword extends Notification public InstanceSettings $settings; - public function __construct($token, public bool $isTransactionalEmail) + public function __construct($token, public bool $isTransactionalEmail = true) { $this->settings = instanceSettings(); $this->token = $token; - $this->isTransactionalEmail = true; } public static function createUrlUsing($callback) diff --git a/app/Notifications/TransactionalEmails/Test.php b/app/Notifications/TransactionalEmails/Test.php index 951c007d9..3add70db2 100644 --- a/app/Notifications/TransactionalEmails/Test.php +++ b/app/Notifications/TransactionalEmails/Test.php @@ -8,10 +8,9 @@ use Illuminate\Notifications\Messages\MailMessage; class Test extends CustomEmailNotification { - public function __construct(public string $emails, public string $isTransactionalEmail) + public function __construct(public string $emails, public bool $isTransactionalEmail = true) { $this->onQueue('high'); - $this->isTransactionalEmail = true; } public function via(): array From d9be1191d633f5a7d5f6faa5b8f456f997da5944 Mon Sep 17 00:00:00 2001 From: Meghea Iulian Date: Thu, 3 Apr 2025 17:02:59 +0300 Subject: [PATCH 4/5] feat(api): update OpenAPI spec for services (#5448) --- app/Http/Controllers/Api/ServicesController.php | 5 +++-- openapi.json | 7 +++++-- openapi.yaml | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Api/ServicesController.php b/app/Http/Controllers/Api/ServicesController.php index cbbe4ab34..027bd5c1c 100644 --- a/app/Http/Controllers/Api/ServicesController.php +++ b/app/Http/Controllers/Api/ServicesController.php @@ -103,7 +103,7 @@ class ServicesController extends Controller mediaType: 'application/json', schema: new OA\Schema( type: 'object', - required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid', 'type'], + required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'], properties: [ 'type' => [ 'description' => 'The one-click service type', @@ -205,6 +205,7 @@ class ServicesController extends Controller 'server_uuid' => ['type' => 'string', 'description' => 'Server UUID.'], 'destination_uuid' => ['type' => 'string', 'description' => 'Destination UUID. Required if server has multiple destinations.'], 'instant_deploy' => ['type' => 'boolean', 'default' => false, 'description' => 'Start the service immediately after creation.'], + 'docker_compose_raw' => ['type' => 'string', 'description' => 'The Docker Compose raw content.'], ], ), ), @@ -256,7 +257,7 @@ class ServicesController extends Controller 'environment_name' => 'string|nullable', 'environment_uuid' => 'string|nullable', 'server_uuid' => 'string|required', - 'destination_uuid' => 'string', + 'destination_uuid' => 'string|nullable', 'name' => 'string|max:255', 'description' => 'string|nullable', 'instant_deploy' => 'boolean', diff --git a/openapi.json b/openapi.json index dbbc3dc24..3956c4380 100644 --- a/openapi.json +++ b/openapi.json @@ -5900,8 +5900,7 @@ "server_uuid", "project_uuid", "environment_name", - "environment_uuid", - "type" + "environment_uuid" ], "properties": { "type": { @@ -6030,6 +6029,10 @@ "type": "boolean", "default": false, "description": "Start the service immediately after creation." + }, + "docker_compose_raw": { + "type": "string", + "description": "The Docker Compose raw content." } }, "type": "object" diff --git a/openapi.yaml b/openapi.yaml index b8f34ef19..a9c538218 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -3991,7 +3991,6 @@ paths: - project_uuid - environment_name - environment_uuid - - type properties: type: description: 'The one-click service type' @@ -4024,6 +4023,9 @@ paths: type: boolean default: false description: 'Start the service immediately after creation.' + docker_compose_raw: + type: string + description: 'The Docker Compose raw content.' type: object responses: '201': From 3b68eaf05dbf8c9ac0474ee02a78cd84eeb83f48 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Fri, 4 Apr 2025 07:43:13 +0200 Subject: [PATCH 5/5] chore(versions): bump version to 406 --- versions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versions.json b/versions.json index 38ae7c427..a24146fa8 100644 --- a/versions.json +++ b/versions.json @@ -1,10 +1,10 @@ { "coolify": { "v4": { - "version": "4.0.0-beta.404" + "version": "4.0.0-beta.405" }, "nightly": { - "version": "4.0.0-beta.405" + "version": "4.0.0-beta.406" }, "helper": { "version": "1.0.8"