|
|
|
@ -5,8 +5,10 @@ configure::set('syslog', false); |
|
|
|
configure::set('passwords', ['length' => rand(16, 26)]); |
|
|
|
configure::set('passwords', ['length' => rand(16, 26)]); |
|
|
|
|
|
|
|
|
|
|
|
configure::set('pre_actions', [ |
|
|
|
configure::set('pre_actions', [ |
|
|
|
|
|
|
|
/** @phpstan-ignore-next-line Variable $cwd might not be defined */ |
|
|
|
'make_dir' => [$cwd . '/my_vaults'=>'', '/etc/neato_secrets'=>''], |
|
|
|
'make_dir' => [$cwd . '/my_vaults'=>'', '/etc/neato_secrets'=>''], |
|
|
|
'chmod_file_or_dir' => |
|
|
|
'chmod_file_or_dir' => |
|
|
|
|
|
|
|
/** @phpstan-ignore-next-line Variable $cwd might not be defined */ |
|
|
|
[ $cwd . '/my_vaults' => 'keydir', '/etc/neato_secrets' => 'keydir' ], |
|
|
|
[ $cwd . '/my_vaults' => 'keydir', '/etc/neato_secrets' => 'keydir' ], |
|
|
|
]); |
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
@ -18,10 +20,13 @@ file_loop(configure::get('pre_actions')); |
|
|
|
|
|
|
|
|
|
|
|
$my_key = enc::make_key_file("/etc/neato_secrets/mysql_key"); |
|
|
|
$my_key = enc::make_key_file("/etc/neato_secrets/mysql_key"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @phpstan-ignore-next-line Variable $cwd might not be defined */ |
|
|
|
if (!file_exists($cwd . "/my_vaults/mysql_secrets")) { |
|
|
|
if (!file_exists($cwd . "/my_vaults/mysql_secrets")) { |
|
|
|
$root_password = make_password(configure::get('passwords', 'length')); |
|
|
|
$root_password = make_password(configure::get('passwords', 'length')); |
|
|
|
$obj = new stdClass(); |
|
|
|
$obj = new stdClass(); |
|
|
|
$obj->root = $root_password; |
|
|
|
$obj->root = $root_password; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @phpstan-ignore-next-line Variable $cwd might not be defined */ |
|
|
|
enc::encode_file($cwd . "/my_vaults/mysql_secrets", $obj, $my_key); |
|
|
|
enc::encode_file($cwd . "/my_vaults/mysql_secrets", $obj, $my_key); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|