From c5a35e43be53109dc3f8d95656d59f07eeb82687 Mon Sep 17 00:00:00 2001 From: mercury Date: Sun, 28 Apr 2024 23:24:27 +0400 Subject: [PATCH] fix import xray --- app/bot.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/bot.php b/app/bot.php index 114f7b2..a742105 100644 --- a/app/bot.php +++ b/app/bot.php @@ -1222,6 +1222,10 @@ class Bot if ($this->getPacConf()['wg1_amnezia'] != $json['pac']['wg1_amnezia']) { $switch_wg1amnezia = 1; } + unset($json['pac']['subzoneslist']); + unset($json['pac']['reverselist']); + unset($json['pac']['excludelist']); + unset($json['pac']['zapret']); $this->setPacConf($json['pac']); $out[] = 'update naiveproxy'; $this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out)); @@ -1232,7 +1236,7 @@ class Bot $out[] = 'migrate xray to singbox'; $this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out)); $pac = $this->getPacConf(); - foreach ($json['xray']['inbounds'][0]['settings']['clients'] as $k => $v) { + foreach ($json['xray']['inbounds'][0]['settings']['clients'] as $v) { $pac['xrusers'][] = [ 'name' => $v['email'], 'uuid' => $v['id'], @@ -1241,7 +1245,7 @@ class Bot } $pac['xray'] = [ "domain" => $json['xray']['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0] != $pac['domain'] ? $json['xray']['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0] : 'vk.com', - "public" => $json['xray'], + "public" => $json['pac']['xray'], "private" => $json['xray']['inbounds'][0]['streamSettings']['realitySettings']['privateKey'], "shortid" => $json['xray']['inbounds'][0]['streamSettings']['realitySettings']['shortIds'][0], ];