Skip to content

Commit

Permalink
Merge pull request #343 from nikspyratos/feature/passwordless-mariadb
Browse files Browse the repository at this point in the history
Feat: Null password support for Mariadb
  • Loading branch information
mattstauffer authored Jun 28, 2024
2 parents da50190 + e3c8437 commit 5a637ff
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 5a637ff

Please sign in to comment.