From 679833a0a6a2799d2086e0965dade0703587c3c5 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Wed, 17 Dec 2025 16:01:39 +0100 Subject: [PATCH] Fix PostgreSQL version selection in global search redirect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow users to select PostgreSQL version instead of automatically creating postgres:16-alpine when using global search. The fix includes: - Remove hardcoded database_image parameter from GlobalSearch - Update Create.php to fall through to Select component when database_image is not provided - Add type and destination to Select component query string with proper URL mapping - Jump directly to PostgreSQL version selection step when navigating from global search 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 --- app/Livewire/GlobalSearch.php | 5 ----- app/Livewire/Project/New/Select.php | 16 ++++++++++++++++ app/Livewire/Project/Resource/Create.php | 7 +++++++ templates/service-templates-latest.json | 16 ++++++++++++++++ templates/service-templates.json | 16 ++++++++++++++++ 5 files changed, 55 insertions(+), 5 deletions(-) diff --git a/app/Livewire/GlobalSearch.php b/app/Livewire/GlobalSearch.php index e1dd678ff..237076acc 100644 --- a/app/Livewire/GlobalSearch.php +++ b/app/Livewire/GlobalSearch.php @@ -1314,11 +1314,6 @@ private function completeResourceCreation() 'server_id' => $this->selectedServerId, ]; - // PostgreSQL requires a database_image parameter - if ($this->selectedResourceType === 'postgresql') { - $queryParams['database_image'] = 'postgres:16-alpine'; - } - $this->redirect(route('project.resource.create', [ 'project_uuid' => $this->selectedProjectUuid, 'environment_uuid' => $this->selectedEnvironmentUuid, diff --git a/app/Livewire/Project/New/Select.php b/app/Livewire/Project/New/Select.php index 0afcf94e6..c5dc13987 100644 --- a/app/Livewire/Project/New/Select.php +++ b/app/Livewire/Project/New/Select.php @@ -53,6 +53,8 @@ class Select extends Component protected $queryString = [ 'server_id', + 'type' => ['except' => ''], + 'destination_uuid' => ['except' => '', 'as' => 'destination'], ]; public function mount() @@ -66,6 +68,20 @@ public function mount() $project = Project::whereUuid($projectUuid)->firstOrFail(); $this->environments = $project->environments; $this->selectedEnvironment = $this->environments->where('uuid', data_get($this->parameters, 'environment_uuid'))->firstOrFail()->name; + + // Check if we have all required params for PostgreSQL type selection + // This handles navigation from global search + $queryType = request()->query('type'); + $queryServerId = request()->query('server_id'); + $queryDestination = request()->query('destination'); + + if ($queryType === 'postgresql' && $queryServerId !== null && $queryDestination) { + $this->type = $queryType; + $this->server_id = $queryServerId; + $this->destination_uuid = $queryDestination; + $this->server = Server::find($queryServerId); + $this->current_step = 'select-postgresql-type'; + } } catch (\Exception $e) { return handleError($e, $this); } diff --git a/app/Livewire/Project/Resource/Create.php b/app/Livewire/Project/Resource/Create.php index 1158fb3f7..966c66a14 100644 --- a/app/Livewire/Project/Resource/Create.php +++ b/app/Livewire/Project/Resource/Create.php @@ -35,6 +35,13 @@ public function mount() if (in_array($type, DATABASE_TYPES)) { if ($type->value() === 'postgresql') { + // PostgreSQL requires database_image to be explicitly set + // If not provided, fall through to Select component for version selection + if (! $database_image) { + $this->type = $type->value(); + + return; + } $database = create_standalone_postgresql( environmentId: $environment->id, destinationUuid: $destination_uuid, diff --git a/templates/service-templates-latest.json b/templates/service-templates-latest.json index c3addcc82..9a7af8787 100644 --- a/templates/service-templates-latest.json +++ b/templates/service-templates-latest.json @@ -3953,6 +3953,22 @@ "logo": "svgs/default.webp", "minversion": "0.0.0" }, + "soju": { + "documentation": "https://soju.im/?utm_source=coolify.io", + "slogan": "A user-friendly IRC bouncer with a modern web interface", + "compose": "c2VydmljZXM6CiAgc29qdToKICAgIGltYWdlOiAnY29kZWJlcmcub3JnL2VtZXJzaW9uL3NvanU6bGF0ZXN0JwogICAgdm9sdW1lczoKICAgICAgLSAnc29qdS1kYjovZGInCiAgICAgIC0gJ3NvanUtdXBsb2FkczovdXBsb2FkcycKICAgICAgLSAnc29qdS1ydW46L3J1bi9zb2p1JwogICAgICAtCiAgICAgICAgdHlwZTogYmluZAogICAgICAgIHNvdXJjZTogLi9zb2p1L2NvbmZpZwogICAgICAgIHRhcmdldDogL3NvanUtY29uZmlnCiAgICAgICAgY29udGVudDogImRiIHNxbGl0ZTMgL2RiL21haW4uZGJcbm1lc3NhZ2Utc3RvcmUgZGJcbmZpbGUtdXBsb2FkIGZzIC91cGxvYWRzL1xubGlzdGVuIGlyYytpbnNlY3VyZTovLzAuMC4wLjA6NjY2N1xubGlzdGVuIHdzK2luc2VjdXJlOi8vMC4wLjAuMDo4MFxubGlzdGVuIHVuaXgrYWRtaW46Ly8vcnVuL3NvanUvYWRtaW5cbiIKICAgIG5ldHdvcmtzOgogICAgICBkZWZhdWx0OgogICAgICAgIGFsaWFzZXM6CiAgICAgICAgICAtIGdhbWphLWJhY2tlbmQKICBnYW1qYToKICAgIGltYWdlOiAnY29kZWJlcmcub3JnL2VtZXJzaW9uL2dhbWphOmxhdGVzdCcKICAgIGVudmlyb25tZW50OgogICAgICAtIFNFUlZJQ0VfRlFETl9HQU1KQV84MAogICAgZGVwZW5kc19vbjoKICAgICAgLSBzb2p1CnZvbHVtZXM6CiAgc29qdS1kYjogbnVsbAogIHNvanUtdXBsb2FkczogbnVsbAogIHNvanUtcnVuOiBudWxsCg==", + "tags": [ + "irc", + "bouncer", + "chat", + "messaging", + "relay" + ], + "category": "communication", + "logo": "svgs/soju.svg", + "minversion": "0.0.0", + "port": "80" + }, "soketi": { "documentation": "https://docs.soketi.app?utm_source=coolify.io", "slogan": "Soketi is your simple, fast, and resilient open-source WebSockets server.", diff --git a/templates/service-templates.json b/templates/service-templates.json index 5da51e9f0..7791c1750 100644 --- a/templates/service-templates.json +++ b/templates/service-templates.json @@ -3953,6 +3953,22 @@ "logo": "svgs/default.webp", "minversion": "0.0.0" }, + "soju": { + "documentation": "https://soju.im/?utm_source=coolify.io", + "slogan": "A user-friendly IRC bouncer with a modern web interface", + "compose": "c2VydmljZXM6CiAgc29qdToKICAgIGltYWdlOiAnY29kZWJlcmcub3JnL2VtZXJzaW9uL3NvanU6bGF0ZXN0JwogICAgdm9sdW1lczoKICAgICAgLSAnc29qdS1kYjovZGInCiAgICAgIC0gJ3NvanUtdXBsb2FkczovdXBsb2FkcycKICAgICAgLSAnc29qdS1ydW46L3J1bi9zb2p1JwogICAgICAtCiAgICAgICAgdHlwZTogYmluZAogICAgICAgIHNvdXJjZTogLi9zb2p1L2NvbmZpZwogICAgICAgIHRhcmdldDogL3NvanUtY29uZmlnCiAgICAgICAgY29udGVudDogImRiIHNxbGl0ZTMgL2RiL21haW4uZGJcbm1lc3NhZ2Utc3RvcmUgZGJcbmZpbGUtdXBsb2FkIGZzIC91cGxvYWRzL1xubGlzdGVuIGlyYytpbnNlY3VyZTovLzAuMC4wLjA6NjY2N1xubGlzdGVuIHdzK2luc2VjdXJlOi8vMC4wLjAuMDo4MFxubGlzdGVuIHVuaXgrYWRtaW46Ly8vcnVuL3NvanUvYWRtaW5cbiIKICAgIG5ldHdvcmtzOgogICAgICBkZWZhdWx0OgogICAgICAgIGFsaWFzZXM6CiAgICAgICAgICAtIGdhbWphLWJhY2tlbmQKICBnYW1qYToKICAgIGltYWdlOiAnY29kZWJlcmcub3JnL2VtZXJzaW9uL2dhbWphOmxhdGVzdCcKICAgIGVudmlyb25tZW50OgogICAgICAtIFNFUlZJQ0VfRlFETl9HQU1KQV84MAogICAgZGVwZW5kc19vbjoKICAgICAgLSBzb2p1CnZvbHVtZXM6CiAgc29qdS1kYjogbnVsbAogIHNvanUtdXBsb2FkczogbnVsbAogIHNvanUtcnVuOiBudWxsCg==", + "tags": [ + "irc", + "bouncer", + "chat", + "messaging", + "relay" + ], + "category": "communication", + "logo": "svgs/soju.svg", + "minversion": "0.0.0", + "port": "80" + }, "soketi": { "documentation": "https://docs.soketi.app?utm_source=coolify.io", "slogan": "Soketi is your simple, fast, and resilient open-source WebSockets server.",