Skip to content

Commit

Permalink
Feat: Null password support for Mariadb too
Browse files Browse the repository at this point in the history
  • Loading branch information
nikspyratos committed May 29, 2024
1 parent 0bc07ac commit e3c8437
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/Services/MariaDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Check failure on line 36 in app/Services/MariaDb.php

View workflow job for this annotation

GitHub Actions / PHPCS

String "allow_empty_password" does not require double quotes; use single quotes instead

Check failure on line 36 in app/Services/MariaDb.php

View workflow job for this annotation

GitHub Actions / PHPCS

String "root_password" does not require double quotes; use single quotes instead

Check failure on line 36 in app/Services/MariaDb.php

View workflow job for this annotation

GitHub Actions / PHPCS

String "" does not require double quotes; use single quotes instead

Check failure on line 36 in app/Services/MariaDb.php

View workflow job for this annotation

GitHub Actions / PHPCS

String "yes" does not require double quotes; use single quotes instead

Check failure on line 36 in app/Services/MariaDb.php

View workflow job for this annotation

GitHub Actions / PHPCS

String "no" does not require double quotes; use single quotes instead

return $parameters;
}
}

0 comments on commit e3c8437

Please sign in to comment.