├── README.md
└── Server_install.sh
/README.md:
--------------------------------------------------------------------------------
1 |
2 | ### Update date 20190416
3 |
4 | * 厌倦了雷同的代理软件,来看看vAgent吧!
5 | * 基于ECC非对称公钥技术的新一代隧道技术
6 | * 版本V3.1
7 |
8 | ---
9 |
10 | ### Table of Contents
11 |
12 | * [关于我们](#关于我们)
13 | * [下载](#下载)
14 | * [License](#license)
15 |
16 | ## 关于我们
17 |
18 | 杀得方滨兴抱头鼠窜的 杰克船长
19 |
20 | 中国第一支由义工组成的软件工程师团队,我们为科学安全上网提供产品设计
21 |
22 | 我们的软件简单到凡是会拿鼠标就可以无障碍使用
23 |
24 | 我们是中国第一个宣布GFW已经失效的团队,前提是你已经在使用vAgent
25 |
26 | 多项专利技术造福加入我们社群的人士
27 |
28 | ## 什么样的人才会加入我们的社团群组?
29 |
30 | * 如果你是科学上网软件设计达人,我们欢迎你加入,或许一个不经意的思想碰撞,我们又将造出世界又一个精品工程
31 |
32 | * 不满足目前科学上网软件低效、雷同的局面,想获得最新尖端技术vAgent
33 |
34 | * 想免费获得海量资源的人士 你可以很好的使用vAgent下载你要的东西
35 |
36 | * 想获得最新的科学上网技术和暗网技术的人士, vAgent的技术已经和TOR水乳交融
37 |
38 | * 学生 记者 艺术生 维权人士加入我们会获得更详细的保护自己隐私的系统性知识和指导
39 |
40 | * 习惯看youtube 4k以上视频的学习达人
41 |
42 | * 手机党等都能同时获得我们的额外的技术支持
43 |
44 | ## 有没有跨平台移动端?
45 |
46 | * 我们已经提供了移动设备的解决方案,请到电报技术群获得支持!
47 |
48 |
49 | ## 部署了vAgent,我能获得什么?
50 | * Youtube高清视频,自己的服务器自己做主
51 | * 通过vAgent一键启动tor,不一样的安全环境为你定制
52 | * 支持vAgent://等一键导入功能,方便分享给你想分享的人
53 |
54 | ## 客户端是否开源,服务端呢?
55 | 很快我们会推送客户端源码,vAgent技术全部开源免费使用
56 | 你可以很轻松的部署vAgent.
57 |
58 | ## 联系我们
59 | **电报社群 [TechSupport](https://t.me/crossgreatfirewall) 进入**
60 |
61 | **电报频道 [TechSupport](https://t.me/everythingjustbegin) 进入**
62 |
63 | ## 下载
64 |
65 | | Download | Server/Client | OS | Arch | Remark |
66 | | --- | --- | --- | --- | --- |
67 |
68 | | [vAgent.exe](https://github.com/vagentProject/vAgent/releases/download/v3.0/vagent3.1.2.zip) | Client | Windows | amd32 | GUI |
69 |
70 |
71 |
72 |
73 | ## 部署vAgent
74 |
75 | ### Ubuntu and Debian 8 +
76 |
77 | ```
78 | wget https://raw.githubusercontent.com/vagentProject/vAgent/master/Server_install.sh --no-check-certificate -O Server_install.sh
79 | bash Server_install.sh
80 | ```
81 |
82 | ### Centos
83 |
84 | ```
85 | 请静候佳音
86 | ```
87 |
88 |
89 |
90 | ## License
91 |
92 | Licensed under The GPLv3 License
93 |
--------------------------------------------------------------------------------
/Server_install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # while-menu: a menu-driven system information program
4 |
5 |
6 | DELAY=1 # Number of seconds to display results
7 |
8 |
9 |
10 |
11 | function_checkService()
12 |
13 | {
14 | dpkg-query -l stunnel4 &> /dev/null
15 | stunnelStatus=$?
16 |
17 | if [ $stunnelStatus -eq 0 ];then
18 | dpkg-query -l squid3 &> /dev/null
19 | sqStatus=$?
20 | if [ $sqStatus -eq 0 ];then
21 |
22 | clear
23 | echo -e "\033[32m---------------------------------\033[0m"
24 | echo -e "\033[32m vagent already installed\033[0m"
25 | else
26 | function_install
27 | function_ServicePort
28 | function_SqConf
29 | function_Basic_Authentication
30 | function_Stunnel_config
31 | function_vagentEcc
32 | function_vagentRestart
33 | function_printKey
34 |
35 | fi
36 |
37 | else
38 | function_install
39 | function_ServicePort
40 | function_SqConf
41 | function_Basic_Authentication
42 | function_Stunnel_config
43 | function_vagentEcc
44 | function_vagentRestart
45 | function_printKey
46 | fi
47 |
48 |
49 |
50 | }
51 |
52 | function_install()
53 | {
54 | echo -e "\033[32m install vagent.............\033[0m"
55 | apt-get install squid3 stunnel4 apache2-utils -y &> /dev/null
56 | }
57 |
58 | function_hitscheck()
59 |
60 | {
61 | dpkg-query -l stunnel4 &> /dev/null
62 | stunnelStatus=$?
63 |
64 | if [ $stunnelStatus -eq 0 ];then
65 | dpkg-query -l squid3 &> /dev/null
66 | sqStatus=$?
67 | if [ $sqStatus -eq 0 ];then
68 |
69 | clear
70 | echo -e "\033[32m---------------------------------\033[0m"
71 | echo -e "\033[32m vagent already installed\033[0m"
72 | else
73 | function_install
74 | function_ServicePort
75 | function_SqConf
76 | function_Basic_Authentication
77 | function_Stunnel_config
78 | function_vagentEcc
79 | function_vagentRestart
80 | function_printKey
81 |
82 | fi
83 |
84 | else
85 | function_install
86 | function_ServicePort
87 | function_SqConf
88 | function_Basic_Authentication
89 | function_Stunnel_config
90 | function_vagentEcc
91 | function_vagentRestart
92 | function_printKey
93 | fi
94 |
95 |
96 |
97 | }
98 |
99 |
100 | function_Uninstall()
101 | {
102 | service stunnel4 stop
103 | /etc/init.d/squid stop
104 | rm -R /etc/squid/*
105 | rm -R /etc/stunnel
106 | apt-get purge --auto-remove squid3 stunnel4
107 | }
108 |
109 | function_status()
110 | {
111 | /etc/init.d/squid status &> /dev/null
112 | # store exit status of grep
113 | # if found grep will return 0 exit stauts
114 | # if not found, grep will return a nonzero exit stauts
115 | status=$?
116 |
117 | if test $status -eq 0
118 | then
119 | echo -e "\033[32m Great vagent already running.............\033[0m"
120 | else
121 | echo "------------------------"
122 | echo -e "\e[31mplease restart vagent\e[0m"
123 | echo "------------------------"
124 | fi
125 |
126 | }
127 |
128 |
129 |
130 | function_SqConf()
131 |
132 | {
133 | echo -e "\033[32m Great vagent already running.............\033[0m"
134 | wget --no-check-certificate -O /etc/squid/squid.conf https://gist.githubusercontent.com/e7d/1f784339df82c57a43bf/raw/squid.conf &> /dev/null
135 | mkdir /var/log/squid &> /dev/null
136 | mkdir /var/cache/squid &> /dev/null
137 | mkdir /var/spool/squid &> /dev/null
138 | chown -cR proxy /var/log/squid &> /dev/null
139 | chown -cR proxy /var/cache/squid &> /dev/null
140 | chown -cR proxy /var/spool/squid &> /dev/null
141 | squid -z &> /dev/null
142 |
143 | }
144 |
145 |
146 | function_Basic_Authentication()
147 |
148 | {
149 | userPwd=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')
150 | htpasswd -c -b -d /etc/squid/users.pwd vagent $userPwd
151 | echo "$userPwd" > /etc/squid/vagentPwd
152 | }
153 |
154 |
155 |
156 | function_printKey()
157 |
158 | {
159 | dpkg-query -l stunnel4 &> /dev/null
160 | stunnelStatus=$?
161 |
162 | if [ $stunnelStatus -eq 0 ];then
163 | dpkg-query -l squid3 &> /dev/null
164 | sqStatus=$?
165 | if [ $sqStatus -eq 0 ];then
166 |
167 | clear
168 | echo -e "\e[31m----------------------------------------------key info Begin------------------------------\e[0m"
169 | infoHits=$(cat /etc/stunnel/stunnel.pem)
170 | echo -e "\033[32m $infoHits \033[0m"
171 |
172 | echo -e "\e[31m----------------------------------------------key info END------------------------------\e[0m"
173 | echo -e "\033[32m userName : vagent \033[0m"
174 |
175 |
176 | userPwd=$(cat /etc/squid/vagentPwd)
177 | echo -e "\033[32m password : $userPwd \033[0m"
178 |
179 | #cat /etc/squid/vagentPwd
180 | serverAdd=$(cat /etc/squid/vagentAdd)
181 |
182 | echo -e "\033[32m $serverAdd \033[0m"
183 | echo -e "\e[31m-----------------------------------------Authentication Account END----------------------\e[0m"
184 |
185 | else
186 | echo -e "\e[31mpleasee install vagent\e[0m"
187 | fi
188 |
189 | else
190 | echo -e "\e[31mpleasee install vagent\e[0m"
191 | fi
192 |
193 |
194 | }
195 |
196 | function_Stunnel_config()
197 | {
198 |
199 | cat << EOF > /etc/stunnel/stunnel.conf
200 | cert = /etc/stunnel/stunnel.pem
201 | [squid]
202 | # Ensure the .connect. line matches your squid port. Default is 3128
203 | accept = $port
204 | connect = 127.0.0.1:3128
205 | EOF
206 | cat /etc/stunnel/stunnel.conf
207 |
208 | }
209 |
210 | function_vagentRestart()
211 |
212 | {
213 | /etc/init.d/squid restart &> /dev/null
214 | status=$?
215 |
216 | if test $status -eq 0
217 | then
218 | echo -e "\033[32m Cache restart success \033[0m"
219 | stunnel4 &> /dev/null
220 | status=$?
221 | if test $status -eq 0
222 | then
223 | echo -e "\033[32m TLS services restart success \033[0m"
224 | else
225 | echo "------------------------"
226 | echo -e "\e[31mcache start fail\e[0m"
227 | fi
228 |
229 | else
230 | echo "------------------------"
231 | echo -e "\e[31mTLS service fail\e[0m"
232 | echo "------------------------"
233 | fi
234 |
235 | }
236 |
237 | function_vagentEcc()
238 |
239 |
240 | {
241 |
242 | Server_add=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'`
243 |
244 | # generate 384bit ca certicate
245 | openssl ecparam -out /etc/stunnel/vagent.key -name secp384r1 -genkey
246 | openssl req -x509 -new -key /etc/stunnel/vagent.key \
247 | -out /etc/stunnel/vagent.pem -outform PEM -days 3650 \
248 | -subj "/emailAddress=$Email/CN=$Server_add/O=vAgent/OU=vAgent/C=Sl/ST=cn/L=vagent"
249 |
250 | #Create the stunnel private key (.pem) and put it in /etc/stunnel.
251 | cat /etc/stunnel/vagent.key /etc/stunnel/vagent.pem >> /etc/stunnel/stunnel.pem
252 | #Show Algorithm
253 | #openssl x509 -in /etc/stunnel/stunnel.pem -text -noout
254 | #openssl ecparam -list_curves
255 | }
256 |
257 |
258 |
259 | function_ServicePort()
260 |
261 |
262 | {
263 |
264 | read -p "input a port: " port
265 | Server_add=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'`
266 | echo "$Server_add:$port" > /etc/squid/vagentAdd
267 | read -p "input a Email: " Email
268 |
269 |
270 | }
271 |
272 |
273 |
274 | while true; do
275 | # clear
276 | cat << _EOF_
277 | Please Select:
278 | ------------------------------------------------------
279 | 1. Install vagent
280 | 2. Uninstall vagent
281 | 3. Show vagent status
282 | 4. print key and server info
283 | 5. restart vagent
284 | 0. Quit
285 |
286 | _EOF_
287 |
288 | read -p "Enter selection [0-5] > "
289 |
290 | if [[ $REPLY =~ ^[0-5]$ ]]; then
291 | case $REPLY in
292 | 1)
293 | function_checkService
294 | sleep $DELAY
295 | continue
296 | ;;
297 | 2)
298 | function_Uninstall
299 | sleep $DELAY
300 | continue
301 | ;;
302 | 3)
303 | function_status
304 | sleep 7
305 | continue
306 | ;;
307 | 4)
308 | function_printKey
309 |
310 | sleep $DELAY
311 | continue
312 | ;;
313 |
314 | 5)
315 | function_vagentRestart
316 | sleep $DELAY
317 | continue
318 | ;;
319 | 0)
320 | break
321 | ;;
322 | esac
323 | else
324 | echo -e "\e[31mInvalid entry.\e[0m"
325 | sleep $DELAY
326 | fi
327 | done
328 | echo -e "\e[31mProgram terminated.\e[0m"
329 |
--------------------------------------------------------------------------------