Browse Source

adding #34

master
Björn 4 years ago
parent
commit
63e12a28e9
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      app/Commands/MariadbClientInstallCommand.php
  2. +2
    -2
      app/Commands/MariadbInstallCommand.php

+ 1
- 1
app/Commands/MariadbClientInstallCommand.php View File

@ -82,7 +82,7 @@ class MariadbClientInstallCommand extends Command
system('rsync -rv --include="ca-cert.pem" --include="client-cert.pem" --include="client-key.pem" --exclude="*" '.$this->argument('remove_user').'@'.$this->argument('remove_host').':/etc/mysql/ssl/ /etc/mysql/ssl/');
// checking if certificates are exists from remote server
if (!file_exist('/etc/mysql/ssl/ca-cert.pem') || !file_exist('/etc/mysql/ssl/client-cert.pem') || file_exist('/etc/mysql/ssl/client-key.pem')) {
if (!file_exists('/etc/mysql/ssl/ca-cert.pem') || !file_exists('/etc/mysql/ssl/client-cert.pem') || !file_exists('/etc/mysql/ssl/client-key.pem')) {
$this->error('Failed! Certificates not found!');
exit();
}


+ 2
- 2
app/Commands/MariadbInstallCommand.php View File

@ -150,7 +150,7 @@ class MariadbInstallCommand extends Command
system('openssl rsa -in /etc/mysql/ssl/client-key.pem -out /etc/mysql/ssl/client-key.pem');
system('openssl x509 -req -in /etc/mysql/ssl/client-req.pem -days 365000 -CA /etc/mysql/ssl/ca-cert.pem -CAkey /etc/mysql/ssl/ca-key.pem -set_serial 01 -out /etc/mysql/ssl/client-cert.pem');
if (!file_exist('/etc/mysql/ssl/ca-cert.pem') || !file_exist('/etc/mysql/ssl/client-cert.pem') || file_exist('/etc/mysql/ssl/client-key.pem')) {
if (!file_exists('/etc/mysql/ssl/ca-cert.pem') || !file_exists('/etc/mysql/ssl/client-cert.pem') || !file_exists('/etc/mysql/ssl/client-key.pem')) {
$this->error('Failed! Certificates not created!');
exit();
}
@ -175,7 +175,7 @@ ssl-key=/etc/mysql/ssl/client-key.pem');
system('chmod 644 /etc/mysql/ssl/*cert*');
system('chmod 644 /etc/mysql/ssl/*key*');
system('service restart mysql');
system('systemctl restart mariadb');
system('ufw allow mysql');
$this->info('Mariadb remote...Success! \o/');


Loading…
Cancel
Save