From 68d003855b9894173f04c9c41752c062ce742077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=A1=D0=B0?= =?UTF-8?q?=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Tue, 14 Oct 2025 17:00:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BD=D1=83=D0=BB=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B5=20=D1=83=D0=B4?= =?UTF-8?q?=D0=B0=D0=BB=D0=B5=D0=BD=D0=BD=D1=83=D1=8E=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BA=D1=83=20apiKey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 96b4d835..f0c866ea 100644 --- a/install.sh +++ b/install.sh @@ -140,6 +140,13 @@ config_after_install() { fi /usr/local/x-ui/x-ui migrate + + local existing_apiKey=$(/usr/local/x-ui/x-ui setting -show true | grep -oP 'ApiKey: \K.*') + if [[ -z "$existing_apiKey" ]]; then + local config_apiKey=$(gen_random_string 32) + /usr/local/x-ui/x-ui setting -apiKey "${config_apiKey}" + echo -e "${green}Generated random API Key: ${config_apiKey}${plain}" + fi } install_x-ui() { @@ -149,7 +156,7 @@ install_x-ui() { if [ $# == 0 ]; then # bash <(curl -Ls https://raw.githubusercontent.com/dimasmir03/3x-ui/install.sh) # wget --inet4-only -O /etc/init.d/x-ui https://raw.githubusercontent.com/dimasmir03/3x-ui/feature/multi-server-support/x-ui.rc - tag_version=$(curl -Ls "https://api.github.com/repos/dimasmir03/3x-ui/feature/multi-server-support/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + tag_version=$(curl -Ls "https://api.github.com/repos/dimasmir03/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') if [[ ! -n "$tag_version" ]]; then echo -e "${yellow}Trying to fetch version with IPv4...${plain}" tag_version=$(curl -4 -Ls "https://api.github.com/repos/dimasmir03/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')