-
Notifications
You must be signed in to change notification settings - Fork 0
/
XrayR.sh
122 lines (119 loc) · 3.3 KB
/
XrayR.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 80
sudo ufw allow 443
bash <(curl -Ls https://raw.githubusercontent.com/zeronxdev/xrayr/main/install.sh)
read -p " Địa chỉ web(VD: https://example.com): " api_host
[ -z "${api_host}" ] && api_host=https://example.com
read -p " Khóa giao tiếp(VD: example_123): " api_key
[ -z "${api_key}" ] && api_key=example_123
read -p " NODE ID Cổng 80: " node_id1
[ -z "${node_id1}" ] && node_id1=0
read -p " NODE ID Cổng 443: " node_id2
[ -z "${node_id2}" ] && node_id2=0
rm -rf /etc/XrayR/ht4g.crt
rm -rf /etc/XrayR/ht4g.key
openssl req -newkey rsa:2048 -x509 -sha256 -days 365 -nodes -out /etc/XrayR/ht4g.crt -keyout /etc/XrayR/ht4g.key -subj "/C=JP/ST=Tokyo/L=Chiyoda-ku/O=Google Trust Services LLC/CN=google.com"
cd /etc/XrayR
cat >config.yml <<EOF
Log:
Log:
Level: none
AccessPath: # /etc/XrayR/access.Log
ErrorPath: # /etc/XrayR/error.log
DnsConfigPath: # /etc/XrayR/dns.json
InboundConfigPath: # /etc/XrayR/custom_inbound.json
RouteConfigPath: # /etc/XrayR/route.json
OutboundConfigPath: # /etc/XrayR/custom_outbound.json
ConnectionConfig:
Handshake: 4
ConnIdle: 30
UplinkOnly: 2
DownlinkOnly: 4
BufferSize: 64
Nodes:
-
PanelType: "V2board"
ApiConfig:
ApiHost: "${api_host}"
ApiKey: "${api_key}"
NodeID1: ${node_id1}
NodeType: V2ray
Timeout: 30
EnableVless: false
EnableXTLS: false
SpeedLimit: 0
DeviceLimit: 0
RuleListPath: # /etc/XrayR/rulelist
ControllerConfig:
DisableSniffing: True
ListenIP: 0.0.0.0
SendIP: 0.0.0.0
UpdatePeriodic: 60
EnableDNS: false
DNSType: AsIs
EnableProxyProtocol: false
EnableFallback: false
FallBackConfigs:
-
SNI:
Path:
Dest: 80
ProxyProtocolVer: 0
CertConfig:
CertMode: none
CertDomain: ""
CertFile: /etc/XrayR/ht4gvpn.crt
KeyFile: /etc/XrayR/ht4gvpn.key
Provider:
Email:
DNSEnv:
CLOUDFLARE_EMAIL:
CLOUDFLARE_API_KEY:
-
PanelType: "V2board"
ApiConfig:
ApiHost: "${api_host}"
ApiKey: "${api_key}"
NodeID2: ${node_id2}
NodeType: Trojan
Timeout: 30
EnableVless: false
EnableXTLS: false
SpeedLimit: 0
DeviceLimit: 0
RuleListPath: # /etc/XrayR/rulelist
ControllerConfig:
DisableSniffing: True
ListenIP: 0.0.0.0
SendIP: 0.0.0.0
UpdatePeriodic: 60
EnableDNS: false
DNSType: AsIs
EnableProxyProtocol: false
EnableFallback: false
FallBackConfigs:
-
SNI:
Path:
Dest: 80
ProxyProtocolVer: 0
CertConfig:
CertMode: file
CertDomain: ""
CertFile: /etc/XrayR/ht4g.crt
KeyFile: /etc/XrayR/ht4g.key
Provider:
Email:
DNSEnv:
CLOUDFLARE_EMAIL:
CLOUDFLARE_API_KEY:
EOF
sed -i "s|ApiHost:.*|ApiHost: ${api_host}|" ./config.yml
sed -i "s|ApiKey:.*|ApiKey: ${api_key}|" ./config.yml
sed -i "s|NodeID1:.*|NodeID: ${node_id1}|" ./config.yml
sed -i "s|NodeID2:.*|NodeID: ${node_id2}|" ./config.yml
clear
cd /root && xrayr restart && echo -e " Cài Đặt Hoàn Tất!"
#Speedtest
curl -Lso- bench.sh | bash