@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 15/60] 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 16/60] 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 17/60] 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 18/60] 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 19/60] 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 20/60] 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 21/60] 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 22/60] 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 c5f365e38442576d4b5e11bef580fd3362d68cb0 Mon Sep 17 00:00:00 2001
From: Zao Soula
Date: Thu, 12 Dec 2024 19:39:11 +0100
Subject: [PATCH 23/60] feat: add infomaniak oauth
---
app/Providers/EventServiceProvider.php | 2 +
bootstrap/helpers/socialite.php | 1 +
composer.json | 1 +
composer.lock | 53 ++++++++++++++++++++++++-
database/seeders/OauthSettingSeeder.php | 1 +
lang/ar.json | 1 +
lang/cs.json | 1 +
lang/de.json | 1 +
lang/en.json | 1 +
lang/es.json | 3 +-
lang/fa.json | 1 +
lang/fr.json | 1 +
lang/it.json | 1 +
lang/ja.json | 1 +
lang/pt.json | 1 +
lang/ro.json | 1 +
lang/tr.json | 1 +
lang/vi.json | 1 +
lang/zh-cn.json | 1 +
lang/zh-tw.json | 1 +
20 files changed, 73 insertions(+), 2 deletions(-)
diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php
index aa3579f8d..428f78cb5 100644
--- a/app/Providers/EventServiceProvider.php
+++ b/app/Providers/EventServiceProvider.php
@@ -11,6 +11,7 @@ use Illuminate\Foundation\Events\MaintenanceModeEnabled;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use SocialiteProviders\Authentik\AuthentikExtendSocialite;
use SocialiteProviders\Azure\AzureExtendSocialite;
+use SocialiteProviders\Infomaniak\InfomaniakExtendSocialite;
use SocialiteProviders\Manager\SocialiteWasCalled;
class EventServiceProvider extends ServiceProvider
@@ -25,6 +26,7 @@ class EventServiceProvider extends ServiceProvider
SocialiteWasCalled::class => [
AzureExtendSocialite::class.'@handle',
AuthentikExtendSocialite::class.'@handle',
+ InfomaniakExtendSocialite::class.'@handle',
],
ProxyStarted::class => [
ProxyStartedNotification::class,
diff --git a/bootstrap/helpers/socialite.php b/bootstrap/helpers/socialite.php
index 130227e81..09dffb78a 100644
--- a/bootstrap/helpers/socialite.php
+++ b/bootstrap/helpers/socialite.php
@@ -40,6 +40,7 @@ function get_socialite_provider(string $provider)
'github' => \Laravel\Socialite\Two\GithubProvider::class,
'gitlab' => \Laravel\Socialite\Two\GitlabProvider::class,
'google' => \Laravel\Socialite\Two\GoogleProvider::class,
+ 'infomaniak' => \SocialiteProviders\Infomaniak\Provider::class,
];
return Socialite::buildProvider(
diff --git a/composer.json b/composer.json
index b8dc354c3..8e8ad0a4b 100644
--- a/composer.json
+++ b/composer.json
@@ -40,6 +40,7 @@
"resend/resend-laravel": "^0.15.0",
"sentry/sentry-laravel": "^4.6",
"socialiteproviders/authentik": "^5.2",
+ "socialiteproviders/infomaniak": "^4.0",
"socialiteproviders/microsoft-azure": "^5.1",
"spatie/laravel-activitylog": "^4.7.3",
"spatie/laravel-data": "^4.11",
diff --git a/composer.lock b/composer.lock
index 3fbe72afb..50d64cba2 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "871067cb42e6347ca53ff36e81ac5079",
+ "content-hash": "5517a7becb5d31fa2ef3ecfaea06f7a7",
"packages": [
{
"name": "3sidedcube/laravel-redoc",
@@ -7467,6 +7467,57 @@
},
"time": "2023-11-07T22:21:16+00:00"
},
+ {
+ "name": "socialiteproviders/infomaniak",
+ "version": "4.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/SocialiteProviders/Infomaniak.git",
+ "reference": "9796ad686204443bfdf3ff19a6c409e8771667e1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/SocialiteProviders/Infomaniak/zipball/9796ad686204443bfdf3ff19a6c409e8771667e1",
+ "reference": "9796ad686204443bfdf3ff19a6c409e8771667e1",
+ "shasum": ""
+ },
+ "require": {
+ "ext-json": "*",
+ "php": "^8.0",
+ "socialiteproviders/manager": "^4.4"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "SocialiteProviders\\Infomaniak\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Leopold Jacquot",
+ "email": "leopold.jacquot@infomaniak.com"
+ }
+ ],
+ "description": "Infomaniak OAuth2 Provider for Laravel Socialite",
+ "keywords": [
+ "infomaniak",
+ "laravel",
+ "oauth",
+ "oauth2",
+ "provider",
+ "socialite"
+ ],
+ "support": {
+ "docs": "https://socialiteproviders.com/qq",
+ "issues": "https://github.com/socialiteproviders/providers/issues",
+ "source": "https://github.com/socialiteproviders/providers"
+ },
+ "time": "2024-11-20T05:42:36+00:00"
+ },
{
"name": "socialiteproviders/manager",
"version": "v4.7.0",
diff --git a/database/seeders/OauthSettingSeeder.php b/database/seeders/OauthSettingSeeder.php
index bf902175f..f219aecc0 100644
--- a/database/seeders/OauthSettingSeeder.php
+++ b/database/seeders/OauthSettingSeeder.php
@@ -19,6 +19,7 @@ class OauthSettingSeeder extends Seeder
'gitlab',
'google',
'authentik',
+ 'infomaniak',
]);
$isOauthSeeded = OauthSetting::count() > 0;
diff --git a/lang/ar.json b/lang/ar.json
index 4b9afbe99..b473318d3 100644
--- a/lang/ar.json
+++ b/lang/ar.json
@@ -5,6 +5,7 @@
"auth.login.github": "تسجيل الدخول باستخدام GitHub",
"auth.login.gitlab": "تسجيل الدخول باستخدام Gitlab",
"auth.login.google": "تسجيل الدخول باستخدام Google",
+ "auth.login.infomaniak": "تسجيل الدخول باستخدام Infomaniak",
"auth.already_registered": "هل سبق لك التسجيل؟",
"auth.confirm_password": "تأكيد كلمة المرور",
"auth.forgot_password": "نسيت كلمة المرور",
diff --git a/lang/cs.json b/lang/cs.json
index 48b47b06a..270fd272b 100644
--- a/lang/cs.json
+++ b/lang/cs.json
@@ -5,6 +5,7 @@
"auth.login.github": "Přihlásit se pomocí GitHubu",
"auth.login.gitlab": "Přihlásit se pomocí Gitlabu",
"auth.login.google": "Přihlásit se pomocí Google",
+ "auth.login.infomaniak": "Přihlásit se pomocí Infomaniak",
"auth.already_registered": "Již jste registrováni?",
"auth.confirm_password": "Potvrďte heslo",
"auth.forgot_password": "Zapomněli jste heslo",
diff --git a/lang/de.json b/lang/de.json
index 29fec629f..c5644e3a7 100644
--- a/lang/de.json
+++ b/lang/de.json
@@ -5,6 +5,7 @@
"auth.login.github": "Mit GitHub anmelden",
"auth.login.gitlab": "Mit GitLab anmelden",
"auth.login.google": "Mit Google anmelden",
+ "auth.login.infomaniak": "Mit Infomaniak anmelden",
"auth.already_registered": "Bereits registriert?",
"auth.confirm_password": "Passwort bestätigen",
"auth.forgot_password": "Passwort vergessen",
diff --git a/lang/en.json b/lang/en.json
index 4e0749ece..cdca68601 100644
--- a/lang/en.json
+++ b/lang/en.json
@@ -6,6 +6,7 @@
"auth.login.github": "Login with GitHub",
"auth.login.gitlab": "Login with Gitlab",
"auth.login.google": "Login with Google",
+ "auth.login.infomaniak": "Login with Infomaniak",
"auth.already_registered": "Already registered?",
"auth.confirm_password": "Confirm password",
"auth.forgot_password": "Forgot password",
diff --git a/lang/es.json b/lang/es.json
index 0d8c0c940..aceacd462 100644
--- a/lang/es.json
+++ b/lang/es.json
@@ -5,6 +5,7 @@
"auth.login.github": "Acceder con GitHub",
"auth.login.gitlab": "Acceder con Gitlab",
"auth.login.google": "Acceder con Google",
+ "auth.login.infomaniak": "Acceder con Infomaniak",
"auth.already_registered": "¿Ya estás registrado?",
"auth.confirm_password": "Confirmar contraseña",
"auth.forgot_password": "¿Olvidaste tu contraseña?",
@@ -27,4 +28,4 @@
"input.recovery_code": "Código de recuperación",
"button.save": "Guardar",
"repository.url": "Examples
Para repositorios públicos, usar https://....
Para repositorios privados, usar git@....
https://github.com/coollabsio/coolify-examples main la rama 'main' será seleccionada.
https://github.com/coollabsio/coolify-examples/tree/nodejs-fastify nodejs-fastify la rama 'nodejs-fastify' será seleccionada.
https://gitea.com/sedlav/expressjs.git main la rama 'main' será seleccionada.
https://gitlab.com/andrasbacsai/nodejs-example.git main la rama 'main' será seleccionada."
-}
\ No newline at end of file
+}
diff --git a/lang/fa.json b/lang/fa.json
index d0ecc4a3b..7a714e626 100644
--- a/lang/fa.json
+++ b/lang/fa.json
@@ -5,6 +5,7 @@
"auth.login.github": "ورود با گیت هاب",
"auth.login.gitlab": "ورود با گیت لب",
"auth.login.google": "ورود با گوگل",
+ "auth.login.infomaniak": "ورود با Infomaniak",
"auth.already_registered": "قبلاً ثبت نام کردهاید؟",
"auth.confirm_password": "تایید رمز عبور",
"auth.forgot_password": "فراموشی رمز عبور",
diff --git a/lang/fr.json b/lang/fr.json
index dbd5a1bf7..a94d633d3 100644
--- a/lang/fr.json
+++ b/lang/fr.json
@@ -5,6 +5,7 @@
"auth.login.github": "Connexion avec GitHub",
"auth.login.gitlab": "Connexion avec Gitlab",
"auth.login.google": "Connexion avec Google",
+ "auth.login.infomaniak": "Connexion avec Infomaniak",
"auth.already_registered": "Déjà enregistré ?",
"auth.confirm_password": "Confirmer le mot de passe",
"auth.forgot_password": "Mot de passe oublié",
diff --git a/lang/it.json b/lang/it.json
index 6e4feb9cc..30b9f3902 100644
--- a/lang/it.json
+++ b/lang/it.json
@@ -5,6 +5,7 @@
"auth.login.github": "Accedi con GitHub",
"auth.login.gitlab": "Accedi con Gitlab",
"auth.login.google": "Accedi con Google",
+ "auth.login.infomaniak": "Accedi con Infomaniak",
"auth.already_registered": "Già registrato?",
"auth.confirm_password": "Conferma password",
"auth.forgot_password": "Password dimenticata",
diff --git a/lang/ja.json b/lang/ja.json
index 4652a3b17..4d4589900 100644
--- a/lang/ja.json
+++ b/lang/ja.json
@@ -5,6 +5,7 @@
"auth.login.github": "GitHubでログイン",
"auth.login.gitlab": "Gitlabでログイン",
"auth.login.google": "Googleでログイン",
+ "auth.login.infomaniak": "Infomaniakでログイン",
"auth.already_registered": "すでに登録済みですか?",
"auth.confirm_password": "パスワードを確認",
"auth.forgot_password": "パスワードを忘れた",
diff --git a/lang/pt.json b/lang/pt.json
index b5dd5c434..c5f393e65 100644
--- a/lang/pt.json
+++ b/lang/pt.json
@@ -5,6 +5,7 @@
"auth.login.github": "Entrar com GitHub",
"auth.login.gitlab": "Entrar com Gitlab",
"auth.login.google": "Entrar com Google",
+ "auth.login.infomaniak": "Entrar com Infomaniak",
"auth.already_registered": "Já tem uma conta?",
"auth.confirm_password": "Confirmar senha",
"auth.forgot_password": "Esqueceu a senha?",
diff --git a/lang/ro.json b/lang/ro.json
index db1aa85db..4c7968cfa 100644
--- a/lang/ro.json
+++ b/lang/ro.json
@@ -5,6 +5,7 @@
"auth.login.github": "Autentificare prin GitHub",
"auth.login.gitlab": "Autentificare prin Gitlab",
"auth.login.google": "Autentificare prin Google",
+ "auth.login.infomaniak": "Autentificare prin Infomaniak",
"auth.already_registered": "Sunteți deja înregistrat?",
"auth.confirm_password": "Confirmați parola",
"auth.forgot_password": "Ați uitat parola",
diff --git a/lang/tr.json b/lang/tr.json
index 255b0d15b..3cbcee409 100644
--- a/lang/tr.json
+++ b/lang/tr.json
@@ -5,6 +5,7 @@
"auth.login.github": "GitHub ile Giriş Yap",
"auth.login.gitlab": "GitLab ile Giriş Yap",
"auth.login.google": "Google ile Giriş Yap",
+ "auth.login.infomaniak": "Infomaniak ile Giriş Yap",
"auth.already_registered": "Zaten kayıtlı mısınız?",
"auth.confirm_password": "Şifreyi Onayla",
"auth.forgot_password": "Şifremi Unuttum",
diff --git a/lang/vi.json b/lang/vi.json
index 548dbe8b7..bb43fd34d 100644
--- a/lang/vi.json
+++ b/lang/vi.json
@@ -5,6 +5,7 @@
"auth.login.github": "Đăng Nhập Bằng GitHub",
"auth.login.gitlab": "Đăng Nhập Bằng Gitlab",
"auth.login.google": "Đăng Nhập Bằng Google",
+ "auth.login.infomaniak": "Đăng Nhập Bằng Infomaniak",
"auth.already_registered": "Đã đăng ký?",
"auth.confirm_password": "Nhập lại mật khẩu",
"auth.forgot_password": "Quên mật khẩu",
diff --git a/lang/zh-cn.json b/lang/zh-cn.json
index 70c457fa8..944887a5f 100644
--- a/lang/zh-cn.json
+++ b/lang/zh-cn.json
@@ -5,6 +5,7 @@
"auth.login.github": "使用 GitHub 登录",
"auth.login.gitlab": "使用 Gitlab 登录",
"auth.login.google": "使用 Google 登录",
+ "auth.login.infomaniak": "使用 Infomaniak 登录",
"auth.already_registered": "已经注册?",
"auth.confirm_password": "确认密码",
"auth.forgot_password": "忘记密码",
diff --git a/lang/zh-tw.json b/lang/zh-tw.json
index 63956f7a1..c42ebb33e 100644
--- a/lang/zh-tw.json
+++ b/lang/zh-tw.json
@@ -5,6 +5,7 @@
"auth.login.github": "使用 GitHub 登入",
"auth.login.gitlab": "使用 Gitlab 登入",
"auth.login.google": "使用 Google 登入",
+ "auth.login.infomaniak": "使用 Infomaniak 登入",
"auth.already_registered": "已經註冊?",
"auth.confirm_password": "確認密碼",
"auth.forgot_password": "忘記密碼",
From fcdec3a80df96cd0f3793c3fcae2306d8d23d43e Mon Sep 17 00:00:00 2001
From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com>
Date: Sun, 15 Dec 2024 15:09:58 +0100
Subject: [PATCH 24/60] fix: unreachable notifications
---
app/Models/Server.php | 52 +++++++++++++++++++++++++++++++++++++++----
1 file changed, 48 insertions(+), 4 deletions(-)
diff --git a/app/Models/Server.php b/app/Models/Server.php
index cc8211789..1e4413d20 100644
--- a/app/Models/Server.php
+++ b/app/Models/Server.php
@@ -1024,14 +1024,58 @@ $schema://$host {
$this->refresh();
$unreachableNotificationSent = (bool) $this->unreachable_notification_sent;
$isReachable = (bool) $this->settings->is_reachable;
- // If the server is reachable, send the reachable notification if it was sent before
+
+ ray('Server Reachability Check', [
+ 'server_id' => $this->id,
+ 'unreachable_notification_sent' => $unreachableNotificationSent,
+ 'is_reachable' => $isReachable,
+ 'unreachable_count' => $this->unreachable_count,
+ ]);
+
if ($isReachable === true) {
+ ray('Server is reachable - resetting counts');
+ $this->unreachable_count = 0;
+ $this->save();
+
if ($unreachableNotificationSent === true) {
+ ray('Sending reachable notification');
$this->sendReachableNotification();
}
- } else {
- // If the server is unreachable, send the unreachable notification if it was not sent before
- if ($unreachableNotificationSent === false) {
+
+ return;
+ }
+
+ ray('Server is not reachable - incrementing count');
+ $this->increment('unreachable_count');
+ ray('Unreachable count: '.$this->unreachable_count);
+ if ($this->unreachable_count === 1) {
+ $this->settings->is_reachable = true;
+ $this->settings->saveQuietly();
+
+ return;
+ }
+
+ if ($this->unreachable_count >= 2 && ! $unreachableNotificationSent) {
+ ray('Starting additional checks', [
+ 'unreachable_count' => $this->unreachable_count,
+ ]);
+ $failedChecks = 0;
+ for ($i = 0; $i < 2; $i++) {
+ sleep(5);
+ $status = $this->status();
+ ray('Check attempt '.($i + 1), ['status' => $status]);
+ if (! $status) {
+ $failedChecks++;
+ }
+ }
+
+ ray('Additional checks complete', [
+ 'failed_checks' => $failedChecks,
+ 'will_send_notification' => ($failedChecks === 2 && ! $unreachableNotificationSent),
+ ]);
+
+ if ($failedChecks === 2 && ! $unreachableNotificationSent) {
+ ray('Sending unreachable notification');
$this->sendUnreachableNotification();
}
}
From 46f99347b89dd788da67a930aa7d1ff4e44d6f56 Mon Sep 17 00:00:00 2001
From: ShadowArcanist
Date: Sun, 15 Dec 2024 22:34:09 +0530
Subject: [PATCH 25/60] Added missing Discord Env for Outline one click service
template
---
templates/compose/getoutline.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/templates/compose/getoutline.yaml b/templates/compose/getoutline.yaml
index ae8d26682..8c15d8499 100644
--- a/templates/compose/getoutline.yaml
+++ b/templates/compose/getoutline.yaml
@@ -57,6 +57,10 @@ services:
- GITHUB_APP_NAME=${GITHUB_APP_NAME}
- GITHUB_APP_ID=${GITHUB_APP_ID}
- GITHUB_APP_PRIVATE_KEY=${GITHUB_APP_PRIVATE_KEY}
+ - DISCORD_CLIENT_ID=${DISCORD_CLIENT_ID}
+ - DISCORD_CLIENT_SECRET=${DISCORD_CLIENT_SECRET}
+ - DISCORD_SERVER_ID=${DISCORD_SERVER_ID}
+ - DISCORD_SERVER_ROLES=${DISCORD_SERVER_ROLES}
- PGSSLMODE=${PGSSLMODE:-disable}
- FORCE_HTTPS=${FORCE_HTTPS:-true}
healthcheck:
From c4cee62ff6ccc5a93e7c51e0e8377f0e5f9929ed Mon Sep 17 00:00:00 2001
From: Andras Bacsai
Date: Mon, 16 Dec 2024 09:45:47 +0100
Subject: [PATCH 26/60] version++
---
config/constants.php | 2 +-
versions.json | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/config/constants.php b/config/constants.php
index a8a70235b..99859ffb8 100644
--- a/config/constants.php
+++ b/config/constants.php
@@ -2,7 +2,7 @@
return [
'coolify' => [
- 'version' => '4.0.0-beta.379',
+ 'version' => '4.0.0-beta.380',
'self_hosted' => env('SELF_HOSTED', true),
'autoupdate' => env('AUTOUPDATE'),
'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'),
diff --git a/versions.json b/versions.json
index c5f41a4db..d00272987 100644
--- a/versions.json
+++ b/versions.json
@@ -1,10 +1,10 @@
{
"coolify": {
"v4": {
- "version": "4.0.0-beta.379"
+ "version": "4.0.0-beta.380"
},
"nightly": {
- "version": "4.0.0-beta.380"
+ "version": "4.0.0-beta.381"
},
"helper": {
"version": "1.0.4"
From 65ba6b947a78b5f9638a1ed5c465fbedde80637c Mon Sep 17 00:00:00 2001
From: Andras Bacsai
Date: Mon, 16 Dec 2024 09:48:41 +0100
Subject: [PATCH 27/60] fix: oauthseeder
---
database/seeders/OauthSettingSeeder.php | 80 +++++++++++--------------
1 file changed, 36 insertions(+), 44 deletions(-)
diff --git a/database/seeders/OauthSettingSeeder.php b/database/seeders/OauthSettingSeeder.php
index bf902175f..df7619fec 100644
--- a/database/seeders/OauthSettingSeeder.php
+++ b/database/seeders/OauthSettingSeeder.php
@@ -4,6 +4,7 @@ namespace Database\Seeders;
use App\Models\OauthSetting;
use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\Log;
class OauthSettingSeeder extends Seeder
{
@@ -12,62 +13,53 @@ class OauthSettingSeeder extends Seeder
*/
public function run(): void
{
- $providers = collect([
- 'azure',
- 'bitbucket',
- 'github',
- 'gitlab',
- 'google',
- 'authentik',
- ]);
+ try {
+ $providers = collect([
+ 'azure',
+ 'bitbucket',
+ 'github',
+ 'gitlab',
+ 'google',
+ 'authentik',
+ ]);
- $isOauthSeeded = OauthSetting::count() > 0;
+ $isOauthSeeded = OauthSetting::count() > 0;
- // We changed how providers are defined in the database, so we authentik does not exists, we need to recreate all of the auth providers
- // Before authentik was a provider, providers started with 0 id
+ // We changed how providers are defined in the database, so we authentik does not exists, we need to recreate all of the auth providers
+ // Before authentik was a provider, providers started with 0 id
- $isOauthAuthentik = OauthSetting::where('provider', 'authentik')->exists();
- if ($isOauthSeeded) {
- if (! $isOauthAuthentik) {
- $allProviders = OauthSetting::all();
- $notFoundProviders = $providers->diff($allProviders->pluck('provider'));
-
- $allProviders->each(function ($provider) {
- $provider->delete();
- });
- $allProviders->each(function ($provider) use ($providers) {
- $providerName = $provider->provider;
-
- $foundProvider = $providers->first(function ($provider) use ($providerName) {
- return $provider === $providerName;
- });
-
- if ($foundProvider) {
- $newProvder = new OauthSetting;
- $newProvder = $provider;
- unset($newProvder->id);
- $newProvder->save();
- }
- });
-
- foreach ($notFoundProviders as $provider) {
- OauthSetting::create([
- 'provider' => $provider,
- ]);
- }
- } else {
+ $isOauthAuthentik = OauthSetting::where('provider', 'authentik')->exists();
+ if (! $isOauthSeeded || $isOauthAuthentik) {
foreach ($providers as $provider) {
OauthSetting::updateOrCreate([
'provider' => $provider,
]);
}
+
+ return;
}
- } else {
- foreach ($providers as $provider) {
- OauthSetting::updateOrCreate([
+
+ $allProviders = OauthSetting::all();
+ $notFoundProviders = $providers->diff($allProviders->pluck('provider'));
+
+ $allProviders->each(function ($provider) {
+ $provider->delete();
+ });
+ $allProviders->each(function ($provider) {
+ $provider = new OauthSetting;
+ $provider->provider = $provider->provider;
+ unset($provider->id);
+ $provider->save();
+ });
+
+ foreach ($notFoundProviders as $provider) {
+ OauthSetting::create([
'provider' => $provider,
]);
}
+
+ } catch (\Exception $e) {
+ Log::error($e->getMessage());
}
}
}
From acf10f39f33d7a499d7a9320c2d34f3b7d1e0390 Mon Sep 17 00:00:00 2001
From: Andras Bacsai
Date: Mon, 16 Dec 2024 10:19:11 +0100
Subject: [PATCH 28/60] fix: compose loading seq
---
app/Livewire/Project/Application/General.php | 6 +++---
.../views/livewire/project/application/general.blade.php | 5 ++---
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.php
index ff29b74e9..d1cc3476c 100644
--- a/app/Livewire/Project/Application/General.php
+++ b/app/Livewire/Project/Application/General.php
@@ -327,7 +327,7 @@ class General extends Component
}
}
- public function set_redirect()
+ public function setRedirect()
{
try {
$has_www = collect($this->application->fqdns)->filter(fn ($fqdn) => str($fqdn)->contains('www.'))->count();
@@ -360,10 +360,10 @@ class General extends Component
if ($warning) {
$this->dispatch('warning', __('warning.sslipdomain'));
}
- $this->resetDefaultLabels();
+ // $this->resetDefaultLabels();
if ($this->application->isDirty('redirect')) {
- $this->set_redirect();
+ $this->setRedirect();
}
$this->checkFqdns();
diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php
index 4812fd4ba..bdcde8deb 100644
--- a/resources/views/livewire/project/application/general.blade.php
+++ b/resources/views/livewire/project/application/general.blade.php
@@ -84,7 +84,7 @@
@@ -161,8 +161,7 @@
Nixpacks will detect the required configuration
automatically.
-
Framework
+ Framework
Specific Docs
@endif
From 2565deba4f92eb8377c17589bb1ff5a10d73d19a Mon Sep 17 00:00:00 2001
From: Andras Bacsai
Date: Mon, 16 Dec 2024 10:25:56 +0100
Subject: [PATCH 29/60] fix: resource clone name + volume name generation
---
app/Livewire/Project/Shared/ResourceOperations.php | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/app/Livewire/Project/Shared/ResourceOperations.php b/app/Livewire/Project/Shared/ResourceOperations.php
index e67df6aa9..de7bb3c05 100644
--- a/app/Livewire/Project/Shared/ResourceOperations.php
+++ b/app/Livewire/Project/Shared/ResourceOperations.php
@@ -42,9 +42,11 @@ class ResourceOperations extends Component
$uuid = (string) new Cuid2;
$server = $new_destination->server;
if ($this->resource->getMorphClass() === \App\Models\Application::class) {
+ $name = 'clone-of-'.str($this->resource->name)->limit(20).'-'.$uuid;
+
$new_resource = $this->resource->replicate()->fill([
'uuid' => $uuid,
- 'name' => $this->resource->name.'-clone-'.$uuid,
+ 'name' => $name,
'fqdn' => generateFqdn($server, $uuid),
'status' => 'exited',
'destination_id' => $new_destination->id,
@@ -64,8 +66,12 @@ class ResourceOperations extends Component
}
$persistentVolumes = $this->resource->persistentStorages()->get();
foreach ($persistentVolumes as $volume) {
+ $volumeName = str($volume->name)->replace($this->resource->uuid, $new_resource->uuid)->value();
+ if ($volumeName === $volume->name) {
+ $volumeName = $new_resource->uuid.'-'.str($volume->name)->afterLast('-');
+ }
$newPersistentVolume = $volume->replicate()->fill([
- 'name' => $new_resource->uuid.'-'.str($volume->name)->afterLast('-'),
+ 'name' => $volumeName,
'resource_id' => $new_resource->id,
]);
$newPersistentVolume->save();
From d58abd19983e7fd497ee7f9456b7fcfb4d9abdab Mon Sep 17 00:00:00 2001
From: Andras Bacsai
Date: Mon, 16 Dec 2024 10:38:18 +0100
Subject: [PATCH 30/60] refactor
---
app/Jobs/DatabaseBackupJob.php | 5 +----
app/Livewire/Project/Database/BackupNow.php | 6 ++----
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/app/Jobs/DatabaseBackupJob.php b/app/Jobs/DatabaseBackupJob.php
index 06aec5e49..6730dceb7 100644
--- a/app/Jobs/DatabaseBackupJob.php
+++ b/app/Jobs/DatabaseBackupJob.php
@@ -32,8 +32,6 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue
public Server $server;
- public ScheduledDatabaseBackup $backup;
-
public StandalonePostgresql|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|ServiceDatabase $database;
public ?string $container_name = null;
@@ -58,10 +56,9 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue
public ?S3Storage $s3 = null;
- public function __construct($backup)
+ public function __construct(public ScheduledDatabaseBackup $backup)
{
$this->onQueue('high');
- $this->backup = $backup;
}
public function handle(): void
diff --git a/app/Livewire/Project/Database/BackupNow.php b/app/Livewire/Project/Database/BackupNow.php
index 9c9c175e2..3cd360562 100644
--- a/app/Livewire/Project/Database/BackupNow.php
+++ b/app/Livewire/Project/Database/BackupNow.php
@@ -9,11 +9,9 @@ class BackupNow extends Component
{
public $backup;
- public function backup_now()
+ public function backupNow()
{
- dispatch(new DatabaseBackupJob(
- backup: $this->backup
- ));
+ DatabaseBackupJob::dispatch($this->backup);
$this->dispatch('success', 'Backup queued. It will be available in a few minutes.');
}
}
From 52310fd21a0a3d22638ded8846e95204e9298ce6 Mon Sep 17 00:00:00 2001
From: Andras Bacsai
Date: Mon, 16 Dec 2024 12:05:16 +0100
Subject: [PATCH 31/60] add debug dev
---
docker/production/Dockerfile | 3 +++
docker/production/entrypoint.d/99-debug-mode.sh | 6 ++++++
2 files changed, 9 insertions(+)
create mode 100644 docker/production/entrypoint.d/99-debug-mode.sh
diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile
index 09281a666..419cac393 100644
--- a/docker/production/Dockerfile
+++ b/docker/production/Dockerfile
@@ -99,6 +99,9 @@ RUN mkdir -p /usr/local/bin && \
COPY docker/production/etc/php/conf.d/zzz-custom-php.ini /usr/local/etc/php/conf.d/zzz-custom-php.ini
ENV PHP_OPCACHE_ENABLE=1
+# Configure entrypoint
+COPY --chmod=755 docker/production/entrypoint.d/ /usr/local/bin/entrypoint.d/
+
# Copy application files from previous stages
COPY --from=base --chown=www-data:www-data /var/www/html/vendor ./vendor
COPY --from=static-assets --chown=www-data:www-data /app/public/build ./public/build
diff --git a/docker/production/entrypoint.d/99-debug-mode.sh b/docker/production/entrypoint.d/99-debug-mode.sh
new file mode 100644
index 000000000..d1c8e5aa8
--- /dev/null
+++ b/docker/production/entrypoint.d/99-debug-mode.sh
@@ -0,0 +1,6 @@
+# Debug mode
+if [ "$DEBUG" = "true" ]; then
+ echo "Debug mode is enabled"
+ echo "Installing development dependencies..."
+ composer install --dev --no-scripts
+fi
From e0e2126f387ef24eb7400f73c71285a36a0f8188 Mon Sep 17 00:00:00 2001
From: Andras Bacsai
Date: Mon, 16 Dec 2024 12:08:30 +0100
Subject: [PATCH 32/60] fix: update Dockerfile entrypoint path to
/etc/entrypoint.d
---
docker/production/Dockerfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile
index 419cac393..aaef29f9d 100644
--- a/docker/production/Dockerfile
+++ b/docker/production/Dockerfile
@@ -100,7 +100,7 @@ COPY docker/production/etc/php/conf.d/zzz-custom-php.ini /usr/local/etc/php/conf
ENV PHP_OPCACHE_ENABLE=1
# Configure entrypoint
-COPY --chmod=755 docker/production/entrypoint.d/ /usr/local/bin/entrypoint.d/
+COPY --chmod=755 docker/production/entrypoint.d/ /etc/entrypoint.d
# Copy application files from previous stages
COPY --from=base --chown=www-data:www-data /var/www/html/vendor ./vendor
From e90df5a46bc83794d145681d0fd256d8173bacbe Mon Sep 17 00:00:00 2001
From: Andras Bacsai
Date: Mon, 16 Dec 2024 12:14:36 +0100
Subject: [PATCH 33/60] fix: debug mode
---
docker/production/entrypoint.d/99-debug-mode.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docker/production/entrypoint.d/99-debug-mode.sh b/docker/production/entrypoint.d/99-debug-mode.sh
index d1c8e5aa8..b2900808d 100644
--- a/docker/production/entrypoint.d/99-debug-mode.sh
+++ b/docker/production/entrypoint.d/99-debug-mode.sh
@@ -1,5 +1,5 @@
# Debug mode
-if [ "$DEBUG" = "true" ]; then
+if [ "$APP_DEBUG" = "true" ]; then
echo "Debug mode is enabled"
echo "Installing development dependencies..."
composer install --dev --no-scripts
From f9d509bc4cd216caf99378298f13cd3f05c52d27 Mon Sep 17 00:00:00 2001
From: Andras Bacsai
Date: Mon, 16 Dec 2024 12:19:07 +0100
Subject: [PATCH 34/60] enhance debug mode script to clear optimized classes
after installing development dependencies
---
docker/production/entrypoint.d/99-debug-mode.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docker/production/entrypoint.d/99-debug-mode.sh b/docker/production/entrypoint.d/99-debug-mode.sh
index b2900808d..e0a181373 100644
--- a/docker/production/entrypoint.d/99-debug-mode.sh
+++ b/docker/production/entrypoint.d/99-debug-mode.sh
@@ -3,4 +3,6 @@ if [ "$APP_DEBUG" = "true" ]; then
echo "Debug mode is enabled"
echo "Installing development dependencies..."
composer install --dev --no-scripts
+ echo "Clearing optimized classes..."
+ php artisan optimize:clear
fi
From a0ad4bc90e697b537851b3fb82816183423c8fc2 Mon Sep 17 00:00:00 2001
From: Andras Bacsai
Date: Mon, 16 Dec 2024 12:48:09 +0100
Subject: [PATCH 35/60] better impersonate
---
app/Livewire/Admin/Index.php | 21 ++++++++++++----
resources/views/components/navbar.blade.php | 24 ++++++++++---------
.../views/livewire/admin/index.blade.php | 9 +++++--
3 files changed, 37 insertions(+), 17 deletions(-)
diff --git a/app/Livewire/Admin/Index.php b/app/Livewire/Admin/Index.php
index 359db6329..b5f6d2929 100644
--- a/app/Livewire/Admin/Index.php
+++ b/app/Livewire/Admin/Index.php
@@ -21,16 +21,28 @@ class Index extends Component
public function mount()
{
- if (! isCloud()) {
+ if (! isCloud() && ! isDev()) {
return redirect()->route('dashboard');
}
-
- if (Auth::id() !== 0) {
+ if (Auth::id() !== 0 && ! session('impersonating')) {
return redirect()->route('dashboard');
}
$this->getSubscribers();
}
+ public function back()
+ {
+ if (session('impersonating')) {
+ session()->forget('impersonating');
+ $user = User::find(0);
+ $team_to_switch_to = $user->teams->first();
+ Auth::login($user);
+ refreshSession($team_to_switch_to);
+
+ return redirect(request()->header('Referer'));
+ }
+ }
+
public function submitSearch()
{
if ($this->search !== '') {
@@ -52,9 +64,10 @@ class Index extends Component
if (Auth::id() !== 0) {
return redirect()->route('dashboard');
}
+ session(['impersonating' => true]);
$user = User::find($user_id);
$team_to_switch_to = $user->teams->first();
- Cache::forget("team:{$user->id}");
+ // Cache::forget("team:{$user->id}");
Auth::login($user);
refreshSession($team_to_switch_to);
diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.php
index 7d343c645..9a75200b1 100644
--- a/resources/views/components/navbar.blade.php
+++ b/resources/views/components/navbar.blade.php
@@ -340,17 +340,19 @@
@endif
- @if (isCloud() && isInstanceAdmin())
-
-
-
+ @if (isCloud() || isDev())
+ @if (isInstanceAdmin() || session('impersonating'))
+
+
+
+ @endif
@endif
@if (isInstanceAdmin() && !isCloud())
diff --git a/resources/views/livewire/admin/index.blade.php b/resources/views/livewire/admin/index.blade.php
index 06914e1e4..7bf3c7c0c 100644
--- a/resources/views/livewire/admin/index.blade.php
+++ b/resources/views/livewire/admin/index.blade.php
@@ -1,7 +1,12 @@
Admin Dashboard
-
Who am I now?
-
{{ auth()->user()->name }}
+
+
Who am I now?
+ @if (session('impersonating'))
+ Go back to root
+ @endif
+
+
{{ auth()->user()->name }} ({{ auth()->user()->email }})