mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 16:17:10 +00:00
feat(ui): Shadow UI redesign, domain management, and DNS autoconfigure (#11119)
Co-authored-by: ShadowArcanist <162910371+ShadowArcanist@users.noreply.github.com>
This commit is contained in:
1 parent
0b843bb07c
commit
8ae56587d5
497 files changed
+44045
-22630
No files matched your search
@@ -48,6 +48,8 @@ class Advanced extends Component
|
||||
#[Validate('boolean')]
|
||||
public bool $webhook_allow_localhost;
|
||||
|
||||
public ?string $domain_connect_private_key = null;
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
@@ -63,6 +65,7 @@ class Advanced extends Component
|
||||
'is_mcp_server_enabled' => 'boolean',
|
||||
'webhook_allowed_internal_hosts' => 'nullable|string',
|
||||
'webhook_allow_localhost' => 'boolean',
|
||||
'domain_connect_private_key' => 'nullable|string',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -84,6 +87,8 @@ class Advanced extends Component
|
||||
$this->is_mcp_server_enabled = $this->settings->is_mcp_server_enabled ?? false;
|
||||
$this->webhook_allowed_internal_hosts = collect($this->settings->webhook_allowed_internal_hosts ?? [])->implode(',');
|
||||
$this->webhook_allow_localhost = $this->settings->webhook_allow_localhost ?? false;
|
||||
// Do not prefill the secret into the form; only update when the admin pastes a new value.
|
||||
$this->domain_connect_private_key = null;
|
||||
}
|
||||
|
||||
public function submit()
|
||||
@@ -155,6 +160,11 @@ class Advanced extends Component
|
||||
return;
|
||||
}
|
||||
|
||||
if (isCloud() && filled($this->domain_connect_private_key)) {
|
||||
$this->settings->domain_connect_private_key = $this->normalizeDomainConnectPrivateKey($this->domain_connect_private_key);
|
||||
$this->domain_connect_private_key = null;
|
||||
}
|
||||
|
||||
$this->instantSave($webhookAllowedInternalHosts);
|
||||
} catch (\Exception $e) {
|
||||
return handleError($e, $this);
|
||||
@@ -187,6 +197,32 @@ class Advanced extends Component
|
||||
}
|
||||
}
|
||||
|
||||
public function clearDomainConnectPrivateKey(): void
|
||||
{
|
||||
try {
|
||||
if (! isCloud()) {
|
||||
return;
|
||||
}
|
||||
$this->authorize('update', $this->settings);
|
||||
$this->settings->domain_connect_private_key = null;
|
||||
$this->settings->save();
|
||||
$this->domain_connect_private_key = null;
|
||||
$this->dispatch('success', 'Domain Connect private key removed.');
|
||||
} catch (\Exception $e) {
|
||||
handleError($e, $this);
|
||||
}
|
||||
}
|
||||
|
||||
private function normalizeDomainConnectPrivateKey(string $key): string
|
||||
{
|
||||
$key = str_replace(["\r\n", "\r"], "\n", trim($key));
|
||||
if (! str_contains($key, "\n") && str_contains($key, '\\n')) {
|
||||
$key = str_replace('\\n', "\n", $key);
|
||||
}
|
||||
|
||||
return $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, string>|false
|
||||
*/
|
||||
@@ -230,33 +266,6 @@ class Advanced extends Component
|
||||
return filter_var($entry, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) !== false;
|
||||
}
|
||||
|
||||
public function toggleRegistration($password): bool
|
||||
{
|
||||
if (! verifyPasswordConfirmation($password, $this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->settings->is_registration_enabled = $this->is_registration_enabled = true;
|
||||
$this->settings->save();
|
||||
$this->dispatch('success', 'Registration has been enabled.');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function toggleTwoStepConfirmation($password): bool
|
||||
{
|
||||
$this->authorize('update', $this->settings);
|
||||
if (! verifyPasswordConfirmation($password, $this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->settings->disable_two_step_confirmation = $this->disable_two_step_confirmation = true;
|
||||
$this->settings->save();
|
||||
$this->dispatch('success', 'Two step confirmation has been disabled.');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.settings.advanced');
|
||||
|
||||
Reference in new issue
Block a user