Skip to content

Commit

Permalink
Move config.ini into $HOME/.config/vpngate-with-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
ductin committed Apr 21, 2017
1 parent fce8aae commit 3682169
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 4 deletions.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified config.py
100644 → 100755
Empty file.
Empty file modified icon/connected.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icon/connecting1.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icon/connecting2.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icon/connecting3.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icon/connectnot.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified old/LICENSE
100644 → 100755
Empty file.
Empty file modified old/README.md
100644 → 100755
Empty file.
Empty file modified old/config.py
100644 → 100755
Empty file.
Empty file modified ui_elements.py
100644 → 100755
Empty file.
Empty file modified user_script.sh
100644 → 100755
Empty file.
15 changes: 11 additions & 4 deletions vpnproxy_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __str__(self):
uptime = datetime.timedelta(milliseconds=int(self.uptime))
uptime = re.split(',|\.', str(uptime))[0]
txt = [self.country_short, str(self.ping), '%.2f' % speed, uptime, self.logPolicy, str(self.score), self.proto,
self.port]
self.ip, self.port]
txt = [dta.center(spaces[ind + 1]) for ind, dta in enumerate(txt)]
return ''.join(txt)

Expand Down Expand Up @@ -327,7 +327,7 @@ def vpn_manager(ovpn):

# get config file path
path = os.path.realpath(sys.argv[0])
config_file = os.path.split(path)[0] + '/config.ini'
config_file = os.path.expanduser('~/.config/vpngate-with-proxy/config.ini')
cfg = Setting(config_file)
args = sys.argv[1:]

Expand All @@ -342,6 +342,9 @@ def vpn_manager(ovpn):
get_input(cfg, args)

else:
if not os.path.exists(os.path.expanduser('~/.config/vpngate-with-proxy')):
os.makedirs(os.path.expanduser('~/.config/vpngate-with-proxy'))

print '\n' + '_' * 12 + ctext(' First time config ', 'gB') + '_' * 12 + '\n'

cfg.proxy['use_proxy'] = 'no' if raw_input(
Expand Down Expand Up @@ -384,6 +387,10 @@ def vpn_manager(ovpn):
get_input(cfg, 'config')
print '\n' + '_' * 12 + ctext(' Config done', 'gB') + '_' * 12 + '\n'


if not os.path.exists("config.ini"):
os.symlink(config_file, "config.ini")

# ------------------- check_dependencies: ----------------------
mirrors.extend(cfg.mirror['url'].split(', '))
use_proxy, proxy, port, ip = cfg.proxy.values()
Expand Down Expand Up @@ -421,8 +428,8 @@ def vpn_manager(ovpn):
dns_manager()
ranked, vpn_list = refresh_data()

labels = ['Index', 'Country', 'Ping', 'Speed', 'Up time', 'Log Policy', 'Score', 'protocol', 'Portal']
spaces = [6, 7, 6, 10, 10, 10, 10, 8, 8]
labels = ['Idx', 'Geo', 'Ping', 'Speed', 'Up', 'Log', 'Score', 'proto', 'Ip', 'Port']
spaces = [5, 5, 7, 8, 8, 8, 8, 5, 19, 6]
labels = [label.center(spaces[ind]) for ind, label in enumerate(labels)]
connected_servers = []

Expand Down

0 comments on commit 3682169

Please sign in to comment.