diff --git a/app/Actions/Database/StopDatabaseProxy.php b/app/Actions/Database/StopDatabaseProxy.php index 9ee794351..a753153eb 100644 --- a/app/Actions/Database/StopDatabaseProxy.php +++ b/app/Actions/Database/StopDatabaseProxy.php @@ -30,7 +30,6 @@ class StopDatabaseProxy } instant_remote_process(["docker rm -f {$uuid}-proxy"], $server); - $database->is_public = false; $database->save(); DatabaseProxyStopped::dispatch(); diff --git a/app/Actions/Proxy/StartProxy.php b/app/Actions/Proxy/StartProxy.php index 3139f02e2..1fff55861 100644 --- a/app/Actions/Proxy/StartProxy.php +++ b/app/Actions/Proxy/StartProxy.php @@ -57,7 +57,7 @@ class StartProxy " echo 'Successfully stopped and removed existing coolify-proxy.'", 'fi', "echo 'Starting coolify-proxy.'", - 'docker compose up -d --remove-orphans', + 'docker compose up -d', "echo 'Successfully started coolify-proxy.'", ]); $commands = $commands->merge(connectProxyToNetworks($server)); diff --git a/app/Http/Controllers/Api/ApplicationsController.php b/app/Http/Controllers/Api/ApplicationsController.php index 5265fbb37..485563818 100644 --- a/app/Http/Controllers/Api/ApplicationsController.php +++ b/app/Http/Controllers/Api/ApplicationsController.php @@ -1681,7 +1681,8 @@ class ApplicationsController extends Controller ], 422); } $domains = $request->domains; - if ($request->has('domains') && $server->isProxyShouldRun()) { + $requestHasDomains = $request->has('domains'); + if ($requestHasDomains && $server->isProxyShouldRun()) { $uuid = $request->uuid; $fqdn = $request->domains; $fqdn = str($fqdn)->replaceEnd(',', '')->trim(); @@ -1743,7 +1744,7 @@ class ApplicationsController extends Controller removeUnnecessaryFieldsFromRequest($request); $data = $request->all(); - if ($request->has('domains') && $server->isProxyShouldRun()) { + if ($requestHasDomains && $server->isProxyShouldRun()) { data_set($data, 'fqdn', $domains); } diff --git a/app/Jobs/DatabaseBackupJob.php b/app/Jobs/DatabaseBackupJob.php index 09a187f6a..6070ad16a 100644 --- a/app/Jobs/DatabaseBackupJob.php +++ b/app/Jobs/DatabaseBackupJob.php @@ -346,9 +346,9 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue if ($databaseWithCollections === 'all') { $commands[] = 'mkdir -p '.$this->backup_dir; if (str($this->database->image)->startsWith('mongo:4')) { - $commands[] = "docker exec $this->container_name mongodump --uri=$url --gzip --archive > $this->backup_location"; + $commands[] = "docker exec $this->container_name mongodump --uri=\"$url\" --gzip --archive > $this->backup_location"; } else { - $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --gzip --archive > $this->backup_location"; + $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=\"$url\" --gzip --archive > $this->backup_location"; } } else { if (str($databaseWithCollections)->contains(':')) { @@ -361,15 +361,15 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue $commands[] = 'mkdir -p '.$this->backup_dir; if ($collectionsToExclude->count() === 0) { if (str($this->database->image)->startsWith('mongo:4')) { - $commands[] = "docker exec $this->container_name mongodump --uri=$url --gzip --archive > $this->backup_location"; + $commands[] = "docker exec $this->container_name mongodump --uri=\"$url\" --gzip --archive > $this->backup_location"; } else { - $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --db $databaseName --gzip --archive > $this->backup_location"; + $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=\"$url\" --db $databaseName --gzip --archive > $this->backup_location"; } } else { if (str($this->database->image)->startsWith('mongo:4')) { $commands[] = "docker exec $this->container_name mongodump --uri=$url --gzip --excludeCollection ".$collectionsToExclude->implode(' --excludeCollection ')." --archive > $this->backup_location"; } else { - $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --db $databaseName --gzip --excludeCollection ".$collectionsToExclude->implode(' --excludeCollection ')." --archive > $this->backup_location"; + $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=\"$url\" --db $databaseName --gzip --excludeCollection ".$collectionsToExclude->implode(' --excludeCollection ')." --archive > $this->backup_location"; } } } @@ -415,9 +415,9 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue try { $commands[] = 'mkdir -p '.$this->backup_dir; if ($this->backup->dump_all) { - $commands[] = "docker exec $this->container_name mysqldump -u root -p{$this->database->mysql_root_password} --all-databases --single-transaction --quick --lock-tables=false --compress | gzip > $this->backup_location"; + $commands[] = "docker exec $this->container_name mysqldump -u root -p\"{$this->database->mysql_root_password}\" --all-databases --single-transaction --quick --lock-tables=false --compress | gzip > $this->backup_location"; } else { - $commands[] = "docker exec $this->container_name mysqldump -u root -p{$this->database->mysql_root_password} $database > $this->backup_location"; + $commands[] = "docker exec $this->container_name mysqldump -u root -p\"{$this->database->mysql_root_password}\" $database > $this->backup_location"; } $this->backup_output = instant_remote_process($commands, $this->server); $this->backup_output = trim($this->backup_output); @@ -435,9 +435,9 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue try { $commands[] = 'mkdir -p '.$this->backup_dir; if ($this->backup->dump_all) { - $commands[] = "docker exec $this->container_name mariadb-dump -u root -p{$this->database->mariadb_root_password} --all-databases --single-transaction --quick --lock-tables=false --compress > $this->backup_location"; + $commands[] = "docker exec $this->container_name mariadb-dump -u root -p\"{$this->database->mariadb_root_password}\" --all-databases --single-transaction --quick --lock-tables=false --compress > $this->backup_location"; } else { - $commands[] = "docker exec $this->container_name mariadb-dump -u root -p{$this->database->mariadb_root_password} $database > $this->backup_location"; + $commands[] = "docker exec $this->container_name mariadb-dump -u root -p\"{$this->database->mariadb_root_password}\" $database > $this->backup_location"; } $this->backup_output = instant_remote_process($commands, $this->server); $this->backup_output = trim($this->backup_output); @@ -495,7 +495,7 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue } else { $commands[] = "docker run -d --network {$network} --name backup-of-{$this->backup->uuid} --rm -v $this->backup_location:$this->backup_location:ro {$fullImageName}"; } - $commands[] = "docker exec backup-of-{$this->backup->uuid} mc config host add temporary {$endpoint} $key $secret"; + $commands[] = "docker exec backup-of-{$this->backup->uuid} mc config host add temporary {$endpoint} $key \"$secret\""; $commands[] = "docker exec backup-of-{$this->backup->uuid} mc cp $this->backup_location temporary/$bucket{$this->backup_dir}/"; instant_remote_process($commands, $this->server); diff --git a/app/Livewire/Project/New/PublicGitRepository.php b/app/Livewire/Project/New/PublicGitRepository.php index 2f2331fc0..45b3b5726 100644 --- a/app/Livewire/Project/New/PublicGitRepository.php +++ b/app/Livewire/Project/New/PublicGitRepository.php @@ -188,11 +188,22 @@ class PublicGitRepository extends Component private function getGitSource() { + $this->git_branch = 'main'; + $this->base_directory = '/'; + $this->repository_url_parsed = Url::fromString($this->repository_url); $this->git_host = $this->repository_url_parsed->getHost(); $this->git_repository = $this->repository_url_parsed->getSegment(1).'/'.$this->repository_url_parsed->getSegment(2); + if ($this->repository_url_parsed->getSegment(3) === 'tree') { - $this->git_branch = str($this->repository_url_parsed->getPath())->after('tree/')->value(); + $path = str($this->repository_url_parsed->getPath())->trim('/'); + $this->git_branch = str($path)->after('tree/')->before('/')->value(); + $this->base_directory = str($path)->after($this->git_branch)->after('/')->value(); + if (filled($this->base_directory)) { + $this->base_directory = '/'.$this->base_directory; + } else { + $this->base_directory = '/'; + } } else { $this->git_branch = 'main'; } diff --git a/app/Livewire/Project/Shared/EnvironmentVariable/All.php b/app/Livewire/Project/Shared/EnvironmentVariable/All.php index 80156bf65..35e585c82 100644 --- a/app/Livewire/Project/Shared/EnvironmentVariable/All.php +++ b/app/Livewire/Project/Shared/EnvironmentVariable/All.php @@ -138,6 +138,7 @@ class All extends Component private function handleBulkSubmit() { $variables = parseEnvFormatToArray($this->variables); + $this->deleteRemovedVariables(false, $variables); $this->updateOrCreateVariables(false, $variables); @@ -189,6 +190,9 @@ class All extends Component private function updateOrCreateVariables($isPreview, $variables) { foreach ($variables as $key => $value) { + if (str($key)->startsWith('SERVICE_FQDN') || str($key)->startsWith('SERVICE_URL')) { + continue; + } $method = $isPreview ? 'environment_variables_preview' : 'environment_variables'; $found = $this->resource->$method()->where('key', $key)->first(); diff --git a/app/Livewire/SwitchTeam.php b/app/Livewire/SwitchTeam.php index 7629c9596..145c285ab 100644 --- a/app/Livewire/SwitchTeam.php +++ b/app/Livewire/SwitchTeam.php @@ -30,6 +30,6 @@ class SwitchTeam extends Component } refreshSession($team_to_switch_to); - return redirect(request()->header('Referer')); + return redirect('dashboard'); } } diff --git a/bootstrap/helpers/proxy.php b/bootstrap/helpers/proxy.php index 6a258d52b..714358e37 100644 --- a/bootstrap/helpers/proxy.php +++ b/bootstrap/helpers/proxy.php @@ -149,6 +149,7 @@ function generate_default_proxy_configuration(Server $server) 'coolify.proxy=true', ]; $config = [ + 'name' => 'coolify-proxy', 'networks' => $array_of_networks->toArray(), 'services' => [ 'traefik' => [ @@ -182,9 +183,9 @@ function generate_default_proxy_configuration(Server $server) '--entrypoints.http.address=:80', '--entrypoints.https.address=:443', '--entrypoints.http.http.encodequerysemicolons=true', - '--entryPoints.http.http2.maxConcurrentStreams=50', + '--entryPoints.http.http2.maxConcurrentStreams=250', '--entrypoints.https.http.encodequerysemicolons=true', - '--entryPoints.https.http2.maxConcurrentStreams=50', + '--entryPoints.https.http2.maxConcurrentStreams=250', '--entrypoints.https.http3', '--providers.file.directory=/traefik/dynamic/', '--providers.file.watch=true', diff --git a/public/coolify-logo-dev-transparent.png b/public/coolify-logo-dev-transparent.png new file mode 100644 index 000000000..9beeb9ba3 Binary files /dev/null and b/public/coolify-logo-dev-transparent.png differ diff --git a/public/coolify-transparent.png b/public/coolify-transparent.png index 22d337a1e..96fc0db36 100644 Binary files a/public/coolify-transparent.png and b/public/coolify-transparent.png differ diff --git a/public/coolify.png b/public/coolify.png deleted file mode 100644 index fa01fec05..000000000 Binary files a/public/coolify.png and /dev/null differ diff --git a/public/favicon-dev.png b/public/favicon-dev.png deleted file mode 100644 index d7c507015..000000000 Binary files a/public/favicon-dev.png and /dev/null differ diff --git a/public/favicon.png b/public/favicon.png deleted file mode 100644 index 2c4482801..000000000 Binary files a/public/favicon.png and /dev/null differ diff --git a/public/svgs/coolify.png b/public/svgs/coolify.png index fa01fec05..96fc0db36 100644 Binary files a/public/svgs/coolify.png and b/public/svgs/coolify.png differ diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index db7aad83e..492c723ad 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -5,6 +5,20 @@ + + + + + + + + + + + + + + @use('App\Models\InstanceSettings') @php @@ -21,7 +35,7 @@ @endphp