[fix] 修复新版本xray-core publickey 字段变更问题

This commit is contained in:
Olia Lisa 2025-09-11 10:08:34 +08:00
parent 0319d932e3
commit 18adcb65ce
2 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ port=$(jq -r '.inbounds[0].port' $config_dir/config.json)
dest=$(jq -r '.inbounds[0].streamSettings.realitySettings.dest' $config_dir/config.json)
sni=$(echo $dest | awk -F ':' '{print $1}')
network="tcp"
public_key=$(cat $config_dir/key.txt | grep "Public" | awk -F ': ' '{print $2}')
public_key=$(cat $config_dir/key.txt | grep "Password" | awk -F ': ' '{print $2}')
# 打印配置信息
echo -e "\033[32m" # config info with green color
@ -32,7 +32,7 @@ echo "port: $port"
echo "uuid: $uuid"
echo "dest: $dest"
echo "sni: $sni"
echo "public_key: $public_key"
echo "publicKey/password: $public_key"
echo "network: $network"
if [ "$ipv4" != "null" ]; then
sub_ipv4="vless://$uuid@$ipv4:$port?encryption=none&security=reality&type=$network&sni=$sni&fp=chrome&pbk=$public_key&flow=xtls-rprx-vision#my_docker_vless_reality_vision"

View File

@ -8,7 +8,7 @@ source $script_dir/utils/jq_util.sh
docker run --rm teddysun/xray:latest /usr/bin/xray x25519 > $config_dir/key.txt
# 获取私钥
private_key=$(grep "Private key" $config_dir/key.txt | awk -F ': ' '{print $2}')
private_key=$(grep "Private" $config_dir/key.txt | awk -F ': ' '{print $2}')
# 修改config.json密钥属性
modify_json_file "$config_dir/config.json" ".inbounds[0].streamSettings.realitySettings.privateKey" "$private_key"