mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 17:21:04 +00:00
fix(validation): enforce url validation for instance domain (#8078)
This commit is contained in:
@@ -14,7 +14,7 @@ class Index extends Component
|
|||||||
|
|
||||||
public ?Server $server = null;
|
public ?Server $server = null;
|
||||||
|
|
||||||
#[Validate('nullable|string|max:255')]
|
#[Validate('nullable|string|max:255|url')]
|
||||||
public ?string $fqdn = null;
|
public ?string $fqdn = null;
|
||||||
|
|
||||||
#[Validate('required|integer|min:1025|max:65535')]
|
#[Validate('required|integer|min:1025|max:65535')]
|
||||||
@@ -46,6 +46,11 @@ class Index extends Component
|
|||||||
|
|
||||||
public $buildActivityId = null;
|
public $buildActivityId = null;
|
||||||
|
|
||||||
|
protected array $messages = [
|
||||||
|
'fqdn.url' => 'Invalid instance URL.',
|
||||||
|
'fqdn.max' => 'URL must not exceed 255 characters.',
|
||||||
|
];
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
return view('livewire.settings.index');
|
return view('livewire.settings.index');
|
||||||
|
|||||||
@@ -18,8 +18,10 @@
|
|||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<div class="flex flex-wrap items-end gap-2">
|
<div class="flex flex-wrap items-end gap-2">
|
||||||
<div class="flex gap-2 md:flex-row flex-col w-full">
|
<div class="flex gap-2 md:flex-row flex-col w-full">
|
||||||
<x-forms.input canGate="update" :canResource="$settings" id="fqdn" label="Domain"
|
<x-forms.input canGate="update" :canResource="$settings" id="fqdn" label="URL"
|
||||||
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."
|
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" />
|
placeholder="https://coolify.yourdomain.com" />
|
||||||
<x-forms.input canGate="update" :canResource="$settings" id="instance_name" label="Name" placeholder="Coolify"
|
<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." />
|
helper="Custom name for your Coolify instance, shown in the URL." />
|
||||||
|
|||||||
Reference in New Issue
Block a user