Commit d522d5bd authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix: enable SSL before forcing it (CapRover requires domain SSL first)

Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent eb5a517f
...@@ -137,7 +137,6 @@ private function deployApp(Instance $instance, string $dbPassword, string $admin ...@@ -137,7 +137,6 @@ private function deployApp(Instance $instance, string $dbPassword, string $admin
$this->caprover->configureAppFull($instance->app_name, [ $this->caprover->configureAppFull($instance->app_name, [
'containerHttpPort' => 80, 'containerHttpPort' => 80,
'instanceCount' => 1, 'instanceCount' => 1,
'forceSsl' => true,
'volumes' => [ 'volumes' => [
['containerPath' => '/var/www/html/storage/app', 'volumeName' => "{$instance->app_name}-storage"], ['containerPath' => '/var/www/html/storage/app', 'volumeName' => "{$instance->app_name}-storage"],
], ],
...@@ -153,10 +152,11 @@ private function deployApp(Instance $instance, string $dbPassword, string $admin ...@@ -153,10 +152,11 @@ private function deployApp(Instance $instance, string $dbPassword, string $admin
], ],
]); ]);
// Step 3: Enable SSL // Step 3: Enable SSL then force it
$progress('Enabling SSL...'); $progress('Enabling SSL...');
try { try {
$this->caprover->enableSsl($instance->app_name); $this->caprover->enableSsl($instance->app_name);
$this->caprover->forceSsl($instance->app_name);
} catch (\Throwable $e) { } catch (\Throwable $e) {
// Wildcard cert handles this — not critical // Wildcard cert handles this — not critical
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment