mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +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();
|
||||
|
@ -1,12 +1,12 @@
|
||||
if ! sudo mkdir __path__; then
|
||||
if ! sudo mkdir -p __path__; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! echo __certificate__ | sudo tee __certificate_path__; then
|
||||
if ! echo "__certificate__" | sudo tee __certificate_path__; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! echo __pk__ | sudo tee __pk_path__; then
|
||||
if ! echo "__pk__" | sudo tee __pk_path__; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user