mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 08:10:07 +01:00
add the ability to renew the CA when renewing all certs
This commit is contained in:
@@ -502,8 +502,11 @@ public function secure(string $url, ?string $siteConf = null, int $certificateEx
|
||||
/**
|
||||
* Renews all domains with a trusted TLS certificate.
|
||||
*/
|
||||
public function renew($expireIn = 368): void
|
||||
public function renew($expireIn = 368, $ca = false): void
|
||||
{
|
||||
if ($ca) {
|
||||
$this->removeCa();
|
||||
}
|
||||
collect($this->securedWithDates())->each(function ($row) use ($expireIn) {
|
||||
$url = $this->domain($row['site']);
|
||||
|
||||
|
||||
@@ -306,11 +306,12 @@ function (ConsoleCommandEvent $event) {
|
||||
/**
|
||||
* Renews all domains with a trusted TLS certificate.
|
||||
*/
|
||||
$app->command('renew [--expireIn=]', function (OutputInterface $output, $expireIn = 368) {
|
||||
Site::renew($expireIn);
|
||||
$app->command('renew [--expireIn=] [--ca]', function (OutputInterface $output, $expireIn = 368, $ca = null) {
|
||||
Site::renew($expireIn, $ca);
|
||||
Nginx::restart();
|
||||
})->descriptions('Renews all domains with a trusted TLS certificate.', [
|
||||
'--expireIn' => 'The amount of days the self signed certificate is valid for. Default is set to "368"',
|
||||
'--ca' => 'Renew the Certificate Authority certificate before renewing the site certificates.',
|
||||
]);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user