Permalink
Browse files

Updates

  • Loading branch information...
1 parent 0da437a commit 1dd91224806c0b8bf3fbe443893906a7cd687607 @dustball dustball committed Jan 9, 2012
Showing with 15 additions and 6 deletions.
  1. +4 −3 main.py
  2. +1 −1 pfsense/bridge.py
  3. +9 −1 pfsense/install.sh
  4. +1 −1 templates/main.html
View
7 main.py
@@ -13,6 +13,7 @@
import string
DOMAIN = 'hackerdojo.com'
+TOTAL_DEVICES = 2
MEMBER_DOWNLOAD = 0
MEMBER_UPLOAD = 0
GUEST_TIMEOUT = 43200 # 12 hours
@@ -80,10 +81,10 @@ class MacAddressMapping(db.Model):
@classmethod
def register_new_device(cls, address, username):
- total_devices = 2
devices = cls.all().filter('username =', username).order("-created").fetch(100)
- for d in devices[total_devices-1:]:
- d.delete()
+ if len(devices) >= TOTAL_DEVICES:
+ for d in devices[TOTAL_DEVICES-1:]:
+ d.delete()
m = cls(address=address, username=username)
m.put()
return m
View
2 pfsense/bridge.py
@@ -53,7 +53,7 @@ def _handle():
srv=RadiusServer(addresses=[''], dict=dictionary.Dictionary("dictionary"))
-srv.hosts["127.0.0.1"]=server.RemoteHost("127.0.0.1", "secret", "localhost")
+srv.hosts["192.168.1.1"]=server.RemoteHost("192.168.1.1", "secret", "localhost")
logger.info("starting server...")
try:
View
10 pfsense/install.sh
@@ -1,8 +1,13 @@
+# Enable SSH
+# SSH in, terminal
+# Run script below
+
echo "NOTICE:"
echo "This is going to install the custom RADIUS server for the captive portal"
echo "and run it in screen. We assume it is being run on a FreeBSD pfSense box."
echo
sleep 3
+setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/Latest/
pkg_add -r python
pkg_add -r py26-setuptools
pkg_add -r screen
@@ -15,4 +20,7 @@ mkdir -p /home/captiveportal
cd /home/captiveportal
fetch https://github.com/progrium/hd-captiveportal/raw/master/pfsense/dictionary
fetch https://github.com/progrium/hd-captiveportal/raw/master/pfsense/bridge.py
-screen python bridge.py
+screen python bridge.py
+
+
+# Enable
View
2 templates/main.html
@@ -5,7 +5,7 @@
<div class="grid_12 alpha omega">
<img border=0 src="/static/dojo400.png" style="margin:1.5em" width="400" height="141" />
- <h2><b>FIBER Internet<SUP><SMALL>BETA</SMALL></SUP> has arrived!</b> Members, login below to gain full access to your new connection. Guests may have unlimited free usage of our slower connection.</h2>
+ <h2><b>100/100Mbps Fiber Internet</b> Members, login below to gain full access to the premium network. Guests may have unlimited free usage of our slower connection.</h2>
</div>

0 comments on commit 1dd9122

Please sign in to comment.