hsand / pia-wg Goto Github PK
View Code? Open in Web Editor NEWA WireGuard configuration utility for Private Internet Access
License: GNU General Public License v3.0
A WireGuard configuration utility for Private Internet Access
License: GNU General Public License v3.0
The PIA file generation still works but the file generated seems to have stopped working as of 1/3/22 after working for about 4 months without issue. The description does mention that PIA could change their API at any moment and break things. Well, I think it happened. Thanks anyway for the solution up until today :). OpenVPN still works with PIA but hopefully we can get WG back going.
I'm trying to set this up on Raspbian "buster." I followed the instructions, but when I run the last command:
sudo wg-quick up wg0
I get the following message:
wg-quick: 'wg0' already exists
And also now the device no longer has internet access while still being accessible over LAN.
not having been able to connect recently with the vpn, I also tried to recreate my wg0.conf file but nothing I receive anything from the vpn
When i come to the part of entering usn&pwd(all previous steps were successfully operated), I could enter the username but I'm not able to enter the password.
(venv) C:\Users\Downloads\pia-wg-master\pia-wg-master>python3 generate-config.py
Traceback (most recent call last):
File "C:\Users\Downloads\pia-wg-master\pia-wg-master\generate-config.py", line 1, in
from piawg import piawg
File "C:\Users\Downloads\pia-wg-master\pia-wg-master\piawg.py", line 1, in
import requests
ModuleNotFoundError: No module named 'requests'
Please excuse my lack of python knowledge. Your how-to is very user friendly, however I have a dependency error that I do not know how to resolve. Here is the text from the command line:
**ERROR: Cannot install -r requirements.txt (line 5) and urllib3==1.26.6 because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested urllib3==1.26.6
requests 2.24.0 depends on urllib3!=1.25.0, !=1.25.1, <1.26 and >=1.21.1
To fix this you could try to:
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies**
Thank you for your assistance.
Hello, Thanks for this super helpful script! This may be a dead project but I'll ask anyway.
Would it be possible to add a port forwarding option?
(venv) PS C:\pia-wg-master> python generate-config.py
Traceback (most recent call last):
File "C:\pia-wg-master\generate-config.py", line 6, in
pia = piawg()
^^^^^^^
File "C:\pia-wg-master\piawg.py", line 16, in init
self.get_server_list()
File "C:\pia-wg-master\piawg.py", line 26, in get_server_list
data = json.loads(r.text.splitlines()[0])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\foxi\AppData\Local\Programs\Python\Python312\Lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\foxi\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\foxi\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I used the tool to generate the config and it said everything worked but when I put this in my wireguard set up it doesn't work...
[Interface]
Address = 10.38.134.8
PrivateKey = <>
DNS = 10.0.0.243,10.0.0.242
[Peer]
PublicKey = <>
Endpoint = 46.246.3.218:1337
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25
I encountered a problem when asked for my PIA credentials, it says "Error logging in, please try again ..."
I'm sure my credentials are working.
I tested several servers and all indicated this error to me.
I grabbed pia-wg today and installed python 3.10.2 and follow ed the readme.
Generate-config.py fails with "FileNotFoundError: [WinError 2] The system cannot find the file specified" and i have no idea why.
Here's my whole console output:
(venv2) D:\pia-wg-master\pia-wg-master>generate-config.py
Traceback (most recent call last):
File "D:\pia-wg-master\pia-wg-master\generate-config.py", line 9, in
pia.generate_keys()
File "D:\pia-wg-master\pia-wg-master\piawg.py", line 54, in generate_keys
self.privatekey = subprocess.run(['wg', 'genkey'], stdout=subprocess.PIPE, encoding="utf-8").stdout.strip()
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 501, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 966, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1435, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
Thanks for this useful piece of codes ! I use it regularly on my router to get PIA Wireguard working properly.
Is there any plan to implement the dedicated IP feature in your code ? I know it should be possible by providing somehow the unique token generated by PIA.
Hi! Thank you for the script, @hsand! Any chance you're interested in uploading it to pypi.org?
This would really simplify installation, especially for those who use pipx or don't mind installing it without venv.
Check: https://ipv6leak.com/
Fix: https://www.reddit.com/r/WireGuard/comments/nl2uxl/comment/gzgaxo8
- AllowedIPs = 0.0.0.0/0
+ AllowedIPs = 0.0.0.0/0, ::/0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.