Difference between revisions of "BasicInternet:Voucher Platform"

From its-wiki.no

Jump to: navigation, search
(Goal)
(Goal)
Line 42: Line 42:
 
5.- Max-All-Session (Maximum time per voucher in SECONDS) [optional] {ONLY radcheck}
 
5.- Max-All-Session (Maximum time per voucher in SECONDS) [optional] {ONLY radcheck}
  
6.- Mikrotik-Rate-Limit (Data transfer rate limit) [optional] {ONLY radreply}
+
6.- Mikrotik-Rate-Limit (Data transfer rate limit) [optional] {ONLY radreply}. Sintax is "uploadRate/downloadRate". For example 512k/1M
  
  
Line 56: Line 56:
  
  
Furthermore, we need to specify the optional variables. If any of them is equal to zero (0), then it will be ignored. For exapmle for 1hour  :
+
Furthermore, we need to specify the optional variables. If any of them is equal to zero (0), then it will be ignored. For exapmle for radcheck script and 1hour vouchers :
  
 
Mikrotik_Total_Limit=0
 
Mikrotik_Total_Limit=0
Line 74: Line 74:
 
username@appserver:~/voucher_scripts$ mysql -u root -p radius < radcheck_1hour.sql
 
username@appserver:~/voucher_scripts$ mysql -u root -p radius < radcheck_1hour.sql
  
 +
or
  
This should populate the radcheck table with the new 1 hour valid vouchers.
+
username@appserver:~/voucher_scripts$ mysql -u root -p radius < radreply_1hour.sql
 +
 
 +
 
 +
The first one should populate the radcheck table while the second one should populate the radreply table with the new 1 hour valid vouchers.
  
  

Revision as of 10:21, 27 October 2017

Voucher Platform for Basic Internet

Goal

  • IP-domain specific voucher sets, e.g. Kinderdorf, Kigali, Kinshasa South

[igaritano]

My suggestion is to add a hidden string to identify the origin of the vouchers.

For example, let's consider the following voucher "TFOP" for the Kinderdorf. During the voucher creation process, I would add "_Kinderdorf" to all vouchers. That would give us "TFOP_Kinderdorf" as result.

In order to have the solution up and running, we will need to modify the login page for each site, so that each login web page automatically adds the site related string. Thus, users will only need to introduce TFOP and the web page will append "_Kinderdorf" before sending the information to the radius server.


  • Adminstrator login for ordering vouchers, specification of vouchers (out of a list)
    • pattern (alphanumeric, length)
    • first character
    • validity (time, amount of data, validity e.g. 1 year)


  • Voucher creation

[igaritano]

I have created two bash scripts [(1) radcheck.sh and (2) radreply.sh] in order to create two sql scripts [(1) radcheck.sql and (2) radreply.sh]. Each bash script, creates a single sql script.


Whenever we create new vouchers, depending on the configuration parameters, we will need to populate either one or two database tables. These two tables are called (1) radcheck and (2) radreply.

(1) radcheck table will be always populated with new voucher information. (2) radreply will depend on the configuration parameters.


There are six (these are which up to now we have used) variables each voucher could (not all of them are necessary) have:

1.- username* [necessary] {BOTH radcheck and radreply}

2.- User-Password* (The password) [necessary] {ONLY radcheck}

3.- Mikrotik-Total-Limit (Data transfer limit in BYTES) [optional] {BOTH radcheck and radreply}

4.- Max-Secs-Passed (Maximum time per session in SECONDS) [optional] {ONLY radcheck}

5.- Max-All-Session (Maximum time per voucher in SECONDS) [optional] {ONLY radcheck}

6.- Mikrotik-Rate-Limit (Data transfer rate limit) [optional] {ONLY radreply}. Sintax is "uploadRate/downloadRate". For example 512k/1M


Each bash script takes as input a text file, where each voucher name (or username) is written in a single line. For example 1hour.csv :

OLFV

OTPU

OYKA

OPDM


Furthermore, we need to specify the optional variables. If any of them is equal to zero (0), then it will be ignored. For exapmle for radcheck script and 1hour vouchers  :

Mikrotik_Total_Limit=0

Max_Secs_Passed=0

Max_All_Session=3600


Each bash script takes this information as input and generates a sql script which we will need to run on the radius server.

PLEASE, verify that the sintax of the sql script looks ok.


In order to run the sql script on the server, use the following sentence:

username@appserver:~/voucher_scripts$ mysql -u root -p radius < radcheck_1hour.sql

or

username@appserver:~/voucher_scripts$ mysql -u root -p radius < radreply_1hour.sql


The first one should populate the radcheck table while the second one should populate the radreply table with the new 1 hour valid vouchers.


  • Voucher enabling to specific Radius server

Open issues

  • Architectural drawing
  • max number of vouchers
  • username/password when only using one string, e.g. GravidPlus "g1304"