Added documentation for operations

This commit is contained in:
Roger Garcia 2020-04-04 21:44:24 +02:00
parent d38912d074
commit c13f0a2905
2 changed files with 11 additions and 0 deletions

View file

@ -17,6 +17,8 @@ In order to configure simplex custom options we have to modify `simplex-config.j
- timeout: For receiving UDP response
## Scripts
Before run any script you must build the solution. Please run `npm run build`.
### Consistency
This script is used to ensure consistency between simplex datasources and RADIUS datasources. There are several functionalities covered:
- syncradius: This ensures consistency between RADIUS and simplex tables
@ -26,6 +28,14 @@ This script is used to ensure consistency between simplex datasources and RADIUS
Usage: `npm run consistency -- <action> [-f if we want to fix the issues]`
### Operations
This script is used in server side to perform operations in the database. Now supported options are:
- initialsubs: This option creates available subscription ids between min and max. Syntax: `npm run operations -- -o initialsubs "{"min": <int>, "max": <int> }"`
- addipv4range: This option creates ipv4 ranges in the pool. Syntax: `npm run operations -- -o addipv4range "{"subnet": "<a.b.c.d/i>", "available": <boolean> }"`
- migrateipv4: This option changes ipv4 from circuits and radius tables. Syntax: `npm run operations -- -o addipv4range "{"oldSubnet": "<a.b.c.d/i>", "newSubnet": "<a.b.c.d/i>", "available": <boolean>, "exceptions": {"<a.b.c.d>": true... } }"`
- removeipv4range: This option removes ipv4 subnet from pool. Syntax: `npm run operations -- -o addipv4range "{"subnet": "<a.b.c.d/i>"}"`
## Contribute
This software is developed using the node.js runtime, so you need an environment with it. You also need a MySQL or mariaDB database running in your system. In this repo is explained how to use Docker to

View file

@ -28,6 +28,7 @@
"docker:run": "docker run -p 3000:3000 -d simplex-api",
"migrate": "node ./dist/migrate",
"consistency": "node ./dist/scripts/consistency",
"operations": "node ./dist/scripts/operations",
"prestart": "npm run build",
"start": "node .",
"prepublishOnly": "npm run test"