linuxmint / pia-manager

A VPN configuration tool for PIA
GNU Lesser General Public License v3.0
32 stars 11 forks source link

Allow users to update their list of gateways #2

Closed DanielOaks closed 7 years ago

DanielOaks commented 7 years ago

This PR adds this command:

pia-manager --update-gateways [--use-ips]

Essentially, --update-gateways downloads the new list of servers and then writes the output to the file /usr/share/pia-manager/gateways.list.dynamic. On the actual GUI side, if the .dynamic file exists it prefers that – and otherwise it grabs it from the usual location.

There are certainly ways to improve this going forward. I'm thinking we can make the actual code that handles --update-gateways a part of the usr/lib/pia-manager/pia-manager.py script. The reason I haven't done this yet is just because of the interesting getpass.getuser() stuff that the bin script does.

The good thing about doing this is that we can have a button on the interface called something like "Update server list", would make actually using this a bunch easier for users than having to go use a terminal command. As well, we'd also be able to add i10n for the outputs there.

The --use-ips option wouldn't be used too much, but it's mostly useful when users are heading to places that do weird DNS blocking, so supporting it as well is a good idea.