Developer Installation Instructions

Note

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

For user guides and general information, please see:

Dependencies

  • NodeJs >= 20.9.0

  • NPM - Node package manager >= 10.1.0

  • yarn - Yarn package manager >= 1.19.1

Prerequisites

OpenWISP RADIUS

OpenWISP WiFi Login Pages is a frontend for OpenWISP RADIUS. In order to use it, this app needs a running instance of OpenWISP RADIUS and an organization correctly configured, you can obtain this by following these steps:

  • Follow the instructions to install OpenWISP RADIUS for development.

  • After successfully starting the OpenWISP RADIUS server, open a browser and visit: http://localhost:8000/admin/, then sign in with the credentials of the superuser we created during the installation of openwisp-radius.

  • Visit the change page of the organization you want to add to this module and note down the following parameters: name, slug, uuid and token (from the Organization RADIUS Settings).

Installing for Development

Fork and clone the forked repository:

git clone https://github.com/<your_fork>/openwisp-wifi-login-pages.git

Navigate into the cloned repository:

cd openwisp-wifi-login-pages

Install the dependencies:

yarn

Launch development server:

yarn start

You can access the application at http://localhost:8080/default/login/

Run tests with:

yarn test # headless tests

Running Automated Browser Tests

Prerequisites for running browser tests:

  1. Gecko driver needs to be installed.

  2. Having running instances of openwisp-radius and openwisp-wifi-login-pages is required.

  3. OPENWIPS_RADIUS_PATH environment variable is needed to setup/tear down the database needed to run the browser tests. This can be set using the following command:

    export OPENWISP_RADIUS_PATH=<PATH_TO_OPENWISP_RADIUS_DIRECTORY>
    
  4. If a virtual environment is used to run openwisp-radius then this needs to be activated before running browser tests.

  5. Configuration file of mobile organization is needed before running yarn start. mobile organization can be created by running:

    node browser-test/create-mobile-configuration.js
    
  6. In the test environment of openwisp-radius, the default organization must be present.

After doing all the prerequisites, you need to make sure OpenWISP RADIUS is running:

cd $OPENWISP_RADIUS_PATH
# enable python virtual environment if needed
./manage.py runserver

Then, in another terminal, from the root directory of this repository, you need to build this app and serve it:

yarn build-dev
yarn start

Then, in another terminal, from the root directory of this repository, you can finally run the browser based tests:

export OPENWISP_RADIUS_PATH=<PATH_TO_OPENWISP_RADIUS_DIRECTORY>
# enable python virtual environment if needed
yarn browser-test