From c19b591c6ae7e96202b158bf43aa989fa22646d5 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 4 Aug 2015 20:34:53 +0200 Subject: [PATCH] Generate the HTTP Resonse with python for 1.0.x PirateBox too Will avoid Captive Portal message from Android. Especially some devices tend to leave the PirateBox network, because they don't receive a 204 from their specific URL. Closes #115 --- piratebox/piratebox/conf/lighttpd/lighttpd.conf | 4 ++++ piratebox/piratebox/www/generate_204 | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 piratebox/piratebox/www/generate_204 diff --git a/piratebox/piratebox/conf/lighttpd/lighttpd.conf b/piratebox/piratebox/conf/lighttpd/lighttpd.conf index 7ad6ed3..5f1795f 100644 --- a/piratebox/piratebox/conf/lighttpd/lighttpd.conf +++ b/piratebox/piratebox/conf/lighttpd/lighttpd.conf @@ -71,6 +71,10 @@ $HTTP["url"] =~ "^/cgi-bin/" { cgi.assign = ( ".py" => "/usr/bin/python" ) } +$HTTP["url"] =~ "^generate_204" { + cgi.assign = ( "" => "/usr/bin/python" ) +} + ## Warning this represents a security risk, as it allow to execute any file ## with a .pl/.py even outside of /usr/lib/cgi-bin. # diff --git a/piratebox/piratebox/www/generate_204 b/piratebox/piratebox/www/generate_204 new file mode 100644 index 0000000..daa0eed --- /dev/null +++ b/piratebox/piratebox/www/generate_204 @@ -0,0 +1,3 @@ +#!/usr/bin/python + +print ("HTTP/1.0 204 No Content")