Skip to main content

# VPNChooser #

![vpnchooser screenshot](https://github.com/cbrand/vpnchooser/raw/master/images/screenshot.png “VPNChooser Screenshot”)

The vpnchooser is a web application which can be used as a graphical user interface to move devices from one ip rule table to another.

These can be used to reroute clients to different gateways, hence the name “vpnchooser”.

## Setup ##

The system builds on top of a linux router utilizing the ip rule system. It has been tested with the “[dd-wrt](http://www.dd-wrt.com/site/index)” router system though should work fine with every linux router which has ssh access.

First you need to define an own ip rule definition and send the traffic on the router to an other gateway (which usually should be sending the traffic through an vpn).

` ip route add default via {gateway} dev {device} table 10 `

### Via Docker ###

For this it is necessary to checkout the full repository at [Github](https://github.com/cbrand/vpnchooser).

If you want to test the setup I would recommend docker.

Ensure you have [docker](https://www.docker.com/) and [docker-compose](https://docs.docker.com/compose/) installed.

Copy the “example.cfg” and put it with the username, the password and the retrieved host key as “docker.cfg”.

To fill in the data you require the ssh host key of the user. You can usually get these with one of the following commands on the server/router:

` ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub ssh-keygen -l -f /etc/ssh/ssh_host_key.pub `

As a alternative you can follow the normal installation instructions and use the configuration generating utility provided by the console script, which is packed in the package.

` vpnchooser generate_config --docker {path_to_config_file} `

This will ask for the necessary configuration options (host of the router, username, password) and extracts the ssh host key from the host. Finally it stores it to the file passed as a command line parameter.

For a production build you also should adjust the root password for mysql, which is stored in the docker-compose.yml file.

After that you can start the necessary docker instances with the following command.

` docker-compose up `

This builds and downloads all necessary system components and starts the necessary system components. After that you should be able to access the application through port 5000. The default username is “admin” and the password is “admin”.

### Without Docker ###

To run the system without docker you need to at least provide a Redis server which can be used to synchronize the redis backend. An optional database can also be provided. However a default sqlite database can also be utilized.

If you have provided the necessary software you can install the application. I recommend doing this in an [virtual environment](http://docs.python-guide.org/en/latest/dev/virtualenvs/).

You can now install the vpnchooser via ` easy_install vpnchooser `

After this you can generate a configuration file with the “vpnchooser” command.

` vpnchooser generate_config {path_to_config_file} `

This will guide you through the process of configuring the data. After the file is generated you should set it as the configuration file and then can start the server.

` export FLASK_CONFIG_FILE={path_to_config_file} vpnchooser runserver `

In a different terminal start the celery process to synchronize the current state with the router.

` export FLASK_CONFIG_FILE={path_to_config_file} vpnchooser runcelery `

## Development Environment ##

To compile the frontend you do need node.js and npm.

Go to the “src/vpnchooser/static” folder and type

` npm install grunt dev `

This will compile the frontend.

## License ##

The code is licensed under the [MIT](http://opensource.org/licenses/MIT) license.

## TODO ##

The application is still in development. If you want to contribute here are some topics which would be nice to have:

  • SSH Private Keys for authentication with the router

  • Better documentation
    • On Boarding

    • Code

  • Unit Tests

I will gladly review and merge pull requests given to this project.

Metadata

Release files for vpnchooser 0.6.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distributions (sdists)

Source distribution for vpnchooser 0.6.5
File Size Uploaded Provenance Actions
vpnchooser-0.6.5.zip 877.0 kB Without provenance Details for vpnchooser-0.6.5.zip
vpnchooser-0.6.5.tar.gz 857.3 kB Without provenance Details for vpnchooser-0.6.5.tar.gz

Release files / vpnchooser-0.6.5.zip

Download URL vpnchooser-0.6.5.zip
Size 877.0 kB
Tags Source
SHA-256 checksum
How to use checksums
86f3ba501693b63ccc7990e375d5a1b33245b85c3433d47bd73503f175abd363
BLAKE2b-256 checksum
How to use checksums
73e3d641dcdd6d6068ca64a99c539007011b0edfb692490728c67174c55b637d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / vpnchooser-0.6.5.tar.gz

Download URL vpnchooser-0.6.5.tar.gz
Size 857.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8b5928cc1fe04688e47bfd0e7bdfb2584e7ae726b9f004403d8d35e846a2c0ec
BLAKE2b-256 checksum
How to use checksums
617994b7f2bb71fa0b8645c552ec1d041640135e020b8fffeb02cb91c7934560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for vpnchooser 0.6.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page