mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-17 06:14:40 +00:00
fix(validation): add input validation for emails configuration
This commit is contained in:
1 parent
3b2e6e11f1
commit
1daff4e23c
4 files changed
+7
-7
No files matched your search
@@ -42,7 +42,7 @@ class Email extends Component
|
|||||||
public ?string $smtpHost = null;
|
public ?string $smtpHost = null;
|
||||||
|
|
||||||
#[Validate(['nullable', 'numeric', 'min:1', 'max:65535'])]
|
#[Validate(['nullable', 'numeric', 'min:1', 'max:65535'])]
|
||||||
public ?int $smtpPort = null;
|
public ?string $smtpPort = null;
|
||||||
|
|
||||||
#[Validate(['nullable', 'string', 'in:starttls,tls,none'])]
|
#[Validate(['nullable', 'string', 'in:starttls,tls,none'])]
|
||||||
public ?string $smtpEncryption = null;
|
public ?string $smtpEncryption = null;
|
||||||
@@ -54,7 +54,7 @@ class Email extends Component
|
|||||||
public ?string $smtpPassword = null;
|
public ?string $smtpPassword = null;
|
||||||
|
|
||||||
#[Validate(['nullable', 'numeric'])]
|
#[Validate(['nullable', 'numeric'])]
|
||||||
public ?int $smtpTimeout = null;
|
public ?string $smtpTimeout = null;
|
||||||
|
|
||||||
#[Validate(['boolean'])]
|
#[Validate(['boolean'])]
|
||||||
public bool $resendEnabled = false;
|
public bool $resendEnabled = false;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class SettingsEmail extends Component
|
|||||||
public ?string $smtpHost = null;
|
public ?string $smtpHost = null;
|
||||||
|
|
||||||
#[Validate(['nullable', 'numeric', 'min:1', 'max:65535'])]
|
#[Validate(['nullable', 'numeric', 'min:1', 'max:65535'])]
|
||||||
public ?int $smtpPort = null;
|
public ?string $smtpPort = null;
|
||||||
|
|
||||||
#[Validate(['nullable', 'string', 'in:starttls,tls,none'])]
|
#[Validate(['nullable', 'string', 'in:starttls,tls,none'])]
|
||||||
public ?string $smtpEncryption = 'starttls';
|
public ?string $smtpEncryption = 'starttls';
|
||||||
@@ -45,7 +45,7 @@ class SettingsEmail extends Component
|
|||||||
public ?string $smtpPassword = null;
|
public ?string $smtpPassword = null;
|
||||||
|
|
||||||
#[Validate(['nullable', 'numeric'])]
|
#[Validate(['nullable', 'numeric'])]
|
||||||
public ?int $smtpTimeout = null;
|
public ?string $smtpTimeout = null;
|
||||||
|
|
||||||
#[Validate(['boolean'])]
|
#[Validate(['boolean'])]
|
||||||
public bool $resendEnabled = false;
|
public bool $resendEnabled = false;
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
<div class="flex flex-col w-full gap-2 xl:flex-row">
|
<div class="flex flex-col w-full gap-2 xl:flex-row">
|
||||||
<x-forms.input canGate="update" :canResource="$settings" required id="smtpHost" placeholder="smtp.mailgun.org" label="Host" />
|
<x-forms.input canGate="update" :canResource="$settings" required id="smtpHost" placeholder="smtp.mailgun.org" label="Host" />
|
||||||
<x-forms.input canGate="update" :canResource="$settings" required id="smtpPort" placeholder="587" label="Port" />
|
<x-forms.input canGate="update" :canResource="$settings" required id="smtpPort" type="number" placeholder="587" label="Port" />
|
||||||
<x-forms.select canGate="update" :canResource="$settings" required id="smtpEncryption" label="Encryption">
|
<x-forms.select canGate="update" :canResource="$settings" required id="smtpEncryption" label="Encryption">
|
||||||
<option value="starttls">StartTLS</option>
|
<option value="starttls">StartTLS</option>
|
||||||
<option value="tls">TLS/SSL</option>
|
<option value="tls">TLS/SSL</option>
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
<div class="flex flex-col w-full gap-2 xl:flex-row">
|
<div class="flex flex-col w-full gap-2 xl:flex-row">
|
||||||
<x-forms.input canGate="update" :canResource="$settings" id="smtpUsername" label="SMTP Username" />
|
<x-forms.input canGate="update" :canResource="$settings" id="smtpUsername" label="SMTP Username" />
|
||||||
<x-forms.input canGate="update" :canResource="$settings" id="smtpPassword" type="password" label="SMTP Password" />
|
<x-forms.input canGate="update" :canResource="$settings" id="smtpPassword" type="password" label="SMTP Password" />
|
||||||
<x-forms.input canGate="update" :canResource="$settings" id="smtpTimeout" helper="Timeout value for sending emails."
|
<x-forms.input canGate="update" :canResource="$settings" id="smtpTimeout" type="number" helper="Timeout value for sending emails."
|
||||||
label="Timeout" />
|
label="Timeout" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
<x-forms.input id="smtpUsername" label="SMTP Username" />
|
<x-forms.input id="smtpUsername" label="SMTP Username" />
|
||||||
<x-forms.input id="smtpPassword" type="password" label="SMTP Password"
|
<x-forms.input id="smtpPassword" type="password" label="SMTP Password"
|
||||||
autocomplete="new-password" />
|
autocomplete="new-password" />
|
||||||
<x-forms.input id="smtpTimeout" helper="Timeout value for sending emails." label="Timeout" />
|
<x-forms.input id="smtpTimeout" type="number" helper="Timeout value for sending emails." label="Timeout" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in new issue
Block a user