captive.whump.shanti-portal/README.md

44 lines
1.9 KiB
Markdown
Raw Normal View History

2016-04-05 14:43:13 +00:00
# Captive Portal
2016-04-15 17:27:44 +00:00
Captive portal webpage written with simplicity in mind.
- Present a webpage to the user
2016-09-13 07:29:57 +00:00
- User submits a form
2016-04-15 17:27:44 +00:00
- Plugins are executed with form data
- User is granted access to whatever treasure the portal is guarding
This is a commonly seen setup in public Wifi networks or hotspots.
2016-09-07 08:56:54 +00:00
This app was specifically written for such a hotspot and as such requires a lot of other configuration around it. This is an ongoing [documentation project here](https://wiki.sydit.se/teknik:guider:networking:captive_portal_med_iptables).
2016-04-15 17:27:44 +00:00
2016-04-15 17:24:44 +00:00
# Plugins
Plugins are executed when the user clicks through the captive portal form, whether they submit data or just approve an EULA these plugins are executed.
Plugins accept data from the request of the user, as of writing this is only wsgi environ data.
2016-04-18 19:46:04 +00:00
Result of the plugins decide whether the user gets accepted into the portal or not. As such plugins have the potential to do anything from check the users IP against a whitelist to authenticate against a RADIUS server or Active Directory.
2016-04-18 19:42:29 +00:00
Sample plugins prefixed with sample\_ are a good starting point for understanding the plugins.
Plugins can be made mandatory, or skipped by being disabled, see plugins.cfg for more configuration.
2016-04-15 17:24:44 +00:00
## Why plugins, why job queue?
My primary use case for this portal would be with tens of thousands of users so already I imagined that creating firewall rules would be a blocking action.
Also with plugins there are options to connect other authentication methods like LDAP or RADIUS, and even other actions to the portal. All of which are possibly blocking. So plugins and job queues felt like a necessary technology to use. Otherwise this type of portal could be a very simple CGI script that runs a system() command.
2016-04-18 19:46:04 +00:00
2016-04-16 17:10:28 +00:00
# Get started
python setup.py install
python portal.py
## RQ worker
2016-04-15 17:24:44 +00:00
2016-04-15 17:25:02 +00:00
rq worker -u redis://127.0.0.1:6379/
2016-04-18 19:42:29 +00:00
# Deployment
See examples in docs/examples directory.