-
Notifications
You must be signed in to change notification settings - Fork 95
/
Copy pathazure-pipelines.yml
46 lines (43 loc) · 1.5 KB
/
azure-pipelines.yml
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
# write a azure pipeline yaml
trigger:
- master
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
persistCredentials: true
- script: |
# install dependencies
sudo apt-get update
sudo apt-get install -y gcc cmake libevent-dev libjson-c-dev libssl-dev libz-dev
# go to build folder
mkdir build
cd build
# run cmake
cmake ..
# run make
make
# enable bbr
sudo sysctl -w net.core.default_qdisc=fq
sudo sysctl -w net.ipv4.tcp_congestion_control=bbr
# generate ini file for xfrpc
# the ini file is to configure the xfrpc
# the xfrpc will connect to frps server
# the frps server is running on from environment variable XFRPC_SERVER
# the frps server is listening on port from environment variable FRPS_PORT
# the frps server is using the token from environment variable TOKEN
# xfrpc add a proxy named chatgptd
# the proxy is listening on port 1080
# xfrpc will connect to frps server and forward the traffic to the proxy
# the proxy will forward the traffic to the go-shadowsocks2
# the go-shadowsocks2 will forward the traffic to the internet
echo "[common]" > xfrpc.ini
echo "server_addr = $(XFRPC_SERVER)" >> xfrpc.ini
echo "server_port = $(FRPS_PORT)" >> xfrpc.ini
echo "token = $(TOKEN)" >> xfrpc.ini
echo "[chatgptd]" >> xfrpc.ini
echo "type = socks5" >> xfrpc.ini
echo "remote_port = $(REMOTE_PORT)" >> xfrpc.ini
# run xfrpc
./xfrpc -c xfrpc.ini -f -d 7
displayName: 'build and run xfrpc'