-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathexternal.sh
executable file
·98 lines (90 loc) · 2.18 KB
/
external.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
read -p "Enter -IR- server address: " IR_SERVER
# Add iptables rules
iptables -t filter -D INPUT -s $IR_SERVER/32 -p tcp -m tcp --dport 80 -j ACCEPT 2>/dev/null
iptables -t filter -A INPUT -s $IR_SERVER/32 -p tcp -m tcp --dport 80 -j ACCEPT
# Install docker and docker-compose
apt update -y
apt install -y docker.io docker-compose
# Gather host information
UUID=$(cat /proc/sys/kernel/random/uuid)
AID=10
IP=$(hostname -I | cut -d' ' -f1)
PORT=80
NETW=ws
WSPATH=/graphql
# Generate config.json
cat > config.json << conf
{
"log": {
"loglevel": "warning",
"access": "/var/log/v2ray/access.log"
},
"inbounds": [
{
"port": $PORT,
"protocol": "vmess",
"allocate": {
"strategy": "always"
},
"settings": {
"clients": [
{
"id": "$UUID",
"level": 1,
"alterId": $AID,
"email": "client@example.com"
}
],
"disableInsecureEncryption": true
},
"streamSettings": {
"network": "$NETW",
"wsSettings": {
"connectionReuse": true,
"path": "$WSPATH"
},
"security": "none",
"tcpSettings": {
"header": {
"type": "http",
"response": {
"version": "1.1",
"status": "200",
"reason": "OK",
"headers": {
"Content-Type": [
"application/octet-stream",
"application/x-msdownload",
"text/html",
"application/x-shockwave-flash"
],
"Transfer-Encoding": ["chunked"],
"Connection": ["keep-alive"],
"Pragma": "no-cache"
}
}
}
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}
conf
# Run docker container
docker-compose up -d
# User output
printf "SET These to your v2ray client.\n"
echo -e "\033[1;30m* IP: $IR_SERVER"
echo -e "* Port: $PORT"
echo -e "* UUID: $UUID"
echo -e "* Alter-ID: $AID"
echo -e "* Encryption: auto"
echo -e "* Network: $NETW"
echo -e "* ws path: $WSPATH \033[0m"