1
0
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:
Austin Drummond
2024-11-14 20:38:12 -05:00
parent 5da6033253
commit 072859eced
2 changed files with 7 additions and 3 deletions

View File

@@ -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']);

View File

@@ -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.',
]);
/**