GithubHelp home page GithubHelp logo

tonytwostep / pia-wg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hsand/pia-wg

0.0 0.0 0.0 40 KB

A WireGuard configuration utility for Private Internet Access. Fork adds env vars and CLI arguments for use with automation

License: GNU General Public License v3.0

Python 90.45% Shell 9.55%

pia-wg's Introduction

pia-wg

Modifications of this fork

Specify PIA credentials via env vars (optional)

  • PIA_USERNAME (the pia username)
  • PIA_PASSWORD (the pia password)

If these vars are not specified the program will fall back to the default behavior to get the credentials (user prompt)

CLI arguments for generate-config.py (optional)

  • --list or -l - list out the availble PIA servers to use in the generated config
  • --server or -s - specify a server to use when generating the config

If a server is not specified manually with -s the program will fall back to the default behavior of having you select a server from the list UI

Original README contents

A WireGuard configuration utility for Private Internet Access

This is a Python utility that generates WireGuard configuration files for the Private Internet Access VPN service. This allows you to take advantage of the WireGuard protocol without relying on PIA's proprietary client.

This was created by reverse engineering the manual-connections script released by PIA. At this stage, the tool is a quick and dirty attempt to get things working. It could break at any moment if PIA makes changes to their API.

pia-wg runs on both Windows and Linux.

Windows

  • Install the latest version of Python 3
    • Select "Add Python to environment variables"
  • Install WireGuard

Open a command prompt and navigate to the directory where you placed the pia-wg utility. The following commands will create a virtual Python environment, install the dependencies, and run the tool.

python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
generate-config.py

Follow the prompts. When finished, you can exit the virtual environment with the deactivate command.

The script should generate a .conf file that can be imported into the WireGuard utility.

Linux (Debian/Ubuntu)

Install dependencies, clone pia-wg project, and create a virual Python environment:

sudo apt install git python3-venv wireguard openresolv
git clone https://github.com/hsand/pia-wg.git
cd pia-wg
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Run the tool, and follow the prompts

python3 generate-config.py

Copy the .conf file to /etc/wireguard/, and start the interface

sudo cp PIA-Iceland-1605054556.conf /etc/wireguard/wg0.conf
sudo wg-quick up wg0

You can shut down the interface with sudo wg-quick down wg0

Check everything is working

Visit https://dnsleaktest.com/ to see your new IP and check for DNS leaks.

pia-wg's People

Contributors

hsand avatar tonytwostep avatar michaelmagan avatar jsaterdalen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.