mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 22:46:16 +00:00
Ask for email when generating LetsEncrypt SSLs (#452)
This commit is contained in:
@ -3,7 +3,9 @@
|
||||
namespace App\Web\Pages\Servers\Sites\Pages\SSL;
|
||||
|
||||
use App\Actions\SSL\CreateSSL;
|
||||
use App\Enums\SslType;
|
||||
use App\Models\Ssl;
|
||||
use App\Web\Fields\AlertField;
|
||||
use App\Web\Pages\Servers\Sites\Page;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\CreateAction;
|
||||
@ -11,6 +13,7 @@
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Get;
|
||||
use Filament\Support\Enums\MaxWidth;
|
||||
|
||||
@ -45,25 +48,32 @@ protected function getHeaderActions(): array
|
||||
->label('New Certificate')
|
||||
->icon('heroicon-o-lock-closed')
|
||||
->form([
|
||||
AlertField::make('letsencrypt-info')
|
||||
->warning()
|
||||
->message('Let\'s Encrypt has rate limits. Read more about them <a href="https://letsencrypt.org/docs/rate-limits/" target="_blank" class="underline">here</a>.'),
|
||||
Select::make('type')
|
||||
->options(
|
||||
collect(config('core.ssl_types'))->mapWithKeys(fn ($type) => [$type => $type])
|
||||
)
|
||||
->rules(fn (Get $get) => CreateSSL::rules($get())['type'])
|
||||
->reactive(),
|
||||
TextInput::make('email')
|
||||
->rules(fn (Get $get) => CreateSSL::rules($get())['email'] ?? [])
|
||||
->visible(fn (Get $get) => $get('type') === SslType::LETSENCRYPT)
|
||||
->helperText('Email address to provide to Certbot.'),
|
||||
Textarea::make('certificate')
|
||||
->rows(5)
|
||||
->rules(fn (Get $get) => CreateSSL::rules($get())['certificate'])
|
||||
->visible(fn (Get $get) => $get('type') === 'custom'),
|
||||
->visible(fn (Get $get) => $get('type') === SslType::CUSTOM),
|
||||
Textarea::make('private')
|
||||
->label('Private Key')
|
||||
->rows(5)
|
||||
->rules(fn (Get $get) => CreateSSL::rules($get())['private'])
|
||||
->visible(fn (Get $get) => $get('type') === 'custom'),
|
||||
->visible(fn (Get $get) => $get('type') === SslType::CUSTOM),
|
||||
DatePicker::make('expires_at')
|
||||
->format('Y-m-d')
|
||||
->rules(fn (Get $get) => CreateSSL::rules($get())['expires_at'])
|
||||
->visible(fn (Get $get) => $get('type') === 'custom'),
|
||||
->visible(fn (Get $get) => $get('type') === SslType::CUSTOM),
|
||||
Checkbox::make('aliases')
|
||||
->label("Set SSL for site's aliases as well"),
|
||||
])
|
||||
|
Reference in New Issue
Block a user