diff --git a/src/cli/Commands/BalancerCommand.php b/src/cli/Commands/BalancerCommand.php index cdaabe88..f2ec9878 100644 --- a/src/cli/Commands/BalancerCommand.php +++ b/src/cli/Commands/BalancerCommand.php @@ -68,7 +68,7 @@ class BalancerCommand implements CommandInterface { $rInstallDir = BIN_PATH . 'install/'; if ($rType == 1) { - $rPackages = array('iproute2', 'net-tools', 'libcurl4', 'libxslt1-dev', 'libonig-dev', 'e2fsprogs', 'wget', 'sysstat', 'mcrypt', 'python3', 'certbot', 'iptables-persistent', 'libjpeg-dev', 'libpng-dev', 'libssh2-1', 'xz-utils', 'zip', 'unzip', 'cron'); + $rPackages = array('iproute2', 'net-tools', 'libcurl4', 'libcurl3-gnutls', 'libxslt1-dev', 'libonig-dev', 'e2fsprogs', 'wget', 'sysstat', 'mcrypt', 'python3', 'certbot', 'iptables-persistent', 'libjpeg-dev', 'libpng-dev', 'libssh2-1', 'xz-utils', 'zip', 'unzip', 'cron'); $rInstallFiles = 'proxy.tar.gz'; } elseif ($rType == 2) { $rPackages = array('cpufrequtils', 'iproute2', 'python', 'net-tools', 'dirmngr', 'gpg-agent', 'software-properties-common', 'libmaxminddb0', 'libmaxminddb-dev', 'mmdb-bin', 'libcurl4', 'libgeoip-dev', 'libxslt1-dev', 'libonig-dev', 'e2fsprogs', 'wget', 'sysstat', 'alsa-utils', 'v4l-utils', 'mcrypt', 'python3', 'certbot', 'iptables-persistent', 'libjpeg-dev', 'libpng-dev', 'libssh2-1', 'xz-utils', 'zip', 'unzip', 'cron', 'libfribidi-dev', 'libharfbuzz-dev', 'libogg0'); @@ -147,9 +147,9 @@ class BalancerCommand implements CommandInterface { if ($rType == 1) { if ($this->sendFileSSH($rConn, $rInstallDir . $rInstallFiles, '/tmp/' . $rInstallFiles, true)) { echo "Extracting to directory\n"; - $this->runSSH($rConn, 'sudo rm -rf ' . MAIN_HOME . 'console.php'); + $this->runSSH($rConn, 'sudo rm -rf ' . MAIN_HOME . 'service'); $this->runSSH($rConn, 'sudo tar -zxvf "/tmp/' . $rInstallFiles . '" -C "' . MAIN_HOME . '"'); - $rRemoteCheck = trim($this->runSSH($rConn, 'test -f ' . MAIN_HOME . 'console.php && echo OK')['output']); + $rRemoteCheck = trim($this->runSSH($rConn, 'test -f ' . MAIN_HOME . 'service && echo OK')['output']); if ($rRemoteCheck !== 'OK') { $db->query('UPDATE `servers` SET `status` = 4 WHERE `id` = ?;', $rServerID); echo "Failed to extract files! Exiting\n"; diff --git a/src/core/Backup/BackupService.php b/src/core/Backup/BackupService.php index 4fca328f..09277588 100644 --- a/src/core/Backup/BackupService.php +++ b/src/core/Backup/BackupService.php @@ -100,6 +100,13 @@ class BackupService { * @param array $config Database config */ public static function revokePrivileges($host, $db, $config) { + if ($db->query('SELECT COUNT(*) AS `count` FROM `mysql`.`db` WHERE `User` = ? AND `Host` = ? AND `Db` = ?;', $config['username'], $host, $config['database'])) { + $rGrantRow = $db->get_row(); + if (empty($rGrantRow) || intval($rGrantRow['count']) === 0) { + return; + } + } + $db->query("REVOKE ALL PRIVILEGES ON `" . $config['database'] . "`.* FROM '" . $config['username'] . "'@'" . $host . "';"); } diff --git a/src/public/Controllers/Admin/ProxiesController.php b/src/public/Controllers/Admin/ProxiesController.php index dc5b3789..dbfcd84a 100644 --- a/src/public/Controllers/Admin/ProxiesController.php +++ b/src/public/Controllers/Admin/ProxiesController.php @@ -16,9 +16,9 @@ class ProxiesController extends BaseAdminController { public function index() { $this->requirePermission(); - ServerRepository::getAll(true); + $rServers = ServerRepository::getAll(true); $this->setTitle('Proxy Servers'); - $this->render('proxies'); + $this->render('proxies', compact('rServers')); } }