Page 1 of 1

Creating tickets

Posted: Wed Jan 06, 2016 7:33 pm
by Joseph Mariki
Hello Gargoyle. I have a small project at school and I will need your system. My question is, does this software cloud managed? Second question is, can I create and print tickets or vouchers with bandwidth limits? Thanks in advance. Joseph.

Re: Creating tickets

Posted: Wed Jan 06, 2016 8:01 pm
by Lantis
Hi Joseph,

The software is managed via the web interface of the router. There is no "cloud" management so to speak.

There is no built in way to print tickets or vouchers with bandwidth limits.
I can think of a few ways of implementing this in a rather crude way. Can i get more details on your project? What exactly are you trying to achieve. I'd love to help you, without doing it all for you :).

Re: Creating tickets

Posted: Fri Jun 05, 2020 2:10 am
by compever
Hi Lantis,

I realise that is resurrecting an old thread, but I thought that was the best place to ask the question.

I am very interested in creating a ticketing system for Gargoyle, and your “very crude way” would be a great start. :-)

Are you still willing to share that knowledge?

Re: Creating tickets

Posted: Fri Jun 05, 2020 10:33 am
by Lantis
Sure.

So the basic goal is to lock a device to an IP. if you can do that, the quotas etc are trivial.
My crude method involved registering the device ahead of time by MAC Address. Use this to assign a static IP and then establish required quotas.
Then the user just needs to be given the wifi password and they're in.

I imagine this all happening just before the ticket generation phase.

"Please enter your MAC Address to get X MB of data"

Does that point you in the right direction?

Re: Creating tickets

Posted: Mon Jun 08, 2020 7:16 pm
by compever
For our usage getting the user to enter their MAC address isn't feasible, but I can get that information from the logs and script the application of a quota. Thank you for pointing me in that direction.

Where my knowledge is lacking is in how to apply a quota via script. I could manually apply a quota and reverse engineer how it was done, but if you already know how that would be much better. :)

Re: Creating tickets

Posted: Mon Jun 08, 2020 7:36 pm
by Lantis
Honestly i'd just be doing the same thing to explain it to you. Best if you test it locally and understand the ins and outs of how it works.

The only pointers I can give would be:
- Quotas are stored in /etc/config/firewall
- They are applied to the system by restore_quotas
- restore_quotas is typically called via /usr/lib/gargoyle_firewall_util/gargoyle_firewall_util.sh which does some bootstrapping and other iptables setup first
- There are some extra flags which are set initially in /etc/config/firewall, and then deleted by restore_quotas after dealing with them (i think the "id" field should be left out, and then restore_quotas generates you one. You can supply it yourself, just make sure no clashes) (You should set option "ignore_backup_at_next_restore" to "1" when first creating a quota so it doesn't attempt to load historical data. restore_quotas will handle and remove this option after processing)


Oh, and if you come up with anything interesting out of this journey, please do share it back with us. It would be interesting to see at the very least.

Re: Creating tickets

Posted: Mon Jun 08, 2020 7:47 pm
by compever
That was heaps for me to work with. Thank you.

I will get working on this. As I am doing it in my spare time (aren't we all) it may take a while, but I will certainly share what I come up with.