Auto-generate a root password for MariaDB installs too.
This commit is contained in:
parent
1d02320e4c
commit
aa50f1d7ab
|
@ -11,6 +11,10 @@ COMPOSER_PLUGIN_MODE=false
|
|||
AUTO_ASSIGN_PORT_MIN=8000
|
||||
AUTO_ASSIGN_PORT_MAX=8099
|
||||
|
||||
# Database passwords
|
||||
MYSQL_PASSWORD=azur4c457
|
||||
MYSQL_ROOT_PASSWORD=azur4c457
|
||||
|
||||
# Developer options.
|
||||
# Populate these!
|
||||
INIT_BASE_URL=http://azuracast.local
|
||||
|
|
|
@ -112,17 +112,29 @@ class InstallCommand
|
|||
|
||||
// Randomize the MariaDB root password for new installs.
|
||||
if ($isNewInstall) {
|
||||
if (!$devMode && 'azur4c457' === $azuracastEnv[Environment::DB_PASSWORD]) {
|
||||
if ($devMode) {
|
||||
if (empty($azuracastEnv['MYSQL_ROOT_PASSWORD'])) {
|
||||
$azuracastEnv['MYSQL_ROOT_PASSWORD'] = 'azur4c457_root';
|
||||
}
|
||||
} else {
|
||||
if (
|
||||
empty($azuracastEnv[Environment::DB_PASSWORD])
|
||||
|| 'azur4c457' === $azuracastEnv[Environment::DB_PASSWORD]
|
||||
) {
|
||||
$azuracastEnv[Environment::DB_PASSWORD] = Strings::generatePassword(12);
|
||||
}
|
||||
|
||||
if (empty($azuracastEnv['MYSQL_ROOT_PASSWORD'])) {
|
||||
$azuracastEnv['MYSQL_RANDOM_ROOT_PASSWORD'] = 'no';
|
||||
$azuracastEnv['MYSQL_ROOT_PASSWORD'] = ($devMode)
|
||||
? 'azur4c457'
|
||||
: Strings::generatePassword(20);
|
||||
$azuracastEnv['MYSQL_ROOT_PASSWORD'] = Strings::generatePassword(20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($azuracastEnv['MYSQL_ROOT_PASSWORD'])) {
|
||||
unset($azuracastEnv['MYSQL_RANDOM_ROOT_PASSWORD']);
|
||||
} else {
|
||||
$azuracastEnv['MYSQL_RANDOM_ROOT_PASSWORD'] = 'yes';
|
||||
}
|
||||
|
||||
// Display header messages
|
||||
if ($isNewInstall) {
|
||||
|
|
|
@ -136,8 +136,6 @@ class AzuraCastEnvFile extends AbstractEnvFile
|
|||
'description' => __(
|
||||
'Do not modify this after installation.',
|
||||
),
|
||||
'default' => 'yes',
|
||||
'required' => true,
|
||||
],
|
||||
'MYSQL_ROOT_PASSWORD' => [
|
||||
'name' => __('MariaDB Root Password'),
|
||||
|
|
Loading…
Reference in New Issue