From a3c4f86e809ecd508c8d46f272af0754563044db Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:03:55 +0100 Subject: [PATCH] fix(ssl): do not remove SSL directory --- app/Actions/Database/StartMariadb.php | 3 +-- app/Actions/Database/StartMysql.php | 1 - app/Actions/Database/StartPostgresql.php | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/Actions/Database/StartMariadb.php b/app/Actions/Database/StartMariadb.php index dd6f2d735..cd001ae45 100644 --- a/app/Actions/Database/StartMariadb.php +++ b/app/Actions/Database/StartMariadb.php @@ -56,7 +56,6 @@ class StartMariadb }); } else { $this->commands[] = "echo 'Setting up SSL for this database.'"; - $this->commands[] = "rm -rf $this->configuration_dir/ssl"; $this->commands[] = "mkdir -p $this->configuration_dir/ssl"; $server = $this->database->destination->server; $caCert = SslCertificate::where('server_id', $server->id)->firstOrFail(); @@ -188,7 +187,7 @@ class StartMariadb $this->commands[] = "docker compose -f $this->configuration_dir/docker-compose.yml up -d"; $this->commands[] = "echo 'Database started.'"; if ($this->database->enable_ssl) { - $this->commands[] = executeInDocker($this->database->uuid, 'chown mariadb:mariadb /etc/mysql/certs/server.crt /etc/mysql/certs/server.key'); + $this->commands[] = executeInDocker($this->database->uuid, "chown {$this->database->mariadb_user}:{$this->database->mariadb_user} /etc/mysql/certs/server.crt /etc/mysql/certs/server.key"); } return remote_process($this->commands, $database->destination->server, callEventOnFinish: 'DatabaseStatusChanged'); diff --git a/app/Actions/Database/StartMysql.php b/app/Actions/Database/StartMysql.php index 88fcfe911..b7b18361e 100644 --- a/app/Actions/Database/StartMysql.php +++ b/app/Actions/Database/StartMysql.php @@ -56,7 +56,6 @@ class StartMysql }); } else { $this->commands[] = "echo 'Setting up SSL for this database.'"; - $this->commands[] = "rm -rf $this->configuration_dir/ssl"; $this->commands[] = "mkdir -p $this->configuration_dir/ssl"; $server = $this->database->destination->server; $caCert = SslCertificate::where('server_id', $server->id)->firstOrFail(); diff --git a/app/Actions/Database/StartPostgresql.php b/app/Actions/Database/StartPostgresql.php index 9ce953491..b582136a3 100644 --- a/app/Actions/Database/StartPostgresql.php +++ b/app/Actions/Database/StartPostgresql.php @@ -61,7 +61,6 @@ class StartPostgresql }); } else { $this->commands[] = "echo 'Setting up SSL for this database.'"; - $this->commands[] = "rm -rf $this->configuration_dir/ssl"; $this->commands[] = "mkdir -p $this->configuration_dir/ssl"; $server = $this->database->destination->server;