From 9f9349925a13110b8b0bd936011a425f7d846c71 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Thu, 30 Jan 2025 12:58:48 +0100 Subject: [PATCH] fix(ssl): permission of ssl crt and key inside the container --- app/Actions/Database/StartPostgresql.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Actions/Database/StartPostgresql.php b/app/Actions/Database/StartPostgresql.php index 518639935..df516bbda 100644 --- a/app/Actions/Database/StartPostgresql.php +++ b/app/Actions/Database/StartPostgresql.php @@ -134,7 +134,7 @@ public function handle(StandalonePostgresql $database) $docker_compose['services'][$container_name]['command'] = [ 'postgres', '-c', - 'ssl=off', // temp for dev + 'ssl=on', '-c', 'ssl_cert_file=/etc/postgresql/ssl/internal.crt', '-c', @@ -166,6 +166,9 @@ public function handle(StandalonePostgresql $database) $this->commands[] = "echo 'Pulling {$database->image} image.'"; $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml pull"; $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml up -d"; + if ($this->database->enable_ssl) { + $this->commands[] = executeInDocker($this->database->uuid, "chown {$this->database->postgres_user}:{$this->database->postgres_user} /etc/postgresql/ssl/internal.key /etc/postgresql/ssl/internal.crt"); + } $this->commands[] = "echo 'Database started.'"; return remote_process($this->commands, $database->destination->server, callEventOnFinish: 'DatabaseStatusChanged');