From 8e0893622e87a3cd453150e9d9dbab56d266ad88 Mon Sep 17 00:00:00 2001 From: mercury Date: Tue, 27 Jun 2023 01:00:45 +0400 Subject: [PATCH] fix ssl export again --- app/bot.php | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/app/bot.php b/app/bot.php index 3fdaa7e..f829139 100644 --- a/app/bot.php +++ b/app/bot.php @@ -722,7 +722,7 @@ class Bot 'sl' => $this->getSSLocalConfig(), 'ad' => yaml_parse_file('/config/adguard/AdGuardHome.yaml'), 'pac' => $this->getPacConf(), - 'ssl' => file_exists('/certs/cert_private') ? [ + 'ssl' => file_exists('/certs/cert_private') && preg_match('~BEGIN PRIVATE KEY~', file_get_contents('/certs/cert_private')) ? [ 'private' => file_get_contents('/certs/cert_private'), 'public' => file_get_contents('/certs/cert_public'), ] : false, @@ -734,22 +734,6 @@ class Bot public function exportManual() { - $conf = [ - 'wg' => [ - 'server' => $this->readConfig(), - 'clients' => json_decode(file_get_contents($this->clients), true) ?: [], - ], - 'ss' => $this->getSSConfig(), - 'sl' => $this->getSSLocalConfig(), - 'ad' => yaml_parse_file('/config/adguard/AdGuardHome.yaml'), - 'pac' => $this->getPacConf(), - 'ssl' => [ - 'private' => file_exists('/certs/cert_private') ? file_get_contents('/certs/cert_private') : false, - 'public' => file_exists('/certs/cert_public') ? file_get_contents('/certs/cert_public') : false, - ], - 'mtproto' => file_get_contents('/config/mtprotosecret'), - - ]; return $this->upload('vpnbot_export_' . date('d_m_Y_H_i') . '.json', $this->export()); }