mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
fix custom ssl creation (#122)
This commit is contained in:
@ -24,7 +24,7 @@ public function create(Site $site, array $input): void
|
||||
'type' => $input['type'],
|
||||
'certificate' => $input['certificate'] ?? null,
|
||||
'pk' => $input['private'] ?? null,
|
||||
'expires_at' => $input['type'] === SslType::LETSENCRYPT ? now()->addMonths(3) : null,
|
||||
'expires_at' => $input['type'] === SslType::LETSENCRYPT ? now()->addMonths(3) : $input['expires_at'],
|
||||
'status' => SslStatus::CREATING,
|
||||
]);
|
||||
$ssl->save();
|
||||
@ -53,6 +53,7 @@ protected function validate(array $input): void
|
||||
if (isset($input['type']) && $input['type'] == SslType::CUSTOM) {
|
||||
$rules['certificate'] = 'required';
|
||||
$rules['private'] = 'required';
|
||||
$rules['expires_at'] = 'required|date_format:Y-m-d|after_or_equal:'.now();
|
||||
}
|
||||
|
||||
Validator::make($input, $rules)->validate();
|
||||
|
Reference in New Issue
Block a user