From e3c8437152b10fe40ab58cb54027b2b7d545560f Mon Sep 17 00:00:00 2001 From: Nik Spyratos <17888779+nikspyratos@users.noreply.github.com> Date: Wed, 29 May 2024 16:56:32 +0200 Subject: [PATCH] Feat: Null password support for Mariadb too --- app/Services/MariaDb.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Services/MariaDb.php b/app/Services/MariaDb.php index 4819f3f2..06a63c1e 100644 --- a/app/Services/MariaDb.php +++ b/app/Services/MariaDb.php @@ -17,14 +17,24 @@ class MariaDb extends BaseService [ 'shortname' => 'root_password', 'prompt' => 'What will the root password be?', - 'default' => 'password', + 'default' => '', ], ]; protected $dockerRunTemplate = '-p "${:port}":3306 \ -e MYSQL_ROOT_PASSWORD="${:root_password}" \ + -e MYSQL_ALLOW_EMPTY_PASSWORD="${:allow_empty_password}" \ -v "${:volume}":/var/lib/mysql \ "${:organization}"/"${:image_name}":"${:tag}"'; protected static $displayName = 'MariaDB'; + + protected function buildParameters(): array + { + $parameters = parent::buildParameters(); + + $parameters["allow_empty_password"] = $parameters["root_password"] === "" ? "yes" : "no"; + + return $parameters; + } }