Skip to main content

A Python library built on XML-RPC that demystifies remote interaction with OpenVPN Access Server

Project description

Python OpenVPN Access Server SDK

A Python library built on XML-RPC that demystifies remote interaction with OpenVPN Access Server

OpenVPN Access Server provides an XML-RPC API that allows administrators to manage the server remotely and programatically. Unfortunately, OpenVPN explicitly provides this feature undocumented. This SDK provides a way to interact with this API, with helpful error messages, powerful functionality, and a clear explanation of what the hell you're looking at.

For support please email peritz@pardonmynoot.com. Code is at https://github.com/peritz/pyovpn-as

Getting Started

Getting started is simple. First you must enable the XML-RPC feature on your access server. This can be done either through the web interface by navigating to Configurations -> Client Settings -> Enable Complete API or by setting it via the command line ./sacli --key "xmlrpc.relay_level" --value 2 ConfigPut

Now we can start running commands:

>>> from pyovpn_as import client

>>> mgmt_client = client.from_args('https://ovpn.example.org/RPC2/', 'openvpn', 'P4ssw0rd!!!!')

>>> new_user = mgmt_client.users.create_new_user('newuser', 'P4ssw0rd123£', prop_superuser=True)

>>> new_user.type

"user_connect"

>>> new_user.is_admin

True

>>> mgmt_client.users.delete_user(as_client, '404')
Traceback (most recent call last):   
  File "<stdin>", line 1, in <module>
AccessServerProfileNotFoundError: User "404" does not exist

Installation

pip install pyovpn-as

How to Contribute

There are three main ways to contribute to this project:

  • Search for open issues or open your own issue for a bug or problem discovered in the codebase or the documentation
  • Submit a pull request to merge a feature or fix into the master branch (more information on how to do that and what maintainers expect from your code can be found in the full documentation)
  • Use this SDK to poke at OpenVPN Access Server to find additional functionality, or to clarify the functionality given here, then open an issue and tell us what you found and how we can improve

We don't accept monetary contributions, everything you see is free :)

License

GPL license, see the License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyovpn-as-0.0.8.tar.gz (45.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyovpn_as-0.0.8-py3-none-any.whl (47.4 kB view details)

Uploaded Python 3

File details

Details for the file pyovpn-as-0.0.8.tar.gz.

File metadata

  • Download URL: pyovpn-as-0.0.8.tar.gz
  • Upload date:
  • Size: 45.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pyovpn-as-0.0.8.tar.gz
Algorithm Hash digest
SHA256 e0bbd5bd20296375fd8ca34a62781a8a02714903f68c61131bdec5bafc30bab4
MD5 74b2fa00d67d480283940e8e9a288efc
BLAKE2b-256 4f4d39b5684b527700f4500bffc9efd8b485c8c634d1652e93ffb72b1c461b4b

See more details on using hashes here.

File details

Details for the file pyovpn_as-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: pyovpn_as-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 47.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pyovpn_as-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1b9367edcb503dc61e6b6c23764064cece0719910cee5cc45cb94a1b7f9cf139
MD5 244f85aa315aea64ef2dea8e994fd074
BLAKE2b-256 e40a72c3b8de2a512c263f44bb4661cd11e64296b5d6505b764547097652a7a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page