fix(validation): enforce url validation for instance domain (#8078)

This commit is contained in:
ShadowArcanist 2026-02-03 22:00:12 +01:00 committed by GitHub
parent ed0002524e
commit e57cc16b91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View file

@ -14,7 +14,7 @@ class Index extends Component
public ?Server $server = null;
#[Validate('nullable|string|max:255')]
#[Validate('nullable|string|max:255|url')]
public ?string $fqdn = null;
#[Validate('required|integer|min:1025|max:65535')]
@ -46,6 +46,11 @@ class Index extends Component
public $buildActivityId = null;
protected array $messages = [
'fqdn.url' => 'Invalid instance URL.',
'fqdn.max' => 'URL must not exceed 255 characters.',
];
public function render()
{
return view('livewire.settings.index');

View file

@ -18,8 +18,10 @@ class="flex flex-col h-full gap-8 sm:flex-row">
<div class="flex flex-col gap-2">
<div class="flex flex-wrap items-end gap-2">
<div class="flex gap-2 md:flex-row flex-col w-full">
<x-forms.input canGate="update" :canResource="$settings" id="fqdn" label="Domain"
helper="Enter the full domain name (FQDN) of the instance, including 'https://' if you want to secure the dashboard with HTTPS. Setting this will make the dashboard accessible via this domain, secured by HTTPS, instead of just the IP address."
<x-forms.input canGate="update" :canResource="$settings" id="fqdn" label="URL"
helper="Enter the full URL of the instance (for example, https://dashboard.example.com).<br><br>
<span class='dark:text-warning text-coollabs'>Important: </span>
If you want the dashboard to be accessible over HTTPS, you must include <b>https://</b> at the start of the URL. Without it, the dashboard will use HTTP and wont be secured."
placeholder="https://coolify.yourdomain.com" />
<x-forms.input canGate="update" :canResource="$settings" id="instance_name" label="Name" placeholder="Coolify"
helper="Custom name for your Coolify instance, shown in the URL." />