fix(database): proxy ssl port if ssl is enabled

This commit is contained in:
Andras Bacsai
2025-06-30 09:26:28 +02:00
parent 2b84ce841b
commit 620f70c7ff

View File

@@ -27,6 +27,8 @@ class StartDatabaseProxy
$server = data_get($database, 'destination.server'); $server = data_get($database, 'destination.server');
$containerName = data_get($database, 'uuid'); $containerName = data_get($database, 'uuid');
$proxyContainerName = "{$database->uuid}-proxy"; $proxyContainerName = "{$database->uuid}-proxy";
$isSSLEnabled = $database->enable_ssl ?? false;
if ($database->getMorphClass() === \App\Models\ServiceDatabase::class) { if ($database->getMorphClass() === \App\Models\ServiceDatabase::class) {
$databaseType = $database->databaseType(); $databaseType = $database->databaseType();
$network = $database->service->uuid; $network = $database->service->uuid;
@@ -42,6 +44,12 @@ class StartDatabaseProxy
'standalone-mongodb' => 27017, 'standalone-mongodb' => 27017,
default => throw new \Exception("Unsupported database type: $databaseType"), default => throw new \Exception("Unsupported database type: $databaseType"),
}; };
if ($isSSLEnabled) {
$internalPort = match ($databaseType) {
'standalone-redis', 'standalone-keydb', 'standalone-dragonfly' => 6380,
default => throw new \Exception("Unsupported database type: $databaseType"),
};
}
$configuration_dir = database_proxy_dir($database->uuid); $configuration_dir = database_proxy_dir($database->uuid);
if (isDev()) { if (isDev()) {