diff --git a/app/Actions/Server/UpdateCoolify.php b/app/Actions/Server/UpdateCoolify.php index c992ed786..7fb788652 100644 --- a/app/Actions/Server/UpdateCoolify.php +++ b/app/Actions/Server/UpdateCoolify.php @@ -38,9 +38,6 @@ public function handle($manual_update = false) } $this->update(); } catch (\Throwable $e) { - ray('InstanceAutoUpdateJob failed'); - ray($e->getMessage()); - send_internal_notification('InstanceAutoUpdateJob failed: ' . $e->getMessage()); throw $e; } } @@ -57,7 +54,6 @@ private function update() "curl -fsSL https://cdn.coollabs.io/coolify/upgrade.sh -o /data/coolify/source/upgrade.sh", "bash /data/coolify/source/upgrade.sh $this->latestVersion" ], $this->server); - send_internal_notification("Instance updated from {$this->currentVersion} -> {$this->latestVersion}"); return; } } diff --git a/app/Console/Commands/ServicesGenerate.php b/app/Console/Commands/ServicesGenerate.php index d96d4743c..0471e2324 100644 --- a/app/Console/Commands/ServicesGenerate.php +++ b/app/Console/Commands/ServicesGenerate.php @@ -26,7 +26,6 @@ class ServicesGenerate extends Command */ public function handle() { - // ray()->clearAll(); $files = array_diff(scandir(base_path('templates/compose')), ['.', '..']); $files = array_filter($files, function ($file) { return strpos($file, '.yaml') !== false; @@ -63,6 +62,7 @@ private function process_file($file) $documentation = collect(preg_grep('/^# documentation:/', explode("\n", $content)))->values(); if ($documentation->count() > 0) { $documentation = str($documentation[0])->after('# documentation:')->trim()->value(); + $documentation = str($documentation)->append('?utm_source=coolify.io'); } else { $documentation = 'https://coolify.io/docs'; } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index ab8794877..601e1517c 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -6,15 +6,12 @@ use App\Jobs\CleanupInstanceStuffsJob; use App\Jobs\DatabaseBackupJob; use App\Jobs\ScheduledTaskJob; -use App\Jobs\InstanceAutoUpdateJob; use App\Jobs\ContainerStatusJob; +use App\Jobs\PullCoolifyImageJob; use App\Jobs\PullHelperImageJob; use App\Jobs\PullSentinelImageJob; -use App\Jobs\PullTemplatesAndVersions; use App\Jobs\PullTemplatesFromCDN; -use App\Jobs\PullVersionsFromCDN; use App\Jobs\ServerStatusJob; -use App\Models\InstanceSettings; use App\Models\ScheduledDatabaseBackup; use App\Models\ScheduledTask; use App\Models\Server; @@ -32,37 +29,33 @@ protected function schedule(Schedule $schedule): void // Instance Jobs $schedule->command('horizon:snapshot')->everyMinute(); $schedule->job(new CleanupInstanceStuffsJob)->everyMinute()->onOneServer(); - $schedule->job(new PullVersionsFromCDN)->everyTenMinutes()->onOneServer(); $schedule->job(new PullTemplatesFromCDN)->everyTwoHours()->onOneServer(); - // $schedule->job(new CheckResaleLicenseJob)->hourly()->onOneServer(); // Server Jobs $this->check_scheduled_backups($schedule); $this->check_resources($schedule); $this->check_scheduled_backups($schedule); - // $this->pull_helper_image($schedule); $this->check_scheduled_tasks($schedule); $schedule->command('uploads:clear')->everyTwoMinutes(); } else { // Instance Jobs $schedule->command('horizon:snapshot')->everyFiveMinutes(); $schedule->command('cleanup:unreachable-servers')->daily(); - $schedule->job(new PullVersionsFromCDN)->everyTenMinutes()->onOneServer(); - $schedule->job(new PullTemplatesFromCDN)->everyTwoHours()->onOneServer(); + $schedule->job(new PullCoolifyImageJob)->everyTenMinutes()->onOneServer(); + $schedule->job(new PullTemplatesFromCDN)->everyThirtyMinutes()->onOneServer(); $schedule->job(new CleanupInstanceStuffsJob)->everyTwoMinutes()->onOneServer(); // $schedule->job(new CheckResaleLicenseJob)->hourly()->onOneServer(); // Server Jobs - $this->instance_auto_update($schedule); $this->check_scheduled_backups($schedule); $this->check_resources($schedule); - $this->pull_helper_image($schedule); + $this->pull_images($schedule); $this->check_scheduled_tasks($schedule); $schedule->command('cleanup:database --yes')->daily(); $schedule->command('uploads:clear')->everyTwoMinutes(); } } - private function pull_helper_image($schedule) + private function pull_images($schedule) { $servers = $this->all_servers->where('settings.is_usable', true)->where('settings.is_reachable', true)->where('ip', '!=', '1.2.3.4'); foreach ($servers as $server) { @@ -93,16 +86,6 @@ private function check_resources($schedule) $schedule->job(new ServerStatusJob($server))->everyMinute()->onOneServer(); } } - private function instance_auto_update($schedule) - { - if (isDev() || isCloud()) { - return; - } - $settings = InstanceSettings::get(); - if ($settings->is_auto_update_enabled) { - $schedule->job(new InstanceAutoUpdateJob)->everyTenMinutes()->onOneServer(); - } - } private function check_scheduled_backups($schedule) { $scheduled_backups = ScheduledDatabaseBackup::all(); diff --git a/app/Http/Controllers/Webhook/Github.php b/app/Http/Controllers/Webhook/Github.php index bddfaff92..07b573ab6 100644 --- a/app/Http/Controllers/Webhook/Github.php +++ b/app/Http/Controllers/Webhook/Github.php @@ -410,11 +410,12 @@ public function normal(Request $request) if ($action === 'closed' || $action === 'close') { $found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first(); if ($found) { + $container_name = generateApplicationContainerName($application, $pull_request_id); + instant_remote_process(["docker rm -f $container_name"], $application->destination->server); + ApplicationPullRequestUpdateJob::dispatchSync(application: $application, preview: $found, status: ProcessStatus::CLOSED); $found->delete(); - $container_name = generateApplicationContainerName($application, $pull_request_id); - // ray('Stopping container: ' . $container_name); - instant_remote_process(["docker rm -f $container_name"], $application->destination->server); + $return_payloads->push([ 'application' => $application->name, 'status' => 'success', @@ -430,7 +431,6 @@ public function normal(Request $request) } } } - ray($return_payloads); return response($return_payloads); } catch (Exception $e) { ray($e->getMessage()); diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 6b06a2508..6517aae0a 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -113,7 +113,6 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted public $tries = 1; public function __construct(int $application_deployment_queue_id) { - ray()->clearAll(); $this->application_deployment_queue = ApplicationDeploymentQueue::find($application_deployment_queue_id); $this->application = Application::find($this->application_deployment_queue->application_id); $this->build_pack = data_get($this->application, 'build_pack'); @@ -290,7 +289,6 @@ private function decide_what_to_do() } private function post_deployment() { - if ($this->server->isProxyShouldRun()) { GetContainersStatus::dispatch($this->server); // dispatch(new ContainerStatusJob($this->server)); @@ -347,9 +345,15 @@ private function deploy_docker_compose_buildpack() } if (data_get($this->application, 'docker_compose_custom_start_command')) { $this->docker_compose_custom_start_command = $this->application->docker_compose_custom_start_command; + if (!str($this->docker_compose_custom_start_command)->contains('--project-directory')) { + $this->docker_compose_custom_start_command = str($this->docker_compose_custom_start_command)->replaceFirst('compose', 'compose --project-directory ' . $this->workdir)->value(); + } } if (data_get($this->application, 'docker_compose_custom_build_command')) { $this->docker_compose_custom_build_command = $this->application->docker_compose_custom_build_command; + if (!str($this->docker_compose_custom_build_command)->contains('--project-directory')) { + $this->docker_compose_custom_build_command = str($this->docker_compose_custom_build_command)->replaceFirst('compose', 'compose --project-directory ' . $this->workdir)->value(); + } } if ($this->pull_request_id === 0) { $this->application_deployment_queue->addLogEntry("Starting deployment of {$this->application->name} to {$this->server->name}."); @@ -367,7 +371,7 @@ private function deploy_docker_compose_buildpack() $yaml = $composeFile = $this->application->docker_compose_raw; $this->save_environment_variables(); } else { - $composeFile = $this->application->parseCompose(pull_request_id: $this->pull_request_id); + $composeFile = $this->application->parseCompose(pull_request_id: $this->pull_request_id, preview_id: data_get($this, 'preview.id')); $this->save_environment_variables(); if (!is_null($this->env_filename)) { $services = collect($composeFile['services']); @@ -1987,7 +1991,7 @@ private function run_pre_deployment_command() if ($containers->count() == 0) { return; } - $this->application_deployment_queue->addLogEntry("Executing pre-deployment command (see debug log for output)."); + $this->application_deployment_queue->addLogEntry("Executing pre-deployment command (see debug log for output/errors)."); foreach ($containers as $container) { $containerName = data_get($container, 'Names'); @@ -2010,6 +2014,7 @@ private function run_post_deployment_command() if (empty($this->application->post_deployment_command)) { return; } + $this->application_deployment_queue->addLogEntry("----------------------------------------"); $this->application_deployment_queue->addLogEntry("Executing post-deployment command (see debug log for output)."); $containers = getCurrentApplicationContainerStatus($this->server, $this->application->id, $this->pull_request_id); @@ -2018,11 +2023,20 @@ private function run_post_deployment_command() if ($containers->count() == 1 || str_starts_with($containerName, $this->application->post_deployment_command_container . '-' . $this->application->uuid)) { $cmd = "sh -c '" . str_replace("'", "'\''", $this->application->post_deployment_command) . "'"; $exec = "docker exec {$containerName} {$cmd}"; - $this->execute_remote_command( - [ - 'command' => $exec, 'hidden' => true - ], - ); + try { + $this->execute_remote_command( + [ + 'command' => $exec, 'hidden' => true, 'save' => 'post-deployment-command-output' + ], + ); + } catch (Exception $e) { + $post_deployment_command_output = $this->saved_outputs->get('post-deployment-command-output'); + if ($post_deployment_command_output) { + $this->application_deployment_queue->addLogEntry("Post-deployment command failed."); + $this->application_deployment_queue->addLogEntry($post_deployment_command_output, 'stderr'); + } + } + return; } } diff --git a/app/Jobs/ApplicationPullRequestUpdateJob.php b/app/Jobs/ApplicationPullRequestUpdateJob.php index 74f7a7b67..0aedd99a8 100755 --- a/app/Jobs/ApplicationPullRequestUpdateJob.php +++ b/app/Jobs/ApplicationPullRequestUpdateJob.php @@ -31,6 +31,7 @@ public function handle() { try { if ($this->application->is_public_repository()) { + ray('Public repository. Skipping comment update.'); return; } if ($this->status === ProcessStatus::CLOSED) { @@ -59,7 +60,7 @@ public function handle() } } catch (\Throwable $e) { ray($e); - throw $e; + return $e; } } diff --git a/app/Jobs/CheckLogDrainContainerJob.php b/app/Jobs/CheckLogDrainContainerJob.php index 8776b67c3..376a691cc 100644 --- a/app/Jobs/CheckLogDrainContainerJob.php +++ b/app/Jobs/CheckLogDrainContainerJob.php @@ -80,9 +80,9 @@ public function handle(): void } } } catch (\Throwable $e) { - send_internal_notification("CheckLogDrainContainerJob failed on ({$this->server->id}) with: " . $e->getMessage()); + if (!isCloud()) send_internal_notification("CheckLogDrainContainerJob failed on ({$this->server->id}) with: " . $e->getMessage()); ray($e->getMessage()); - handleError($e); + return handleError($e); } } } diff --git a/app/Jobs/PullCoolifyImageJob.php b/app/Jobs/PullCoolifyImageJob.php new file mode 100644 index 000000000..9ab0ced0f --- /dev/null +++ b/app/Jobs/PullCoolifyImageJob.php @@ -0,0 +1,59 @@ +get('https://cdn.coollabs.io/coolify/versions.json'); + if ($response->successful()) { + $versions = $response->json(); + File::put(base_path('versions.json'), json_encode($versions, JSON_PRETTY_PRINT)); + } + $latest_version = get_latest_version_of_coolify(); + instant_remote_process(["docker pull -q ghcr.io/coollabsio/coolify:{$latest_version}"], $server, false); + + $settings = InstanceSettings::get(); + $current_version = config('version'); + if (!$settings->is_auto_update_enabled) { + return; + } + if ($latest_version === $current_version) { + return; + } + if (version_compare($latest_version, $current_version, '<')) { + return; + } + instant_remote_process([ + "curl -fsSL https://cdn.coollabs.io/coolify/upgrade.sh -o /data/coolify/source/upgrade.sh", + "bash /data/coolify/source/upgrade.sh $latest_version" + ], $server); + } catch (\Throwable $e) { + throw $e; + } + } +} diff --git a/app/Jobs/PullVersionsFromCDN.php b/app/Jobs/PullVersionsFromCDN.php index 0d4084a30..a5397ef08 100644 --- a/app/Jobs/PullVersionsFromCDN.php +++ b/app/Jobs/PullVersionsFromCDN.php @@ -34,8 +34,7 @@ public function handle(): void } } } catch (\Throwable $e) { - send_internal_notification('PullTemplatesAndVersions failed with: ' . $e->getMessage()); - ray($e->getMessage()); + throw $e; } } } diff --git a/app/Livewire/Project/Application/Heading.php b/app/Livewire/Project/Application/Heading.php index 619be693d..473d00671 100644 --- a/app/Livewire/Project/Application/Heading.php +++ b/app/Livewire/Project/Application/Heading.php @@ -25,6 +25,7 @@ public function getListeners() return [ "echo-private:team.{$teamId},ApplicationStatusChanged" => 'check_status', "compose_loaded" => '$refresh', + "update_links" => '$refresh', ]; } public function mount() diff --git a/app/Livewire/Project/Application/Previews.php b/app/Livewire/Project/Application/Previews.php index 1f4a144a9..90815a755 100644 --- a/app/Livewire/Project/Application/Previews.php +++ b/app/Livewire/Project/Application/Previews.php @@ -43,7 +43,7 @@ public function save_preview($preview_id) try { $success = true; $preview = $this->application->previews->find($preview_id); - if (isset($preview->fqdn)) { + if (data_get_str($preview, 'fqdn')->isNotEmpty()) { $preview->fqdn = str($preview->fqdn)->replaceEnd(',', '')->trim(); $preview->fqdn = str($preview->fqdn)->replaceStart(',', '')->trim(); $preview->fqdn = str($preview->fqdn)->trim()->lower(); @@ -79,7 +79,7 @@ public function generate_preview($preview_id) $random = new Cuid2(7); $preview_fqdn = str_replace('{{random}}', $random, $template); $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); - $preview_fqdn = str_replace('{{pr_id}}', $preview_id, $preview_fqdn); + $preview_fqdn = str_replace('{{pr_id}}', $preview->pull_request_id, $preview_fqdn); $preview_fqdn = "$schema://$preview_fqdn"; $preview->fqdn = $preview_fqdn; $preview->save(); @@ -88,17 +88,34 @@ public function generate_preview($preview_id) public function add(int $pull_request_id, string|null $pull_request_html_url = null) { try { - $this->setDeploymentUuid(); - $found = ApplicationPreview::where('application_id', $this->application->id)->where('pull_request_id', $pull_request_id)->first(); - if (!$found && !is_null($pull_request_html_url)) { - ApplicationPreview::create([ - 'application_id' => $this->application->id, - 'pull_request_id' => $pull_request_id, - 'pull_request_html_url' => $pull_request_html_url - ]); + if ($this->application->build_pack === 'dockercompose') { + $this->setDeploymentUuid(); + $found = ApplicationPreview::where('application_id', $this->application->id)->where('pull_request_id', $pull_request_id)->first(); + if (!$found && !is_null($pull_request_html_url)) { + $found = ApplicationPreview::create([ + 'application_id' => $this->application->id, + 'pull_request_id' => $pull_request_id, + 'pull_request_html_url' => $pull_request_html_url, + 'docker_compose_domains' => $this->application->docker_compose_domains, + ]); + } + $found->generate_preview_fqdn_compose(); + $this->application->refresh(); + } else { + $this->setDeploymentUuid(); + $found = ApplicationPreview::where('application_id', $this->application->id)->where('pull_request_id', $pull_request_id)->first(); + if (!$found && !is_null($pull_request_html_url)) { + $found = ApplicationPreview::create([ + 'application_id' => $this->application->id, + 'pull_request_id' => $pull_request_id, + 'pull_request_html_url' => $pull_request_html_url, + ]); + } + $this->application->generate_preview_fqdn($pull_request_id); + $this->application->refresh(); + $this->dispatch('update_links'); + $this->dispatch('success', 'Preview added.'); } - $this->application->generate_preview_fqdn($pull_request_id); - $this->application->refresh(); } catch (\Throwable $e) { return handleError($e, $this); } @@ -152,7 +169,7 @@ public function stop(int $pull_request_id) } } GetContainersStatus::dispatchSync($this->application->destination->server); - $this->application->refresh(); + $this->dispatch('reloadWindow'); } catch (\Throwable $e) { return handleError($e, $this); } @@ -172,15 +189,10 @@ public function delete(int $pull_request_id) } ApplicationPreview::where('application_id', $this->application->id)->where('pull_request_id', $pull_request_id)->first()->delete(); $this->application->refresh(); + $this->dispatch('update_links'); + $this->dispatch('success', 'Preview deleted.'); } catch (\Throwable $e) { return handleError($e, $this); } } - - public function previewRefresh() - { - $this->application->previews->each(function ($preview) { - $preview->refresh(); - }); - } } diff --git a/app/Livewire/Project/Application/PreviewsCompose.php b/app/Livewire/Project/Application/PreviewsCompose.php new file mode 100644 index 000000000..85d8d81c9 --- /dev/null +++ b/app/Livewire/Project/Application/PreviewsCompose.php @@ -0,0 +1,56 @@ +service, 'domain'); + $docker_compose_domains = data_get($this->preview, 'docker_compose_domains'); + $docker_compose_domains = json_decode($docker_compose_domains, true); + $docker_compose_domains[$this->serviceName]['domain'] = $domain; + $this->preview->docker_compose_domains = json_encode($docker_compose_domains); + $this->preview->save(); + $this->dispatch('update_links'); + $this->dispatch('success', 'Domain saved.'); + } + public function generate() + { + $domains = collect(json_decode($this->preview->application->docker_compose_domains)) ?? collect(); + $domain = $domains->first(function ($_, $key) { + return $key === $this->serviceName; + }); + if ($domain) { + $domain = data_get($domain, 'domain'); + $url = Url::fromString($domain); + $template = $this->preview->application->preview_url_template; + $host = $url->getHost(); + $schema = $url->getScheme(); + $random = new Cuid2(7); + $preview_fqdn = str_replace('{{random}}', $random, $template); + $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); + $preview_fqdn = str_replace('{{pr_id}}', $this->preview->pull_request_id, $preview_fqdn); + $preview_fqdn = "$schema://$preview_fqdn"; + $docker_compose_domains = data_get($this->preview, 'docker_compose_domains'); + $docker_compose_domains = json_decode($docker_compose_domains, true); + $docker_compose_domains[$this->serviceName]['domain'] = $this->service->domain = $preview_fqdn; + $this->preview->docker_compose_domains = json_encode($docker_compose_domains); + $this->preview->save(); + } + $this->dispatch('update_links'); + $this->dispatch('success', 'Domain generated.'); + } +} diff --git a/app/Livewire/Project/Database/Backup/Index.php b/app/Livewire/Project/Database/Backup/Index.php index 5a14c313b..04ba642ec 100644 --- a/app/Livewire/Project/Database/Backup/Index.php +++ b/app/Livewire/Project/Database/Backup/Index.php @@ -7,7 +7,6 @@ class Index extends Component { public $database; - public $s3s; public function mount() { $project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first(); @@ -36,7 +35,6 @@ public function mount() ]); } $this->database = $database; - $this->s3s = currentTeam()->s3s; } public function render() { diff --git a/app/Livewire/Project/Database/BackupExecutions.php b/app/Livewire/Project/Database/BackupExecutions.php index 5e9319cfd..9666bbb43 100644 --- a/app/Livewire/Project/Database/BackupExecutions.php +++ b/app/Livewire/Project/Database/BackupExecutions.php @@ -50,7 +50,7 @@ public function download_file($exeuctionId) public function refreshBackupExecutions(): void { if ($this->backup) { - $this->executions = $this->backup->executions()->get()->sortByDesc('created_at'); + $this->executions = $this->backup->executions()->get()->sortBy('created_at'); } } } diff --git a/app/Livewire/Project/Database/CreateScheduledBackup.php b/app/Livewire/Project/Database/CreateScheduledBackup.php index 2b9aa987b..72ecca7b6 100644 --- a/app/Livewire/Project/Database/CreateScheduledBackup.php +++ b/app/Livewire/Project/Database/CreateScheduledBackup.php @@ -25,6 +25,7 @@ class CreateScheduledBackup extends Component ]; public function mount() { + $this->s3s = currentTeam()->s3s; if ($this->s3s->count() > 0) { $this->s3_storage_id = $this->s3s->first()->id; } diff --git a/app/Livewire/Project/New/PublicGitRepository.php b/app/Livewire/Project/New/PublicGitRepository.php index f4f3008d4..802d6ccb2 100644 --- a/app/Livewire/Project/New/PublicGitRepository.php +++ b/app/Livewire/Project/New/PublicGitRepository.php @@ -6,6 +6,7 @@ use App\Models\GithubApp; use App\Models\GitlabApp; use App\Models\Project; +use App\Models\Service; use App\Models\StandaloneDocker; use App\Models\SwarmDocker; use Carbon\Carbon; @@ -33,6 +34,8 @@ class PublicGitRepository extends Component public $build_pack = 'nixpacks'; public bool $show_is_static = true; + public bool $new_compose_services = false; + protected $rules = [ 'repository_url' => 'required|url', 'port' => 'required|numeric', @@ -177,6 +180,31 @@ public function submit() $project = Project::where('uuid', $project_uuid)->first(); $environment = $project->load(['environments'])->environments->where('name', $environment_name)->first(); + if ($this->build_pack === 'dockercompose' && isDev() && $this->new_compose_services ) { + $server = $destination->server; + $new_service = [ + 'name' => 'service' . str()->random(10), + 'docker_compose_raw' => 'coolify', + 'environment_id' => $environment->id, + 'server_id' => $server->id, + ]; + if ($this->git_source === 'other') { + $new_service['git_repository'] = $this->git_repository; + $new_service['git_branch'] = $this->git_branch; + } else { + $new_service['git_repository'] = $this->git_repository; + $new_service['git_branch'] = $this->git_branch; + $new_service['source_id'] = $this->git_source->id; + $new_service['source_type'] = $this->git_source->getMorphClass(); + } + $service = Service::create($new_service); + return redirect()->route('project.service.configuration', [ + 'service_uuid' => $service->uuid, + 'environment_name' => $environment->name, + 'project_uuid' => $project->uuid, + ]); + return; + } if ($this->git_source === 'other') { $application_init = [ 'name' => generate_random_name(), diff --git a/app/Livewire/Project/Resource/Create.php b/app/Livewire/Project/Resource/Create.php index 48c5b107d..6d94d833e 100644 --- a/app/Livewire/Project/Resource/Create.php +++ b/app/Livewire/Project/Resource/Create.php @@ -10,6 +10,7 @@ class Create extends Component { public $type; + public $project; public function mount() { $type = str(request()->query('type')); @@ -20,6 +21,7 @@ public function mount() if (!$project) { return redirect()->route('dashboard'); } + $this->project = $project; $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first(); if (!$environment) { return redirect()->route('dashboard'); diff --git a/app/Livewire/Source/Github/Change.php b/app/Livewire/Source/Github/Change.php index b7acb30a7..8fd36adc5 100644 --- a/app/Livewire/Source/Github/Change.php +++ b/app/Livewire/Source/Github/Change.php @@ -11,16 +11,16 @@ class Change extends Component { public string $webhook_endpoint; - public ?string $ipv4; - public ?string $ipv6; - public ?string $fqdn; + public ?string $ipv4 = null; + public ?string $ipv6 = null; + public ?string $fqdn = null; public ?bool $default_permissions = true; public ?bool $preview_deployment_permissions = true; public ?bool $administration = false; public $parameters; - public ?GithubApp $github_app; + public ?GithubApp $github_app = null; public string $name; public bool $is_system_wide; diff --git a/app/Models/Application.php b/app/Models/Application.php index e0ed328f9..e606735df 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -861,14 +861,10 @@ function parseRawCompose() instant_remote_process($commands, $this->destination->server, false); } - function parseCompose(int $pull_request_id = 0) + function parseCompose(int $pull_request_id = 0, ?int $preview_id = null) { if ($this->docker_compose_raw) { - $mainCompose = parseDockerComposeFile(resource: $this, isNew: false, pull_request_id: $pull_request_id); - if ($this->getMorphClass() === 'App\Models\Application' && $this->docker_compose_pr_raw) { - parseDockerComposeFile(resource: $this, isNew: false, pull_request_id: $pull_request_id, is_pr: true); - } - return $mainCompose; + return parseDockerComposeFile(resource: $this, isNew: false, pull_request_id: $pull_request_id, preview_id: $preview_id); } else { return collect([]); } @@ -1052,7 +1048,8 @@ public function parseHealthcheckFromDockerfile($dockerfile, bool $isInit = false } } } - function generate_preview_fqdn(int $pull_request_id) { + function generate_preview_fqdn(int $pull_request_id) + { $preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->id, $pull_request_id); if (is_null(data_get($preview, 'fqdn')) && $this->fqdn) { if (str($this->fqdn)->contains(',')) { diff --git a/app/Models/ApplicationPreview.php b/app/Models/ApplicationPreview.php index 87dce056e..7c7297af2 100644 --- a/app/Models/ApplicationPreview.php +++ b/app/Models/ApplicationPreview.php @@ -2,6 +2,9 @@ namespace App\Models; +use Spatie\Url\Url; +use Visus\Cuid2\Cuid2; + class ApplicationPreview extends BaseModel { protected $guarded = []; @@ -34,4 +37,26 @@ public function application() { return $this->belongsTo(Application::class); } + function generate_preview_fqdn_compose() + { + $domains = collect(json_decode($this->application->docker_compose_domains)) ?? collect(); + foreach ($domains as $service_name => $domain) { + $domain = data_get($domain, 'domain'); + $url = Url::fromString($domain); + $template = $this->application->preview_url_template; + $host = $url->getHost(); + $schema = $url->getScheme(); + $random = new Cuid2(7); + $preview_fqdn = str_replace('{{random}}', $random, $template); + $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); + $preview_fqdn = str_replace('{{pr_id}}', $this->pull_request_id, $preview_fqdn); + $preview_fqdn = "$schema://$preview_fqdn"; + $docker_compose_domains = data_get($this, 'docker_compose_domains'); + $docker_compose_domains = json_decode($docker_compose_domains, true); + $docker_compose_domains[$service_name]['domain'] = $preview_fqdn; + $docker_compose_domains = json_encode($docker_compose_domains); + $this->docker_compose_domains = $docker_compose_domains; + $this->save(); + } + } } diff --git a/bootstrap/helpers/constants.php b/bootstrap/helpers/constants.php index 11cfc3df2..8976f8d48 100644 --- a/bootstrap/helpers/constants.php +++ b/bootstrap/helpers/constants.php @@ -38,7 +38,7 @@ // Based on /etc/os-release const SUPPORTED_OS = [ 'ubuntu debian raspbian', - 'centos fedora rhel ol rocky amzn', + 'centos fedora rhel ol rocky amzn almalinux', 'sles opensuse-leap opensuse-tumbleweed' ]; diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.php index 0ce578758..fb980c296 100644 --- a/bootstrap/helpers/docker.php +++ b/bootstrap/helpers/docker.php @@ -488,8 +488,10 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview )); } } else { - if ($preview->fqdn) { + if (data_get($preview,'fqdn')) { $domains = Str::of(data_get($preview, 'fqdn'))->explode(','); + } else { + $domains = collect([]); } $labels = $labels->merge(fqdnLabelsForTraefik( uuid: $appUuid, diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index 240d78b33..3fcc335a0 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -657,9 +657,8 @@ function getTopLevelNetworks(Service|Application $resource) } } -function parseDockerComposeFile(Service|Application $resource, bool $isNew = false, int $pull_request_id = 0, bool $is_pr = false) +function parseDockerComposeFile(Service|Application $resource, bool $isNew = false, int $pull_request_id = 0, ?int $preview_id = null) { - // ray()->clearAll(); if ($resource->getMorphClass() === 'App\Models\Service') { if ($resource->docker_compose_raw) { try { @@ -912,7 +911,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal } else if ($type->value() === 'volume') { if ($topLevelVolumes->has($source->value())) { $v = $topLevelVolumes->get($source->value()); - if (data_get($v, 'driver_opts')) { + if (data_get($v, 'driver_opts.type') === 'cifs') { return $volume; } } @@ -1283,20 +1282,11 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal $isSameDockerComposeFile = false; if ($resource->dockerComposePrLocation() === $resource->dockerComposeLocation()) { $isSameDockerComposeFile = true; - $is_pr = false; } - if ($is_pr) { - try { - $yaml = Yaml::parse($resource->docker_compose_pr_raw); - } catch (\Exception $e) { - return; - } - } else { - try { - $yaml = Yaml::parse($resource->docker_compose_raw); - } catch (\Exception $e) { - return; - } + try { + $yaml = Yaml::parse($resource->docker_compose_raw); + } catch (\Exception $e) { + return; } $server = $resource->destination->server; $topLevelVolumes = collect(data_get($yaml, 'volumes', [])); @@ -1330,7 +1320,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal if ($pull_request_id !== 0) { $definedNetwork = collect(["{$resource->uuid}-$pull_request_id"]); } - $services = collect($services)->map(function ($service, $serviceName) use ($topLevelVolumes, $topLevelNetworks, $definedNetwork, $isNew, $generatedServiceFQDNS, $resource, $server, $pull_request_id) { + $services = collect($services)->map(function ($service, $serviceName) use ($topLevelVolumes, $topLevelNetworks, $definedNetwork, $isNew, $generatedServiceFQDNS, $resource, $server, $pull_request_id, $preview_id) { $serviceVolumes = collect(data_get($service, 'volumes', [])); $servicePorts = collect(data_get($service, 'ports', [])); $serviceNetworks = collect(data_get($service, 'networks', [])); @@ -1380,8 +1370,13 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal $volume = str("$name:$mount"); if ($topLevelVolumes->has($name)) { $v = $topLevelVolumes->get($name); - if (data_get($v, 'driver_opts')) { + if (data_get($v, 'driver_opts.type') === 'cifs') { // Do nothing + } else { + if (is_null(data_get($v, 'name'))) { + data_set($v, 'name', $name); + data_set($topLevelVolumes, $name, $v); + } } } else { $topLevelVolumes->put($name, [ @@ -1391,8 +1386,12 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal } else { if ($topLevelVolumes->has($name->value())) { $v = $topLevelVolumes->get($name->value()); - if (data_get($v, 'driver_opts')) { + if (data_get($v, 'driver_opts.type') === 'cifs') { // Do nothing + } else { + if (is_null(data_get($v, 'name'))) { + data_set($topLevelVolumes, $name->value(), $v); + } } } else { $topLevelVolumes->put($name->value(), [ @@ -1444,8 +1443,13 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal if (!str($source)->startsWith('/')) { if ($topLevelVolumes->has($source)) { $v = $topLevelVolumes->get($source); - if (data_get($v, 'driver_opts')) { + if (data_get($v, 'driver_opts.type') === 'cifs') { // Do nothing + } else { + if (is_null(data_get($v, 'name'))) { + data_set($v, 'name', $source); + data_set($topLevelVolumes, $source, $v); + } } } else { $topLevelVolumes->put($source, [ @@ -1716,21 +1720,32 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal if ($fqdns) { $fqdns = str($fqdns)->explode(','); if ($pull_request_id !== 0) { - $fqdns = $fqdns->map(function ($fqdn) use ($pull_request_id, $resource) { - $preview = ApplicationPreview::findPreviewByApplicationAndPullId($resource->id, $pull_request_id); - $url = Url::fromString($fqdn); - $template = $resource->preview_url_template; - $host = $url->getHost(); - $schema = $url->getScheme(); - $random = new Cuid2(7); - $preview_fqdn = str_replace('{{random}}', $random, $template); - $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); - $preview_fqdn = str_replace('{{pr_id}}', $pull_request_id, $preview_fqdn); - $preview_fqdn = "$schema://$preview_fqdn"; - $preview->fqdn = $preview_fqdn; - $preview->save(); - return $preview_fqdn; - }); + $preview = $resource->previews()->find($preview_id); + $docker_compose_domains = collect(json_decode(data_get($preview, 'docker_compose_domains'))); + if ($docker_compose_domains->count() > 0) { + $found_fqdn = data_get($docker_compose_domains, "$serviceName.domain"); + if ($found_fqdn) { + $fqdns = collect($found_fqdn); + } else { + $fqdns = collect([]); + } + } else { + $fqdns = $fqdns->map(function ($fqdn) use ($pull_request_id, $resource) { + $preview = ApplicationPreview::findPreviewByApplicationAndPullId($resource->id, $pull_request_id); + $url = Url::fromString($fqdn); + $template = $resource->preview_url_template; + $host = $url->getHost(); + $schema = $url->getScheme(); + $random = new Cuid2(7); + $preview_fqdn = str_replace('{{random}}', $random, $template); + $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); + $preview_fqdn = str_replace('{{pr_id}}', $pull_request_id, $preview_fqdn); + $preview_fqdn = "$schema://$preview_fqdn"; + $preview->fqdn = $preview_fqdn; + $preview->save(); + return $preview_fqdn; + }); + } } $serviceLabels = $serviceLabels->merge(fqdnLabelsForTraefik( uuid: $resource->uuid, @@ -1797,13 +1812,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal $resource->docker_compose_raw = Yaml::dump($yaml, 10, 2); $resource->docker_compose = Yaml::dump($finalServices, 10, 2); } else { - if ($is_pr) { - $resource->docker_compose_pr_raw = Yaml::dump($yaml, 10, 2); - $resource->docker_compose_pr = Yaml::dump($finalServices, 10, 2); - } else { - $resource->docker_compose_raw = Yaml::dump($yaml, 10, 2); - $resource->docker_compose = Yaml::dump($finalServices, 10, 2); - } + $resource->docker_compose_raw = Yaml::dump($yaml, 10, 2); + $resource->docker_compose = Yaml::dump($finalServices, 10, 2); } $resource->save(); return collect($finalServices); diff --git a/config/sentry.php b/config/sentry.php index ad068446a..660b5e54f 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -7,7 +7,7 @@ // The release version of your application // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) - 'release' => '4.0.0-beta.294', + 'release' => '4.0.0-beta.295', // When left empty or `null` the Laravel environment will be used 'environment' => config('app.env'), diff --git a/config/version.php b/config/version.php index c57853f01..7778ab41b 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@ text('docker_compose_domains')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('application_previews', function (Blueprint $table) { + $table->dropColumn('docker_compose_domains'); + }); + } +}; diff --git a/database/migrations/2024_06_06_103938_change_pr_issue_commend_id_type.php b/database/migrations/2024_06_06_103938_change_pr_issue_commend_id_type.php new file mode 100644 index 000000000..c7d71203b --- /dev/null +++ b/database/migrations/2024_06_06_103938_change_pr_issue_commend_id_type.php @@ -0,0 +1,28 @@ +string('pull_request_issue_comment_id')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('application_previews', function (Blueprint $table) { + $table->integer('pull_request_issue_comment_id')->nullable()->change(); + }); + } +}; diff --git a/database/migrations/new_services.php b/database/migrations/new_services.php new file mode 100644 index 000000000..77d952734 --- /dev/null +++ b/database/migrations/new_services.php @@ -0,0 +1,32 @@ +string('git_repository')->nullable(); + $table->string('git_branch')->nullable(); + $table->nullableMorphs('source'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('services', function (Blueprint $table) { + $table->dropColumn('git_repository'); + $table->dropColumn('git_branch'); + $table->dropMorphs('source'); + }); + } +}; diff --git a/public/svgs/rocketchat.svg b/public/svgs/rocketchat.svg new file mode 100644 index 000000000..01fde7a6a --- /dev/null +++ b/public/svgs/rocketchat.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/resources/views/components/applications/links.blade.php b/resources/views/components/applications/links.blade.php index a14d0e3ae..cf9e9c029 100644 --- a/resources/views/components/applications/links.blade.php +++ b/resources/views/components/applications/links.blade.php @@ -45,24 +45,48 @@ @endforeach @endif - @if (data_get($application, 'previews', collect([]))->count() > 0) - @foreach (data_get($application, 'previews') as $preview) - @if (data_get($preview, 'fqdn')) - - - - - - - - PR{{ data_get($preview, 'pull_request_id') }} | - {{ data_get($preview, 'fqdn') }} - - @endif - @endforeach + @if (data_get($application, 'previews', collect())->count() > 0) + @if (data_get($application, 'build_pack') === 'dockercompose') + @foreach ($application->previews as $preview) + @foreach (collect(json_decode($preview->docker_compose_domains)) as $fqdn) + @if (data_get($fqdn, 'domain')) + @foreach (explode(',', data_get($fqdn, 'domain')) as $domain) + + + + + + + PR{{ data_get($preview, 'pull_request_id') }} | + {{ getFqdnWithoutPort($domain) }} + + @endforeach + @endif + @endforeach + @endforeach + @else + @foreach (data_get($application, 'previews') as $preview) + @if (data_get($preview, 'fqdn')) + + + + + + + + PR{{ data_get($preview, 'pull_request_id') }} | + {{ data_get($preview, 'fqdn') }} + + @endif + @endforeach + @endif @endif @if (data_get($application, 'ports_mappings_array')) @foreach ($application->ports_mappings_array as $port) diff --git a/resources/views/destination/all.blade.php b/resources/views/destination/all.blade.php index bb1b99bf5..13f955745 100644 --- a/resources/views/destination/all.blade.php +++ b/resources/views/destination/all.blade.php @@ -1,4 +1,7 @@ + + Destinations | Coolify +

Destinations

@if ($servers->count() > 0) diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index ed546d511..c8d3a33cc 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -15,7 +15,7 @@ - Coolify + {{ $title ?? 'Coolify' }} @env('local') @else diff --git a/resources/views/livewire/boarding/index.blade.php b/resources/views/livewire/boarding/index.blade.php index 3df18ff92..2e5fa41c9 100644 --- a/resources/views/livewire/boarding/index.blade.php +++ b/resources/views/livewire/boarding/index.blade.php @@ -1,4 +1,7 @@ @php use App\Enums\ProxyTypes; @endphp + + Onboarding | Coolify +
diff --git a/resources/views/livewire/command-center/index.blade.php b/resources/views/livewire/command-center/index.blade.php index 1282a1b19..e128b3f30 100644 --- a/resources/views/livewire/command-center/index.blade.php +++ b/resources/views/livewire/command-center/index.blade.php @@ -1,4 +1,7 @@
+ + Command Center | Coolify +

Command Center

Execute commands on your servers without leaving the browser.
@if ($servers->count() > 0) diff --git a/resources/views/livewire/dashboard.blade.php b/resources/views/livewire/dashboard.blade.php index a9d116dcb..37f010397 100644 --- a/resources/views/livewire/dashboard.blade.php +++ b/resources/views/livewire/dashboard.blade.php @@ -1,4 +1,7 @@
+ + Dashboard | Coolify + @if (session('error')) @endif diff --git a/resources/views/livewire/notifications/discord.blade.php b/resources/views/livewire/notifications/discord.blade.php index d85f59600..1dbdf241e 100644 --- a/resources/views/livewire/notifications/discord.blade.php +++ b/resources/views/livewire/notifications/discord.blade.php @@ -1,4 +1,7 @@
+ + Notifications | Coolify +
@@ -7,7 +10,7 @@ Save @if ($team->discord_enabled) - Send Test Notifications diff --git a/resources/views/livewire/notifications/email.blade.php b/resources/views/livewire/notifications/email.blade.php index cccd4c26e..f911251d5 100644 --- a/resources/views/livewire/notifications/email.blade.php +++ b/resources/views/livewire/notifications/email.blade.php @@ -1,4 +1,7 @@
+ + Notifications | Coolify +
diff --git a/resources/views/livewire/notifications/telegram.blade.php b/resources/views/livewire/notifications/telegram.blade.php index 01d8b1329..3f57ff471 100644 --- a/resources/views/livewire/notifications/telegram.blade.php +++ b/resources/views/livewire/notifications/telegram.blade.php @@ -1,4 +1,7 @@
+ + Notifications | Coolify +
diff --git a/resources/views/livewire/profile/index.blade.php b/resources/views/livewire/profile/index.blade.php index 5cf547cb9..b2583519b 100644 --- a/resources/views/livewire/profile/index.blade.php +++ b/resources/views/livewire/profile/index.blade.php @@ -1,4 +1,7 @@
+ + Profile | Coolify +

Profile

Your user profile settings.
diff --git a/resources/views/livewire/project/application/configuration.blade.php b/resources/views/livewire/project/application/configuration.blade.php index 89f771e7f..4be672063 100644 --- a/resources/views/livewire/project/application/configuration.blade.php +++ b/resources/views/livewire/project/application/configuration.blade.php @@ -1,4 +1,7 @@
+ + {{ data_get_str($application, 'name')->limit(10) }} > Configuration | Coolify +

Configuration

diff --git a/resources/views/livewire/project/application/deployment/index.blade.php b/resources/views/livewire/project/application/deployment/index.blade.php index dfd716b07..4282700f8 100644 --- a/resources/views/livewire/project/application/deployment/index.blade.php +++ b/resources/views/livewire/project/application/deployment/index.blade.php @@ -1,4 +1,7 @@
+ + {{ data_get_str($application, 'name')->limit(10) }} > Deployments | Coolify +

Deployments

diff --git a/resources/views/livewire/project/application/deployment/show.blade.php b/resources/views/livewire/project/application/deployment/show.blade.php index a8d4f3847..b65b463f0 100644 --- a/resources/views/livewire/project/application/deployment/show.blade.php +++ b/resources/views/livewire/project/application/deployment/show.blade.php @@ -1,4 +1,7 @@
+ + {{ data_get_str($application, 'name')->limit(10) }} > Deployment | Coolify +

Deployment

diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php index df7ba526c..39c21c690 100644 --- a/resources/views/livewire/project/application/general.blade.php +++ b/resources/views/livewire/project/application/general.blade.php @@ -38,7 +38,6 @@
@endif @if ($application->build_pack === 'dockercompose') - @if ( !is_null($parsedServices) && count($parsedServices) > 0 && @@ -266,20 +265,24 @@ class="underline" href="https://coolify.io/docs/knowledge-base/docker/registry"

Pre/Post Deployment Commands

- - + + @if ($application->build_pack === 'dockercompose') + + @endif
- + id="application.post_deployment_command" label="Post-deployment " + helper="An optional script or command to execute in the newly built container after the deployment completes.
It is always executed with 'sh -c', so you do not need add it manually." /> + @if ($application->build_pack === 'dockercompose') + + @endif
diff --git a/resources/views/livewire/project/application/previews-compose.blade.php b/resources/views/livewire/project/application/previews-compose.blade.php new file mode 100644 index 000000000..4e50ad18d --- /dev/null +++ b/resources/views/livewire/project/application/previews-compose.blade.php @@ -0,0 +1,7 @@ +
+ + Save + Generate + Domain +
diff --git a/resources/views/livewire/project/application/previews.blade.php b/resources/views/livewire/project/application/previews.blade.php index f069157a3..79a7b88b0 100644 --- a/resources/views/livewire/project/application/previews.blade.php +++ b/resources/views/livewire/project/application/previews.blade.php @@ -42,11 +42,16 @@ class="dark:text-warning">{{ $application->destination->server->name }}.< - Add + Configure - Deploy + + + + Deploy @@ -58,7 +63,7 @@ class="dark:text-warning">{{ $application->destination->server->name }}.<
@if ($application->previews->count() > 0) -
Previews
+

Deployments

@foreach (data_get($application, 'previews') as $previewName => $preview)
@@ -81,21 +86,35 @@ class="dark:text-warning">{{ $application->destination->server->name }}.<
-
- - Save - Generate - Domain -
-
- - @if (data_get($preview, 'status') === 'exited') - Deploy + + @if ($application->build_pack === 'dockercompose') +
+ @if (collect(json_decode($preview->docker_compose_domains))->count() === 0) +
+ + Save + Generate + Domain +
@else - Redeploy + @foreach (collect(json_decode($preview->docker_compose_domains)) as $serviceName => $service) + + @endforeach @endif - +
+ @else +
+ + Save + Generate + Domain +
+ @endif +
@if (count($parameters) > 0) @@ -111,6 +130,27 @@ class="dark:text-warning">{{ $application->destination->server->name }}.< @endif
+ + @if (data_get($preview, 'status') === 'exited') + + + + + Deploy + @else + + + + + + Redeploy + @endif + @if (data_get($preview, 'status') !== 'exited') diff --git a/resources/views/livewire/project/clone-me.blade.php b/resources/views/livewire/project/clone-me.blade.php index b2007fcb6..1246af050 100644 --- a/resources/views/livewire/project/clone-me.blade.php +++ b/resources/views/livewire/project/clone-me.blade.php @@ -1,4 +1,7 @@
+ + {{ data_get_str($project, 'name')->limit(10) }} > Clone | Coolify +

Clone

Quickly clone all resources to a new project or environment.
diff --git a/resources/views/livewire/project/database/backup-executions.blade.php b/resources/views/livewire/project/database/backup-executions.blade.php index dd96e13a9..644ac9fa4 100644 --- a/resources/views/livewire/project/database/backup-executions.blade.php +++ b/resources/views/livewire/project/database/backup-executions.blade.php @@ -1,4 +1,4 @@ -
+
@isset($backup)

Executions

diff --git a/resources/views/livewire/project/database/backup/execution.blade.php b/resources/views/livewire/project/database/backup/execution.blade.php index 9056296fe..d778b5c2c 100644 --- a/resources/views/livewire/project/database/backup/execution.blade.php +++ b/resources/views/livewire/project/database/backup/execution.blade.php @@ -1,9 +1,12 @@
+ + {{ data_get_str($database, 'name')->limit(10) }} > Backup | Coolify +

Backups

- +
diff --git a/resources/views/livewire/project/database/backup/index.blade.php b/resources/views/livewire/project/database/backup/index.blade.php index 2208209c1..e9ba05431 100644 --- a/resources/views/livewire/project/database/backup/index.blade.php +++ b/resources/views/livewire/project/database/backup/index.blade.php @@ -1,12 +1,15 @@
+ + {{ data_get_str($database, 'name')->limit(10) }} > Backups | Coolify +

Backups

-
+

Scheduled Backups

- +
diff --git a/resources/views/livewire/project/database/configuration.blade.php b/resources/views/livewire/project/database/configuration.blade.php index 75d7d3b79..809a48c0f 100644 --- a/resources/views/livewire/project/database/configuration.blade.php +++ b/resources/views/livewire/project/database/configuration.blade.php @@ -1,4 +1,7 @@
+ + {{ data_get_str($database, 'name')->limit(10) }} > Configuration | Coolify +

Configuration

diff --git a/resources/views/livewire/project/database/mariadb/general.blade.php b/resources/views/livewire/project/database/mariadb/general.blade.php index 9ba97fa59..7f0596b5c 100644 --- a/resources/views/livewire/project/database/mariadb/general.blade.php +++ b/resources/views/livewire/project/database/mariadb/general.blade.php @@ -12,23 +12,23 @@
+
If you change the values in the database, please sync it here, otherwise + automations (like backups) won't work. +
@if ($database->started_at) -
- - +
+ + + helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work." />
@else -
Please verify these values. You can only modify them before the initial - start. After that, you need to modify it in the database. -
-
+
+
If you change the values in the database, please sync it here, otherwise + automations (like backups) won't work. +
@if ($database->started_at) -
+
+ placeholder="If empty: postgres" helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work." /> + required helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work." />
@else -
Please verify these values. You can only modify them before the initial - start. After that, you need to modify it in the database. -
-
+
diff --git a/resources/views/livewire/project/database/mysql/general.blade.php b/resources/views/livewire/project/database/mysql/general.blade.php index fd22fedb0..539948b2e 100644 --- a/resources/views/livewire/project/database/mysql/general.blade.php +++ b/resources/views/livewire/project/database/mysql/general.blade.php @@ -12,23 +12,23 @@
+
If you change the values in the database, please sync it here, otherwise + automations (like backups) won't work. +
@if ($database->started_at) -
- - +
+ + + helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work." />
@else -
Please verify these values. You can only modify them before the initial - start. After that, you need to modify it in the database. -
-
+
-
+
- +
If you change the values in the database, please sync it here, otherwise automations (like backups) won't work. +
@if ($database->started_at) -
- - +
+ +
@else -
Please verify these values. You can only modify them before the initial - start. After that, you need to modify it in the database. -
-
+
-
@endif diff --git a/resources/views/livewire/project/database/scheduled-backups.blade.php b/resources/views/livewire/project/database/scheduled-backups.blade.php index 0dce5fb9a..66b28eb39 100644 --- a/resources/views/livewire/project/database/scheduled-backups.blade.php +++ b/resources/views/livewire/project/database/scheduled-backups.blade.php @@ -1,5 +1,5 @@
-
+
@forelse($database->scheduledBackups as $backup) @if ($type == 'database')

Executions

- +
@endif
diff --git a/resources/views/livewire/project/edit.blade.php b/resources/views/livewire/project/edit.blade.php index 816873aab..ec9304da9 100644 --- a/resources/views/livewire/project/edit.blade.php +++ b/resources/views/livewire/project/edit.blade.php @@ -1,4 +1,7 @@
+ + {{ data_get_str($project, 'name')->limit(10) }} > Edit | Coolify +

Project: {{ data_get($project, 'name') }}

diff --git a/resources/views/livewire/project/environment-edit.blade.php b/resources/views/livewire/project/environment-edit.blade.php index 842692296..b4c37a37b 100644 --- a/resources/views/livewire/project/environment-edit.blade.php +++ b/resources/views/livewire/project/environment-edit.blade.php @@ -1,4 +1,7 @@
+ + {{ data_get_str($project, 'name')->limit(10) }} > Edit | Coolify +

Environment: {{ data_get($environment, 'name') }}

@@ -6,7 +9,7 @@