Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Site_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,22 @@ public function __invoke( $args, $assoc_args ) {
$args = [ 'site', 'ssl-renew', $site->site_url ];
$callback = $site_types[ $type ];

if ( 'le' !== $site->site_ssl || ! $site->site_enabled || 'inherit' === $site->site_ssl ) {
continue;
}

$api_key_absent = empty( EE\Utils\get_config_value( 'cloudflare-api-key' ) );
$skip_wildcard_warning = false;

if ( $site->site_ssl_wildcard && $api_key_absent ) {
EE::warning( "Wildcard site found: $site->site_url, skipping it as api keys not found. Please renew this site manually using command `ee site ssl-renew $site->site_url`" );
if ( ! $skip_wildcard_warning ) {
EE::warning( "As this is a wildcard certificate, it cannot be automatically renewed.\nPlease run `ee site ssl-renew $site->site_url` to renew the certificate, or add cloudflare api key in EasyEngine config. Ref: https://rt.cx/eecf" );
$skip_wildcard_warning = true;
}
continue;
}

$command = EE::get_root_command();
$leaf_command = CommandFactory::create( 'site', $callback, $command );
$command->add_subcommand( 'site', $leaf_command );
Expand Down
2 changes: 1 addition & 1 deletion src/helper/class-ee-site.php
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ private function renew_ssl_cert( $args, $force ) {
$this->enable( $args, [ 'force' => true ] );
}

if ( ! $client->isRenewalNecessary( $this->site_data['site_url'] ) ) {
if ( ! $force && ! $client->isRenewalNecessary( $this->site_data['site_url'] ) ) {
return 0;
}

Expand Down