Skip to content

Commit 430f141

Browse files
authored
Merge pull request #450 from mrrobot47/fix/skip-ssl-gen
Skip cert generation if certs dir missing
2 parents dbbbfcd + 344c101 commit 430f141

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

migrations/container/20250903101855_site-command_generate_default_self_signed_cert.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,24 @@ public function __construct() {
1616
$this->certs_dir = EE_ROOT_DIR . '/services/nginx-proxy/certs';
1717
$this->key_path = $this->certs_dir . '/default.key';
1818
$this->crt_path = $this->certs_dir . '/default.crt';
19+
20+
if ( ! $this->fs->exists( $this->certs_dir ) ) {
21+
$this->skip_this_migration = true;
22+
}
1923
}
2024

2125
/**
2226
* Generate default self-signed cert if not present.
2327
* @throws EE\ExitException
2428
*/
2529
public function up() {
30+
31+
if ( $this->skip_this_migration ) {
32+
EE::debug( 'Skipping default self-signed cert generation migration as it is not needed.' );
33+
34+
return;
35+
}
36+
2637
if ( $this->fs->exists( $this->key_path ) && $this->fs->exists( $this->crt_path ) ) {
2738
EE::debug( 'Default self-signed cert already exists. Skipping generation.' );
2839

0 commit comments

Comments
 (0)