From 90a5a23fd96f697d80ad3b5f2e0815f2ffe76a9d Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 12 Jan 2024 15:41:43 +0100 Subject: [PATCH 01/11] Fix initial username placeholder in PostgreSQL database view --- .../livewire/project/database/postgresql/general.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/livewire/project/database/postgresql/general.blade.php b/resources/views/livewire/project/database/postgresql/general.blade.php index 35eabbafc..50201e115 100644 --- a/resources/views/livewire/project/database/postgresql/general.blade.php +++ b/resources/views/livewire/project/database/postgresql/general.blade.php @@ -29,7 +29,7 @@ @if ($database->started_at)
- From f762959c9fcaa91a76ec74c1c320f81af5a5f34c Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 12 Jan 2024 15:41:46 +0100 Subject: [PATCH 02/11] Refactor select.blade.php file --- resources/views/livewire/project/new/select.blade.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/resources/views/livewire/project/new/select.blade.php b/resources/views/livewire/project/new/select.blade.php index 4ff231c8b..caff1fb15 100644 --- a/resources/views/livewire/project/new/select.blade.php +++ b/resources/views/livewire/project/new/select.blade.php @@ -202,10 +202,7 @@
  • Select a Server
  • Select a Destination
  • - @if ($isDatabase) -
    Swarm clusters are excluded from this type of resource at the moment. It will - be activated soon. Stay tuned.
    - @endif + {{-- @if ($isDatabase)
    @endforelse
    + @if ($isDatabase) +
    Swarm clusters are excluded from this type of resource at the moment. It will + be activated soon. Stay tuned.
    + @endif @endif @if ($current_step === 'destinations')
      @@ -267,7 +268,7 @@
    @endforeach @endif -
    From 5ffbba908be40e242d943eae13d74a600649eaf2 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 12 Jan 2024 15:41:49 +0100 Subject: [PATCH 03/11] Refactor healthcheck test in StartPostgresql.php --- app/Actions/Database/StartPostgresql.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/Actions/Database/StartPostgresql.php b/app/Actions/Database/StartPostgresql.php index fbbf71f91..edf4a27e1 100644 --- a/app/Actions/Database/StartPostgresql.php +++ b/app/Actions/Database/StartPostgresql.php @@ -50,12 +50,8 @@ class StartPostgresql ], 'healthcheck' => [ 'test' => [ - 'CMD-SHELL', - 'pg_isready', - '-d', - $this->database->postgres_db, - '-U', - $this->database->postgres_user, + "CMD-SHELL", + "psql -U {$this->database->postgres_user} -d {$this->database->postgres_db} -c 'SELECT 1' || exit 1" ], 'interval' => '5s', 'timeout' => '5s', From 891deee05a6029a26e29173430203e67f91f3ecd Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 12 Jan 2024 15:42:05 +0100 Subject: [PATCH 04/11] Update version numbers to 4.0.0-beta.191 --- config/sentry.php | 2 +- config/version.php | 2 +- versions.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/sentry.php b/config/sentry.php index 9426b3076..4604c57d8 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -7,7 +7,7 @@ return [ // 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.190', + 'release' => '4.0.0-beta.191', // 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 0e5343e99..542c254a1 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@ Date: Fri, 12 Jan 2024 21:26:51 +0100 Subject: [PATCH 05/11] refactor: compose file and install script --- docker-compose.prod.yml | 3 ++- scripts/install.sh | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 2ec79158d..8ae8ced62 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,7 +1,7 @@ version: '3.8' services: coolify: - image: "ghcr.io/coollabsio/coolify:${LATEST_IMAGE:-4.0.0-beta.153}" + image: "ghcr.io/coollabsio/coolify:${LATEST_IMAGE:-4.0.0-beta.190}" volumes: - type: bind source: /data/coolify/source/.env @@ -10,6 +10,7 @@ services: - /data/coolify/ssh:/var/www/html/storage/app/ssh - /data/coolify/applications:/var/www/html/storage/app/applications - /data/coolify/databases:/var/www/html/storage/app/databases + - /data/coolify/services:/var/www/html/storage/app/services - /data/coolify/backups:/var/www/html/storage/app/backups environment: - APP_ID diff --git a/scripts/install.sh b/scripts/install.sh index f7ca9fa16..af364f9c9 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -127,9 +127,8 @@ fi echo -e "-------------" -mkdir -p /data/coolify/ssh/keys -mkdir -p /data/coolify/ssh/mux -mkdir -p /data/coolify/source +mkdir -p /data/coolify/{source,ssh,applications,databases,backups,services,proxy} +mkdir -p /data/coolify/ssh/{keys,mux} mkdir -p /data/coolify/proxy/dynamic chown -R 9999:root /data/coolify From 083dc1505323228dd74170b3be3fee3d0762f74d Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 15 Jan 2024 08:40:46 +0100 Subject: [PATCH 06/11] Update version and add OpenSSH server detection and PermitRootLogin check --- scripts/install.sh | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index af364f9c9..a92755107 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -6,7 +6,7 @@ set -e # Exit immediately if a command exits with a non-zero status #set -u # Treat unset variables as an error and exit set -o pipefail # Cause a pipeline to return the status of the last command that exited with a non-zero status -VERSION="1.1.0" +VERSION="1.2.0" DOCKER_VERSION="24.0" CDN="https://cdn.coollabs.io/coolify" @@ -65,6 +65,44 @@ sles | opensuse-leap | opensuse-tumbleweed) ;; esac +# Detect OpenSSH server +SSH_DETECTED=false +if [ -x "$(command -v systemctl)" ]; then + if systemctl status sshd >/dev/null 2>&1; then + echo "OpenSSH server is installed and running." + SSH_DETECTED=true + fi +elif [ -x "$(command -v service)" ]; then + if service sshd status >/dev/null 2>&1; then + echo "OpenSSH server is installed and running." + SSH_DETECTED=true + fi +fi +if [ "$SSH_DETECTED" = "false" ]; then + echo "###############################################################################" + echo "WARNING: Could not detect if OpenSSH server is installed and running - this does not mean that it is not installed, just that we could not detect it." + echo -e "Please make sure it is set, otherwise Coolify cannot connect to the host system. \n" + echo "###############################################################################" +fi + +# Detect SSH PermitRootLogin +SSH_PERMIT_ROOT_LOGIN=false +SSH_PERMIT_ROOT_LOGIN_CONFIG=$(grep "^PermitRootLogin" /etc/ssh/sshd_config | awk '{print $2}') || SSH_PERMIT_ROOT_LOGIN_CONFIG="N/A (commented out or not found at all)" +if [ "$SSH_PERMIT_ROOT_LOGIN_CONFIG" = "prohibit-password" ] || [ "$SSH_PERMIT_ROOT_LOGIN_CONFIG" = "yes" ] || [ "$SSH_PERMIT_ROOT_LOGIN_CONFIG" = "without-password" ]; then + echo "PermitRootLogin is enabled." + SSH_PERMIT_ROOT_LOGIN=true +fi + + +if [ "$SSH_PERMIT_ROOT_LOGIN" != "true" ]; then + echo "###############################################################################" + echo "WARNING: PermitRootLogin is not enabled in /etc/ssh/sshd_config." + echo -e "It is set to $SSH_PERMIT_ROOT_LOGIN_CONFIG. Should be prohibit-password, yes or without-password.\n" + echo -e "Please make sure it is set, otherwise Coolify cannot connect to the host system. \n" + echo "(Currently we only support root user to login via SSH, this will be changed in the future.)" + echo "###############################################################################" +fi + if ! [ -x "$(command -v docker)" ]; then echo "Docker is not installed. Installing Docker." curl https://releases.rancher.com/install-docker/${DOCKER_VERSION}.sh | sh From bccca6e87417cf9797ac143119d78852f056ba49 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 15 Jan 2024 09:03:46 +0100 Subject: [PATCH 07/11] add docs to server validation --- app/Livewire/Server/Form.php | 4 ++-- app/Livewire/Server/ShowPrivateKey.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Livewire/Server/Form.php b/app/Livewire/Server/Form.php index d81d69e8f..466ca5472 100644 --- a/app/Livewire/Server/Form.php +++ b/app/Livewire/Server/Form.php @@ -76,7 +76,7 @@ class Form extends Component $this->server->settings->is_usable = true; $this->server->settings->save(); } else { - $this->dispatch('error', 'Server is not reachable. Please check your connection and configuration.'); + $this->dispatch('error', 'Server is not reachable.
    Please validate your configuration and connection. See this
    documentation.'); return; } } @@ -85,7 +85,7 @@ class Form extends Component try { $uptime = $this->server->validateConnection(); if (!$uptime) { - $install && $this->dispatch('error', 'Server is not reachable. Please check your connection and configuration.'); + $install && $this->dispatch('error', 'Server is not reachable.
    Please validate your configuration and connection. See this documentation.'); return; } $supported_os_type = $this->server->validateOS(); diff --git a/app/Livewire/Server/ShowPrivateKey.php b/app/Livewire/Server/ShowPrivateKey.php index 8478094ad..a39765c71 100644 --- a/app/Livewire/Server/ShowPrivateKey.php +++ b/app/Livewire/Server/ShowPrivateKey.php @@ -39,7 +39,7 @@ class ShowPrivateKey extends Component if ($uptime) { $this->dispatch('success', 'Server is reachable.'); } else { - $this->dispatch('error', 'Server is not reachable. Please check your connection and private key configuration.'); + $this->dispatch('error', 'Server is not reachable.
    Please validate your configuration and connection. See this documentation.'); return; } } catch (\Throwable $e) { From 1afb509c3322192f93381976bf3b235e8b8e74af Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 15 Jan 2024 10:03:15 +0100 Subject: [PATCH 08/11] add domain validation + custom dns servers add new guides / docs --- app/Livewire/Project/Application/General.php | 13 +++-- app/Livewire/Server/Form.php | 4 +- app/Livewire/Server/ShowPrivateKey.php | 2 +- app/Livewire/Settings/Configuration.php | 13 +++++ bootstrap/helpers/proxy.php | 2 +- bootstrap/helpers/shared.php | 51 +++++++++++++++++-- composer.json | 1 + composer.lock | 50 +++++++++++++++++- ...024_01_15_084609_add_custom_dns_server.php | 30 +++++++++++ .../livewire/settings/configuration.blade.php | 4 +- 10 files changed, 158 insertions(+), 12 deletions(-) create mode 100644 database/migrations/2024_01_15_084609_add_custom_dns_server.php diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.php index 0c5828af3..ab16f64d7 100644 --- a/app/Livewire/Project/Application/General.php +++ b/app/Livewire/Project/Application/General.php @@ -209,7 +209,7 @@ class General extends Component public function updatedApplicationFqdn() { $this->resetDefaultLabels(false); - $this->dispatch('success', 'Labels reset to default!'); + // $this->dispatch('success', 'Labels reset to default!'); } public function submit($showToaster = true) { @@ -235,9 +235,16 @@ class General extends Component ]); } if (data_get($this->application, 'fqdn')) { - $domains = Str::of($this->application->fqdn)->trim()->explode(',')->map(function ($domain) { - return Str::of($domain)->trim()->lower(); + $this->application->fqdn = str($this->application->fqdn)->replaceEnd(',', '')->trim(); + $domains = str($this->application->fqdn)->trim()->explode(',')->map(function ($domain) { + return str($domain)->trim()->lower(); }); + $domains = $domains->unique(); + foreach ($domains as $domain) { + if (!validate_dns_entry($domain, $this->application->destination->server)) { + $showToaster && $this->dispatch('error', "Validating DNS settings for: $domain failed.
    Make sure you have added the DNS records correctly.

    Check this documentation for further help."); + } + } $this->application->fqdn = $domains->implode(','); } diff --git a/app/Livewire/Server/Form.php b/app/Livewire/Server/Form.php index 466ca5472..d832c83d8 100644 --- a/app/Livewire/Server/Form.php +++ b/app/Livewire/Server/Form.php @@ -76,7 +76,7 @@ class Form extends Component $this->server->settings->is_usable = true; $this->server->settings->save(); } else { - $this->dispatch('error', 'Server is not reachable.
    Please validate your configuration and connection. See this documentation.'); + $this->dispatch('error', 'Server is not reachable.
    Please validate your configuration and connection.

    Check this documentation for further help.'); return; } } @@ -85,7 +85,7 @@ class Form extends Component try { $uptime = $this->server->validateConnection(); if (!$uptime) { - $install && $this->dispatch('error', 'Server is not reachable.
    Please validate your configuration and connection. See this documentation.'); + $install && $this->dispatch('error', 'Server is not reachable.
    Please validate your configuration and connection.

    Check this documentation for further help.'); return; } $supported_os_type = $this->server->validateOS(); diff --git a/app/Livewire/Server/ShowPrivateKey.php b/app/Livewire/Server/ShowPrivateKey.php index a39765c71..0834866c1 100644 --- a/app/Livewire/Server/ShowPrivateKey.php +++ b/app/Livewire/Server/ShowPrivateKey.php @@ -39,7 +39,7 @@ class ShowPrivateKey extends Component if ($uptime) { $this->dispatch('success', 'Server is reachable.'); } else { - $this->dispatch('error', 'Server is not reachable.
    Please validate your configuration and connection. See this documentation.'); + $this->dispatch('error', 'Server is not reachable.
    Please validate your configuration and connection.

    Check this documentation for further help.'); return; } } catch (\Throwable $e) { diff --git a/app/Livewire/Settings/Configuration.php b/app/Livewire/Settings/Configuration.php index 43f4afb7a..bafc82447 100644 --- a/app/Livewire/Settings/Configuration.php +++ b/app/Livewire/Settings/Configuration.php @@ -15,6 +15,7 @@ class Configuration extends Component public bool $do_not_track; public bool $is_auto_update_enabled; public bool $is_registration_enabled; + public bool $is_dns_validation_enabled; public bool $next_channel; protected string $dynamic_config_path = '/data/coolify/proxy/dynamic'; protected Server $server; @@ -24,12 +25,14 @@ class Configuration extends Component 'settings.resale_license' => 'nullable', 'settings.public_port_min' => 'required', 'settings.public_port_max' => 'required', + 'settings.custom_dns_servers' => 'nullable', ]; protected $validationAttributes = [ 'settings.fqdn' => 'FQDN', 'settings.resale_license' => 'Resale License', 'settings.public_port_min' => 'Public port min', 'settings.public_port_max' => 'Public port max', + 'settings.custom_dns_servers' => 'Custom DNS servers', ]; public function mount() @@ -38,6 +41,7 @@ class Configuration extends Component $this->is_auto_update_enabled = $this->settings->is_auto_update_enabled; $this->is_registration_enabled = $this->settings->is_registration_enabled; $this->next_channel = $this->settings->next_channel; + $this->is_dns_validation_enabled = $this->settings->is_dns_validation_enabled; } public function instantSave() @@ -45,6 +49,7 @@ class Configuration extends Component $this->settings->do_not_track = $this->do_not_track; $this->settings->is_auto_update_enabled = $this->is_auto_update_enabled; $this->settings->is_registration_enabled = $this->is_registration_enabled; + $this->settings->is_dns_validation_enabled = $this->is_dns_validation_enabled; if ($this->next_channel) { $this->settings->next_channel = false; $this->next_channel = false; @@ -63,6 +68,14 @@ class Configuration extends Component return; } $this->validate(); + + $this->settings->custom_dns_servers = str($this->settings->custom_dns_servers)->replaceEnd(',', '')->trim(); + $this->settings->custom_dns_servers = str($this->settings->custom_dns_servers)->trim()->explode(',')->map(function ($dns) { + return str($dns)->trim()->lower(); + }); + $this->settings->custom_dns_servers = $this->settings->custom_dns_servers->unique(); + $this->settings->custom_dns_servers = $this->settings->custom_dns_servers->implode(','); + $this->settings->save(); $this->server = Server::findOrFail(0); $this->setup_instance_fqdn(); diff --git a/bootstrap/helpers/proxy.php b/bootstrap/helpers/proxy.php index 1c419afbf..80eebe1a6 100644 --- a/bootstrap/helpers/proxy.php +++ b/bootstrap/helpers/proxy.php @@ -288,7 +288,7 @@ function setup_dynamic_configuration() ], $server); if (config('app.env') == 'local') { - ray($yaml); + // ray($yaml); } } } diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index 87a850fe4..ce51745db 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -22,14 +22,11 @@ use App\Notifications\Channels\EmailChannel; use App\Notifications\Channels\TelegramChannel; use App\Notifications\Internal\GeneralNotification; use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException; -use Illuminate\Database\QueryException; use Illuminate\Mail\Message; use Illuminate\Notifications\Messages\MailMessage; -use Illuminate\Support\Collection; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Http; -use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Request; use Illuminate\Support\Facades\Route; @@ -40,6 +37,7 @@ use Visus\Cuid2\Cuid2; use phpseclib3\Crypt\RSA; use Spatie\Url\Url; use Symfony\Component\Yaml\Yaml; +use PurplePixie\PhpDns\DNSQuery; function base_configuration_dir(): string { @@ -1592,3 +1590,50 @@ function getRealtime() return $envDefined; } } + +function validate_dns_entry(string $fqdn, Server $server) +{ + $url = Url::fromString($fqdn); + $host = $url->getHost(); + if (str($host)->contains('sslip.io')) { + return true; + } + $settings = InstanceSettings::get(); + $is_dns_validation_enabled = data_get($settings, 'is_dns_validation_enabled'); + if (!$is_dns_validation_enabled) { + return true; + } + $dnsServers = data_get($settings, 'custom_dns_servers'); + $dnsServers = str($dnsServers)->explode(','); + if ($server->id === 0) { + $ip = data_get($settings, 'public_ipv4') || data_get($settings, 'public_ipv6') || $server->ip; + } else { + $ip = $server->ip; + } + $foundMatch = false; + $type = \PurplePixie\PhpDns\DNSTypes::NAME_A; + foreach ($dnsServers as $dnsServer) { + try { + ray("Checking $host on $dnsServer"); + $query = new DNSQuery($dnsServer); + $results = $query->query($host, $type); + if ($results === false || $query->hasError()) { + ray("Error: " . $query->getLasterror()); + } else { + foreach ($results as $result) { + if ($result->getType() == $type) { + if ($result->getData() === $ip) { + ray($host . " has IP address " . $result->getData()); + ray($result->getString()); + $foundMatch = true; + break; + } + } + } + } + } catch (\Exception $e) { + } + } + ray("Found match: $foundMatch"); + return $foundMatch; +} diff --git a/composer.json b/composer.json index 5a7f39844..e9cf53d10 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,7 @@ "nubs/random-name-generator": "^2.2", "phpseclib/phpseclib": "~3.0", "poliander/cron": "^3.0", + "purplepixie/phpdns": "^2.1", "pusher/pusher-php-server": "^7.2", "resend/resend-laravel": "^0.5.0", "sentry/sentry-laravel": "^3.4", diff --git a/composer.lock b/composer.lock index 82bed2c82..8d0e9da81 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": "44337ff4ff1d9c435d9776fec01ebe9c", + "content-hash": "de3b59fade9b132d2582a40dcf3c00f9", "packages": [ { "name": "amphp/amp", @@ -6287,6 +6287,54 @@ }, "time": "2023-10-14T21:56:36+00:00" }, + { + "name": "purplepixie/phpdns", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/purplepixie/phpdns.git", + "reference": "e1e4f18a60d01947e2aac7157325a9e2e7755bf7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/purplepixie/phpdns/zipball/e1e4f18a60d01947e2aac7157325a9e2e7755bf7", + "reference": "e1e4f18a60d01947e2aac7157325a9e2e7755bf7", + "shasum": "" + }, + "require": { + "php": ">=7.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-0": { + "PurplePixie": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Cutting", + "email": "dcutting@purplepixie.org" + } + ], + "description": "PHP DNS Direct Query Module", + "support": { + "issues": "https://github.com/purplepixie/phpdns/issues", + "source": "https://github.com/purplepixie/phpdns/tree/2.1.0" + }, + "time": "2023-11-06T15:37:19+00:00" + }, { "name": "pusher/pusher-php-server", "version": "7.2.4", diff --git a/database/migrations/2024_01_15_084609_add_custom_dns_server.php b/database/migrations/2024_01_15_084609_add_custom_dns_server.php new file mode 100644 index 000000000..24d288d02 --- /dev/null +++ b/database/migrations/2024_01_15_084609_add_custom_dns_server.php @@ -0,0 +1,30 @@ +boolean('is_dns_validation_enabled')->default(true); + $table->string('custom_dns_servers')->nullable()->default('1.1.1.1'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('instance_settings', function (Blueprint $table) { + $table->dropColumn('is_dns_validation_enabled'); + $table->dropColumn('custom_dns_servers'); + }); + } +}; diff --git a/resources/views/livewire/settings/configuration.blade.php b/resources/views/livewire/settings/configuration.blade.php index 4abdbf600..091a07dbb 100644 --- a/resources/views/livewire/settings/configuration.blade.php +++ b/resources/views/livewire/settings/configuration.blade.php @@ -9,8 +9,10 @@
    General configuration for your Coolify instance.
    -
    +
    + +
    {{--
    From 0f5559bc61594f3ff708c05a3e1cfd11ca023646 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 15 Jan 2024 10:19:37 +0100 Subject: [PATCH 09/11] fix: service stack view --- .../project/service/configuration.blade.php | 10 +++------- .../livewire/project/service/index.blade.php | 17 ++--------------- .../livewire/project/service/storage.blade.php | 5 +++++ 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/resources/views/livewire/project/service/configuration.blade.php b/resources/views/livewire/project/service/configuration.blade.php index c02a2ea05..62b02ec88 100644 --- a/resources/views/livewire/project/service/configuration.blade.php +++ b/resources/views/livewire/project/service/configuration.blade.php @@ -68,8 +68,7 @@
    {{ $application->status }}
    -
    - -
    +
    -
    + @endisset
    -
    - -
    - @endisset +
    - diff --git a/resources/views/livewire/project/service/storage.blade.php b/resources/views/livewire/project/service/storage.blade.php index 8aef17717..59d3a8b23 100644 --- a/resources/views/livewire/project/service/storage.blade.php +++ b/resources/views/livewire/project/service/storage.blade.php @@ -48,5 +48,10 @@ @endforeach @endif + @if ( + $resource->persistentStorages()->get()->count() == 0 && + $resource->fileStorages()->get()->count() == 0) +
    No storages found.
    + @endif @endif From da71353bfa7b865a0efb3446f97228b8ccdf6041 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 15 Jan 2024 10:49:39 +0100 Subject: [PATCH 10/11] Update application and proxy configuration --- app/Livewire/Project/Application/Heading.php | 2 +- bootstrap/helpers/docker.php | 5 +++-- bootstrap/helpers/proxy.php | 18 ++++++++++++++---- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/Livewire/Project/Application/Heading.php b/app/Livewire/Project/Application/Heading.php index a8a5f7d27..4a138eaca 100644 --- a/app/Livewire/Project/Application/Heading.php +++ b/app/Livewire/Project/Application/Heading.php @@ -39,7 +39,7 @@ class Heading extends Component } else { dispatch(new ServerStatusJob($this->application->destination->server)); } - if ($showNotification) $this->dispatch('success', "Application ({$this->application->name}) status updated."); + if ($showNotification) $this->dispatch('success', "Application status updated."); } public function force_deploy_without_cache() diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.php index 781888595..1ae92ff3a 100644 --- a/bootstrap/helpers/docker.php +++ b/bootstrap/helpers/docker.php @@ -229,11 +229,12 @@ function fqdnLabelsForTraefik(string $uuid, Collection $domains, bool $is_force_ $http_label = "http-{$loop}-{$uuid}"; $https_label = "https-{$loop}-{$uuid}"; + $labels->push("traefik.http.middlewares.gzip.compress=true"); + $labels->push("traefik.http.routers.{$https_label}.middlewares=gzip"); if ($schema === 'https') { // Set labels for https $labels->push("traefik.http.routers.{$https_label}.rule=Host(`{$host}`) && PathPrefix(`{$path}`)"); $labels->push("traefik.http.routers.{$https_label}.entryPoints=https"); - $labels->push("traefik.http.routers.{$https_label}.middlewares=gzip"); if ($port) { $labels->push("traefik.http.routers.{$https_label}.service={$https_label}"); $labels->push("traefik.http.services.{$https_label}.loadbalancer.server.port=$port"); @@ -254,13 +255,13 @@ function fqdnLabelsForTraefik(string $uuid, Collection $domains, bool $is_force_ $labels->push("traefik.http.routers.{$http_label}.service={$http_label}"); } if ($is_force_https_enabled) { + $labels->push("traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"); $labels->push("traefik.http.routers.{$http_label}.middlewares=redirect-to-https"); } } else { // Set labels for http $labels->push("traefik.http.routers.{$http_label}.rule=Host(`{$host}`) && PathPrefix(`{$path}`)"); $labels->push("traefik.http.routers.{$http_label}.entryPoints=http"); - $labels->push("traefik.http.routers.{$http_label}.middlewares=gzip"); if ($port) { $labels->push("traefik.http.services.{$http_label}.loadbalancer.server.port=$port"); $labels->push("traefik.http.routers.{$http_label}.service={$http_label}"); diff --git a/bootstrap/helpers/proxy.php b/bootstrap/helpers/proxy.php index 80eebe1a6..a273a90e0 100644 --- a/bootstrap/helpers/proxy.php +++ b/bootstrap/helpers/proxy.php @@ -103,9 +103,6 @@ function generate_default_proxy_configuration(Server $server) "traefik.http.routers.traefik.entrypoints=http", "traefik.http.routers.traefik.service=api@internal", "traefik.http.services.traefik.loadbalancer.server.port=8080", - // Global Middlewares - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https", - "traefik.http.middlewares.gzip.compress=true", ]; $config = [ "version" => "3.8", @@ -198,10 +195,23 @@ function setup_dynamic_configuration() $traefik_dynamic_conf = [ 'http' => [ + 'middlewares' => [ + 'redirect-to-https' => [ + 'redirectscheme' => [ + 'scheme' => 'https', + ], + ], + 'gzip' => [ + 'compress' => true, + ], + ], 'routers' => [ 'coolify-http' => [ + 'middlewares' => [ + 0 => 'gzip', + ], 'entryPoints' => [ 0 => 'http', ], @@ -251,7 +261,7 @@ function setup_dynamic_configuration() if ($schema === 'https') { $traefik_dynamic_conf['http']['routers']['coolify-http']['middlewares'] = [ - 0 => 'redirect-to-https@docker', + 0 => 'redirect-to-https', ]; $traefik_dynamic_conf['http']['routers']['coolify-https'] = [ From 48990db699131310755432f8669e38be0eac37f2 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 15 Jan 2024 11:00:09 +0100 Subject: [PATCH 11/11] Add link to documentation for further help --- resources/views/livewire/boarding/index.blade.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/views/livewire/boarding/index.blade.php b/resources/views/livewire/boarding/index.blade.php index 5a52d3a17..179881e03 100644 --- a/resources/views/livewire/boarding/index.blade.php +++ b/resources/views/livewire/boarding/index.blade.php @@ -56,6 +56,8 @@ Please make sure you have the correct public key in your ~/.ssh/authorized_keys file for user 'root' or skip the boarding process and add a new private key manually to Coolify and to the server. +
    + Check this documentation for further help. Check again