fix(validation): enforce url validation for instance domain (#8078)
This commit is contained in:
parent
ed0002524e
commit
e57cc16b91
2 changed files with 10 additions and 3 deletions
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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 won’t 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." />
|
||||
|
|
|
|||
Loading…
Reference in a new issue