diff --git a/client/protocols/protocols_defs.h b/client/protocols/protocols_defs.h index 498c89a0..865edae4 100644 --- a/client/protocols/protocols_defs.h +++ b/client/protocols/protocols_defs.h @@ -148,6 +148,7 @@ namespace amnezia namespace xray { constexpr char serverConfigPath[] = "/opt/amnezia/xray/server.json"; + constexpr char uuidPath[] = "/opt/amnezia/xray/xray_uuid.key"; constexpr char PublicKeyPath[] = "/opt/amnezia/xray/xray_public.key"; constexpr char PrivateKeyPath[] = "/opt/amnezia/xray/xray_private.key"; constexpr char shortidPath[] = "/opt/amnezia/xray/xray_short_id.key"; diff --git a/client/server_scripts/xray/configure_container.sh b/client/server_scripts/xray/configure_container.sh index 4e27f734..a84751c7 100644 --- a/client/server_scripts/xray/configure_container.sh +++ b/client/server_scripts/xray/configure_container.sh @@ -1,4 +1,5 @@ cd /opt/amnezia/xray +XRAY_CLIENT_ID=$(xray uuid) && echo $XRAY_CLIENT_ID > /opt/amnezia/xray/xray_uuid.key XRAY_SHORT_ID=$(openssl rand -hex 8) && echo $XRAY_SHORT_ID > /opt/amnezia/xray/xray_short_id.key KEYPAIR=$(xray x25519) @@ -32,6 +33,10 @@ cat > /opt/amnezia/xray/server.json <getTextFileFromContainer(container, credentials, amnezia::protocols::xray::uuidPath, error); + xrayDefUuid.replace("\n", ""); + + if (!isClientExists(clientId) && clientId != xrayDefUuid) { QJsonObject client; client[configKey::clientId] = clientId;