From 6f8858fdbc074155ac1d88002f4589229d19c0b4 Mon Sep 17 00:00:00 2001 From: Olia Lisa Date: Sun, 19 Apr 2026 13:11:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=9F=E6=88=90short=5Fid?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=B9=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?config.json=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/create_config.sh | 6 ++++++ bin/update_short_id.sh | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 bin/update_short_id.sh diff --git a/bin/create_config.sh b/bin/create_config.sh index 58d1783..bac1b78 100644 --- a/bin/create_config.sh +++ b/bin/create_config.sh @@ -9,6 +9,9 @@ create_reality_config(){ # 生成uui, 写入到config.json文件 update_uuid + # 生成shor_id, 写入到config.json文件 + update_short_id + # 生成密钥对, 修改config.json中的密钥属性 update_key @@ -29,6 +32,9 @@ create_xhttp_reality_config(){ # 生成uuid, 写入到config.json文件 update_uuid + + # 生成shor_id, 写入到config.json文件 + update_short_id # 生成密钥对, 修改config.json中的密钥属性 update_key diff --git a/bin/update_short_id.sh b/bin/update_short_id.sh new file mode 100644 index 0000000..b99d595 --- /dev/null +++ b/bin/update_short_id.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +update_short_id(){ + + local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # 脚本文件绝对路径 + local config_dir="$script_dir/../conf" + + # 生成 shortId + local short_id=$(openssl rand -hex 8) + + #修改 shortId + modify_json_file "$config_dir/config.json" ".inbounds[0].streamSettings.realitySettings.shortIds[0]" "$short_id" + + echo "设置shortId成功." +}