GithubHelp home page GithubHelp logo

isabella232 / protonvpn-nm-lib Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pop-os/protonvpn-nm-lib

0.0 0.0 0.0 1.16 MB

ProtonVPN NM Library

License: GNU General Public License v3.0

Makefile 1.81% Shell 1.31% Python 95.34% Jinja 1.54%

protonvpn-nm-lib's Introduction

ProtonVPN NM Library

Copyright (c) 2021 Proton Technologies AG

This repository holds the ProtonVPN NM Library. For licensing information see COPYING. For contribution policy see CONTRIBUTING.

Description

The ProtonVPN NM (NetworkManager) Library is intended for every ProtonVPN service user.

You can download the latest stable release, either from our official repositories or directly on the official GitHub repository.

Dependencies:

Distro Command
Fedora/CentOS/RHEL sudo dnf install -y NetworkManager NetworkManager-openvpn NetworkManager-openvpn-gnome openvpn python3-pyxdg python3-keyring python3-jinja2 python3-distro python3-gobject libsecret-devel dbus-x11 gnome-keyring
Ubuntu/Linux Mint/Debian and derivatives sudo apt install -y network-manager network-manager-openvpn openvpn python3-xdg python3-keyring python3-jinja2 python3-distro gir1.2-nm-1.0 libsecret-tools dbus-x11 gnome-keyring network-manager-openvpn-gnome
Arch Linux/Manjaro sudo pacman -S networkmanager networkmanager-openvpn openvpn python-pyxdg python-keyring python-jinja python-distro dbus-x11 gnome-keyring

Additional dependency:

Proton Python Client

Virtual Environment Dependencies:

If you would like to run the the CLI from within a virtual environment (for either development purposes or other), then you can easily do that with the help of pipenv. Make sure to install pipenv and additional packages before.

Distro Command
Fedora/CentOS/RHEL sudo dnf install pkgconf-pkg-config networkmanager networkmanager-openvpn openvpn cairo-devel cairo-gobject-devel libsecret-devel gobject-introspection-devel dbus-x11 gnome-keyring
Ubuntu/Linux Mint/Debian and derivatives sudo apt install -y pkg-config network-manager network-manager-openvpn openvpn libcairo2-dev libgirepository1.0-dev gir1.2-nm-1.0 dbus-x11 libsecret-tools gnome-keyring
Arch Linux/Manjaro sudo pacman -S pkgconf networkmanager networkmanager-openvpn openvpn cairo base-devel gobject-introspection pkgconf dbus-x11 libsecret gnome-keyring gtk3

Install inside virtual environment:

  1. cd protonvpn-nm-core
  2. pipenv install (installs virtual environment and all necessary dependencies from Pipfile).
  3. pipenv shell (enter virtual environment).
  4. pip install -e . (to install).

How to use:

Import

from protonvpn_nm_lib.api import protonvpn


Login

protonvpn.login("[email protected]", "ProtonPassword")


Logout

protonvpn.logout()


Connect

protonvpn.setup_connection(ConnectionTypeEnum.SERVERNAME, "PT#12", ProtocolEnum.TCP)
protonvpn.connect()


Disconnect

protonvpn.disconnect()


API Description
protonvpn.login(username, password) Login with your Proton credentials.
protonvpn.logout() Logout user and delete current user session.
protonvpn.setup_connection(connection_type, connection_type_extra_arg, protocol) Setup and configure VPN connection prior to calling protonvpn.connect().
protonvpn.setup_reconnect() Setup and configure VPN connection to a previously connected server. Should be called before calling protonvpn.connect().
protonvpn.connect() Should be used either after protonvpn.setup_connection() protonvpn.setup_reconnect().
protonvpn.disconnect() Disconnect from ProtonVPN.
protonvpn.check_session_exists() Check if sessions exists.
protonvpn.get_connection_status() Get active connection status.
protonvpn.get_settings() Get user settings. This object can be used to get and set user settings.
protonvpn.get_session() Get user session. This object can be used to get servers list, get keyring data and other.
protonvpn.get_country() Get country.
protonvpn.get_connection_metadata() Get metadata of an active ProtonVPN connection.
protonvpn.get_non_active_protonvpn_connection() Get non active ProtonVPN connection.
protonvpn.get_active_protonvpn_connection() Get active ProtonVPN connection.
protonvpn.ensure_connectivity() Ensure that there is an internet connection.

protonvpn-nm-lib's People

Contributors

calexandru2018 avatar dhoko avatar feltcat avatar mickaelifs avatar mmstick avatar rollwagen 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.