Metadata-Version: 2.1
Name: django-wireguard
Version: 0.1.3
Summary: A Django app for managing WireGuard Interfaces.
Home-page: https://gitlab.com/thatsed/django-wireguard
Author: Alessandro Romani
Author-email: romani.ae98@gmail.com
License: MIT
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 3.1
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.6
Requires-Dist: Django (>=2.2)
Requires-Dist: cryptography (>=3.2.1)
Requires-Dist: pyroute2 (>=0.5.14)

================
Django Wireguard
================

This is a Django app that provides management via Admin Site for WireGuard interfaces and peers.


Installation
------------

Install with pip: ``pip install django-wireguard``


Quick start
-----------

1. Add "django_wireguard" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [
        ...
        'django_wireguard',
    ]

2. Run ``python manage.py migrate`` to create the models.

3. Visit http://localhost:8000/admin/ to manage the VPN peers. Note: you must enable the Django Admin Site first https://docs.djangoproject.com/en/3.1/ref/contrib/admin/.


Enabling the Wagtail Integration
--------------------------------

1. Add "simple_vpn.wagtail" to your INSTALLED_APPS setting after simple_vpn::

    INSTALLED_APPS = [
        ...
        'django_wireguard'
        'django_wireguard.wagtail',
    ]

2. You can manage the VPN from the Wagtail Admin Panel Settings. ``Inspect`` a WireguardPeer object to view their configuration.


Configuration
-------------

The following settings can be provided:

* ``WIREGUARD_ENDPOINT`` the endpoint for the peer configuration. Set it to the server Public IP address or domain. Default: ``localhost``.
* ``WIREGUARD_STORE_PRIVATE_KEYS`` set this to False to disable auto generation of peer private keys. Default: ``True``.
* ``WIREGUARD_WAGTAIL_SHOW_IN_SETTINGS`` set this to False to show WireGuard models in root sidebar instead of settings panel. Default: ``True``.

Testing with Docker
-------------------

1. Make sure the WireGuard kernel modules are installed and loaded on the host machine.
2. Run ``docker build -f Dockerfile.test -t django_wg_test .``
3. Run ``docker run --cap-add NET_ADMIN django_wg_test``


