diff --git a/app/Models/PrivateKey.php b/app/Models/PrivateKey.php index fab1f1de7..80015d87f 100644 --- a/app/Models/PrivateKey.php +++ b/app/Models/PrivateKey.php @@ -219,15 +219,14 @@ class PrivateKey extends BaseModel private static function fingerprintExists($fingerprint, $excludeId = null) { $query = self::query() - ->where('fingerprint', $fingerprint); + ->where('fingerprint', $fingerprint) + ->where('id', '!=', $excludeId); if (currentTeam()) { $query->where('team_id', currentTeam()->id); } - return $query - ->when($excludeId, fn ($query) => $query->where('id', '!=', $excludeId)) - ->exists(); + return $query->exists(); } public static function cleanupUnusedKeys() diff --git a/app/View/Components/Forms/Checkbox.php b/app/View/Components/Forms/Checkbox.php index 414dbf2ae..0bdebe7e4 100644 --- a/app/View/Components/Forms/Checkbox.php +++ b/app/View/Components/Forms/Checkbox.php @@ -17,11 +17,14 @@ class Checkbox extends Component public ?string $value = null, public ?string $label = null, public ?string $helper = null, + public string|bool|null $checked = false, public string|bool $instantSave = false, public bool $disabled = false, public string $defaultClass = 'dark:border-neutral-700 text-coolgray-400 focus:ring-warning dark:bg-coolgray-100 rounded cursor-pointer dark:disabled:bg-base dark:disabled:cursor-not-allowed', ) { - // + if ($this->disabled) { + $this->defaultClass .= ' opacity-40'; + } } /** diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.php index 302193131..da99c5cbd 100644 --- a/bootstrap/helpers/docker.php +++ b/bootstrap/helpers/docker.php @@ -227,13 +227,17 @@ function generateServiceSpecificFqdns(ServiceApplication|Application $resource) $MINIO_BROWSER_REDIRECT_URL = $variables->where('key', 'MINIO_BROWSER_REDIRECT_URL')->first(); $MINIO_SERVER_URL = $variables->where('key', 'MINIO_SERVER_URL')->first(); - if (str($MINIO_BROWSER_REDIRECT_URL->value)->isEmpty()) { - $MINIO_BROWSER_REDIRECT_URL?->update([ + if (is_null($MINIO_BROWSER_REDIRECT_URL) || is_null($MINIO_SERVER_URL)) { + return collect([]); + } + + if (str($MINIO_BROWSER_REDIRECT_URL->value ?? '')->isEmpty()) { + $MINIO_BROWSER_REDIRECT_URL->update([ 'value' => generateFqdn($server, 'console-'.$uuid, true), ]); } - if (str($MINIO_SERVER_URL->value)->isEmpty()) { - $MINIO_SERVER_URL?->update([ + if (str($MINIO_SERVER_URL->value ?? '')->isEmpty()) { + $MINIO_SERVER_URL->update([ 'value' => generateFqdn($server, 'minio-'.$uuid, true), ]); } @@ -246,13 +250,17 @@ function generateServiceSpecificFqdns(ServiceApplication|Application $resource) $LOGTO_ENDPOINT = $variables->where('key', 'LOGTO_ENDPOINT')->first(); $LOGTO_ADMIN_ENDPOINT = $variables->where('key', 'LOGTO_ADMIN_ENDPOINT')->first(); - if (str($LOGTO_ENDPOINT?->value)->isEmpty()) { - $LOGTO_ENDPOINT?->update([ + if (is_null($LOGTO_ENDPOINT) || is_null($LOGTO_ADMIN_ENDPOINT)) { + return collect([]); + } + + if (str($LOGTO_ENDPOINT->value ?? '')->isEmpty()) { + $LOGTO_ENDPOINT->update([ 'value' => generateFqdn($server, 'logto-'.$uuid), ]); } - if (str($LOGTO_ADMIN_ENDPOINT?->value)->isEmpty()) { - $LOGTO_ADMIN_ENDPOINT?->update([ + if (str($LOGTO_ADMIN_ENDPOINT->value ?? '')->isEmpty()) { + $LOGTO_ADMIN_ENDPOINT->update([ 'value' => generateFqdn($server, 'logto-admin-'.$uuid), ]); } diff --git a/config/constants.php b/config/constants.php index 8a88c6c7a..363cdd14f 100644 --- a/config/constants.php +++ b/config/constants.php @@ -2,9 +2,9 @@ return [ 'coolify' => [ - 'version' => '4.0.0-beta.369', + 'version' => '4.0.0-beta.370', 'self_hosted' => env('SELF_HOSTED', true), - 'autoupdate' => env('AUTOUPDATE', false), + 'autoupdate' => env('AUTOUPDATE'), 'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'), 'helper_image' => env('HELPER_IMAGE', 'ghcr.io/coollabsio/coolify-helper'), 'is_windows_docker_desktop' => env('IS_WINDOWS_DOCKER_DESKTOP', false), diff --git a/config/version.php b/config/version.php index 00330af8b..64226ac05 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@ false, 'instantSave' => false, 'value' => null, + 'checked' => false, 'hideLabel' => false, 'fullWidth' => false, ]) @@ -14,7 +15,9 @@ 'w-full' => $fullWidth, ])> @if (!$hideLabel) -