Skip to content

Commit

Permalink
Merge pull request coollabsio#4306 from coollabsio/next
Browse files Browse the repository at this point in the history
v4.0.0-beta.370
  • Loading branch information
andrasbacsai authored Nov 15, 2024
2 parents 73af96e + 1fc4c78 commit 092bd91
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 25 deletions.
7 changes: 3 additions & 4 deletions app/Models/PrivateKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,14 @@ public static function generateFingerprint($privateKey)
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()
Expand Down
5 changes: 4 additions & 1 deletion app/View/Components/Forms/Checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ public function __construct(
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';
}
}

/**
Expand Down
24 changes: 16 additions & 8 deletions bootstrap/helpers/docker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]);
}
Expand All @@ -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),
]);
}
Expand Down
4 changes: 2 additions & 2 deletions config/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion config/version.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

return '4.0.0-beta.369';
return '4.0.0-beta.370';
12 changes: 8 additions & 4 deletions resources/views/components/forms/checkbox.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
'disabled' => false,
'instantSave' => false,
'value' => null,
'checked' => false,
'hideLabel' => false,
'fullWidth' => false,
])
Expand All @@ -14,7 +15,9 @@
'w-full' => $fullWidth,
])>
@if (!$hideLabel)
<label @class(['flex gap-4 items-center px-0 min-w-fit label w-full cursor-pointer', 'opacity-40' => $disabled])>
<label @class([
'flex gap-4 items-center px-0 min-w-fit label w-full cursor-pointer',
])>
<span class="flex flex-grow gap-2">
@if ($label)
{!! $label !!}
Expand All @@ -26,9 +29,10 @@
@endif
</span>
@endif
<input @disabled($disabled) type="checkbox" {{ $attributes->merge(['class' => $defaultClass]) }}
@if ($instantSave) wire:loading.attr="disabled" wire:click='{{ $instantSave === 'instantSave' || $instantSave == '1' ? 'instantSave' : $instantSave }}'
wire:model={{ $id }} @else wire:model={{ $value ?? $id }} @endif />
<input @disabled($disabled) type="checkbox" {{ $attributes->merge(['class' => $defaultClass]) }}
@if ($instantSave) wire:loading.attr="disabled" wire:click='{{ $instantSave === 'instantSave' || $instantSave == '1' ? 'instantSave' : $instantSave }}'
@if ($checked) checked @endif
wire:model={{ $id }} @else wire:model={{ $value ?? $id }} @endif />
@if (!$hideLabel)
</label>
@endif
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/modal-input.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class="relative w-auto h-auto" wire:ignore>
@endif
<template x-teleport="body">
<div x-show="modalOpen"
class="fixed top-0 left-0 lg:px-0 px-4 z-[99] flex items-center justify-center w-screen h-screen" x-cloak>
class="fixed top-0 left-0 lg:px-0 px-4 z-[99] flex items-center justify-center w-screen h-screen">
<div x-show="modalOpen" x-transition:enter="ease-out duration-100" x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100" x-transition:leave="ease-in duration-100"
x-transition:leave-start="opacity-100" x-transition:leave-end="opacity-0"
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/settings/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class="px-4 py-2 text-gray-800 cursor-pointer hover:bg-gray-100 dark:hover:bg-co
@if (!is_null(config('constants.coolify.autoupdate', null)))
<div class="text-right md:w-96">
<x-forms.checkbox instantSave helper="AUTOUPDATE is set in .env file, you need to modify it there."
disabled id="is_auto_update_enabled" label="Enabled" />
disabled checked="{{ config('constants.coolify.autoupdate') }}" label="Auto Update Enabled" />
</div>
@else
<x-forms.checkbox instantSave id="is_auto_update_enabled" label="Auto Update Enabled" />
Expand Down
6 changes: 3 additions & 3 deletions versions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"coolify": {
"v4": {
"version": "4.0.0-beta.369"
"version": "4.0.0-beta.370"
},
"nightly": {
"version": "4.0.0-beta.370"
"version": "4.0.0-beta.371"
},
"helper": {
"version": "1.0.4"
Expand All @@ -16,4 +16,4 @@
"version": "0.0.15"
}
}
}
}

0 comments on commit 092bd91

Please sign in to comment.