forked from sajjaddg/xray-reality
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconf.docker.sh
More file actions
executable file
·25 lines (19 loc) · 876 Bytes
/
conf.docker.sh
File metadata and controls
executable file
·25 lines (19 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
json=$(curl -s https://raw.githubusercontent.com/vahidx4r4x/xray-reality/master/config.json)
keys=$(xray x25519)
pk=$(echo "$keys" | awk '/Private key:/ {print $3}')
pub=$(echo "$keys" | awk '/Public key:/ {print $3}')
serverIp=$(curl -s ifconfig.me)
uuid=$(xray uuid)
shortId=$(openssl rand -hex 8)
url="vless://$uuid@$serverIp:443?path=%2F&security=reality&encryption=none&pbk=$pub&fp=chrome&type=http&sni=yahoo.com&sid=$shortId#IRVLESS-REALITY-04"
newJson=$(echo "$json" | jq \
--arg pk "$pk" \
--arg uuid "$uuid" \
'.inbounds[0].streamSettings.realitySettings.privateKey = $pk |
.inbounds[0].settings.clients[0].id = $uuid |
.inbounds[0].streamSettings.realitySettings.shortIds += ["'$shortId'"]')
echo "$newJson" | sudo tee /usr/local/etc/xray/config.json >/dev/null
sudo service xray restart
echo "$url" >> /root/test.url
exit 0