Developer Installation Instructions

Note

This page is for developers who want to customize or extend OpenWISP RADIUS, whether for bug fixes, new features, or contributions.

For user guides and general information, please see:

The following diagram illustrates the role of the RADIUS module within the OpenWISP architecture.

OpenWISP Architecture: Radius module

OpenWISP Architecture: highlighted radius module

Important

For an enhanced viewing experience, open the image above in a new browser tab.

Refer to Architecture, Modules, Technologies for more information.

Dependencies

  • Python >= 3.9

Installing for Development

Install the system dependencies:

sudo apt update
sudo apt install xmlsec1 gettext \
    sqlite3 \
    # the dependencies below are needed
    # to test the integration with
    # OpenWISP Monitoring
    fping \
    gdal-bin \
    libproj-dev \
    libgeos-dev \
    libspatialite-dev \
    spatialite-bin \
    libsqlite3-mod-spatialite
# For running E2E Selenium tests (Firefox is the default browser)
sudo apt install firefox chromium

Fork the openwisp-radius repository on GitHub, then clone your fork. Replace YOUR_GITHUB_USERNAME with your GitHub username:

git clone git@github.com:YOUR_GITHUB_USERNAME/openwisp-radius.git

Navigate into the cloned repository:

cd openwisp-radius/

Launch Redis (and InfluxDB for the integration with OpenWISP Monitoring):

docker compose up -d redis influxdb

Setup and activate a virtual-environment (we'll be using virtualenv):

python -m virtualenv env
source env/bin/activate

Make sure that your base python packages are up to date before moving to the next step:

pip install -U pip wheel setuptools

Install development dependencies:

pip install -e .[saml,openvpn_status]
pip install -r requirements-test.txt
sudo npm install -g prettier

Install WebDriver for Chromium for your browser version from https://chromedriver.chromium.org/home and Extract chromedriver to one of directories from your $PATH (example: ~/.local/bin/).

Create database:

cd tests/
./manage.py migrate
./manage.py createsuperuser

Launch celery worker (for background jobs):

celery -A openwisp2 worker -l info

Launch development server:

./manage.py runserver

You can access the admin interface at http://127.0.0.1:8000/admin/.

Run tests with:

./runtests

Run quality assurance tests with:

./run-qa-checks

Alternative Sources

Pypi

To install the latest Pypi:

pip install openwisp-radius

Github

To install the latest development version tarball via HTTPs:

pip install https://github.com/openwisp/openwisp-radius/tarball/master

Alternatively you can install the latest development version from Git:

pip install -e git+https://github.com/openwisp/openwisp-radius#egg=openwisp_radius[saml,openvpn_status]

Migrating an existing freeradius database

If you already have a freeradius 3 database with the default schema, you should be able to use it with OpenWISP RADIUS (and extended apps) easily:

  1. first of all, back up your existing database;

  2. configure django to connect to your existing database;

  3. fake the first migration (which only replicates the default freeradius schema) and then launch the rest of migrations normally, see the examples below to see how to do this.

./manage.py migrate --fake openwisp-radius 0001_initial_freeradius
./manage.py migrate

Troubleshooting Steps for Common Installation Issues

If you encounter any issue during installation, run:

pip install -e .[saml] -r requirements-test.txt

instead of pip install -r requirements-test.txt