Skip to content

REST API Server for FreeRadius3 with DaloRadius Frontend

License

Notifications You must be signed in to change notification settings

jozefrebjak/radius-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jozef Rebjak's Radius API Server

API Server for FreeRadius3 with DaloRadius

Version Node.js CI Last commit Issues Forks GitHub stars License

Built With

Features

GET

  • Users
    • /user-all/
    • /user-id/{id}
    • /user-username/{username}
    • /user-group/{groupname}
  • Nas
    • /nas-all
    • /nas-id/{id}
    • /nas-name/{shortname}
    • /nas-ip/{nasname}

POST

  • Users
    • /user-create/
  • Nas
    • /nas-create/

UPDATE

  • Users
    • /user-update/{username}

DELETE

  • Users
    • /user-delete-id/{id}
    • /user-delete-username/{username}
  • Nas
    • /nas-delete-id/{id}
    • /nas-delete-name/{shortname}
    • /nas-delete-ip/{nasname}

Documentation with testing of API endpoints

  • Swagger Documentation
    • /api-docs

Known problems

  • Missing Authorization
  • Only HTTP Scheme for now

Getting Started with this repo

This guide will take you through setting up your Radius API Server

Step 1: Starter installation

With git clone:
git clone https://github.com/jozefrebjak/radius-api.git /opt/radius-api

cd /opt/radius-api

npm install

Step 2: Edit env

After instalation of dependencies you need to specife .env parameters

# Create .env file in root folder
touch .env

# Insert this parameters and edit them with your parameters
DB_HOST=YOUR_DATABASE_HOSTNAME_OR_IP
DB_USER=YOUR_USER 
DB_PASS=YOUR_USER_PASS
DB_DATABASE=YOUR_DATABASE_NAME
DB_PORT=YOUR_DATABASE_PORT

Step 3: Install SQL Procedures to your radius database

Go to the /opt/radius-api/extra/database

There is two procedures needed for production. They are need for POST and UPDATE of USER and NAS.

  1. procedure-userAddOrEdit.sql
  2. procedure-nasAdd.sql

Log to your database and run the sql statements from that files.

Step 4: Run Radius API Server as a service

Once installed or cloned locally and all packages are installed you can setup service.

# Copy example service file to your systemd
cp /opt/radius-api/extra/radius-api.service /etc/systemd/system/radius-api.service

systemctl daemon-reload

systemctl enable radius-api

systemctl start radius-api

service api status

License

License