PHP Deployment Scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
neatoDeploy/config_files/deploy_mysql_ex1.php

31 lines
955 B

<?php
Configure::set('display', true); // Show Output
Configure::set('logfile', true); // Save to log folder
Configure::set('syslog', false);
Configure::set('passwords', ['length' => rand(16, 26)]);
$root_password = make_password(Configure::get('passwords', 'length'));
Configure::set('pre_actions', [
'make_dir' => [$cwd . '/my_vaults'=>'', '/etc/neato_secrets'=>''],
'chmod_file_or_dir' =>
[ $cwd . '/my_vaults' => 'secret', '/etc/neato_secrets' => 'secret' ],
]);
//do_command('service', 'mysql', 'stop');
force_root();
file_loop(Configure::get('pre_actions'));
$my_key = Enc::make_key_file("/etc/neato_secrets/mysql_data");
$obj = new stdClass();
$obj->root = $root_password;
Enc::encode_file($cwd . "/my_vaults/my_secrets", $obj, $my_key);
//$my_key = read_file("/etc/neato_secrets/mysql_data");
//$o = Enc::decode_file($cwd . "/my_vaults/my_secrets", $my_key);
//echo $o->root;
//do_command('service', 'mysql', 'start');