@forelse ($project->environments->sortBy('created_at') as $environment)
-
+
From 5f1adc98d8802130489717e52923281149a2bcd6 Mon Sep 17 00:00:00 2001
From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com>
Date: Fri, 22 Nov 2024 15:45:46 +0100
Subject: [PATCH 08/17] fix environment select
---
app/Livewire/Project/Resource/EnvironmentSelect.php | 4 ++--
.../livewire/project/resource/environment-select.blade.php | 7 +++----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/app/Livewire/Project/Resource/EnvironmentSelect.php b/app/Livewire/Project/Resource/EnvironmentSelect.php
index efb1b6ca2..a38d750da 100644
--- a/app/Livewire/Project/Resource/EnvironmentSelect.php
+++ b/app/Livewire/Project/Resource/EnvironmentSelect.php
@@ -15,7 +15,7 @@ class EnvironmentSelect extends Component
public function mount()
{
- $this->selectedEnvironment = request()->route('environment_name');
+ $this->selectedEnvironment = request()->route('environment_uuid');
$this->project_uuid = request()->route('project_uuid');
}
@@ -28,7 +28,7 @@ class EnvironmentSelect extends Component
} else {
return redirect()->route('project.resource.index', [
'project_uuid' => $this->project_uuid,
- 'environment_name' => $value,
+ 'environment_uuid' => $value,
]);
}
}
diff --git a/resources/views/livewire/project/resource/environment-select.blade.php b/resources/views/livewire/project/resource/environment-select.blade.php
index c03466d28..725b282a8 100644
--- a/resources/views/livewire/project/resource/environment-select.blade.php
+++ b/resources/views/livewire/project/resource/environment-select.blade.php
@@ -1,8 +1,7 @@
-
-
@foreach ($environments as $environment)
-
+
@endforeach
+
+
From d183d33025d0a39d5220804034e4a0999a94e3e9 Mon Sep 17 00:00:00 2001
From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com>
Date: Fri, 22 Nov 2024 15:51:25 +0100
Subject: [PATCH 09/17] boarding new uuid
---
app/Livewire/Boarding/Index.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/Livewire/Boarding/Index.php b/app/Livewire/Boarding/Index.php
index b6c799c4e..897737907 100644
--- a/app/Livewire/Boarding/Index.php
+++ b/app/Livewire/Boarding/Index.php
@@ -9,6 +9,7 @@ use App\Models\Server;
use App\Models\Team;
use Illuminate\Support\Collection;
use Livewire\Component;
+use Visus\Cuid2\Cuid2;
class Index extends Component
{
@@ -340,6 +341,7 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
$this->createdProject = Project::create([
'name' => 'My first project',
'team_id' => currentTeam()->id,
+ 'uuid' => (string) new Cuid2,
]);
$this->currentState = 'create-resource';
}
@@ -352,7 +354,7 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
'project.resource.create',
[
'project_uuid' => $this->createdProject->uuid,
- 'environment_name' => 'production',
+ 'environment_uuid' => $this->createdProject->environments->first()->uuid,
'server' => $this->createdServer->id,
]
);
From 9630efce67a78e2418afdf065c517a6ade43fd2f Mon Sep 17 00:00:00 2001
From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com>
Date: Fri, 22 Nov 2024 15:52:36 +0100
Subject: [PATCH 10/17] uuid deplyment
---
app/Livewire/Project/Application/Deployment/Show.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/Livewire/Project/Application/Deployment/Show.php b/app/Livewire/Project/Application/Deployment/Show.php
index 04170fa28..dba0d8ae5 100644
--- a/app/Livewire/Project/Application/Deployment/Show.php
+++ b/app/Livewire/Project/Application/Deployment/Show.php
@@ -26,7 +26,7 @@ class Show extends Component
if (! $project) {
return redirect()->route('dashboard');
}
- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);
if (! $environment) {
return redirect()->route('dashboard');
}
@@ -46,7 +46,7 @@ class Show extends Component
if (! $application_deployment_queue) {
return redirect()->route('project.application.deployment.index', [
'project_uuid' => $project->uuid,
- 'environment_name' => $environment->name,
+ 'environment_uuid' => $environment->uuid,
'application_uuid' => $application->uuid,
]);
}
From 5a8bff5e96404e650454789e320e563916ac0451 Mon Sep 17 00:00:00 2001
From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com>
Date: Fri, 22 Nov 2024 15:53:11 +0100
Subject: [PATCH 11/17] Update Heading.php
---
app/Livewire/Project/Application/Heading.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/Livewire/Project/Application/Heading.php b/app/Livewire/Project/Application/Heading.php
index 3edb21974..b0c150299 100644
--- a/app/Livewire/Project/Application/Heading.php
+++ b/app/Livewire/Project/Application/Heading.php
@@ -90,7 +90,7 @@ class Heading extends Component
'project_uuid' => $this->parameters['project_uuid'],
'application_uuid' => $this->parameters['application_uuid'],
'deployment_uuid' => $this->deploymentUuid,
- 'environment_name' => $this->parameters['environment_name'],
+ 'environment_uuid' => $this->parameters['environment_uuid'],
]);
}
@@ -132,7 +132,7 @@ class Heading extends Component
'project_uuid' => $this->parameters['project_uuid'],
'application_uuid' => $this->parameters['application_uuid'],
'deployment_uuid' => $this->deploymentUuid,
- 'environment_name' => $this->parameters['environment_name'],
+ 'environment_uuid' => $this->parameters['environment_uuid'],
]);
}
From 277fd78769cf109487ad61f2df913b034015eeb5 Mon Sep 17 00:00:00 2001
From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com>
Date: Fri, 22 Nov 2024 16:03:20 +0100
Subject: [PATCH 12/17] new uuid routes
---
app/Livewire/Project/AddEmpty.php | 2 ++
.../Project/Application/Configuration.php | 2 +-
.../Project/Application/Deployment/Index.php | 2 +-
app/Livewire/Project/Application/Previews.php | 2 +-
app/Livewire/Project/Application/Rollback.php | 2 +-
app/Livewire/Project/CloneMe.php | 8 ++++---
.../Project/Database/Backup/Execution.php | 2 +-
.../Project/Database/Backup/Index.php | 4 ++--
.../Project/Database/Configuration.php | 2 +-
app/Livewire/Project/EnvironmentEdit.php | 9 +++++---
app/Livewire/Project/New/DockerCompose.php | 4 ++--
app/Livewire/Project/New/DockerImage.php | 4 ++--
app/Livewire/Project/New/EmptyProject.php | 4 +++-
.../Project/New/GithubPrivateRepository.php | 4 ++--
.../New/GithubPrivateRepositoryDeployKey.php | 4 ++--
.../Project/New/PublicGitRepository.php | 8 +++----
app/Livewire/Project/New/Select.php | 18 ++++-----------
app/Livewire/Project/New/SimpleDockerfile.php | 4 ++--
app/Livewire/Project/Resource/Create.php | 6 ++---
app/Livewire/Project/Resource/Index.php | 22 +++++++++----------
app/Livewire/Project/Shared/Danger.php | 6 ++---
app/Livewire/Project/Shared/Destination.php | 2 +-
.../Project/Shared/ResourceOperations.php | 16 +++++++-------
.../SharedVariables/Environment/Show.php | 4 ++--
app/Livewire/Source/Github/Change.php | 4 ++--
app/Models/Application.php | 4 ++--
app/Models/Project.php | 18 ++-------------
app/Models/Service.php | 4 ++--
app/Models/StandaloneClickhouse.php | 2 +-
app/Models/StandaloneDragonfly.php | 2 +-
app/Models/StandaloneKeydb.php | 2 +-
app/Models/StandaloneMariadb.php | 2 +-
app/Models/StandaloneMongodb.php | 2 +-
app/Models/StandaloneMysql.php | 2 +-
app/Models/StandalonePostgresql.php | 2 +-
app/Models/StandaloneRedis.php | 2 +-
.../resources/breadcrumbs.blade.php | 4 +++-
.../project/environment-edit.blade.php | 2 +-
.../livewire/project/resource/index.blade.php | 8 +++----
39 files changed, 94 insertions(+), 107 deletions(-)
diff --git a/app/Livewire/Project/AddEmpty.php b/app/Livewire/Project/AddEmpty.php
index fd976548a..07873c059 100644
--- a/app/Livewire/Project/AddEmpty.php
+++ b/app/Livewire/Project/AddEmpty.php
@@ -5,6 +5,7 @@ namespace App\Livewire\Project;
use App\Models\Project;
use Livewire\Attributes\Validate;
use Livewire\Component;
+use Visus\Cuid2\Cuid2;
class AddEmpty extends Component
{
@@ -22,6 +23,7 @@ class AddEmpty extends Component
'name' => $this->name,
'description' => $this->description,
'team_id' => currentTeam()->id,
+ 'uuid' => (string) new Cuid2,
]);
return redirect()->route('project.show', $project->uuid);
diff --git a/app/Livewire/Project/Application/Configuration.php b/app/Livewire/Project/Application/Configuration.php
index d4ec8f581..2b781a8c7 100644
--- a/app/Livewire/Project/Application/Configuration.php
+++ b/app/Livewire/Project/Application/Configuration.php
@@ -20,7 +20,7 @@ class Configuration extends Component
if (! $project) {
return redirect()->route('dashboard');
}
- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);
if (! $environment) {
return redirect()->route('dashboard');
}
diff --git a/app/Livewire/Project/Application/Deployment/Index.php b/app/Livewire/Project/Application/Deployment/Index.php
index 4f761c2cf..b847c40ef 100644
--- a/app/Livewire/Project/Application/Deployment/Index.php
+++ b/app/Livewire/Project/Application/Deployment/Index.php
@@ -34,7 +34,7 @@ class Index extends Component
if (! $project) {
return redirect()->route('dashboard');
}
- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);
if (! $environment) {
return redirect()->route('dashboard');
}
diff --git a/app/Livewire/Project/Application/Previews.php b/app/Livewire/Project/Application/Previews.php
index d42bf03d7..bdf62706c 100644
--- a/app/Livewire/Project/Application/Previews.php
+++ b/app/Livewire/Project/Application/Previews.php
@@ -171,7 +171,7 @@ class Previews extends Component
'project_uuid' => $this->parameters['project_uuid'],
'application_uuid' => $this->parameters['application_uuid'],
'deployment_uuid' => $this->deployment_uuid,
- 'environment_name' => $this->parameters['environment_name'],
+ 'environment_uuid' => $this->parameters['environment_uuid'],
]);
} catch (\Throwable $e) {
return handleError($e, $this);
diff --git a/app/Livewire/Project/Application/Rollback.php b/app/Livewire/Project/Application/Rollback.php
index 1e58a1458..ff5db1e08 100644
--- a/app/Livewire/Project/Application/Rollback.php
+++ b/app/Livewire/Project/Application/Rollback.php
@@ -37,7 +37,7 @@ class Rollback extends Component
'project_uuid' => $this->parameters['project_uuid'],
'application_uuid' => $this->parameters['application_uuid'],
'deployment_uuid' => $deployment_uuid,
- 'environment_name' => $this->parameters['environment_name'],
+ 'environment_uuid' => $this->parameters['environment_uuid'],
]);
}
diff --git a/app/Livewire/Project/CloneMe.php b/app/Livewire/Project/CloneMe.php
index 4d2bc6589..e2013a50d 100644
--- a/app/Livewire/Project/CloneMe.php
+++ b/app/Livewire/Project/CloneMe.php
@@ -12,7 +12,7 @@ class CloneMe extends Component
{
public string $project_uuid;
- public string $environment_name;
+ public string $environment_uuid;
public int $project_id;
@@ -44,7 +44,7 @@ class CloneMe extends Component
{
$this->project_uuid = $project_uuid;
$this->project = Project::where('uuid', $project_uuid)->firstOrFail();
- $this->environment = $this->project->environments->where('name', $this->environment_name)->first();
+ $this->environment = $this->project->environments->where('uuid', $this->environment_uuid)->first();
$this->project_id = $this->project->id;
$this->servers = currentTeam()->servers;
$this->newName = str($this->project->name.'-clone-'.(string) new Cuid2)->slug();
@@ -89,6 +89,7 @@ class CloneMe extends Component
if ($this->environment->name !== 'production') {
$project->environments()->create([
'name' => $this->environment->name,
+ 'uuid' => (string) new Cuid2,
]);
}
$environment = $project->environments->where('name', $this->environment->name)->first();
@@ -100,6 +101,7 @@ class CloneMe extends Component
$project = $this->project;
$environment = $this->project->environments()->create([
'name' => $this->newName,
+ 'uuid' => (string) new Cuid2,
]);
}
$applications = $this->environment->applications;
@@ -183,7 +185,7 @@ class CloneMe extends Component
return redirect()->route('project.resource.index', [
'project_uuid' => $project->uuid,
- 'environment_name' => $environment->name,
+ 'environment_uuid' => $environment->uuid,
]);
} catch (\Exception $e) {
return handleError($e, $this);
diff --git a/app/Livewire/Project/Database/Backup/Execution.php b/app/Livewire/Project/Database/Backup/Execution.php
index 564091659..4ac3b2e2c 100644
--- a/app/Livewire/Project/Database/Backup/Execution.php
+++ b/app/Livewire/Project/Database/Backup/Execution.php
@@ -22,7 +22,7 @@ class Execution extends Component
if (! $project) {
return redirect()->route('dashboard');
}
- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);
if (! $environment) {
return redirect()->route('dashboard');
}
diff --git a/app/Livewire/Project/Database/Backup/Index.php b/app/Livewire/Project/Database/Backup/Index.php
index 9ff2f48d5..2df32ec7b 100644
--- a/app/Livewire/Project/Database/Backup/Index.php
+++ b/app/Livewire/Project/Database/Backup/Index.php
@@ -14,7 +14,7 @@ class Index extends Component
if (! $project) {
return redirect()->route('dashboard');
}
- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);
if (! $environment) {
return redirect()->route('dashboard');
}
@@ -31,7 +31,7 @@ class Index extends Component
) {
return redirect()->route('project.database.configuration', [
'project_uuid' => $project->uuid,
- 'environment_name' => $environment->name,
+ 'environment_uuid' => $environment->uuid,
'database_uuid' => $database->uuid,
]);
}
diff --git a/app/Livewire/Project/Database/Configuration.php b/app/Livewire/Project/Database/Configuration.php
index e14b27cf6..bbe8e81f6 100644
--- a/app/Livewire/Project/Database/Configuration.php
+++ b/app/Livewire/Project/Database/Configuration.php
@@ -14,7 +14,7 @@ class Configuration extends Component
if (! $project) {
return redirect()->route('dashboard');
}
- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);
if (! $environment) {
return redirect()->route('dashboard');
}
diff --git a/app/Livewire/Project/EnvironmentEdit.php b/app/Livewire/Project/EnvironmentEdit.php
index f48220b3d..e98b088ec 100644
--- a/app/Livewire/Project/EnvironmentEdit.php
+++ b/app/Livewire/Project/EnvironmentEdit.php
@@ -23,11 +23,11 @@ class EnvironmentEdit extends Component
#[Validate(['nullable', 'string', 'max:255'])]
public ?string $description = null;
- public function mount(string $project_uuid, string $environment_name)
+ public function mount(string $project_uuid, string $environment_uuid)
{
try {
$this->project = Project::ownedByCurrentTeam()->where('uuid', $project_uuid)->firstOrFail();
- $this->environment = $this->project->environments()->where('name', $environment_name)->firstOrFail();
+ $this->environment = $this->project->environments()->where('uuid', $environment_uuid)->firstOrFail();
$this->syncData();
} catch (\Throwable $e) {
return handleError($e, $this);
@@ -52,7 +52,10 @@ class EnvironmentEdit extends Component
{
try {
$this->syncData(true);
- $this->redirectRoute('project.environment.edit', ['environment_name' => $this->environment->name, 'project_uuid' => $this->project->uuid]);
+ $this->redirectRoute('project.environment.edit', [
+ 'environment_uuid' => $this->environment->uuid,
+ 'project_uuid' => $this->project->uuid,
+ ]);
} catch (\Throwable $e) {
return handleError($e, $this);
}
diff --git a/app/Livewire/Project/New/DockerCompose.php b/app/Livewire/Project/New/DockerCompose.php
index 199a20cf6..c1361c7ac 100644
--- a/app/Livewire/Project/New/DockerCompose.php
+++ b/app/Livewire/Project/New/DockerCompose.php
@@ -59,7 +59,7 @@ class DockerCompose extends Component
}
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
- $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();
+ $environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();
$destination_uuid = $this->query['destination'];
$destination = StandaloneDocker::where('uuid', $destination_uuid)->first();
@@ -96,7 +96,7 @@ class DockerCompose extends Component
return redirect()->route('project.service.configuration', [
'service_uuid' => $service->uuid,
- 'environment_name' => $environment->name,
+ 'environment_uuid' => $environment->uuid,
'project_uuid' => $project->uuid,
]);
} catch (\Throwable $e) {
diff --git a/app/Livewire/Project/New/DockerImage.php b/app/Livewire/Project/New/DockerImage.php
index 417fb2ea0..942924437 100644
--- a/app/Livewire/Project/New/DockerImage.php
+++ b/app/Livewire/Project/New/DockerImage.php
@@ -45,7 +45,7 @@ class DockerImage extends Component
$destination_class = $destination->getMorphClass();
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
- $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();
+ $environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();
$application = Application::create([
'name' => 'docker-image-'.new Cuid2,
'repository_project_id' => 0,
@@ -69,7 +69,7 @@ class DockerImage extends Component
return redirect()->route('project.application.configuration', [
'application_uuid' => $application->uuid,
- 'environment_name' => $environment->name,
+ 'environment_uuid' => $environment->uuid,
'project_uuid' => $project->uuid,
]);
}
diff --git a/app/Livewire/Project/New/EmptyProject.php b/app/Livewire/Project/New/EmptyProject.php
index 28249b442..54cfc4b4d 100644
--- a/app/Livewire/Project/New/EmptyProject.php
+++ b/app/Livewire/Project/New/EmptyProject.php
@@ -4,6 +4,7 @@ namespace App\Livewire\Project\New;
use App\Models\Project;
use Livewire\Component;
+use Visus\Cuid2\Cuid2;
class EmptyProject extends Component
{
@@ -12,8 +13,9 @@ class EmptyProject extends Component
$project = Project::create([
'name' => generate_random_name(),
'team_id' => currentTeam()->id,
+ 'uuid' => (string) new Cuid2,
]);
- return redirect()->route('project.show', ['project_uuid' => $project->uuid, 'environment_name' => 'production']);
+ return redirect()->route('project.show', ['project_uuid' => $project->uuid, 'environment_uuid' => $project->environments->first()->uuid]);
}
}
diff --git a/app/Livewire/Project/New/GithubPrivateRepository.php b/app/Livewire/Project/New/GithubPrivateRepository.php
index 2f4f5a25c..370d00555 100644
--- a/app/Livewire/Project/New/GithubPrivateRepository.php
+++ b/app/Livewire/Project/New/GithubPrivateRepository.php
@@ -177,7 +177,7 @@ class GithubPrivateRepository extends Component
$destination_class = $destination->getMorphClass();
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
- $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();
+ $environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();
$application = Application::create([
'name' => generate_application_name($this->selected_repository_owner.'/'.$this->selected_repository_repo, $this->selected_branch_name),
@@ -211,7 +211,7 @@ class GithubPrivateRepository extends Component
return redirect()->route('project.application.configuration', [
'application_uuid' => $application->uuid,
- 'environment_name' => $environment->name,
+ 'environment_uuid' => $environment->uuid,
'project_uuid' => $project->uuid,
]);
} catch (\Throwable $e) {
diff --git a/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php b/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php
index b46c4a794..01b0c9ae8 100644
--- a/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php
+++ b/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php
@@ -136,7 +136,7 @@ class GithubPrivateRepositoryDeployKey extends Component
$this->get_git_source();
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
- $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();
+ $environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();
if ($this->git_source === 'other') {
$application_init = [
'name' => generate_random_name(),
@@ -184,7 +184,7 @@ class GithubPrivateRepositoryDeployKey extends Component
return redirect()->route('project.application.configuration', [
'application_uuid' => $application->uuid,
- 'environment_name' => $environment->name,
+ 'environment_uuid' => $environment->uuid,
'project_uuid' => $project->uuid,
]);
} catch (\Throwable $e) {
diff --git a/app/Livewire/Project/New/PublicGitRepository.php b/app/Livewire/Project/New/PublicGitRepository.php
index bd35dccef..2f2331fc0 100644
--- a/app/Livewire/Project/New/PublicGitRepository.php
+++ b/app/Livewire/Project/New/PublicGitRepository.php
@@ -225,7 +225,7 @@ class PublicGitRepository extends Component
$this->validate();
$destination_uuid = $this->query['destination'];
$project_uuid = $this->parameters['project_uuid'];
- $environment_name = $this->parameters['environment_name'];
+ $environment_uuid = $this->parameters['environment_uuid'];
$destination = StandaloneDocker::where('uuid', $destination_uuid)->first();
if (! $destination) {
@@ -237,7 +237,7 @@ class PublicGitRepository extends Component
$destination_class = $destination->getMorphClass();
$project = Project::where('uuid', $project_uuid)->first();
- $environment = $project->load(['environments'])->environments->where('name', $environment_name)->first();
+ $environment = $project->load(['environments'])->environments->where('uuid', $environment_uuid)->first();
if ($this->build_pack === 'dockercompose' && isDev() && $this->new_compose_services) {
$server = $destination->server;
@@ -260,7 +260,7 @@ class PublicGitRepository extends Component
return redirect()->route('project.service.configuration', [
'service_uuid' => $service->uuid,
- 'environment_name' => $environment->name,
+ 'environment_uuid' => $environment->uuid,
'project_uuid' => $project->uuid,
]);
@@ -319,7 +319,7 @@ class PublicGitRepository extends Component
return redirect()->route('project.application.configuration', [
'application_uuid' => $application->uuid,
- 'environment_name' => $environment->name,
+ 'environment_uuid' => $environment->uuid,
'project_uuid' => $project->uuid,
]);
} catch (\Throwable $e) {
diff --git a/app/Livewire/Project/New/Select.php b/app/Livewire/Project/New/Select.php
index 3dedc11af..7ef688718 100644
--- a/app/Livewire/Project/New/Select.php
+++ b/app/Livewire/Project/New/Select.php
@@ -61,7 +61,7 @@ class Select extends Component
}
$projectUuid = data_get($this->parameters, 'project_uuid');
$this->environments = Project::whereUuid($projectUuid)->first()->environments;
- $this->selectedEnvironment = data_get($this->parameters, 'environment_name');
+ $this->selectedEnvironment = data_get($this->parameters, 'environment_uuid');
}
public function render()
@@ -73,20 +73,10 @@ class Select extends Component
{
return redirect()->route('project.resource.create', [
'project_uuid' => $this->parameters['project_uuid'],
- 'environment_name' => $this->selectedEnvironment,
+ 'environment_uuid' => $this->selectedEnvironment,
]);
}
- // public function addExistingPostgresql()
- // {
- // try {
- // instantCommand("psql {$this->existingPostgresqlUrl} -c 'SELECT 1'");
- // $this->dispatch('success', 'Successfully connected to the database.');
- // } catch (\Throwable $e) {
- // return handleError($e, $this);
- // }
- // }
-
public function loadServices()
{
$services = get_service_templates(true);
@@ -304,7 +294,7 @@ class Select extends Component
return redirect()->route('project.resource.create', [
'project_uuid' => $this->parameters['project_uuid'],
- 'environment_name' => $this->parameters['environment_name'],
+ 'environment_uuid' => $this->parameters['environment_uuid'],
'type' => $this->type,
'destination' => $this->destination_uuid,
'server_id' => $this->server_id,
@@ -319,7 +309,7 @@ class Select extends Component
} else {
return redirect()->route('project.resource.create', [
'project_uuid' => $this->parameters['project_uuid'],
- 'environment_name' => $this->parameters['environment_name'],
+ 'environment_uuid' => $this->parameters['environment_uuid'],
'type' => $this->type,
'destination' => $this->destination_uuid,
'server_id' => $this->server_id,
diff --git a/app/Livewire/Project/New/SimpleDockerfile.php b/app/Livewire/Project/New/SimpleDockerfile.php
index 3c7f42329..c3ed6039a 100644
--- a/app/Livewire/Project/New/SimpleDockerfile.php
+++ b/app/Livewire/Project/New/SimpleDockerfile.php
@@ -46,7 +46,7 @@ CMD ["nginx", "-g", "daemon off;"]
$destination_class = $destination->getMorphClass();
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
- $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();
+ $environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();
$port = get_port_from_dockerfile($this->dockerfile);
if (! $port) {
@@ -78,7 +78,7 @@ CMD ["nginx", "-g", "daemon off;"]
return redirect()->route('project.application.configuration', [
'application_uuid' => $application->uuid,
- 'environment_name' => $environment->name,
+ 'environment_uuid' => $environment->uuid,
'project_uuid' => $project->uuid,
]);
}
diff --git a/app/Livewire/Project/Resource/Create.php b/app/Livewire/Project/Resource/Create.php
index 9266a57fc..48c396dc0 100644
--- a/app/Livewire/Project/Resource/Create.php
+++ b/app/Livewire/Project/Resource/Create.php
@@ -25,7 +25,7 @@ class Create extends Component
return redirect()->route('dashboard');
}
$this->project = $project;
- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first();
+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first();
if (! $environment) {
return redirect()->route('dashboard');
}
@@ -57,7 +57,7 @@ class Create extends Component
return redirect()->route('project.database.configuration', [
'project_uuid' => $project->uuid,
- 'environment_name' => $environment->name,
+ 'environment_uuid' => $environment->uuid,
'database_uuid' => $database->uuid,
]);
}
@@ -106,7 +106,7 @@ class Create extends Component
return redirect()->route('project.service.configuration', [
'service_uuid' => $service->uuid,
- 'environment_name' => $environment->name,
+ 'environment_uuid' => $environment->uuid,
'project_uuid' => $project->uuid,
]);
}
diff --git a/app/Livewire/Project/Resource/Index.php b/app/Livewire/Project/Resource/Index.php
index 283496887..fc394e88f 100644
--- a/app/Livewire/Project/Resource/Index.php
+++ b/app/Livewire/Project/Resource/Index.php
@@ -41,7 +41,7 @@ class Index extends Component
if (! $project) {
return redirect()->route('dashboard');
}
- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first();
+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first();
if (! $environment) {
return redirect()->route('dashboard');
}
@@ -52,7 +52,7 @@ class Index extends Component
if (data_get($application, 'environment.project.uuid')) {
$application->hrefLink = route('project.application.configuration', [
'project_uuid' => data_get($application, 'environment.project.uuid'),
- 'environment_name' => data_get($application, 'environment.name'),
+ 'environment_uuid' => data_get($application, 'environment.uuid'),
'application_uuid' => data_get($application, 'uuid'),
]);
}
@@ -64,7 +64,7 @@ class Index extends Component
if (data_get($postgresql, 'environment.project.uuid')) {
$postgresql->hrefLink = route('project.database.configuration', [
'project_uuid' => data_get($postgresql, 'environment.project.uuid'),
- 'environment_name' => data_get($postgresql, 'environment.name'),
+ 'environment_uuid' => data_get($postgresql, 'environment.uuid'),
'database_uuid' => data_get($postgresql, 'uuid'),
]);
}
@@ -76,7 +76,7 @@ class Index extends Component
if (data_get($redis, 'environment.project.uuid')) {
$redis->hrefLink = route('project.database.configuration', [
'project_uuid' => data_get($redis, 'environment.project.uuid'),
- 'environment_name' => data_get($redis, 'environment.name'),
+ 'environment_uuid' => data_get($redis, 'environment.uuid'),
'database_uuid' => data_get($redis, 'uuid'),
]);
}
@@ -88,7 +88,7 @@ class Index extends Component
if (data_get($mongodb, 'environment.project.uuid')) {
$mongodb->hrefLink = route('project.database.configuration', [
'project_uuid' => data_get($mongodb, 'environment.project.uuid'),
- 'environment_name' => data_get($mongodb, 'environment.name'),
+ 'environment_uuid' => data_get($mongodb, 'environment.uuid'),
'database_uuid' => data_get($mongodb, 'uuid'),
]);
}
@@ -100,7 +100,7 @@ class Index extends Component
if (data_get($mysql, 'environment.project.uuid')) {
$mysql->hrefLink = route('project.database.configuration', [
'project_uuid' => data_get($mysql, 'environment.project.uuid'),
- 'environment_name' => data_get($mysql, 'environment.name'),
+ 'environment_uuid' => data_get($mysql, 'environment.uuid'),
'database_uuid' => data_get($mysql, 'uuid'),
]);
}
@@ -112,7 +112,7 @@ class Index extends Component
if (data_get($mariadb, 'environment.project.uuid')) {
$mariadb->hrefLink = route('project.database.configuration', [
'project_uuid' => data_get($mariadb, 'environment.project.uuid'),
- 'environment_name' => data_get($mariadb, 'environment.name'),
+ 'environment_uuid' => data_get($mariadb, 'environment.uuid'),
'database_uuid' => data_get($mariadb, 'uuid'),
]);
}
@@ -124,7 +124,7 @@ class Index extends Component
if (data_get($keydb, 'environment.project.uuid')) {
$keydb->hrefLink = route('project.database.configuration', [
'project_uuid' => data_get($keydb, 'environment.project.uuid'),
- 'environment_name' => data_get($keydb, 'environment.name'),
+ 'environment_uuid' => data_get($keydb, 'environment.uuid'),
'database_uuid' => data_get($keydb, 'uuid'),
]);
}
@@ -136,7 +136,7 @@ class Index extends Component
if (data_get($dragonfly, 'environment.project.uuid')) {
$dragonfly->hrefLink = route('project.database.configuration', [
'project_uuid' => data_get($dragonfly, 'environment.project.uuid'),
- 'environment_name' => data_get($dragonfly, 'environment.name'),
+ 'environment_uuid' => data_get($dragonfly, 'environment.uuid'),
'database_uuid' => data_get($dragonfly, 'uuid'),
]);
}
@@ -148,7 +148,7 @@ class Index extends Component
if (data_get($clickhouse, 'environment.project.uuid')) {
$clickhouse->hrefLink = route('project.database.configuration', [
'project_uuid' => data_get($clickhouse, 'environment.project.uuid'),
- 'environment_name' => data_get($clickhouse, 'environment.name'),
+ 'environment_uuid' => data_get($clickhouse, 'environment.uuid'),
'database_uuid' => data_get($clickhouse, 'uuid'),
]);
}
@@ -160,7 +160,7 @@ class Index extends Component
if (data_get($service, 'environment.project.uuid')) {
$service->hrefLink = route('project.service.configuration', [
'project_uuid' => data_get($service, 'environment.project.uuid'),
- 'environment_name' => data_get($service, 'environment.name'),
+ 'environment_uuid' => data_get($service, 'environment.uuid'),
'service_uuid' => data_get($service, 'uuid'),
]);
$service->status = $service->status();
diff --git a/app/Livewire/Project/Shared/Danger.php b/app/Livewire/Project/Shared/Danger.php
index a0b4ac2c4..7da48f9fb 100644
--- a/app/Livewire/Project/Shared/Danger.php
+++ b/app/Livewire/Project/Shared/Danger.php
@@ -20,7 +20,7 @@ class Danger extends Component
public $projectUuid;
- public $environmentName;
+ public $environmentUuid;
public bool $delete_configurations = true;
@@ -39,7 +39,7 @@ class Danger extends Component
$parameters = get_route_parameters();
$this->modalId = new Cuid2;
$this->projectUuid = data_get($parameters, 'project_uuid');
- $this->environmentName = data_get($parameters, 'environment_name');
+ $this->environmentUuid = data_get($parameters, 'environment_uuid');
if ($this->resource === null) {
if (isset($parameters['service_uuid'])) {
@@ -107,7 +107,7 @@ class Danger extends Component
return redirect()->route('project.resource.index', [
'project_uuid' => $this->projectUuid,
- 'environment_name' => $this->environmentName,
+ 'environment_uuid' => $this->environmentUuid,
]);
} catch (\Throwable $e) {
return handleError($e, $this);
diff --git a/app/Livewire/Project/Shared/Destination.php b/app/Livewire/Project/Shared/Destination.php
index c305e817c..e28ff1d5b 100644
--- a/app/Livewire/Project/Shared/Destination.php
+++ b/app/Livewire/Project/Shared/Destination.php
@@ -85,7 +85,7 @@ class Destination extends Component
'project_uuid' => data_get($this->resource, 'environment.project.uuid'),
'application_uuid' => data_get($this->resource, 'uuid'),
'deployment_uuid' => $deployment_uuid,
- 'environment_name' => data_get($this->resource, 'environment.name'),
+ 'environment_uuid' => data_get($this->resource, 'environment.uuid'),
]);
}
diff --git a/app/Livewire/Project/Shared/ResourceOperations.php b/app/Livewire/Project/Shared/ResourceOperations.php
index e67df6aa9..81313c133 100644
--- a/app/Livewire/Project/Shared/ResourceOperations.php
+++ b/app/Livewire/Project/Shared/ResourceOperations.php
@@ -15,7 +15,7 @@ class ResourceOperations extends Component
public $projectUuid;
- public $environmentName;
+ public $environmentUuid;
public $projects;
@@ -25,7 +25,7 @@ class ResourceOperations extends Component
{
$parameters = get_route_parameters();
$this->projectUuid = data_get($parameters, 'project_uuid');
- $this->environmentName = data_get($parameters, 'environment_name');
+ $this->environmentUuid = data_get($parameters, 'environment_uuid');
$this->projects = Project::ownedByCurrentTeam()->get();
$this->servers = currentTeam()->servers;
}
@@ -72,7 +72,7 @@ class ResourceOperations extends Component
}
$route = route('project.application.configuration', [
'project_uuid' => $this->projectUuid,
- 'environment_name' => $this->environmentName,
+ 'environment_uuid' => $this->environmentUuid,
'application_uuid' => $new_resource->uuid,
]).'#resource-operations';
@@ -115,7 +115,7 @@ class ResourceOperations extends Component
}
$route = route('project.database.configuration', [
'project_uuid' => $this->projectUuid,
- 'environment_name' => $this->environmentName,
+ 'environment_uuid' => $this->environmentUuid,
'database_uuid' => $new_resource->uuid,
]).'#resource-operations';
@@ -141,7 +141,7 @@ class ResourceOperations extends Component
$new_resource->parse();
$route = route('project.service.configuration', [
'project_uuid' => $this->projectUuid,
- 'environment_name' => $this->environmentName,
+ 'environment_uuid' => $this->environmentUuid,
'service_uuid' => $new_resource->uuid,
]).'#resource-operations';
@@ -159,7 +159,7 @@ class ResourceOperations extends Component
if ($this->resource->type() === 'application') {
$route = route('project.application.configuration', [
'project_uuid' => $new_environment->project->uuid,
- 'environment_name' => $new_environment->name,
+ 'environment_uuid' => $new_environment->uuid,
'application_uuid' => $this->resource->uuid,
]).'#resource-operations';
@@ -167,7 +167,7 @@ class ResourceOperations extends Component
} elseif (str($this->resource->type())->startsWith('standalone-')) {
$route = route('project.database.configuration', [
'project_uuid' => $new_environment->project->uuid,
- 'environment_name' => $new_environment->name,
+ 'environment_uuid' => $new_environment->uuid,
'database_uuid' => $this->resource->uuid,
]).'#resource-operations';
@@ -175,7 +175,7 @@ class ResourceOperations extends Component
} elseif ($this->resource->type() === 'service') {
$route = route('project.service.configuration', [
'project_uuid' => $new_environment->project->uuid,
- 'environment_name' => $new_environment->name,
+ 'environment_uuid' => $new_environment->uuid,
'service_uuid' => $this->resource->uuid,
]).'#resource-operations';
diff --git a/app/Livewire/SharedVariables/Environment/Show.php b/app/Livewire/SharedVariables/Environment/Show.php
index daf1df212..68aa4f01b 100644
--- a/app/Livewire/SharedVariables/Environment/Show.php
+++ b/app/Livewire/SharedVariables/Environment/Show.php
@@ -42,8 +42,8 @@ class Show extends Component
public function mount()
{
$this->parameters = get_route_parameters();
- $this->project = Project::ownedByCurrentTeam()->where('uuid', request()->route('project_uuid'))->first();
- $this->environment = $this->project->environments()->where('name', request()->route('environment_name'))->first();
+ $this->project = Project::ownedByCurrentTeam()->where('uuid', request()->route('project_uuid'))->firstOrFail();
+ $this->environment = $this->project->environments()->where('uuid', request()->route('environment_uuid'))->firstOrFail();
}
public function render()
diff --git a/app/Livewire/Source/Github/Change.php b/app/Livewire/Source/Github/Change.php
index 07cef54f9..0e84756f8 100644
--- a/app/Livewire/Source/Github/Change.php
+++ b/app/Livewire/Source/Github/Change.php
@@ -116,14 +116,14 @@ class Change extends Component
} else {
$parameters = data_get(session('from'), 'parameters');
$back = data_get(session('from'), 'back');
- $environment_name = data_get($parameters, 'environment_name');
+ $environment_uuid = data_get($parameters, 'environment_uuid');
$project_uuid = data_get($parameters, 'project_uuid');
$type = data_get($parameters, 'type');
$destination = data_get($parameters, 'destination');
session()->forget('from');
return redirect()->route($back, [
- 'environment_name' => $environment_name,
+ 'environment_uuid' => $environment_uuid,
'project_uuid' => $project_uuid,
'type' => $type,
'destination' => $destination,
diff --git a/app/Models/Application.php b/app/Models/Application.php
index c284528f1..0e611931b 100644
--- a/app/Models/Application.php
+++ b/app/Models/Application.php
@@ -318,7 +318,7 @@ class Application extends BaseModel
if (data_get($this, 'environment.project.uuid')) {
return route('project.application.configuration', [
'project_uuid' => data_get($this, 'environment.project.uuid'),
- 'environment_name' => data_get($this, 'environment.name'),
+ 'environment_uuid' => data_get($this, 'environment.uuid'),
'application_uuid' => data_get($this, 'uuid'),
]);
}
@@ -331,7 +331,7 @@ class Application extends BaseModel
if (data_get($this, 'environment.project.uuid')) {
$route = route('project.application.scheduled-tasks', [
'project_uuid' => data_get($this, 'environment.project.uuid'),
- 'environment_name' => data_get($this, 'environment.name'),
+ 'environment_uuid' => data_get($this, 'environment.uuid'),
'application_uuid' => data_get($this, 'uuid'),
'task_uuid' => $task_uuid,
]);
diff --git a/app/Models/Project.php b/app/Models/Project.php
index f27e6c208..3b50b9b33 100644
--- a/app/Models/Project.php
+++ b/app/Models/Project.php
@@ -3,6 +3,7 @@
namespace App\Models;
use OpenApi\Attributes as OA;
+use Visus\Cuid2\Cuid2;
#[OA\Schema(
description: 'Project model',
@@ -24,8 +25,6 @@ class Project extends BaseModel
{
protected $guarded = [];
- protected $appends = ['default_environment'];
-
public static function ownedByCurrentTeam()
{
return Project::whereTeamId(currentTeam()->id)->orderByRaw('LOWER(name)');
@@ -40,6 +39,7 @@ class Project extends BaseModel
Environment::create([
'name' => 'production',
'project_id' => $project->id,
+ 'uuid' => (string) new Cuid2,
]);
});
static::deleting(function ($project) {
@@ -140,18 +140,4 @@ class Project extends BaseModel
{
return $this->postgresqls()->get()->merge($this->redis()->get())->merge($this->mongodbs()->get())->merge($this->mysqls()->get())->merge($this->mariadbs()->get())->merge($this->keydbs()->get())->merge($this->dragonflies()->get())->merge($this->clickhouses()->get());
}
-
- public function getDefaultEnvironmentAttribute()
- {
- $default = $this->environments()->where('name', 'production')->first();
- if ($default) {
- return $default->name;
- }
- $default = $this->environments()->get();
- if ($default->count() > 0) {
- return $default->sortBy('created_at')->first()->name;
- }
-
- return null;
- }
}
diff --git a/app/Models/Service.php b/app/Models/Service.php
index 6d3d2024b..1ba86a95f 100644
--- a/app/Models/Service.php
+++ b/app/Models/Service.php
@@ -1132,7 +1132,7 @@ class Service extends BaseModel
if (data_get($this, 'environment.project.uuid')) {
return route('project.service.configuration', [
'project_uuid' => data_get($this, 'environment.project.uuid'),
- 'environment_name' => data_get($this, 'environment.name'),
+ 'environment_uuid' => data_get($this, 'environment.uuid'),
'service_uuid' => data_get($this, 'uuid'),
]);
}
@@ -1145,7 +1145,7 @@ class Service extends BaseModel
if (data_get($this, 'environment.project.uuid')) {
$route = route('project.service.scheduled-tasks', [
'project_uuid' => data_get($this, 'environment.project.uuid'),
- 'environment_name' => data_get($this, 'environment.name'),
+ 'environment_uuid' => data_get($this, 'environment.uuid'),
'service_uuid' => data_get($this, 'uuid'),
'task_uuid' => $task_uuid,
]);
diff --git a/app/Models/StandaloneClickhouse.php b/app/Models/StandaloneClickhouse.php
index 6d66c6854..4776be4a8 100644
--- a/app/Models/StandaloneClickhouse.php
+++ b/app/Models/StandaloneClickhouse.php
@@ -169,7 +169,7 @@ class StandaloneClickhouse extends BaseModel
if (data_get($this, 'environment.project.uuid')) {
return route('project.database.configuration', [
'project_uuid' => data_get($this, 'environment.project.uuid'),
- 'environment_name' => data_get($this, 'environment.name'),
+ 'environment_uuid' => data_get($this, 'environment.uuid'),
'database_uuid' => data_get($this, 'uuid'),
]);
}
diff --git a/app/Models/StandaloneDragonfly.php b/app/Models/StandaloneDragonfly.php
index f7d83f0a3..6eaf81a14 100644
--- a/app/Models/StandaloneDragonfly.php
+++ b/app/Models/StandaloneDragonfly.php
@@ -174,7 +174,7 @@ class StandaloneDragonfly extends BaseModel
if (data_get($this, 'environment.project.uuid')) {
return route('project.database.configuration', [
'project_uuid' => data_get($this, 'environment.project.uuid'),
- 'environment_name' => data_get($this, 'environment.name'),
+ 'environment_uuid' => data_get($this, 'environment.uuid'),
'database_uuid' => data_get($this, 'uuid'),
]);
}
diff --git a/app/Models/StandaloneKeydb.php b/app/Models/StandaloneKeydb.php
index 083c743d9..b096d4bde 100644
--- a/app/Models/StandaloneKeydb.php
+++ b/app/Models/StandaloneKeydb.php
@@ -174,7 +174,7 @@ class StandaloneKeydb extends BaseModel
if (data_get($this, 'environment.project.uuid')) {
return route('project.database.configuration', [
'project_uuid' => data_get($this, 'environment.project.uuid'),
- 'environment_name' => data_get($this, 'environment.name'),
+ 'environment_uuid' => data_get($this, 'environment.uuid'),
'database_uuid' => data_get($this, 'uuid'),
]);
}
diff --git a/app/Models/StandaloneMariadb.php b/app/Models/StandaloneMariadb.php
index 833dad6c4..0b19d13c7 100644
--- a/app/Models/StandaloneMariadb.php
+++ b/app/Models/StandaloneMariadb.php
@@ -174,7 +174,7 @@ class StandaloneMariadb extends BaseModel
if (data_get($this, 'environment.project.uuid')) {
return route('project.database.configuration', [
'project_uuid' => data_get($this, 'environment.project.uuid'),
- 'environment_name' => data_get($this, 'environment.name'),
+ 'environment_uuid' => data_get($this, 'environment.uuid'),
'database_uuid' => data_get($this, 'uuid'),
]);
}
diff --git a/app/Models/StandaloneMongodb.php b/app/Models/StandaloneMongodb.php
index dd8893180..e4f400952 100644
--- a/app/Models/StandaloneMongodb.php
+++ b/app/Models/StandaloneMongodb.php
@@ -183,7 +183,7 @@ class StandaloneMongodb extends BaseModel
if (data_get($this, 'environment.project.uuid')) {
return route('project.database.configuration', [
'project_uuid' => data_get($this, 'environment.project.uuid'),
- 'environment_name' => data_get($this, 'environment.name'),
+ 'environment_uuid' => data_get($this, 'environment.uuid'),
'database_uuid' => data_get($this, 'uuid'),
]);
}
diff --git a/app/Models/StandaloneMysql.php b/app/Models/StandaloneMysql.php
index 710fea1bc..46556c04d 100644
--- a/app/Models/StandaloneMysql.php
+++ b/app/Models/StandaloneMysql.php
@@ -175,7 +175,7 @@ class StandaloneMysql extends BaseModel
if (data_get($this, 'environment.project.uuid')) {
return route('project.database.configuration', [
'project_uuid' => data_get($this, 'environment.project.uuid'),
- 'environment_name' => data_get($this, 'environment.name'),
+ 'environment_uuid' => data_get($this, 'environment.uuid'),
'database_uuid' => data_get($this, 'uuid'),
]);
}
diff --git a/app/Models/StandalonePostgresql.php b/app/Models/StandalonePostgresql.php
index 4a457a6cf..762afe884 100644
--- a/app/Models/StandalonePostgresql.php
+++ b/app/Models/StandalonePostgresql.php
@@ -170,7 +170,7 @@ class StandalonePostgresql extends BaseModel
if (data_get($this, 'environment.project.uuid')) {
return route('project.database.configuration', [
'project_uuid' => data_get($this, 'environment.project.uuid'),
- 'environment_name' => data_get($this, 'environment.name'),
+ 'environment_uuid' => data_get($this, 'environment.uuid'),
'database_uuid' => data_get($this, 'uuid'),
]);
}
diff --git a/app/Models/StandaloneRedis.php b/app/Models/StandaloneRedis.php
index 826bb951c..5aeb283a1 100644
--- a/app/Models/StandaloneRedis.php
+++ b/app/Models/StandaloneRedis.php
@@ -170,7 +170,7 @@ class StandaloneRedis extends BaseModel
if (data_get($this, 'environment.project.uuid')) {
return route('project.database.configuration', [
'project_uuid' => data_get($this, 'environment.project.uuid'),
- 'environment_name' => data_get($this, 'environment.name'),
+ 'environment_uuid' => data_get($this, 'environment.uuid'),
'database_uuid' => data_get($this, 'uuid'),
]);
}
diff --git a/resources/views/components/resources/breadcrumbs.blade.php b/resources/views/components/resources/breadcrumbs.blade.php
index f9733f63a..f1c1ca99e 100644
--- a/resources/views/components/resources/breadcrumbs.blade.php
+++ b/resources/views/components/resources/breadcrumbs.blade.php
@@ -21,7 +21,9 @@
{{ $this->parameters['environment_name'] }}
+ href="{{ route('project.resource.index', ['environment_uuid' => $this->parameters['environment_uuid'], 'project_uuid' => $this->parameters['project_uuid']]) }}">
+ {{ data_get($resource, 'environment.name', $this->parameters['environment_uuid']) }}
+
@if ($environment->isEmpty())
- + Add New Resource
@else
From 75491098a0bd3ba07d198c89d014af75e5b20899 Mon Sep 17 00:00:00 2001
From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com>
Date: Fri, 22 Nov 2024 16:05:24 +0100
Subject: [PATCH 13/17] new notification links
---
app/Notifications/Application/DeploymentFailed.php | 5 ++++-
app/Notifications/Application/DeploymentSuccess.php | 5 ++++-
app/Notifications/Application/StatusChanged.php | 6 ++++--
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/app/Notifications/Application/DeploymentFailed.php b/app/Notifications/Application/DeploymentFailed.php
index fae8951fd..191f7bd2e 100644
--- a/app/Notifications/Application/DeploymentFailed.php
+++ b/app/Notifications/Application/DeploymentFailed.php
@@ -26,6 +26,8 @@ class DeploymentFailed extends Notification implements ShouldQueue
public string $project_uuid;
+ public string $environment_uuid;
+
public string $environment_name;
public ?string $deployment_url = null;
@@ -40,12 +42,13 @@ class DeploymentFailed extends Notification implements ShouldQueue
$this->preview = $preview;
$this->application_name = data_get($application, 'name');
$this->project_uuid = data_get($application, 'environment.project.uuid');
+ $this->environment_uuid = data_get($application, 'environment.uuid');
$this->environment_name = data_get($application, 'environment.name');
$this->fqdn = data_get($application, 'fqdn');
if (str($this->fqdn)->explode(',')->count() > 1) {
$this->fqdn = str($this->fqdn)->explode(',')->first();
}
- $this->deployment_url = base_url()."/project/{$this->project_uuid}/".urlencode($this->environment_name)."/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
+ $this->deployment_url = base_url()."/project/{$this->project_uuid}/environments/{$this->environment_uuid}/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
}
public function via(object $notifiable): array
diff --git a/app/Notifications/Application/DeploymentSuccess.php b/app/Notifications/Application/DeploymentSuccess.php
index bfdef9f25..05e3048c5 100644
--- a/app/Notifications/Application/DeploymentSuccess.php
+++ b/app/Notifications/Application/DeploymentSuccess.php
@@ -26,6 +26,8 @@ class DeploymentSuccess extends Notification implements ShouldQueue
public string $project_uuid;
+ public string $environment_uuid;
+
public string $environment_name;
public ?string $deployment_url = null;
@@ -40,12 +42,13 @@ class DeploymentSuccess extends Notification implements ShouldQueue
$this->preview = $preview;
$this->application_name = data_get($application, 'name');
$this->project_uuid = data_get($application, 'environment.project.uuid');
+ $this->environment_uuid = data_get($application, 'environment.uuid');
$this->environment_name = data_get($application, 'environment.name');
$this->fqdn = data_get($application, 'fqdn');
if (str($this->fqdn)->explode(',')->count() > 1) {
$this->fqdn = str($this->fqdn)->explode(',')->first();
}
- $this->deployment_url = base_url()."/project/{$this->project_uuid}/".urlencode($this->environment_name)."/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
+ $this->deployment_url = base_url()."/project/{$this->project_uuid}/environments/{$this->environment_uuid}/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
}
public function via(object $notifiable): array
diff --git a/app/Notifications/Application/StatusChanged.php b/app/Notifications/Application/StatusChanged.php
index 3b062effb..be18b800b 100644
--- a/app/Notifications/Application/StatusChanged.php
+++ b/app/Notifications/Application/StatusChanged.php
@@ -19,6 +19,8 @@ class StatusChanged extends Notification implements ShouldQueue
public string $project_uuid;
+ public string $environment_uuid;
+
public string $environment_name;
public ?string $resource_url = null;
@@ -30,12 +32,12 @@ class StatusChanged extends Notification implements ShouldQueue
$this->onQueue('high');
$this->resource_name = data_get($resource, 'name');
$this->project_uuid = data_get($resource, 'environment.project.uuid');
- $this->environment_name = data_get($resource, 'environment.name');
+ $this->environment_uuid = data_get($resource, 'environment.uuid');
$this->fqdn = data_get($resource, 'fqdn', null);
if (str($this->fqdn)->explode(',')->count() > 1) {
$this->fqdn = str($this->fqdn)->explode(',')->first();
}
- $this->resource_url = base_url()."/project/{$this->project_uuid}/".urlencode($this->environment_name)."/application/{$this->resource->uuid}";
+ $this->resource_url = base_url()."/project/{$this->project_uuid}/environments/{$this->environment_uuid}/application/{$this->resource->uuid}";
}
public function via(object $notifiable): array
From bde895b6cd76621a648d1939cdbcb52bc35b54e7 Mon Sep 17 00:00:00 2001
From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com>
Date: Fri, 22 Nov 2024 16:08:27 +0100
Subject: [PATCH 14/17] fix scheduled task url
---
app/Livewire/Project/Shared/ScheduledTask/Show.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/Livewire/Project/Shared/ScheduledTask/Show.php b/app/Livewire/Project/Shared/ScheduledTask/Show.php
index 0900a1d70..0764ab3b9 100644
--- a/app/Livewire/Project/Shared/ScheduledTask/Show.php
+++ b/app/Livewire/Project/Shared/ScheduledTask/Show.php
@@ -46,7 +46,7 @@ class Show extends Component
#[Locked]
public string $task_uuid;
- public function mount(string $task_uuid, string $project_uuid, string $environment_name, ?string $application_uuid = null, ?string $service_uuid = null)
+ public function mount(string $task_uuid, string $project_uuid, string $environment_uuid, ?string $application_uuid = null, ?string $service_uuid = null)
{
try {
$this->task_uuid = $task_uuid;
@@ -60,7 +60,7 @@ class Show extends Component
$this->resource = Service::ownedByCurrentTeam()->where('uuid', $service_uuid)->firstOrFail();
}
$this->parameters = [
- 'environment_name' => $environment_name,
+ 'environment_uuid' => $environment_uuid,
'project_uuid' => $project_uuid,
'application_uuid' => $application_uuid,
'service_uuid' => $service_uuid,
From 371b4a3f83ca3e3e077f13a55be099e131343c10 Mon Sep 17 00:00:00 2001
From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com>
Date: Fri, 22 Nov 2024 16:11:53 +0100
Subject: [PATCH 15/17] remove unused var
---
app/Notifications/Application/StatusChanged.php | 2 --
1 file changed, 2 deletions(-)
diff --git a/app/Notifications/Application/StatusChanged.php b/app/Notifications/Application/StatusChanged.php
index be18b800b..4d0b0b3db 100644
--- a/app/Notifications/Application/StatusChanged.php
+++ b/app/Notifications/Application/StatusChanged.php
@@ -21,8 +21,6 @@ class StatusChanged extends Notification implements ShouldQueue
public string $environment_uuid;
- public string $environment_name;
-
public ?string $resource_url = null;
public ?string $fqdn;
From 0ce01238d749ec7eea8bbee90917d8d5d9045e89 Mon Sep 17 00:00:00 2001
From: Andras Bacsai
Date: Tue, 17 Dec 2024 13:40:07 +0100
Subject: [PATCH 16/17] fix: html css
---
resources/css/app.css | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/resources/css/app.css b/resources/css/app.css
index 32d476c1a..6e7704eb7 100644
--- a/resources/css/app.css
+++ b/resources/css/app.css
@@ -6,11 +6,11 @@
html,
body {
- @apply h-full bg-neutral-50 text-neutral-800 dark:bg-base dark:text-neutral-400 w-full;
+ @apply min-h-full bg-neutral-50 dark:bg-base dark:text-neutral-400 w-full;
}
body {
- @apply text-sm antialiased scrollbar;
+ @apply text-sm antialiased scrollbar min-h-screen;
}
.apexcharts-tooltip {
From 9e3467578f1435887f7b2d20a1bcf2b06554dad2 Mon Sep 17 00:00:00 2001
From: Andras Bacsai
Date: Tue, 17 Dec 2024 13:42:16 +0100
Subject: [PATCH 17/17] feat: add environment_uuid support and update API
documentation
- Introduced `environment_uuid` as a required field in various API endpoints and schemas.
- Updated descriptions to clarify that either `environment_name` or `environment_uuid` must be provided.
- Modified routes and controller methods to accommodate the new UUID parameter.
- Adjusted frontend components to utilize `environment_uuid` for better consistency and clarity.
- Removed deprecated fields related to environment handling.
This change enhances the API's flexibility in identifying environments, improving overall usability.
---
.../Api/ApplicationsController.php | 114 ++++---
.../Controllers/Api/DatabasesController.php | 73 +++--
.../Controllers/Api/ProjectController.php | 17 +-
.../Controllers/Api/ServicesController.php | 26 +-
app/Jobs/ApplicationDeploymentJob.php | 2 +-
.../Project/Application/Configuration.php | 4 +-
.../Project/Application/Deployment/Show.php | 8 -
app/Livewire/Project/Application/Heading.php | 2 +-
.../Project/Database/Configuration.php | 2 +-
app/Livewire/Project/Resource/Index.php | 62 ++--
.../Project/Service/Configuration.php | 4 +-
app/Models/Environment.php | 3 +-
.../Application/StatusChanged.php | 5 +-
bootstrap/helpers/api.php | 1 +
openapi.json | 300 +++++++-----------
openapi.yaml | 228 +++++--------
.../resources/breadcrumbs.blade.php | 5 +-
resources/views/livewire/dashboard.blade.php | 4 +-
.../application/configuration.blade.php | 34 +-
.../project/database/configuration.blade.php | 23 +-
.../livewire/project/resource/index.blade.php | 2 +-
.../project/service/configuration.blade.php | 22 +-
.../project/service/storage.blade.php | 3 +-
routes/api.php | 2 +-
24 files changed, 421 insertions(+), 525 deletions(-)
diff --git a/app/Http/Controllers/Api/ApplicationsController.php b/app/Http/Controllers/Api/ApplicationsController.php
index 6e7370bb3..1e6a3d246 100644
--- a/app/Http/Controllers/Api/ApplicationsController.php
+++ b/app/Http/Controllers/Api/ApplicationsController.php
@@ -117,11 +117,12 @@ class ApplicationsController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['project_uuid', 'server_uuid', 'environment_name', 'git_repository', 'git_branch', 'build_pack', 'ports_exposes'],
+ required: ['project_uuid', 'server_uuid', 'environment_name', 'environment_uuid', 'git_repository', 'git_branch', 'build_pack', 'ports_exposes'],
properties: [
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
'server_uuid' => ['type' => 'string', 'description' => 'The server UUID.'],
- 'environment_name' => ['type' => 'string', 'description' => 'The environment name.'],
+ 'environment_name' => ['type' => 'string', 'description' => 'The environment name. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'],
'git_repository' => ['type' => 'string', 'description' => 'The git repository URL.'],
'git_branch' => ['type' => 'string', 'description' => 'The git branch.'],
'build_pack' => ['type' => 'string', 'enum' => ['nixpacks', 'static', 'dockerfile', 'dockercompose'], 'description' => 'The build pack type.'],
@@ -223,11 +224,12 @@ class ApplicationsController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['project_uuid', 'server_uuid', 'environment_name', 'github_app_uuid', 'git_repository', 'git_branch', 'build_pack', 'ports_exposes'],
+ required: ['project_uuid', 'server_uuid', 'environment_name', 'environment_uuid', 'github_app_uuid', 'git_repository', 'git_branch', 'build_pack', 'ports_exposes'],
properties: [
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
'server_uuid' => ['type' => 'string', 'description' => 'The server UUID.'],
- 'environment_name' => ['type' => 'string', 'description' => 'The environment name.'],
+ 'environment_name' => ['type' => 'string', 'description' => 'The environment name. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'],
'github_app_uuid' => ['type' => 'string', 'description' => 'The Github App UUID.'],
'git_repository' => ['type' => 'string', 'description' => 'The git repository URL.'],
'git_branch' => ['type' => 'string', 'description' => 'The git branch.'],
@@ -329,11 +331,12 @@ class ApplicationsController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['project_uuid', 'server_uuid', 'environment_name', 'private_key_uuid', 'git_repository', 'git_branch', 'build_pack', 'ports_exposes'],
+ required: ['project_uuid', 'server_uuid', 'environment_name', 'environment_uuid', 'private_key_uuid', 'git_repository', 'git_branch', 'build_pack', 'ports_exposes'],
properties: [
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
'server_uuid' => ['type' => 'string', 'description' => 'The server UUID.'],
- 'environment_name' => ['type' => 'string', 'description' => 'The environment name.'],
+ 'environment_name' => ['type' => 'string', 'description' => 'The environment name. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'],
'private_key_uuid' => ['type' => 'string', 'description' => 'The private key UUID.'],
'git_repository' => ['type' => 'string', 'description' => 'The git repository URL.'],
'git_branch' => ['type' => 'string', 'description' => 'The git branch.'],
@@ -435,11 +438,12 @@ class ApplicationsController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['project_uuid', 'server_uuid', 'environment_name', 'dockerfile'],
+ required: ['project_uuid', 'server_uuid', 'environment_name', 'environment_uuid', 'dockerfile'],
properties: [
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
'server_uuid' => ['type' => 'string', 'description' => 'The server UUID.'],
- 'environment_name' => ['type' => 'string', 'description' => 'The environment name.'],
+ 'environment_name' => ['type' => 'string', 'description' => 'The environment name. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'],
'dockerfile' => ['type' => 'string', 'description' => 'The Dockerfile content.'],
'build_pack' => ['type' => 'string', 'enum' => ['nixpacks', 'static', 'dockerfile', 'dockercompose'], 'description' => 'The build pack type.'],
'ports_exposes' => ['type' => 'string', 'description' => 'The ports to expose.'],
@@ -525,11 +529,12 @@ class ApplicationsController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['project_uuid', 'server_uuid', 'environment_name', 'docker_registry_image_name', 'ports_exposes'],
+ required: ['project_uuid', 'server_uuid', 'environment_name', 'environment_uuid', 'docker_registry_image_name', 'ports_exposes'],
properties: [
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
'server_uuid' => ['type' => 'string', 'description' => 'The server UUID.'],
- 'environment_name' => ['type' => 'string', 'description' => 'The environment name.'],
+ 'environment_name' => ['type' => 'string', 'description' => 'The environment name. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'],
'docker_registry_image_name' => ['type' => 'string', 'description' => 'The docker registry image name.'],
'docker_registry_image_tag' => ['type' => 'string', 'description' => 'The docker registry image tag.'],
'ports_exposes' => ['type' => 'string', 'description' => 'The ports to expose.'],
@@ -612,11 +617,12 @@ class ApplicationsController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['project_uuid', 'server_uuid', 'environment_name', 'docker_compose_raw'],
+ required: ['project_uuid', 'server_uuid', 'environment_name', 'environment_uuid', 'docker_compose_raw'],
properties: [
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
'server_uuid' => ['type' => 'string', 'description' => 'The server UUID.'],
- 'environment_name' => ['type' => 'string', 'description' => 'The environment name.'],
+ 'environment_name' => ['type' => 'string', 'description' => 'The environment name. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'],
'docker_compose_raw' => ['type' => 'string', 'description' => 'The Docker Compose raw content.'],
'destination_uuid' => ['type' => 'string', 'description' => 'The destination UUID if the server has more than one destinations.'],
'name' => ['type' => 'string', 'description' => 'The application name.'],
@@ -650,7 +656,7 @@ class ApplicationsController extends Controller
private function create_application(Request $request, $type)
{
- $allowedFields = ['project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'type', 'name', 'description', 'is_static', 'domains', 'git_repository', 'git_branch', 'git_commit_sha', 'private_key_uuid', 'docker_registry_image_name', 'docker_registry_image_tag', 'build_pack', 'install_command', 'build_command', 'start_command', 'ports_exposes', 'ports_mappings', 'base_directory', 'publish_directory', 'health_check_enabled', 'health_check_path', 'health_check_port', 'health_check_host', 'health_check_method', 'health_check_return_code', 'health_check_scheme', 'health_check_response_text', 'health_check_interval', 'health_check_timeout', 'health_check_retries', 'health_check_start_period', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'custom_labels', 'custom_docker_run_options', 'post_deployment_command', 'post_deployment_command_container', 'pre_deployment_command', 'pre_deployment_command_container', 'manual_webhook_secret_github', 'manual_webhook_secret_gitlab', 'manual_webhook_secret_bitbucket', 'manual_webhook_secret_gitea', 'redirect', 'github_app_uuid', 'instant_deploy', 'dockerfile', 'docker_compose_location', 'docker_compose_raw', 'docker_compose_custom_start_command', 'docker_compose_custom_build_command', 'docker_compose_domains', 'watch_paths', 'use_build_server', 'static_image', 'custom_nginx_configuration'];
+ $allowedFields = ['project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'type', 'name', 'description', 'is_static', 'domains', 'git_repository', 'git_branch', 'git_commit_sha', 'private_key_uuid', 'docker_registry_image_name', 'docker_registry_image_tag', 'build_pack', 'install_command', 'build_command', 'start_command', 'ports_exposes', 'ports_mappings', 'base_directory', 'publish_directory', 'health_check_enabled', 'health_check_path', 'health_check_port', 'health_check_host', 'health_check_method', 'health_check_return_code', 'health_check_scheme', 'health_check_response_text', 'health_check_interval', 'health_check_timeout', 'health_check_retries', 'health_check_start_period', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'custom_labels', 'custom_docker_run_options', 'post_deployment_command', 'post_deployment_command_container', 'pre_deployment_command', 'pre_deployment_command_container', 'manual_webhook_secret_github', 'manual_webhook_secret_gitlab', 'manual_webhook_secret_bitbucket', 'manual_webhook_secret_gitea', 'redirect', 'github_app_uuid', 'instant_deploy', 'dockerfile', 'docker_compose_location', 'docker_compose_raw', 'docker_compose_custom_start_command', 'docker_compose_custom_build_command', 'docker_compose_domains', 'watch_paths', 'use_build_server', 'static_image', 'custom_nginx_configuration'];
$teamId = getTeamIdFromToken();
if (is_null($teamId)) {
return invalidTokenResponse();
@@ -664,7 +670,8 @@ class ApplicationsController extends Controller
'name' => 'string|max:255',
'description' => 'string|nullable',
'project_uuid' => 'string|required',
- 'environment_name' => 'string|required',
+ 'environment_name' => 'string|nullable',
+ 'environment_uuid' => 'string|nullable',
'server_uuid' => 'string|required',
'destination_uuid' => 'string',
]);
@@ -684,6 +691,11 @@ class ApplicationsController extends Controller
], 422);
}
+ $environmentUuid = $request->environment_uuid;
+ $environmentName = $request->environment_name;
+ if (blank($environmentUuid) && blank($environmentName)) {
+ return response()->json(['message' => 'You need to provide at least one of environment_name or environment_uuid.'], 422);
+ }
$serverUuid = $request->server_uuid;
$fqdn = $request->domains;
$instantDeploy = $request->instant_deploy;
@@ -716,7 +728,10 @@ class ApplicationsController extends Controller
if (! $project) {
return response()->json(['message' => 'Project not found.'], 404);
}
- $environment = $project->environments()->where('name', $request->environment_name)->first();
+ $environment = $project->environments()->where('name', $environmentName)->first();
+ if (! $environment) {
+ $environment = $project->environments()->where('uuid', $environmentUuid)->first();
+ }
if (! $environment) {
return response()->json(['message' => 'Environment not found.'], 404);
}
@@ -733,12 +748,6 @@ class ApplicationsController extends Controller
}
$destination = $destinations->first();
if ($type === 'public') {
- if (! $request->has('name')) {
- $request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
- }
- if ($request->build_pack === 'dockercompose') {
- $request->offsetSet('ports_exposes', '80');
- }
$validationRules = [
'git_repository' => 'string|required',
'git_branch' => 'string|required',
@@ -748,7 +757,7 @@ class ApplicationsController extends Controller
'docker_compose_raw' => 'string|nullable',
'docker_compose_domains' => 'array|nullable',
];
- $validationRules = array_merge($validationRules, sharedDataApplications());
+ $validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules);
if ($validator->fails()) {
return response()->json([
@@ -756,6 +765,12 @@ class ApplicationsController extends Controller
'errors' => $validator->errors(),
], 422);
}
+ if (! $request->has('name')) {
+ $request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
+ }
+ if ($request->build_pack === 'dockercompose') {
+ $request->offsetSet('ports_exposes', '80');
+ }
$return = $this->validateDataApplications($request, $server);
if ($return instanceof \Illuminate\Http\JsonResponse) {
@@ -820,12 +835,6 @@ class ApplicationsController extends Controller
'domains' => data_get($application, 'domains'),
]));
} elseif ($type === 'private-gh-app') {
- if (! $request->has('name')) {
- $request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
- }
- if ($request->build_pack === 'dockercompose') {
- $request->offsetSet('ports_exposes', '80');
- }
$validationRules = [
'git_repository' => 'string|required',
'git_branch' => 'string|required',
@@ -836,7 +845,7 @@ class ApplicationsController extends Controller
'docker_compose_location' => 'string',
'docker_compose_raw' => 'string|nullable',
];
- $validationRules = array_merge($validationRules, sharedDataApplications());
+ $validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules);
if ($validator->fails()) {
@@ -845,6 +854,14 @@ class ApplicationsController extends Controller
'errors' => $validator->errors(),
], 422);
}
+
+ if (! $request->has('name')) {
+ $request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
+ }
+ if ($request->build_pack === 'dockercompose') {
+ $request->offsetSet('ports_exposes', '80');
+ }
+
$return = $this->validateDataApplications($request, $server);
if ($return instanceof \Illuminate\Http\JsonResponse) {
return $return;
@@ -919,12 +936,6 @@ class ApplicationsController extends Controller
'domains' => data_get($application, 'domains'),
]));
} elseif ($type === 'private-deploy-key') {
- if (! $request->has('name')) {
- $request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
- }
- if ($request->build_pack === 'dockercompose') {
- $request->offsetSet('ports_exposes', '80');
- }
$validationRules = [
'git_repository' => 'string|required',
@@ -937,7 +948,7 @@ class ApplicationsController extends Controller
'docker_compose_raw' => 'string|nullable',
];
- $validationRules = array_merge($validationRules, sharedDataApplications());
+ $validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules);
if ($validator->fails()) {
@@ -946,6 +957,13 @@ class ApplicationsController extends Controller
'errors' => $validator->errors(),
], 422);
}
+ if (! $request->has('name')) {
+ $request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
+ }
+ if ($request->build_pack === 'dockercompose') {
+ $request->offsetSet('ports_exposes', '80');
+ }
+
$return = $this->validateDataApplications($request, $server);
if ($return instanceof \Illuminate\Http\JsonResponse) {
return $return;
@@ -1015,14 +1033,10 @@ class ApplicationsController extends Controller
'domains' => data_get($application, 'domains'),
]));
} elseif ($type === 'dockerfile') {
- if (! $request->has('name')) {
- $request->offsetSet('name', 'dockerfile-'.new Cuid2);
- }
-
$validationRules = [
'dockerfile' => 'string|required',
];
- $validationRules = array_merge($validationRules, sharedDataApplications());
+ $validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules);
if ($validator->fails()) {
@@ -1031,6 +1045,10 @@ class ApplicationsController extends Controller
'errors' => $validator->errors(),
], 422);
}
+ if (! $request->has('name')) {
+ $request->offsetSet('name', 'dockerfile-'.new Cuid2);
+ }
+
$return = $this->validateDataApplications($request, $server);
if ($return instanceof \Illuminate\Http\JsonResponse) {
return $return;
@@ -1100,15 +1118,12 @@ class ApplicationsController extends Controller
'domains' => data_get($application, 'domains'),
]));
} elseif ($type === 'dockerimage') {
- if (! $request->has('name')) {
- $request->offsetSet('name', 'docker-image-'.new Cuid2);
- }
$validationRules = [
'docker_registry_image_name' => 'string|required',
'docker_registry_image_tag' => 'string',
'ports_exposes' => 'string|regex:/^(\d+)(,\d+)*$/|required',
];
- $validationRules = array_merge($validationRules, sharedDataApplications());
+ $validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules);
if ($validator->fails()) {
@@ -1117,6 +1132,9 @@ class ApplicationsController extends Controller
'errors' => $validator->errors(),
], 422);
}
+ if (! $request->has('name')) {
+ $request->offsetSet('name', 'docker-image-'.new Cuid2);
+ }
$return = $this->validateDataApplications($request, $server);
if ($return instanceof \Illuminate\Http\JsonResponse) {
return $return;
@@ -1164,7 +1182,7 @@ class ApplicationsController extends Controller
'domains' => data_get($application, 'domains'),
]));
} elseif ($type === 'dockercompose') {
- $allowedFields = ['project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'type', 'name', 'description', 'instant_deploy', 'docker_compose_raw'];
+ $allowedFields = ['project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'type', 'name', 'description', 'instant_deploy', 'docker_compose_raw'];
$extraFields = array_diff(array_keys($request->all()), $allowedFields);
if ($validator->fails() || ! empty($extraFields)) {
@@ -1186,7 +1204,7 @@ class ApplicationsController extends Controller
$validationRules = [
'docker_compose_raw' => 'string|required',
];
- $validationRules = array_merge($validationRules, sharedDataApplications());
+ $validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules);
if ($validator->fails()) {
@@ -1554,7 +1572,7 @@ class ApplicationsController extends Controller
'docker_compose_custom_build_command' => 'string|nullable',
'custom_nginx_configuration' => 'string|nullable',
];
- $validationRules = array_merge($validationRules, sharedDataApplications());
+ $validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules);
// Validate ports_exposes
diff --git a/app/Http/Controllers/Api/DatabasesController.php b/app/Http/Controllers/Api/DatabasesController.php
index 917171e5c..504665f6a 100644
--- a/app/Http/Controllers/Api/DatabasesController.php
+++ b/app/Http/Controllers/Api/DatabasesController.php
@@ -523,11 +523,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['server_uuid', 'project_uuid', 'environment_name'],
+ required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
- 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
+ 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'postgres_user' => ['type' => 'string', 'description' => 'PostgreSQL user'],
'postgres_password' => ['type' => 'string', 'description' => 'PostgreSQL password'],
'postgres_db' => ['type' => 'string', 'description' => 'PostgreSQL database'],
@@ -589,11 +590,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['server_uuid', 'project_uuid', 'environment_name'],
+ required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
- 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
+ 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
'clickhouse_admin_user' => ['type' => 'string', 'description' => 'Clickhouse admin user'],
'clickhouse_admin_password' => ['type' => 'string', 'description' => 'Clickhouse admin password'],
@@ -651,11 +653,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['server_uuid', 'project_uuid', 'environment_name'],
+ required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
- 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
+ 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
'dragonfly_password' => ['type' => 'string', 'description' => 'DragonFly password'],
'name' => ['type' => 'string', 'description' => 'Name of the database'],
@@ -712,11 +715,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['server_uuid', 'project_uuid', 'environment_name'],
+ required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
- 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
+ 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
'redis_password' => ['type' => 'string', 'description' => 'Redis password'],
'redis_conf' => ['type' => 'string', 'description' => 'Redis conf'],
@@ -774,11 +778,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['server_uuid', 'project_uuid', 'environment_name'],
+ required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
- 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
+ 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
'keydb_password' => ['type' => 'string', 'description' => 'KeyDB password'],
'keydb_conf' => ['type' => 'string', 'description' => 'KeyDB conf'],
@@ -836,11 +841,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['server_uuid', 'project_uuid', 'environment_name'],
+ required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
- 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
+ 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
'mariadb_conf' => ['type' => 'string', 'description' => 'MariaDB conf'],
'mariadb_root_password' => ['type' => 'string', 'description' => 'MariaDB root password'],
@@ -901,11 +907,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['server_uuid', 'project_uuid', 'environment_name'],
+ required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
- 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
+ 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
'mysql_root_password' => ['type' => 'string', 'description' => 'MySQL root password'],
'mysql_password' => ['type' => 'string', 'description' => 'MySQL password'],
@@ -966,11 +973,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['server_uuid', 'project_uuid', 'environment_name'],
+ required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
- 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
+ 'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
'mongo_conf' => ['type' => 'string', 'description' => 'MongoDB conf'],
'mongo_initdb_root_username' => ['type' => 'string', 'description' => 'MongoDB initdb root username'],
@@ -1013,7 +1021,7 @@ class DatabasesController extends Controller
public function create_database(Request $request, NewDatabaseTypes $type)
{
- $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', 'postgres_user', 'postgres_password', 'postgres_db', 'postgres_initdb_args', 'postgres_host_auth_method', 'postgres_conf', 'clickhouse_admin_user', 'clickhouse_admin_password', 'dragonfly_password', 'redis_password', 'redis_conf', 'keydb_password', 'keydb_conf', 'mariadb_conf', 'mariadb_root_password', 'mariadb_user', 'mariadb_password', 'mariadb_database', 'mongo_conf', 'mongo_initdb_root_username', 'mongo_initdb_root_password', 'mongo_initdb_database', 'mysql_root_password', 'mysql_password', 'mysql_user', 'mysql_database', 'mysql_conf'];
+ $allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'postgres_user', 'postgres_password', 'postgres_db', 'postgres_initdb_args', 'postgres_host_auth_method', 'postgres_conf', 'clickhouse_admin_user', 'clickhouse_admin_password', 'dragonfly_password', 'redis_password', 'redis_conf', 'keydb_password', 'keydb_conf', 'mariadb_conf', 'mariadb_root_password', 'mariadb_user', 'mariadb_password', 'mariadb_database', 'mongo_conf', 'mongo_initdb_root_username', 'mongo_initdb_root_password', 'mongo_initdb_database', 'mysql_root_password', 'mysql_password', 'mysql_user', 'mysql_database', 'mysql_conf'];
$teamId = getTeamIdFromToken();
if (is_null($teamId)) {
@@ -1039,6 +1047,11 @@ class DatabasesController extends Controller
'errors' => $errors,
], 422);
}
+ $environmentUuid = $request->environment_uuid;
+ $environmentName = $request->environment_name;
+ if (blank($environmentUuid) && blank($environmentName)) {
+ return response()->json(['message' => 'You need to provide at least one of environment_name or environment_uuid.'], 422);
+ }
$serverUuid = $request->server_uuid;
$instantDeploy = $request->instant_deploy ?? false;
if ($request->is_public && ! $request->public_port) {
@@ -1048,9 +1061,12 @@ class DatabasesController extends Controller
if (! $project) {
return response()->json(['message' => 'Project not found.'], 404);
}
- $environment = $project->environments()->where('name', $request->environment_name)->first();
+ $environment = $project->environments()->where('name', $environmentName)->first();
if (! $environment) {
- return response()->json(['message' => 'Environment not found.'], 404);
+ $environment = $project->environments()->where('uuid', $environmentUuid)->first();
+ }
+ if (! $environment) {
+ return response()->json(['message' => 'You need to provide a valid environment_name or environment_uuid.'], 422);
}
$server = Server::whereTeamId($teamId)->whereUuid($serverUuid)->first();
if (! $server) {
@@ -1074,7 +1090,8 @@ class DatabasesController extends Controller
'description' => 'string|nullable',
'image' => 'string',
'project_uuid' => 'string|required',
- 'environment_name' => 'string|required',
+ 'environment_name' => 'string|nullable',
+ 'environment_uuid' => 'string|nullable',
'server_uuid' => 'string|required',
'destination_uuid' => 'string',
'is_public' => 'boolean',
@@ -1105,7 +1122,7 @@ class DatabasesController extends Controller
}
}
if ($type === NewDatabaseTypes::POSTGRESQL) {
- $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', 'postgres_user', 'postgres_password', 'postgres_db', 'postgres_initdb_args', 'postgres_host_auth_method', 'postgres_conf'];
+ $allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'postgres_user', 'postgres_password', 'postgres_db', 'postgres_initdb_args', 'postgres_host_auth_method', 'postgres_conf'];
$validator = customApiValidator($request->all(), [
'postgres_user' => 'string',
'postgres_password' => 'string',
@@ -1164,7 +1181,7 @@ 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'];
+ $allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', '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(), [
'clickhouse_admin_user' => 'string',
'clickhouse_admin_password' => 'string',
@@ -1220,7 +1237,7 @@ class DatabasesController extends Controller
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
} elseif ($type === NewDatabaseTypes::MYSQL) {
- $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', 'mysql_root_password', 'mysql_password', 'mysql_user', 'mysql_database', 'mysql_conf'];
+ $allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'mysql_root_password', 'mysql_password', 'mysql_user', 'mysql_database', 'mysql_conf'];
$validator = customApiValidator($request->all(), [
'mysql_root_password' => 'string',
'mysql_password' => 'string',
@@ -1279,7 +1296,7 @@ class DatabasesController extends Controller
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
} elseif ($type === NewDatabaseTypes::REDIS) {
- $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', 'redis_password', 'redis_conf'];
+ $allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'redis_password', 'redis_conf'];
$validator = customApiValidator($request->all(), [
'redis_password' => 'string',
'redis_conf' => 'string',
@@ -1335,7 +1352,7 @@ class DatabasesController extends Controller
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
} elseif ($type === NewDatabaseTypes::DRAGONFLY) {
- $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', 'dragonfly_password'];
+ $allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'dragonfly_password'];
$validator = customApiValidator($request->all(), [
'dragonfly_password' => 'string',
]);
@@ -1365,7 +1382,7 @@ class DatabasesController extends Controller
'uuid' => $database->uuid,
]))->setStatusCode(201);
} elseif ($type === NewDatabaseTypes::KEYDB) {
- $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', 'keydb_password', 'keydb_conf'];
+ $allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'keydb_password', 'keydb_conf'];
$validator = customApiValidator($request->all(), [
'keydb_password' => 'string',
'keydb_conf' => 'string',
@@ -1421,7 +1438,7 @@ class DatabasesController extends Controller
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
} elseif ($type === NewDatabaseTypes::CLICKHOUSE) {
- $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', 'clickhouse_admin_user', 'clickhouse_admin_password'];
+ $allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'clickhouse_admin_user', 'clickhouse_admin_password'];
$validator = customApiValidator($request->all(), [
'clickhouse_admin_user' => 'string',
'clickhouse_admin_password' => 'string',
@@ -1457,7 +1474,7 @@ class DatabasesController extends Controller
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
} elseif ($type === NewDatabaseTypes::MONGODB) {
- $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', 'mongo_conf', 'mongo_initdb_root_username', 'mongo_initdb_root_password', 'mongo_initdb_database'];
+ $allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'mongo_conf', 'mongo_initdb_root_username', 'mongo_initdb_root_password', 'mongo_initdb_database'];
$validator = customApiValidator($request->all(), [
'mongo_conf' => 'string',
'mongo_initdb_root_username' => 'string',
diff --git a/app/Http/Controllers/Api/ProjectController.php b/app/Http/Controllers/Api/ProjectController.php
index 1d89c82ed..15795e241 100644
--- a/app/Http/Controllers/Api/ProjectController.php
+++ b/app/Http/Controllers/Api/ProjectController.php
@@ -102,16 +102,16 @@ class ProjectController extends Controller
#[OA\Get(
summary: 'Environment',
- description: 'Get environment by name.',
- path: '/projects/{uuid}/{environment_name}',
- operationId: 'get-environment-by-name',
+ description: 'Get environment by name or UUID.',
+ path: '/projects/{uuid}/{environment_name_or_uuid}',
+ operationId: 'get-environment-by-name-or-uuid',
security: [
['bearerAuth' => []],
],
tags: ['Projects'],
parameters: [
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Project UUID', schema: new OA\Schema(type: 'string')),
- new OA\Parameter(name: 'environment_name', in: 'path', required: true, description: 'Environment name', schema: new OA\Schema(type: 'string')),
+ new OA\Parameter(name: 'environment_name_or_uuid', in: 'path', required: true, description: 'Environment name or UUID', schema: new OA\Schema(type: 'string')),
],
responses: [
new OA\Response(
@@ -141,14 +141,17 @@ class ProjectController extends Controller
if (! $request->uuid) {
return response()->json(['message' => 'UUID is required.'], 422);
}
- if (! $request->environment_name) {
- return response()->json(['message' => 'Environment name is required.'], 422);
+ if (! $request->environment_name_or_uuid) {
+ return response()->json(['message' => 'Environment name or UUID is required.'], 422);
}
$project = Project::whereTeamId($teamId)->whereUuid($request->uuid)->first();
if (! $project) {
return response()->json(['message' => 'Project not found.'], 404);
}
- $environment = $project->environments()->whereName($request->environment_name)->first();
+ $environment = $project->environments()->whereName($request->environment_name_or_uuid)->first();
+ if (! $environment) {
+ $environment = $project->environments()->whereUuid($request->environment_name_or_uuid)->first();
+ }
if (! $environment) {
return response()->json(['message' => 'Environment not found.'], 404);
}
diff --git a/app/Http/Controllers/Api/ServicesController.php b/app/Http/Controllers/Api/ServicesController.php
index f5ecdcf28..03d9d209c 100644
--- a/app/Http/Controllers/Api/ServicesController.php
+++ b/app/Http/Controllers/Api/ServicesController.php
@@ -102,7 +102,7 @@ class ServicesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
- required: ['server_uuid', 'project_uuid', 'environment_name', 'type'],
+ required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid', 'type'],
properties: [
'type' => [
'description' => 'The one-click service type',
@@ -199,7 +199,8 @@ class ServicesController extends Controller
'name' => ['type' => 'string', 'maxLength' => 255, 'description' => 'Name of the service.'],
'description' => ['type' => 'string', 'nullable' => true, 'description' => 'Description of the service.'],
'project_uuid' => ['type' => 'string', 'description' => 'Project UUID.'],
- 'environment_name' => ['type' => 'string', 'description' => 'Environment name.'],
+ 'environment_name' => ['type' => 'string', 'description' => 'Environment name. You need to provide at least one of environment_name or environment_uuid.'],
+ 'environment_uuid' => ['type' => 'string', 'description' => 'Environment UUID. You need to provide at least one of environment_name or environment_uuid.'],
'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.'],
@@ -236,7 +237,7 @@ class ServicesController extends Controller
)]
public function create_service(Request $request)
{
- $allowedFields = ['type', 'name', 'description', 'project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'instant_deploy'];
+ $allowedFields = ['type', 'name', 'description', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy'];
$teamId = getTeamIdFromToken();
if (is_null($teamId)) {
@@ -250,7 +251,8 @@ class ServicesController extends Controller
$validator = customApiValidator($request->all(), [
'type' => 'string|required',
'project_uuid' => 'string|required',
- 'environment_name' => 'string|required',
+ 'environment_name' => 'string|nullable',
+ 'environment_uuid' => 'string|nullable',
'server_uuid' => 'string|required',
'destination_uuid' => 'string',
'name' => 'string|max:255',
@@ -272,6 +274,11 @@ class ServicesController extends Controller
'errors' => $errors,
], 422);
}
+ $environmentUuid = $request->environment_uuid;
+ $environmentName = $request->environment_name;
+ if (blank($environmentUuid) && blank($environmentName)) {
+ return response()->json(['message' => 'You need to provide at least one of environment_name or environment_uuid.'], 422);
+ }
$serverUuid = $request->server_uuid;
$instantDeploy = $request->instant_deploy ?? false;
if ($request->is_public && ! $request->public_port) {
@@ -281,7 +288,10 @@ class ServicesController extends Controller
if (! $project) {
return response()->json(['message' => 'Project not found.'], 404);
}
- $environment = $project->environments()->where('name', $request->environment_name)->first();
+ $environment = $project->environments()->where('name', $environmentName)->first();
+ if (! $environment) {
+ $environment = $project->environments()->where('uuid', $environmentUuid)->first();
+ }
if (! $environment) {
return response()->json(['message' => 'Environment not found.'], 404);
}
@@ -349,7 +359,11 @@ class ServicesController extends Controller
}
$domains = $service->applications()->get()->pluck('fqdn')->sort();
$domains = $domains->map(function ($domain) {
- return str($domain)->beforeLast(':')->value();
+ if (count(explode(':', $domain)) > 2) {
+ return str($domain)->beforeLast(':')->value();
+ }
+
+ return $domain;
});
return response()->json([
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php
index 6b677fa0e..7e4155338 100644
--- a/app/Jobs/ApplicationDeploymentJob.php
+++ b/app/Jobs/ApplicationDeploymentJob.php
@@ -1405,7 +1405,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
'project_uuid' => data_get($this->application, 'environment.project.uuid'),
'application_uuid' => data_get($this->application, 'uuid'),
'deployment_uuid' => $deployment_uuid,
- 'environment_name' => data_get($this->application, 'environment.name'),
+ 'environment_uuid' => data_get($this->application, 'environment.uuid'),
]));
}
}
diff --git a/app/Livewire/Project/Application/Configuration.php b/app/Livewire/Project/Application/Configuration.php
index 514fe3326..56e0caf75 100644
--- a/app/Livewire/Project/Application/Configuration.php
+++ b/app/Livewire/Project/Application/Configuration.php
@@ -21,7 +21,6 @@ class Configuration extends Component
public function mount()
{
-
$this->currentRoute = request()->route()->getName();
$project = currentTeam()
->projects()
@@ -29,7 +28,7 @@ class Configuration extends Component
->where('uuid', request()->route('project_uuid'))
->firstOrFail();
$environment = $project->environments()
- ->select('id', 'name', 'project_id')
+ ->select('id', 'uuid', 'name', 'project_id')
->where('uuid', request()->route('environment_uuid'))
->firstOrFail();
$application = $environment->applications()
@@ -40,7 +39,6 @@ class Configuration extends Component
$this->project = $project;
$this->environment = $environment;
$this->application = $application;
-
}
public function render()
diff --git a/app/Livewire/Project/Application/Deployment/Show.php b/app/Livewire/Project/Application/Deployment/Show.php
index dba0d8ae5..4e86b5c7e 100644
--- a/app/Livewire/Project/Application/Deployment/Show.php
+++ b/app/Livewire/Project/Application/Deployment/Show.php
@@ -34,14 +34,6 @@ class Show extends Component
if (! $application) {
return redirect()->route('dashboard');
}
- // $activity = Activity::where('properties->type_uuid', '=', $deploymentUuid)->first();
- // if (!$activity) {
- // return redirect()->route('project.application.deployment.index', [
- // 'project_uuid' => $project->uuid,
- // 'environment_name' => $environment->name,
- // 'application_uuid' => $application->uuid,
- // ]);
- // }
$application_deployment_queue = ApplicationDeploymentQueue::where('deployment_uuid', $deploymentUuid)->first();
if (! $application_deployment_queue) {
return redirect()->route('project.application.deployment.index', [
diff --git a/app/Livewire/Project/Application/Heading.php b/app/Livewire/Project/Application/Heading.php
index c48b676f1..0afc9123a 100644
--- a/app/Livewire/Project/Application/Heading.php
+++ b/app/Livewire/Project/Application/Heading.php
@@ -38,7 +38,7 @@ class Heading extends Component
{
$this->parameters = [
'project_uuid' => $this->application->project()->uuid,
- 'environment_name' => $this->application->environment->name,
+ 'environment_uuid' => $this->application->environment->uuid,
'application_uuid' => $this->application->uuid,
];
$lastDeployment = $this->application->get_last_successful_deployment();
diff --git a/app/Livewire/Project/Database/Configuration.php b/app/Livewire/Project/Database/Configuration.php
index 96dbec769..938abba54 100644
--- a/app/Livewire/Project/Database/Configuration.php
+++ b/app/Livewire/Project/Database/Configuration.php
@@ -24,7 +24,7 @@ class Configuration extends Component
->where('uuid', request()->route('project_uuid'))
->firstOrFail();
$environment = $project->environments()
- ->select('id', 'name', 'project_id')
+ ->select('id', 'name', 'project_id', 'uuid')
->where('uuid', request()->route('environment_uuid'))
->firstOrFail();
$database = $environment->databases()
diff --git a/app/Livewire/Project/Resource/Index.php b/app/Livewire/Project/Resource/Index.php
index 9146c65ed..2b199dcfd 100644
--- a/app/Livewire/Project/Resource/Index.php
+++ b/app/Livewire/Project/Resource/Index.php
@@ -4,6 +4,7 @@ namespace App\Livewire\Project\Resource;
use App\Models\Environment;
use App\Models\Project;
+use Illuminate\Support\Collection;
use Livewire\Component;
class Index extends Component
@@ -12,39 +13,42 @@ class Index extends Component
public Environment $environment;
- public $applications = [];
+ public Collection $applications;
- public $postgresqls = [];
+ public Collection $postgresqls;
- public $redis = [];
+ public Collection $redis;
- public $mongodbs = [];
+ public Collection $mongodbs;
- public $mysqls = [];
+ public Collection $mysqls;
- public $mariadbs = [];
+ public Collection $mariadbs;
- public $keydbs = [];
+ public Collection $keydbs;
- public $dragonflies = [];
+ public Collection $dragonflies;
- public $clickhouses = [];
+ public Collection $clickhouses;
- public $services = [];
+ public Collection $services;
public array $parameters;
public function mount()
{
+ $this->applications = $this->postgresqls = $this->redis = $this->mongodbs = $this->mysqls = $this->mariadbs = $this->keydbs = $this->dragonflies = $this->clickhouses = $this->services = collect();
$this->parameters = get_route_parameters();
- $project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
- if (! $project) {
- return redirect()->route('dashboard');
- }
- $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first();
- if (! $environment) {
- return redirect()->route('dashboard');
- }
+ $project = currentTeam()
+ ->projects()
+ ->select('id', 'uuid', 'team_id', 'name')
+ ->where('uuid', request()->route('project_uuid'))
+ ->firstOrFail();
+ $environment = $project->environments()
+ ->select('id', 'uuid', 'name', 'project_id')
+ ->where('uuid', request()->route('environment_uuid'))
+ ->firstOrFail();
+
$this->project = $project;
$this->environment = $environment->loadCount([
'applications',
@@ -69,9 +73,9 @@ class Index extends Component
])->get()->sortBy('name');
$this->applications = $this->applications->map(function ($application) {
$application->hrefLink = route('project.application.configuration', [
- 'project_uuid' => data_get($application, 'environment.project.uuid'),
- 'environment_uuid' => data_get($application, 'environment.uuid'),
- 'application_uuid' => data_get($application, 'uuid'),
+ 'project_uuid' => data_get($application, 'environment.project.uuid'),
+ 'environment_uuid' => data_get($application, 'environment.uuid'),
+ 'application_uuid' => data_get($application, 'uuid'),
]);
return $application;
@@ -89,14 +93,6 @@ class Index extends Component
'clickhouses' => 'clickhouses',
];
- // Load all server-related data first to prevent duplicate queries
- $serverData = $this->environment->applications()
- ->with(['destination.server.settings'])
- ->get()
- ->pluck('destination.server')
- ->filter()
- ->unique('id');
-
foreach ($databaseTypes as $property => $relation) {
$this->{$property} = $this->environment->{$relation}()->with([
'tags',
@@ -108,6 +104,7 @@ class Index extends Component
'database_uuid' => $db->uuid,
'environment_uuid' => data_get($this->environment, 'uuid'),
]);
+
return $db;
});
}
@@ -119,10 +116,11 @@ class Index extends Component
])->get()->sortBy('name');
$this->services = $this->services->map(function ($service) {
$service->hrefLink = route('project.service.configuration', [
- 'project_uuid' => data_get($service, 'environment.project.uuid'),
- 'environment_uuid' => data_get($service, 'environment.uuid'),
- 'service_uuid' => data_get($service, 'uuid'),
+ 'project_uuid' => data_get($service, 'environment.project.uuid'),
+ 'environment_uuid' => data_get($service, 'environment.uuid'),
+ 'service_uuid' => data_get($service, 'uuid'),
]);
+
return $service;
});
}
diff --git a/app/Livewire/Project/Service/Configuration.php b/app/Livewire/Project/Service/Configuration.php
index 99a0dea7f..4a5e8627f 100644
--- a/app/Livewire/Project/Service/Configuration.php
+++ b/app/Livewire/Project/Service/Configuration.php
@@ -52,8 +52,8 @@ class Configuration extends Component
->where('uuid', request()->route('project_uuid'))
->firstOrFail();
$environment = $project->environments()
- ->select('id', 'name', 'project_id')
- ->where('name', request()->route('environment_name'))
+ ->select('id', 'uuid', 'name', 'project_id')
+ ->where('uuid', request()->route('environment_uuid'))
->firstOrFail();
$this->service = $environment->services()->whereUuid(request()->route('service_uuid'))->firstOrFail();
diff --git a/app/Models/Environment.php b/app/Models/Environment.php
index 71e8bbd21..b8f1090d8 100644
--- a/app/Models/Environment.php
+++ b/app/Models/Environment.php
@@ -3,7 +3,6 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
-use Illuminate\Database\Eloquent\Model;
use OpenApi\Attributes as OA;
#[OA\Schema(
@@ -18,7 +17,7 @@ use OpenApi\Attributes as OA;
'description' => ['type' => 'string'],
]
)]
-class Environment extends Model
+class Environment extends BaseModel
{
protected $guarded = [];
diff --git a/app/Notifications/Application/StatusChanged.php b/app/Notifications/Application/StatusChanged.php
index 98cdc7ee6..669f6e584 100644
--- a/app/Notifications/Application/StatusChanged.php
+++ b/app/Notifications/Application/StatusChanged.php
@@ -17,6 +17,8 @@ class StatusChanged extends CustomEmailNotification
public string $environment_uuid;
+ public string $environment_name;
+
public ?string $resource_url = null;
public ?string $fqdn;
@@ -27,6 +29,7 @@ class StatusChanged extends CustomEmailNotification
$this->resource_name = data_get($resource, 'name');
$this->project_uuid = data_get($resource, 'environment.project.uuid');
$this->environment_uuid = data_get($resource, 'environment.uuid');
+ $this->environment_name = data_get($resource, 'environment.name');
$this->fqdn = data_get($resource, 'fqdn', null);
if (str($this->fqdn)->explode(',')->count() > 1) {
$this->fqdn = str($this->fqdn)->explode(',')->first();
@@ -80,7 +83,7 @@ class StatusChanged extends CustomEmailNotification
public function toPushover(): PushoverMessage
{
- $message = $this->resource_name . ' has been stopped.';
+ $message = $this->resource_name.' has been stopped.';
return new PushoverMessage(
title: 'Application stopped',
diff --git a/bootstrap/helpers/api.php b/bootstrap/helpers/api.php
index 875866e2f..307c7ed1b 100644
--- a/bootstrap/helpers/api.php
+++ b/bootstrap/helpers/api.php
@@ -166,6 +166,7 @@ function removeUnnecessaryFieldsFromRequest(Request $request)
{
$request->offsetUnset('project_uuid');
$request->offsetUnset('environment_name');
+ $request->offsetUnset('environment_uuid');
$request->offsetUnset('destination_uuid');
$request->offsetUnset('server_uuid');
$request->offsetUnset('type');
diff --git a/openapi.json b/openapi.json
index 5d35331ec..2834e0c8b 100644
--- a/openapi.json
+++ b/openapi.json
@@ -65,6 +65,7 @@
"project_uuid",
"server_uuid",
"environment_name",
+ "environment_uuid",
"git_repository",
"git_branch",
"build_pack",
@@ -81,7 +82,11 @@
},
"environment_name": {
"type": "string",
- "description": "The environment name."
+ "description": "The environment name. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "The environment UUID. You need to provide at least one of environment_name or environment_uuid."
},
"git_repository": {
"type": "string",
@@ -377,6 +382,7 @@
"project_uuid",
"server_uuid",
"environment_name",
+ "environment_uuid",
"github_app_uuid",
"git_repository",
"git_branch",
@@ -394,7 +400,11 @@
},
"environment_name": {
"type": "string",
- "description": "The environment name."
+ "description": "The environment name. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "The environment UUID. You need to provide at least one of environment_name or environment_uuid."
},
"github_app_uuid": {
"type": "string",
@@ -694,6 +704,7 @@
"project_uuid",
"server_uuid",
"environment_name",
+ "environment_uuid",
"private_key_uuid",
"git_repository",
"git_branch",
@@ -711,7 +722,11 @@
},
"environment_name": {
"type": "string",
- "description": "The environment name."
+ "description": "The environment name. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "The environment UUID. You need to provide at least one of environment_name or environment_uuid."
},
"private_key_uuid": {
"type": "string",
@@ -1011,6 +1026,7 @@
"project_uuid",
"server_uuid",
"environment_name",
+ "environment_uuid",
"dockerfile"
],
"properties": {
@@ -1024,7 +1040,11 @@
},
"environment_name": {
"type": "string",
- "description": "The environment name."
+ "description": "The environment name. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "The environment UUID. You need to provide at least one of environment_name or environment_uuid."
},
"dockerfile": {
"type": "string",
@@ -1257,6 +1277,7 @@
"project_uuid",
"server_uuid",
"environment_name",
+ "environment_uuid",
"docker_registry_image_name",
"ports_exposes"
],
@@ -1271,7 +1292,11 @@
},
"environment_name": {
"type": "string",
- "description": "The environment name."
+ "description": "The environment name. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "The environment UUID. You need to provide at least one of environment_name or environment_uuid."
},
"docker_registry_image_name": {
"type": "string",
@@ -1486,6 +1511,7 @@
"project_uuid",
"server_uuid",
"environment_name",
+ "environment_uuid",
"docker_compose_raw"
],
"properties": {
@@ -1499,7 +1525,11 @@
},
"environment_name": {
"type": "string",
- "description": "The environment name."
+ "description": "The environment name. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "The environment UUID. You need to provide at least one of environment_name or environment_uuid."
},
"docker_compose_raw": {
"type": "string",
@@ -3079,7 +3109,8 @@
"required": [
"server_uuid",
"project_uuid",
- "environment_name"
+ "environment_name",
+ "environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3092,7 +3123,11 @@
},
"environment_name": {
"type": "string",
- "description": "Name of the environment"
+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"postgres_user": {
"type": "string",
@@ -3215,7 +3250,8 @@
"required": [
"server_uuid",
"project_uuid",
- "environment_name"
+ "environment_name",
+ "environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3228,7 +3264,11 @@
},
"environment_name": {
"type": "string",
- "description": "Name of the environment"
+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"destination_uuid": {
"type": "string",
@@ -3335,7 +3375,8 @@
"required": [
"server_uuid",
"project_uuid",
- "environment_name"
+ "environment_name",
+ "environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3348,7 +3389,11 @@
},
"environment_name": {
"type": "string",
- "description": "Name of the environment"
+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"destination_uuid": {
"type": "string",
@@ -3451,7 +3496,8 @@
"required": [
"server_uuid",
"project_uuid",
- "environment_name"
+ "environment_name",
+ "environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3464,7 +3510,11 @@
},
"environment_name": {
"type": "string",
- "description": "Name of the environment"
+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"destination_uuid": {
"type": "string",
@@ -3571,7 +3621,8 @@
"required": [
"server_uuid",
"project_uuid",
- "environment_name"
+ "environment_name",
+ "environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3584,7 +3635,11 @@
},
"environment_name": {
"type": "string",
- "description": "Name of the environment"
+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"destination_uuid": {
"type": "string",
@@ -3691,7 +3746,8 @@
"required": [
"server_uuid",
"project_uuid",
- "environment_name"
+ "environment_name",
+ "environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3704,7 +3760,11 @@
},
"environment_name": {
"type": "string",
- "description": "Name of the environment"
+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"destination_uuid": {
"type": "string",
@@ -3823,7 +3883,8 @@
"required": [
"server_uuid",
"project_uuid",
- "environment_name"
+ "environment_name",
+ "environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3836,7 +3897,11 @@
},
"environment_name": {
"type": "string",
- "description": "Name of the environment"
+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"destination_uuid": {
"type": "string",
@@ -3955,7 +4020,8 @@
"required": [
"server_uuid",
"project_uuid",
- "environment_name"
+ "environment_name",
+ "environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3968,7 +4034,11 @@
},
"environment_name": {
"type": "string",
- "description": "Name of the environment"
+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"destination_uuid": {
"type": "string",
@@ -4808,14 +4878,14 @@
]
}
},
- "\/projects\/{uuid}\/{environment_name}": {
+ "\/projects\/{uuid}\/{environment_name_or_uuid}": {
"get": {
"tags": [
"Projects"
],
"summary": "Environment",
- "description": "Get environment by name.",
- "operationId": "get-environment-by-name",
+ "description": "Get environment by name or UUID.",
+ "operationId": "get-environment-by-name-or-uuid",
"parameters": [
{
"name": "uuid",
@@ -4827,9 +4897,9 @@
}
},
{
- "name": "environment_name",
+ "name": "environment_name_or_uuid",
"in": "path",
- "description": "Environment name",
+ "description": "Environment name or UUID",
"required": true,
"schema": {
"type": "string"
@@ -5724,6 +5794,7 @@
"server_uuid",
"project_uuid",
"environment_name",
+ "environment_uuid",
"type"
],
"properties": {
@@ -5835,7 +5906,11 @@
},
"environment_name": {
"type": "string",
- "description": "Environment name."
+ "description": "Environment name. You need to provide at least one of environment_name or environment_uuid."
+ },
+ "environment_uuid": {
+ "type": "string",
+ "description": "Environment UUID. You need to provide at least one of environment_name or environment_uuid."
},
"server_uuid": {
"type": "string",
@@ -7282,13 +7357,10 @@
"uuid": {
"type": "string"
},
- "application_id": {
- "type": "integer"
+ "resourceable_type": {
+ "type": "string"
},
- "service_id": {
- "type": "integer"
- },
- "database_id": {
+ "resourceable_id": {
"type": "integer"
},
"is_build_time": {
@@ -7684,174 +7756,14 @@
"type": "string",
"description": "The date and time the team was last updated."
},
- "smtp_enabled": {
- "type": "boolean",
- "description": "Whether SMTP is enabled or not."
- },
- "smtp_from_address": {
- "type": "string",
- "description": "The email address to send emails from."
- },
- "smtp_from_name": {
- "type": "string",
- "description": "The name to send emails from."
- },
- "smtp_recipients": {
- "type": "string",
- "description": "The email addresses to send emails to."
- },
- "smtp_host": {
- "type": "string",
- "description": "The SMTP host."
- },
- "smtp_port": {
- "type": "string",
- "description": "The SMTP port."
- },
- "smtp_encryption": {
- "type": "string",
- "description": "The SMTP encryption."
- },
- "smtp_username": {
- "type": "string",
- "description": "The SMTP username."
- },
- "smtp_password": {
- "type": "string",
- "description": "The SMTP password."
- },
- "smtp_timeout": {
- "type": "string",
- "description": "The SMTP timeout."
- },
- "smtp_notifications_test": {
- "type": "boolean",
- "description": "Whether to send test notifications via SMTP."
- },
- "smtp_notifications_deployments": {
- "type": "boolean",
- "description": "Whether to send deployment notifications via SMTP."
- },
- "smtp_notifications_status_changes": {
- "type": "boolean",
- "description": "Whether to send status change notifications via SMTP."
- },
- "smtp_notifications_scheduled_tasks": {
- "type": "boolean",
- "description": "Whether to send scheduled task notifications via SMTP."
- },
- "smtp_notifications_database_backups": {
- "type": "boolean",
- "description": "Whether to send database backup notifications via SMTP."
- },
- "smtp_notifications_server_disk_usage": {
- "type": "boolean",
- "description": "Whether to send server disk usage notifications via SMTP."
- },
- "discord_enabled": {
- "type": "boolean",
- "description": "Whether Discord is enabled or not."
- },
- "discord_webhook_url": {
- "type": "string",
- "description": "The Discord webhook URL."
- },
- "discord_notifications_test": {
- "type": "boolean",
- "description": "Whether to send test notifications via Discord."
- },
- "discord_notifications_deployments": {
- "type": "boolean",
- "description": "Whether to send deployment notifications via Discord."
- },
- "discord_notifications_status_changes": {
- "type": "boolean",
- "description": "Whether to send status change notifications via Discord."
- },
- "discord_notifications_database_backups": {
- "type": "boolean",
- "description": "Whether to send database backup notifications via Discord."
- },
- "discord_notifications_scheduled_tasks": {
- "type": "boolean",
- "description": "Whether to send scheduled task notifications via Discord."
- },
- "discord_notifications_server_disk_usage": {
- "type": "boolean",
- "description": "Whether to send server disk usage notifications via Discord."
- },
"show_boarding": {
"type": "boolean",
"description": "Whether to show the boarding screen or not."
},
- "resend_enabled": {
- "type": "boolean",
- "description": "Whether to enable resending or not."
- },
- "resend_api_key": {
- "type": "string",
- "description": "The resending API key."
- },
- "use_instance_email_settings": {
- "type": "boolean",
- "description": "Whether to use instance email settings or not."
- },
- "telegram_enabled": {
- "type": "boolean",
- "description": "Whether Telegram is enabled or not."
- },
- "telegram_token": {
- "type": "string",
- "description": "The Telegram token."
- },
- "telegram_chat_id": {
- "type": "string",
- "description": "The Telegram chat ID."
- },
- "telegram_notifications_test": {
- "type": "boolean",
- "description": "Whether to send test notifications via Telegram."
- },
- "telegram_notifications_deployments": {
- "type": "boolean",
- "description": "Whether to send deployment notifications via Telegram."
- },
- "telegram_notifications_status_changes": {
- "type": "boolean",
- "description": "Whether to send status change notifications via Telegram."
- },
- "telegram_notifications_database_backups": {
- "type": "boolean",
- "description": "Whether to send database backup notifications via Telegram."
- },
- "telegram_notifications_test_message_thread_id": {
- "type": "string",
- "description": "The Telegram test message thread ID."
- },
- "telegram_notifications_deployments_message_thread_id": {
- "type": "string",
- "description": "The Telegram deployment message thread ID."
- },
- "telegram_notifications_status_changes_message_thread_id": {
- "type": "string",
- "description": "The Telegram status change message thread ID."
- },
- "telegram_notifications_database_backups_message_thread_id": {
- "type": "string",
- "description": "The Telegram database backup message thread ID."
- },
"custom_server_limit": {
"type": "string",
"description": "The custom server limit."
},
- "telegram_notifications_scheduled_tasks": {
- "type": "boolean",
- "description": "Whether to send scheduled task notifications via Telegram."
- },
- "telegram_notifications_scheduled_tasks_thread_id": {
- "type": "string",
- "description": "The Telegram scheduled task message thread ID."
- },
"members": {
"description": "The members of the team.",
"type": "array",
diff --git a/openapi.yaml b/openapi.yaml
index 20bf34873..6be1b76f6 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -47,6 +47,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
+ - environment_uuid
- git_repository
- git_branch
- build_pack
@@ -60,7 +61,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
- description: 'The environment name.'
+ description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
git_repository:
type: string
description: 'The git repository URL.'
@@ -272,6 +276,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
+ - environment_uuid
- github_app_uuid
- git_repository
- git_branch
@@ -286,7 +291,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
- description: 'The environment name.'
+ description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
github_app_uuid:
type: string
description: 'The Github App UUID.'
@@ -501,6 +509,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
+ - environment_uuid
- private_key_uuid
- git_repository
- git_branch
@@ -515,7 +524,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
- description: 'The environment name.'
+ description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
private_key_uuid:
type: string
description: 'The private key UUID.'
@@ -730,6 +742,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
+ - environment_uuid
- dockerfile
properties:
project_uuid:
@@ -740,7 +753,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
- description: 'The environment name.'
+ description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
dockerfile:
type: string
description: 'The Dockerfile content.'
@@ -906,6 +922,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
+ - environment_uuid
- docker_registry_image_name
- ports_exposes
properties:
@@ -917,7 +934,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
- description: 'The environment name.'
+ description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
docker_registry_image_name:
type: string
description: 'The docker registry image name.'
@@ -1073,6 +1093,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
+ - environment_uuid
- docker_compose_raw
properties:
project_uuid:
@@ -1083,7 +1104,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
- description: 'The environment name.'
+ description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
docker_compose_raw:
type: string
description: 'The Docker Compose raw content.'
@@ -2137,6 +2161,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
+ - environment_uuid
properties:
server_uuid:
type: string
@@ -2146,7 +2171,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
- description: 'Name of the environment'
+ description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
postgres_user:
type: string
description: 'PostgreSQL user'
@@ -2235,6 +2263,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
+ - environment_uuid
properties:
server_uuid:
type: string
@@ -2244,7 +2273,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
- description: 'Name of the environment'
+ description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2321,6 +2353,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
+ - environment_uuid
properties:
server_uuid:
type: string
@@ -2330,7 +2363,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
- description: 'Name of the environment'
+ description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2404,6 +2440,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
+ - environment_uuid
properties:
server_uuid:
type: string
@@ -2413,7 +2450,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
- description: 'Name of the environment'
+ description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2490,6 +2530,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
+ - environment_uuid
properties:
server_uuid:
type: string
@@ -2499,7 +2540,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
- description: 'Name of the environment'
+ description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2576,6 +2620,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
+ - environment_uuid
properties:
server_uuid:
type: string
@@ -2585,7 +2630,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
- description: 'Name of the environment'
+ description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2671,6 +2719,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
+ - environment_uuid
properties:
server_uuid:
type: string
@@ -2680,7 +2729,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
- description: 'Name of the environment'
+ description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2766,6 +2818,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
+ - environment_uuid
properties:
server_uuid:
type: string
@@ -2775,7 +2828,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
- description: 'Name of the environment'
+ description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -3293,13 +3349,13 @@ paths:
security:
-
bearerAuth: []
- '/projects/{uuid}/{environment_name}':
+ '/projects/{uuid}/{environment_name_or_uuid}':
get:
tags:
- Projects
summary: Environment
- description: 'Get environment by name.'
- operationId: get-environment-by-name
+ description: 'Get environment by name or UUID.'
+ operationId: get-environment-by-name-or-uuid
parameters:
-
name: uuid
@@ -3309,9 +3365,9 @@ paths:
schema:
type: string
-
- name: environment_name
+ name: environment_name_or_uuid
in: path
- description: 'Environment name'
+ description: 'Environment name or UUID'
required: true
schema:
type: string
@@ -3872,6 +3928,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
+ - environment_uuid
- type
properties:
type:
@@ -3891,7 +3948,10 @@ paths:
description: 'Project UUID.'
environment_name:
type: string
- description: 'Environment name.'
+ description: 'Environment name. You need to provide at least one of environment_name or environment_uuid.'
+ environment_uuid:
+ type: string
+ description: 'Environment UUID. You need to provide at least one of environment_name or environment_uuid.'
server_uuid:
type: string
description: 'Server UUID.'
@@ -4856,11 +4916,9 @@ components:
type: integer
uuid:
type: string
- application_id:
- type: integer
- service_id:
- type: integer
- database_id:
+ resourceable_type:
+ type: string
+ resourceable_id:
type: integer
is_build_time:
type: boolean
@@ -5139,132 +5197,12 @@ components:
updated_at:
type: string
description: 'The date and time the team was last updated.'
- smtp_enabled:
- type: boolean
- description: 'Whether SMTP is enabled or not.'
- smtp_from_address:
- type: string
- description: 'The email address to send emails from.'
- smtp_from_name:
- type: string
- description: 'The name to send emails from.'
- smtp_recipients:
- type: string
- description: 'The email addresses to send emails to.'
- smtp_host:
- type: string
- description: 'The SMTP host.'
- smtp_port:
- type: string
- description: 'The SMTP port.'
- smtp_encryption:
- type: string
- description: 'The SMTP encryption.'
- smtp_username:
- type: string
- description: 'The SMTP username.'
- smtp_password:
- type: string
- description: 'The SMTP password.'
- smtp_timeout:
- type: string
- description: 'The SMTP timeout.'
- smtp_notifications_test:
- type: boolean
- description: 'Whether to send test notifications via SMTP.'
- smtp_notifications_deployments:
- type: boolean
- description: 'Whether to send deployment notifications via SMTP.'
- smtp_notifications_status_changes:
- type: boolean
- description: 'Whether to send status change notifications via SMTP.'
- smtp_notifications_scheduled_tasks:
- type: boolean
- description: 'Whether to send scheduled task notifications via SMTP.'
- smtp_notifications_database_backups:
- type: boolean
- description: 'Whether to send database backup notifications via SMTP.'
- smtp_notifications_server_disk_usage:
- type: boolean
- description: 'Whether to send server disk usage notifications via SMTP.'
- discord_enabled:
- type: boolean
- description: 'Whether Discord is enabled or not.'
- discord_webhook_url:
- type: string
- description: 'The Discord webhook URL.'
- discord_notifications_test:
- type: boolean
- description: 'Whether to send test notifications via Discord.'
- discord_notifications_deployments:
- type: boolean
- description: 'Whether to send deployment notifications via Discord.'
- discord_notifications_status_changes:
- type: boolean
- description: 'Whether to send status change notifications via Discord.'
- discord_notifications_database_backups:
- type: boolean
- description: 'Whether to send database backup notifications via Discord.'
- discord_notifications_scheduled_tasks:
- type: boolean
- description: 'Whether to send scheduled task notifications via Discord.'
- discord_notifications_server_disk_usage:
- type: boolean
- description: 'Whether to send server disk usage notifications via Discord.'
show_boarding:
type: boolean
description: 'Whether to show the boarding screen or not.'
- resend_enabled:
- type: boolean
- description: 'Whether to enable resending or not.'
- resend_api_key:
- type: string
- description: 'The resending API key.'
- use_instance_email_settings:
- type: boolean
- description: 'Whether to use instance email settings or not.'
- telegram_enabled:
- type: boolean
- description: 'Whether Telegram is enabled or not.'
- telegram_token:
- type: string
- description: 'The Telegram token.'
- telegram_chat_id:
- type: string
- description: 'The Telegram chat ID.'
- telegram_notifications_test:
- type: boolean
- description: 'Whether to send test notifications via Telegram.'
- telegram_notifications_deployments:
- type: boolean
- description: 'Whether to send deployment notifications via Telegram.'
- telegram_notifications_status_changes:
- type: boolean
- description: 'Whether to send status change notifications via Telegram.'
- telegram_notifications_database_backups:
- type: boolean
- description: 'Whether to send database backup notifications via Telegram.'
- telegram_notifications_test_message_thread_id:
- type: string
- description: 'The Telegram test message thread ID.'
- telegram_notifications_deployments_message_thread_id:
- type: string
- description: 'The Telegram deployment message thread ID.'
- telegram_notifications_status_changes_message_thread_id:
- type: string
- description: 'The Telegram status change message thread ID.'
- telegram_notifications_database_backups_message_thread_id:
- type: string
- description: 'The Telegram database backup message thread ID.'
custom_server_limit:
type: string
description: 'The custom server limit.'
- telegram_notifications_scheduled_tasks:
- type: boolean
- description: 'Whether to send scheduled task notifications via Telegram.'
- telegram_notifications_scheduled_tasks_thread_id:
- type: string
- description: 'The Telegram scheduled task message thread ID.'
members:
description: 'The members of the team.'
type: array
diff --git a/resources/views/components/resources/breadcrumbs.blade.php b/resources/views/components/resources/breadcrumbs.blade.php
index 940975755..5f7029fd0 100644
--- a/resources/views/components/resources/breadcrumbs.blade.php
+++ b/resources/views/components/resources/breadcrumbs.blade.php
@@ -21,7 +21,10 @@
{{ data_get($resource, 'environment.name') }}
+ href="{{ route('project.resource.index', [
+ 'environment_uuid' => data_get($resource, 'environment.uuid'),
+ 'project_uuid' => data_get($resource, 'environment.project.uuid'),
+ ]) }}">{{ data_get($resource, 'environment.name') }}
- @if($project->environments->first())
+ @if ($project->environments->first())
+ Add Resource
diff --git a/resources/views/livewire/project/application/configuration.blade.php b/resources/views/livewire/project/application/configuration.blade.php
index 7827476d8..b8f4b96f6 100644
--- a/resources/views/livewire/project/application/configuration.blade.php
+++ b/resources/views/livewire/project/application/configuration.blade.php
@@ -9,31 +9,31 @@
@if ($application->destination->server->isSwarm())
@endif
@if ($application->git_based())
@endif
diff --git a/resources/views/livewire/project/database/configuration.blade.php b/resources/views/livewire/project/database/configuration.blade.php
index b0702c24a..8575f34b6 100644
--- a/resources/views/livewire/project/database/configuration.blade.php
+++ b/resources/views/livewire/project/database/configuration.blade.php
@@ -8,38 +8,37 @@
-
diff --git a/resources/views/livewire/project/resource/index.blade.php b/resources/views/livewire/project/resource/index.blade.php
index 8973177f8..7e2647e34 100644
--- a/resources/views/livewire/project/resource/index.blade.php
+++ b/resources/views/livewire/project/resource/index.blade.php
@@ -211,7 +211,7 @@
},
goto(item) {
const hrefLink = item.hrefLink;
- window.location.href = `${hrefLink}#tags`;
+ window.location.href = `${hrefLink}/tags`;
},
filterAndSort(items) {
if (this.search === '') {
diff --git a/resources/views/livewire/project/service/configuration.blade.php b/resources/views/livewire/project/service/configuration.blade.php
index d52d3c4b6..196e7f2fd 100644
--- a/resources/views/livewire/project/service/configuration.blade.php
+++ b/resources/views/livewire/project/service/configuration.blade.php
@@ -9,30 +9,30 @@
@@ -95,7 +95,7 @@
+ href="{{ route('project.service.index', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'service_uuid' => $service->uuid, 'stack_service_uuid' => $application->uuid]) }}">
Settings
@if (str($application->status)->contains('running'))
@@ -143,12 +143,12 @@
@if ($database->isBackupSolutionAvailable())
+ href="{{ route('project.service.index', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'service_uuid' => $service->uuid, 'stack_service_uuid' => $database->uuid]) }}#backups">
Backups
@endif
+ href="{{ route('project.service.index', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'service_uuid' => $service->uuid, 'stack_service_uuid' => $database->uuid]) }}">
Settings
@if (str($database->status)->contains('running'))
diff --git a/resources/views/livewire/project/service/storage.blade.php b/resources/views/livewire/project/service/storage.blade.php
index 7c1291dc5..a51684708 100644
--- a/resources/views/livewire/project/service/storage.blade.php
+++ b/resources/views/livewire/project/service/storage.blade.php
@@ -7,7 +7,8 @@
$resource->getMorphClass() == 'App\Models\StandaloneKeydb' ||
$resource->getMorphClass() == 'App\Models\StandaloneDragonfly' ||
$resource->getMorphClass() == 'App\Models\StandaloneClickhouse' ||
- $resource->getMorphClass() == 'App\Models\StandaloneMongodb')
+ $resource->getMorphClass() == 'App\Models\StandaloneMongodb' ||
+ $resource->getMorphClass() == 'App\Models\StandaloneMysql')
Storages
middleware(['api.ability:read']);
Route::get('/projects/{uuid}', [ProjectController::class, 'project_by_uuid'])->middleware(['api.ability:read']);
- Route::get('/projects/{uuid}/{environment_uuid}', [ProjectController::class, 'environment_details'])->middleware(['api.ability:read']);
+ Route::get('/projects/{uuid}/{environment_name_or_uuid}', [ProjectController::class, 'environment_details'])->middleware(['api.ability:read']);
Route::post('/projects', [ProjectController::class, 'create_project'])->middleware(['api.ability:read']);
Route::patch('/projects/{uuid}', [ProjectController::class, 'update_project'])->middleware(['api.ability:write']);