Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update from origin #1

Open
wants to merge 3,196 commits into
base: 3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3196 commits
Select commit Hold shift + click to select a range
d9c7687
bugfix for ipv4
Sep 15, 2014
e1266d6
revert packages.egg
Sep 15, 2014
531083b
random choice appid in rangefetch
Sep 15, 2014
d826a01
Fix bug codeskulptor can not save
jobin-sun Sep 15, 2014
ef65aa1
Merge pull request #43 from jobin-sun/3.0
Sep 15, 2014
a0ae2d7
update greenlet
Sep 16, 2014
e891347
increase FDSET_SIZE to 2560
Sep 16, 2014
7e3c3a0
refine openssl connection
Sep 16, 2014
006b2bc
refine openssl handshake
Sep 16, 2014
cb9cc43
rename
Sep 17, 2014
9edcbd8
switch to ssl
Sep 17, 2014
93cbe3f
bump version to 3.1.25
Sep 17, 2014
afc2270
refine create_connection
Sep 17, 2014
1833fb2
refine strip plugin
Sep 18, 2014
8223825
switch to openssl
Sep 19, 2014
ff6207a
refine proxy.sh
Sep 19, 2014
a2aa7a8
hide some ssl error
Sep 20, 2014
1d89034
refine ssl errors format
Sep 20, 2014
8086f6b
refine urlfetch timeout
Sep 20, 2014
ca4a17d
begin gae server refacting
Sep 21, 2014
948a07e
refactor gae.py
Sep 21, 2014
772c8f9
init 3.2.0
Sep 21, 2014
bc0cb8b
checkout timeout in create_http_request
Sep 21, 2014
f522e3d
dont check timeout in gae fetch plugin
Sep 21, 2014
9b02dbe
refine create_http_request timeout
Sep 21, 2014
89742e9
use headfirst to check timeout
Sep 22, 2014
fcdfdae
refine headfirst
Sep 22, 2014
e139c9d
refine headfirst
Sep 22, 2014
4819788
refine headfirst
Sep 22, 2014
cab8c4e
default set headfirst=0
Sep 22, 2014
0ba0e26
refine uploader
Sep 22, 2014
bb9322a
bugfix for goagent-gtk
Sep 22, 2014
cef1e0d
set headfirst=1
Sep 22, 2014
77969ca
refine uploader
Sep 22, 2014
344c05b
rollback uploader
Sep 23, 2014
e383874
refine upload
Sep 23, 2014
eb00a13
refine uploader
Sep 23, 2014
65cdfb3
refine uploader
Sep 23, 2014
5be6977
refine uploader
Sep 23, 2014
401a560
bugfix for uploader
Sep 23, 2014
e415b18
bugfix for uploader
Sep 23, 2014
5f3e4a8
appengine.google.com = withgae
Sep 23, 2014
abb0ebe
add withgae tip
Sep 23, 2014
53f03c6
increase direct timeout for uploader
Sep 23, 2014
893b688
add read_timeout
Sep 23, 2014
5a284e8
disable _winreg
Sep 23, 2014
a548e77
print password
Sep 23, 2014
2ecb85f
security bugfix for [gae]validate
Sep 24, 2014
4c6ddda
improve CertUtil
Sep 24, 2014
34548a6
remove .gitkeep
Sep 24, 2014
5f054eb
refine uploader
Sep 24, 2014
f60b7ae
bugfix for gae fetch plugin
Sep 25, 2014
c1afa23
refine uploader
Sep 25, 2014
1d853df
refine uploader
Sep 25, 2014
99bf28a
enable openssl session cache
Sep 26, 2014
aa5433d
refine openssl session_cache
Sep 26, 2014
57b3104
refine create_ssl_connection errors
Sep 26, 2014
739a25a
refine iplist for ipv6
Sep 26, 2014
ebacf64
enable openssl session cache for all platform
Sep 27, 2014
d4ae4cc
unused return
Sep 27, 2014
438b046
only enable openssl under windows
Sep 27, 2014
8df29d4
bugfix for openssl session cache
Sep 27, 2014
28f3784
remove docstring
Sep 27, 2014
27ef032
refine openssl session cache
Sep 27, 2014
3eefca2
disable openssl sess cache under linux
Sep 27, 2014
2ad0e8d
refine openssl sess cache
Sep 27, 2014
fbd9e67
revert stripplugin
Sep 27, 2014
c1ea5f6
fix 100% CPU usage on BSD system (OS X)
zhuhaow Sep 27, 2014
c77298e
Merge pull request #49 from dofelw/3.0-test
Sep 27, 2014
ac6abf6
revert openssl sess cache for macosx/linux
Sep 27, 2014
d275b40
bugfix for openssl
Sep 27, 2014
906369f
disable cachesock
Sep 27, 2014
21ba575
refine gae protocol
Sep 28, 2014
d7833c8
legacy app support
Sep 28, 2014
21f200a
only cache first sock for cache_sock = 1
Sep 28, 2014
43c150f
bugfix for uploader
Sep 28, 2014
282ca44
Workaround for CPU 100% issue under MacOSX
Sep 28, 2014
f56de77
begin refactor for php
Sep 28, 2014
d72f7b2
refactor for php
Sep 28, 2014
790902a
bugfix gae/php
Oct 1, 2014
c6d516b
enable cachesock
Oct 1, 2014
00b10ed
refine php
Oct 1, 2014
4e173c6
refine proxy.ini
Oct 1, 2014
cc51fac
refine paas
Oct 1, 2014
0c131ac
random.choice php server
Oct 1, 2014
aadca9c
bugfix for index.js
Oct 1, 2014
4f18b55
bugfix for php
Oct 1, 2014
0339bf0
refine cachesock
Oct 2, 2014
ef6f9d4
avoid crt time error warning when used by other devices
hub01 Oct 2, 2014
09830d1
Merge pull request #50 from hub01/patch-6
Oct 2, 2014
6fdde8c
headfirst for google sites
Oct 3, 2014
d1fa5ae
bugfix for python <= 2.7.5
Oct 3, 2014
9a52aba
bugfix for qq browser
Oct 3, 2014
d001aeb
begin websocket support
Oct 4, 2014
4c54c5f
refine proxy.ini
Oct 4, 2014
a2e9c06
refine read timeout for gae fetch
Oct 4, 2014
5f67b78
refine cache_sock
Oct 4, 2014
c364673
refine cache_sock
Oct 4, 2014
08f8609
refine timeout
Oct 10, 2014
f014dbb
bundle openssl dylib for macosx
Oct 10, 2014
ba37aa6
refine dns resolve
Oct 10, 2014
55f4978
Use a 302 instead of a 301 redirect in filter_redirect.
yfdyh000 Oct 11, 2014
acbf219
Merge pull request #51 from yfdyh000/302redirect
Oct 11, 2014
98034b0
Update README.md
Oct 11, 2014
136d4c9
Update README.md
Oct 11, 2014
8e908fd
Update README.md
Oct 11, 2014
661843a
Update README.md
Oct 11, 2014
cbd3b4f
Update README.md
Oct 11, 2014
ade810a
refine 302 redirect
Oct 11, 2014
11f3c0d
refine uploader
Oct 11, 2014
8b853b9
Update README.md
Oct 12, 2014
df12471
typo
Oct 12, 2014
8fb1f92
drop 3.1.x support
Oct 13, 2014
67f45d6
Update README.md
Oct 13, 2014
f7978bf
Update README.md
Oct 13, 2014
06e4e81
Update README.md
Oct 13, 2014
5d6404e
bugfix for Request timed out: timeout('timed out',)
Oct 13, 2014
b138053
Delete www6.l.google.com
zzq1015 Oct 13, 2014
ea42704
Some DNS changes
zzq1015 Oct 13, 2014
3e81b92
Merge pull request #53 from zzq1015/patch-2
Oct 14, 2014
10087c4
Merge pull request #52 from zzq1015/patch-1
Oct 14, 2014
ab0e43f
Update README.md
Oct 14, 2014
8248970
Update README.md
Oct 14, 2014
9d8b1f7
set autrange size=1.5m
Oct 14, 2014
85e63ec
move README/wiki to https://goagent.github.io
Oct 15, 2014
c30abd5
timeout more quickly
Oct 17, 2014
c4a8b4d
add remove_ca function(not completed).
Oct 18, 2014
e52663b
refine remove_ca method
Oct 18, 2014
1ba4645
remove default CA
Oct 18, 2014
2b4cec9
Update addto-startup.py
zfdang Oct 19, 2014
789159f
Merge pull request #56 from zfdang/3.0
Oct 19, 2014
2da08cc
random sni
Oct 21, 2014
d94dec4
refine timeout for iplist
Oct 22, 2014
c95e873
revert back timeout
Oct 22, 2014
665b351
update ssl
Oct 22, 2014
002142f
refine pac
Oct 23, 2014
d7e6d2a
import_ca support for firefox on android
hub01 Oct 29, 2014
a6a0ba7
Merge pull request #59 from hub01/patch-7
Oct 29, 2014
34894bf
refine iplist algo
Oct 30, 2014
b13b1dc
rewrite iplist algo
Oct 30, 2014
37000e8
cert bugfix for mobile device
Nov 2, 2014
3bc97ae
bump version to 3.2.2
Nov 4, 2014
b1942e5
Update README.md
Nov 4, 2014
5c598cb
catch WindowsError when import_ca
Nov 5, 2014
c4ac5b6
refine CertUtil
Nov 5, 2014
2f85c82
Merge pull request #40 from hub01/patch-5
Nov 5, 2014
5d1cfa7
Update README.md
Nov 5, 2014
394a9fa
refine CertUtil
Nov 6, 2014
be0572b
Add gitignore in server dir.
haosdent Nov 8, 2014
23bd955
Remove unnecessary write file in upload.py
haosdent Nov 8, 2014
7a20743
Merge pull request #64 from haosdent/3.0
Nov 8, 2014
becb8fa
add adsl proxy support for goagent.exe
Nov 8, 2014
95bdb55
bugfix for adsl
Nov 8, 2014
9d3da6d
refine uploader
Nov 8, 2014
3d4dcff
Update README.md
Nov 11, 2014
e26038e
Fix file permissions.
Nov 12, 2014
6e04a27
Merge pull request #65 from pallxk/3.0
Nov 12, 2014
973e3b3
improve dnsproxy
Nov 15, 2014
64650f1
bugfix for adsl support
Nov 16, 2014
cc8de2d
certificate bugfix for chrome 39+
Nov 22, 2014
29ea397
bugfix for CPU 100% usage for linux/macosx
Nov 22, 2014
fd00c8a
adsl support for win8
Nov 22, 2014
aef23ca
hide pagespeed
Nov 22, 2014
5879dcb
bump version to 3.2.3
Nov 22, 2014
f7a857a
drop [gae]maxsize option
Nov 23, 2014
2c078a6
revert to libev
Nov 23, 2014
1828e9c
bugfix for gae download
Nov 23, 2014
9fd4717
bugfix for direct download
Nov 23, 2014
d044211
bugfix
Nov 23, 2014
e19a2ff
refine gae/direct download
Nov 23, 2014
10e4228
proxy.sh 取消kill的错误输出,不美观
Nov 24, 2014
c08247a
Merge pull request #67 from tkisme/3.0
Nov 24, 2014
1199071
Update README.md
Nov 26, 2014
12d403f
smaller packages.egg
Nov 26, 2014
439e3a6
refine strip plugin
Nov 26, 2014
823f613
introduce net2
Nov 26, 2014
16a0bb5
refine rule for internat
Nov 29, 2014
9f6c6da
refine withphp rule
Nov 29, 2014
1076013
Fix appid retry logic that will skip a appid when gae is over quota
zanqi Dec 7, 2014
4765ad4
Merge pull request #70 from zanqi/appid
Dec 8, 2014
44582a7
Re-add sslwrap to workaround gevent on Python 2.7.9
felixonmars Dec 13, 2014
f4ba9ba
Merge pull request #71 from felixonmars/gevent-py279
Dec 13, 2014
28ccbd9
log bad IPs
lilydjwg Dec 13, 2014
5bf9789
log only bad IPs that are predefined
lilydjwg Dec 13, 2014
6893ee6
Merge pull request #72 from lilydjwg/logging
Dec 13, 2014
3bfffe8
refine pac
Dec 13, 2014
3df1945
Update proxy.ini
Dec 16, 2014
ff1ddbb
upgrade switchy
Dec 19, 2014
8c87182
add GAE_SSLVERSION to 'GAE Mode' info
yfdyh000 Dec 19, 2014
27c2a6f
Merge pull request #73 from yfdyh000/add_GAE_SSLVERSION_info
Dec 20, 2014
7999bbb
rename ConfigIntroduce.md.ini
Dec 20, 2014
ad26185
Delete SwitchyOmega.crx
Dec 22, 2014
82e9798
Update README.md
Dec 23, 2014
91f3b20
fix google scholar
Dec 24, 2014
30eac44
logrotate and log to specific file
Dec 25, 2014
7981fe3
Check if /etc/logrotate.d exists
Dec 25, 2014
98fce5e
Merge pull request #81 from tkisme/3.0
Dec 25, 2014
a88ee00
Update proxy.ini
v3aqb Dec 26, 2014
b49d351
Merge pull request #83 from v3aqb/patch-3
Dec 26, 2014
45457e3
update dns blacklist
Dec 26, 2014
d0bee32
Update proxy.ini
Dec 27, 2014
41c835a
Update proxy.ini
Dec 28, 2014
f4f64e8
find error while running over a day,now fix
Dec 28, 2014
338ca80
Merge pull request #85 from tkisme/patch-1
Dec 28, 2014
a187c98
Update proxy.ini
Jan 2, 2015
a379b5e
Add V2EX DNS to the DNS list
Liam0205 Jan 2, 2015
314c6eb
Merge pull request #86 from LiamHuang0205/3.0
Jan 2, 2015
0d5eed2
refine proxylib.py
phuslu Jan 3, 2015
e759663
init vps
phuslu Jan 3, 2015
b80a861
Update proxy.ini
Jan 3, 2015
d6ce7ab
add uploader for vps
Jan 4, 2015
9ef8a45
add sysctl.conf/limits.conf
Jan 4, 2015
fcd96f7
add sysctl
Jan 4, 2015
b9ff04c
add supervisor-3.1.3.egg
Jan 4, 2015
6cc5ed7
add supervisord-goagentvps.conf
Jan 4, 2015
fe69159
utf8 conf
Jan 4, 2015
0d8a705
rename vpsserver to goagentvps
Jan 4, 2015
2493b2b
refine uploadvps.py
Jan 4, 2015
153e156
refine proxy.py for vpsserver
Jan 4, 2015
ff8b460
keep same behavior as stunnel/squid
Jan 4, 2015
6f534ae
backlog = 4096
Jan 4, 2015
f3022b4
enable cache
Jan 4, 2015
785ce21
Update proxy.ini
Jan 5, 2015
aa686f9
Merge pull request #87 from lenovo-me/patch-1
Jan 5, 2015
c9d6722
refine VPS
Jan 5, 2015
29e494c
refine forward_socket for vps
Jan 5, 2015
f773dd6
Delete goagentvps.conf
Jan 6, 2015
ffa295b
refine proxylib.py for vps keepalive
Jan 6, 2015
a0ba30a
add cipher socket for vps
Jan 8, 2015
a74dfdb
Update proxy.py
jobin-sun Jan 14, 2015
aaa72d1
Update proxy.ini
gengjiawen Jan 14, 2015
f0a3b6a
Fix spelling error
eamars Jan 15, 2015
7c1a733
Merge pull request #98 from gengjiawen/3.0
Jan 17, 2015
746b968
Merge pull request #99 from eamars/3.0
Jan 17, 2015
6360876
Merge pull request #97 from jobin-sun/patch-1
Jan 19, 2015
e997930
Update proxy.ini
gengjiawen Jan 25, 2015
b506303
Merge pull request #103 from gengjiawen/3.0
Jan 25, 2015
26dd2b1
Update uploader.py
Jan 30, 2015
437a921
Merge pull request #105 from lenovo-me/3.0
Jan 30, 2015
e1dfe78
Update proxy.ini
v3aqb Feb 12, 2015
33d81e8
Update proxylib.py
wellingfine Feb 28, 2015
7c79d89
Merge pull request #117 from wellingfine/patch-1
Mar 1, 2015
14ef3bf
Merge pull request #109 from v3aqb/patch-4
Mar 1, 2015
20f39d0
Update proxy.ini
Mar 2, 2015
eba883e
Update proxy.py
gengjiawen Mar 3, 2015
3c07a73
Merge pull request #118 from gengjiawen/3.0
Mar 3, 2015
037ce5b
Update proxy.sh
Mar 4, 2015
75a63ab
make goagent support new android sdk download
gengjiawen Mar 7, 2015
5ea98a9
Merge pull request #120 from gengjiawen/3.0
Mar 7, 2015
ddc0706
refine log
Apr 12, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
goagent 3.2.3 [http://git.io/goa](https://nodeload.github.com/goagent/goagent/legacy.zip/3.0)

## Issues
* https://code.google.com/p/goagent/issues/list

## Documents
| | |
| -------- | :---- |
| Simple Guide | https://github.com/goagent/goagent/blob/wiki/SimpleGuide.md |
| Graphic Guide | https://github.com/goagent/goagent/blob/wiki/InstallGuide.md |
| FAQ | https://github.com/goagent/goagent/blob/wiki/FAQ.md |
| Configurations | https://github.com/goagent/goagent/blob/wiki/ConfigIntroduce.md.ini |
| Spam List | https://github.com/goagent/goagent/blob/wiki/SpamList.md |
| History | https://github.com/goagent/goagent/blob/wiki/History.md |

## Code
| | |
| -------- | :---- |
| proxy.py | https://github.com/goagent/goagent |
| python27.exe | https://github.com/goagent/pybuild |
| goagent.exe | https://github.com/goagent/taskbar |

## License
* [GNU GPL v2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
8 changes: 8 additions & 0 deletions local/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DS_Store
*~
*.pyc
*.pac
*.key
*.crt
*.pid
*.user.ini
20 changes: 0 additions & 20 deletions local/CA.crt

This file was deleted.

27 changes: 0 additions & 27 deletions local/CA.key

This file was deleted.

1 change: 0 additions & 1 deletion local/CA.srl

This file was deleted.

Binary file added local/GeoIP.dat
Binary file not shown.
20 changes: 7 additions & 13 deletions local/Microsoft.VC90.CRT.manifest
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<noInheritable/>
<assemblyIdentity
type="win32"
name="Microsoft.VC90.CRT"
version="9.0.21022.8"
processorArchitecture="x86"
publicKeyToken="1fc8b3b9a1e18e3b"
/>
<file name="msvcr90.dll" />
</assembly>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<noInheritable/>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" />
<file name="msvcr90.dll" />
</assembly>
1 change: 1 addition & 0 deletions local/SwitchyOptions.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJjb25maWciOiJ7XCJmaXJzdFRpbWVcIjpcIjpdXCIsXCJwcm94eU1vZGVcIjpcImF1dG9cIixcImF1dG9QYWNTY3JpcHRQYXRoXCI6XCI6bWVtb3J5OlwiLFwicnVsZUxpc3RVcmxcIjpcImh0dHBzOi8vYXV0b3Byb3h5LWdmd2xpc3QuZ29vZ2xlY29kZS5jb20vc3ZuL3RydW5rL2dmd2xpc3QudHh0XCIsXCJydWxlTGlzdFJlbG9hZFwiOlwiNzIwXCIsXCJydWxlTGlzdFByb2ZpbGVJZFwiOlwiR29BZ2VudFwiLFwicnVsZUxpc3RBdXRvUHJveHlcIjp0cnVlLFwic3dpdGNoUnVsZXNcIjp0cnVlLFwicnVsZUxpc3RFbmFibGVkXCI6dHJ1ZSxcInBhY1NjcmlwdERhdGFcIjpcIlwiLFwicHJveHlTZXJ2ZXJcIjpcIlwiLFwicXVpY2tTd2l0Y2hcIjpmYWxzZSxcInF1aWNrU3dpdGNoVHlwZVwiOlwiYmluYXJ5XCIsXCJyZWFwcGx5U2VsZWN0ZWRQcm9maWxlXCI6dHJ1ZSxcImNvbmZpcm1EZWxldGlvblwiOmZhbHNlLFwicnVsZXNGaXJzdFRpbWVcIjpcIjtdXCIsXCJtb25pdG9yUHJveHlDaGFuZ2VzXCI6ZmFsc2UsXCJwcmV2ZW50UHJveHlDaGFuZ2VzXCI6ZmFsc2UsXCJsYXN0TGlzdFVwZGF0ZVwiOlwiVGh1IFNlcCAxMSAyMDE0IDE2OjE2OjMxIEdNVCswODAwIChDaGluYSBTdGFuZGFyZC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9LFwiTmV3IFJ1bGUyXCI6e1wibmFtZVwiOlwiZ29vZ2xlXCIsXCJ1cmxQYXR0ZXJuXCI6XCIqOi8vKi5nb29nbGUqLmNvbS8qXCIsXCJwYXR0ZXJuVHlwZVwiOlwid2lsZGNhcmRcIixcInByb2ZpbGVJZFwiOlwiR29BZ2VudFwiLFwiaWRcIjpcIk5ldyBSdWxlMlwifSxcIk5ldyBSdWxlOFwiOntcIm5hbWVcIjpcIndpa2lwZWRpYVwiLFwidXJsUGF0dGVyblwiOlwiKjovLyoud2lraXBlZGlhLm9yZy8qXCIsXCJwYXR0ZXJuVHlwZVwiOlwid2lsZGNhcmRcIixcInByb2ZpbGVJZFwiOlwiR29BZ2VudFwiLFwiaWRcIjpcIk5ldyBSdWxlOFwifX0iLCJzZWxlY3RlZFByb2ZpbGUiOiJ7XCJpZFwiOlwiYXV0b1wiLFwibmFtZVwiOlwiW0F1dG8gU3dpdGNoXVwiLFwicHJveHlNb2RlXCI6XCJhdXRvXCIsXCJjb2xvclwiOlwiYXV0by1ibHVlXCIsXCJpc0F1dG9tYXRpY01vZGVQcm9maWxlXCI6dHJ1ZSxcInByb3h5Q29uZmlnVXJsXCI6XCI6bWVtb3J5OlwifSJ9
Binary file added local/addto-startup.js
Binary file not shown.
127 changes: 127 additions & 0 deletions local/addto-startup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#!/usr/bin/env python
# coding:utf-8

from __future__ import with_statement

__version__ = '1.0'

import sys
import os
import re
import time
import ctypes
import platform

python2 = os.popen('python2 -V 2>&1').read().startswith('Python 2.') and 'python2' or 'python'

def addto_startup_linux():
filename = os.path.abspath(__file__)
dirname = os.path.dirname(filename)
#you can change it to 'proxy.py' if you like :)
scriptname = 'goagent-gtk.py'
DESKTOP_FILE = '''\
[Desktop Entry]
Type=Application
Categories=Network;Proxy;
Exec=/usr/bin/env %s "%s/%s"
Icon=%s/goagent-logo.png
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=GoAgent GTK
Comment=GoAgent GTK Launcher
''' % (python2, dirname , scriptname , dirname)
#sometimes maybe /etc/xdg/autostart , ~/.kde/Autostart/ , ~/.config/openbox/autostart
for dirname in map(os.path.expanduser, ['~/.config/autostart']):
if not os.path.exists(dirname):
os.makedirs(dirname)
if os.path.isdir(dirname):
filename = os.path.join(dirname, 'goagent-gtk.desktop')
with open(filename, 'w') as fp:
fp.write(DESKTOP_FILE)
# os.chmod(filename, 0755)


def addto_startup_osx():
if os.getuid() != 0:
print 'please use sudo run this script'
sys.exit()
import plistlib
plist = dict(
GroupName = 'wheel',
Label = 'org.goagent.macos',
ProgramArguments = list([
'/usr/bin/%s' % python2,
os.path.join(os.path.abspath(os.path.dirname(__file__)), 'proxy.py')
]),
RunAtLoad = True,
UserName = 'root',
WorkingDirectory = os.path.abspath(os.path.dirname(__file__)),
StandardOutPath = '/var/log/goagent.log',
StandardErrorPath = '/var/log/goagent.log',
KeepAlive = dict(
SuccessfulExit = False,
)
)
filename = '/Library/LaunchDaemons/org.goagent.macos.plist'
print 'write plist to %s' % filename
plistlib.writePlist(plist, filename)
print 'write plist to %s done' % filename
print 'Adding CA.crt to system keychain, You may need to input your password...'
cmd = 'sudo security add-trusted-cert -d -r trustRoot -k "/Library/Keychains/System.keychain" "%s/CA.crt"' % os.path.abspath(os.path.dirname(__file__))
if os.system(cmd) != 0:
print 'Adding CA.crt to system keychain Failed!'
sys.exit(0)
print 'Adding CA.crt to system keychain Done'
print 'To start goagent right now, try this command: sudo launchctl load /Library/LaunchDaemons/org.goagent.macos.plist'
print 'To checkout log file: using Console.app to locate /var/log/goagent.log'

install_sharp_osx()


def install_sharp_osx():
# extracted from SwitchySharp.crx
extension_id = 'dpplabbmogkhghncfbfdeeokoefdjegm'
extension_version = '1.10.2'
extension_path = '%s/SwitchySharp.crx' % os.path.abspath(os.path.dirname(__file__))

dest_path = '/Library/Application Support/Google/Chrome/External Extensions'
dest_file = '%s/%s.json' % (dest_path, extension_id)
print 'Installing SwitchySharp for Chrome...'
cmd = 'mkdir -p "%s"' % dest_path
if os.system(cmd) != 0:
print 'Create Chrome External Extensions folder Failed!'
sys.exit(0)

json_dict = {'external_crx': extension_path,
'external_version': extension_version}
with open(dest_file, 'w') as fp:
import json
json.dump(json_dict, fp)
print 'Installing SwitchySharp done.'


def addto_startup_windows():
if 1 == ctypes.windll.user32.MessageBoxW(None, u'是否将goagent.exe加入到启动项?', u'GoAgent 对话框', 1):
if 1 == ctypes.windll.user32.MessageBoxW(None, u'是否显示托盘区图标?', u'GoAgent 对话框', 1):
pass


def addto_startup_unknown():
print '*** error: Unknown system'


def main():
addto_startup_funcs = {
'Darwin' : addto_startup_osx,
'Windows' : addto_startup_windows,
'Linux' : addto_startup_linux,
}
addto_startup_funcs.get(platform.system(), addto_startup_unknown)()


if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
pass
Loading