From 790b50740f3ba9234fc60f6c08adcefda73157bb Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 9 Apr 2013 08:02:00 +0200 Subject: [PATCH 001/183] fixing merge issue --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d529ca8..7cfd078 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ piratebox/piratebox/version piratebox/piratebox/www/chat_content.html image_stuff/* -piratebox/piratebox/bin/miniircd.py piratebox_ws_* piratebox-ws_* +tmp/* +piratebox/piratebox/bin/miniircd.py From 1aacd6fc2cacae4e56e5b60d44724d4c738c153c Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 29 Mar 2013 09:22:07 +0100 Subject: [PATCH 002/183] first implementation of IRC Server miniircd --- Makefile | 19 +++++++++++++++-- piratebox/piratebox/conf/irc.conf | 13 ++++++++++++ piratebox/piratebox/conf/irc/motd.txt | 13 ++++++++++++ piratebox/piratebox/conf/piratebox.conf | 10 ++++----- piratebox/piratebox/init.d/piratebox | 26 +++++++++++++++++++++++- piratebox/piratebox/init.d/piratebox_alt | 24 ++++++++++++++++++++-- 6 files changed, 95 insertions(+), 10 deletions(-) create mode 100644 piratebox/piratebox/conf/irc.conf create mode 100644 piratebox/piratebox/conf/irc/motd.txt diff --git a/Makefile b/Makefile index 29fc860..6ecd3e5 100644 --- a/Makefile +++ b/Makefile @@ -16,17 +16,29 @@ MOUNT_POINT=image_stuff/image OPENWRT_FOLDER=image_stuff/openwrt OPENWRT_CONFIG_FOLDER=$(OPENWRT_FOLDER)/conf +WORKFOLDER=tmp + +###IRC deployment +IRC_GITHUB_ULR=git://github.com/jrosdahl/miniircd.git +IRC_WORK_FOLDER=$(WORKFOLDER)/irc +IRC_SRC_SERVER=$(IRC_WORK_FOLDER)/miniircd +IRC_TARGET_SERVER=$(PB_SRC_FOLDER)/bin/miniircd.py .DEFAULT_GOAL = package +$(IRC_TARGET_SERVER): + mkdir -p $(WORKFOLDER) + git clone $(IRC_GITHUB_ULR) $(IRC_WORK_FOLDER) + cp $(IRC_SRC_SERVER) $(IRC_TARGET_SERVER) + $(VERSION): echo "$(PACKAGE_NAME)" > $(VERSION_FILE) -$(PACKAGE): $(VERSION) +$(PACKAGE): $(IRC_TARGET_SERVER) $(VERSION) tar czf $@ $(PB_FOLDER) -$(IMAGE_FILE): $(VERSION) $(SRC_IMAGE_UNPACKED) $(OPENWRT_CONFIG_FOLDER) +$(IMAGE_FILE): $(IRC_TARGET_SERVER) $(VERSION) $(SRC_IMAGE_UNPACKED) $(OPENWRT_CONFIG_FOLDER) mkdir -p $(MOUNT_POINT) echo "#### Mounting image-file" sudo mount -o loop,rw,sync $(SRC_IMAGE_UNPACKED) $(MOUNT_POINT) @@ -62,6 +74,9 @@ package: $(PACKAGE) all: package shortimage clean: cleanimage + rm -fr $(WORKFOLDER) + rm -fr $(IRC_WORK_FOLDER) + rm -f $(IRC_TARGET_SERVER) rm -f $(PACKAGE) rm -f $(VERSION_FILE) diff --git a/piratebox/piratebox/conf/irc.conf b/piratebox/piratebox/conf/irc.conf new file mode 100644 index 0000000..0c4c922 --- /dev/null +++ b/piratebox/piratebox/conf/irc.conf @@ -0,0 +1,13 @@ +### Configuration file for mniircd server + + +IRC_CONFIG_FOLDER=$PIRATEBOX_FOLDER/conf/irc + +#Save state ; keeps topic config. Enable with removing # +#IRC_STATEDIR=$IRC_CONFIG_FOLDER/state + +#MOTD Message +IRC_MOTD=$IRC_CONFIG_FOLDER/motd.txt + + + diff --git a/piratebox/piratebox/conf/irc/motd.txt b/piratebox/piratebox/conf/irc/motd.txt new file mode 100644 index 0000000..9fbc93d --- /dev/null +++ b/piratebox/piratebox/conf/irc/motd.txt @@ -0,0 +1,13 @@ +Welcome to IRC-Piratebox! + +Inspired by pirate radio and the free culture movment, PirateBox is a self-contained mobile collaboration and file sharing +device. PirateBox utilizes Free, Libre and Open Source software (FLOSS) to create mobile wireless file sharing networks +where users can anonymously share images, video, audio, documents, and other digital content. + +PirateBox is designed to be safe and secure. No logins are required and no user data is logged. The system is purposely not +connected to the Internet in order to prevent tracking and preserve user privacy. + +PirateBox was created by David Darts and is registered under a Free Art License (2011). To learn more about the project or +to find out how to build your own PirateBox system, please visit http://wiki.daviddarts.com/piratebox + + diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index 97d6bf5..9928260 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -3,11 +3,6 @@ ## written by Matthias Strubel (matthias.strubel@aod-rpg.de) 2011-02-22 ## licenced by gpl ; feel free to improve or send me feedback ## -## 2012-04-12 Created -## 2012-06-08 Changed IP Stuff to generating dnsmasq.conf stuff -## ADDed SubConfig for IPV6 config -## Changed Order of config -## ######## ####### @@ -150,5 +145,10 @@ LIGHTTPD_USER=nobody LIGHTTPD_GROUP=nogroup +#------------------------ IRC Configuration + +#Switch to yes if you want to enable the IRC-Server +ENABLE_IRC_SERVER="no" + #------------------------ Hook in user-config . $PIRATEBOX_FOLDER/conf/hook_custom.conf diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index 34b494d..01b3b57 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -8,7 +8,7 @@ # Default-Start: 2 3 4 5 # Default-Stop: 6 1 0 # Short-Description: All services around piratebox -# Description: Based on /opt/piratebox/conf/piratebox.conf starts: * DNSMASQ * HOSTAPD * DROOPY * WLAN-config * CHAT +# Description: Based on /opt/piratebox/conf/piratebox.conf starts several services ### END INIT INFO ### @@ -29,9 +29,11 @@ PIDFILE_HOSTAPN=/var/run/piratebox_hostapn.pid PIDFILE_DNSMASQ=/var/run/piratebox_dnsmasq.pid PIDFILE_LIGHTTPD=/opt/piratebox/tmp/lighttpd.pid PIDFILE_SHOUTBOX=/opt/piratebox/tmp/shoutbox_daemon.pid +PIDFILE_IRC=/opt/piratebox/tmp/irc.pid PIRATEBOX=/opt/piratebox CONF=$PIRATEBOX/conf/piratebox.conf +CONF_IRC=$PIRATEBOX/conf/irc.conf #CONF_DROOPY=/opt/piratebox/conf/droopy.conf #not used CONF_APN=$PIRATEBOX/conf/hostapd.conf @@ -148,6 +150,22 @@ case "$1" in start-stop-daemon -m --start --background --pidfile $PIDFILE_SHOUTBOX --startas $PIRATEBOX/bin/shoutbox_daemon.sh -- $CONF log_end_msg $? fi + + #Start IRC Server + if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then + + . $CONF_IRC + + IRC_PARMS="--daemon --motd $IRC_MOTD " + + if [ ! -z $STATEDIR ] ; then + IRC_PARMS=" $IRCPARMS --statedir $STATEDIR " + fi + + log_daemon_msg "Starting Miniircd..." + start-stop-daemon -m --start --pidfile $PIDFILE_IRC --exec python $PIRATEBOX/bin/miniircd.py -- $IRC_PARMS + log_end_msg $? + fi fi $PIRATEBOX/bin/hooks/hook_piratebox_start_done.sh "$CONF" @@ -159,6 +177,12 @@ case "$1" in $PIRATEBOX/bin/hooks/hook_piratebox_stop.sh "$CONF" + if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then + log_daemon_msg "Stopping IRC..." + start-stop-daemon --stop --quiet --pidfile $PIDFILE_IRC + log_end_msg $? + fi + if [ "$USE_APN" = "yes" ] ; then log_daemon_msg "Stopping hostap... " start-stop-daemon --stop --quiet --pidfile $PIDFILE_HOSTAPN --oknodo --startas "hostapd" diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index 427a969..7e7930d 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -27,11 +27,11 @@ PIDFILE_HOSTAPN=/var/run/piratebox_hostapn.pid PIDFILE_DNSMASQ=/var/run/piratebox_dnsmasq.pid PIDFILE_LIGHTTPD=/opt/piratebox/tmp/lighttpd.pid PIDFILE_SHOUTBOX=/opt/piratebox/tmp/shoutbox_daemon.pid - +PIDFILE_IRC=/opt/piratebox/tmp/irc.pid PIRATEBOX=/opt/piratebox CONF=$PIRATEBOX/conf/piratebox.conf -#CONF_DROOPY=/opt/piratebox/conf/droopy.conf #not used +CONF_IRC=$PIRATEBOX/conf/irc.conf CONF_APN=$PIRATEBOX/conf/hostapd.conf #Some extra config files for dnsmasq @@ -154,6 +154,20 @@ case "$1" in start-stop-daemon -S -m -b -p $PIDFILE_SHOUTBOX -x $PIRATEBOX/bin/shoutbox_daemon.sh -- $CONF echo $? fi + + + #Start IRC Server + if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then + . $CONF_IRC + IRC_PARMS="--daemon --motd $IRC_MOTD " + + if [ ! -z $STATEDIR ] ; then + IRC_PARMS=" $IRCPARMS --statedir $STATEDIR " + fi + echo "Starting Miniircd..." + start-stop-daemon -m -S -p $PIDFILE_IRC --exec python $PIRATEBOX/bin/miniircd.py -- $IRC_PARMS + echo $? + fi fi $PIRATEBOX/bin/hooks/hook_piratebox_start_done.sh "$CONF" @@ -189,6 +203,12 @@ case "$1" in echo $? fi + if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then + echo "Stopping IRC..." + start-stop-daemon --stop --quiet --pidfile $PIDFILE_IRC + echo $? + fi + echo "Stopping lighttpd..." From 1582c0424fd5c1bdf262f76b4d34ca8da8bf940b Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 29 Mar 2013 09:28:19 +0100 Subject: [PATCH 003/183] added IRC Server to Feature list --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 3ee04a7..d435794 100644 --- a/README +++ b/README @@ -35,7 +35,7 @@ PirateBox scripts can: * Optional Inihibit starting upload-script * Optional Timesave script (for devices without RTC) - can be found in piratebox/bin/timesave.sh * Optional Poll for WLAN device until it available (for USB wifi cards) - + * Optional IRC-Server Is supported by mkPirateBox > v0.5 for OpenWRT Systems https://github.com/MaStr/mkPirateBox From e8ccc271696e3fd2e2a45dfe722c1eb763262dd9 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 10 Jul 2013 15:47:42 +0200 Subject: [PATCH 004/183] first changes for PHP enabling --- CHANGELOG | 2 ++ piratebox/piratebox/conf/lighttpd/lighttpd.conf | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 090a995..c46f1cc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,6 @@ CHANGELOG +* Enables PHP Support per default + === v0.6G === * Hide dot files in directory-listing which are usually hidden files diff --git a/piratebox/piratebox/conf/lighttpd/lighttpd.conf b/piratebox/piratebox/conf/lighttpd/lighttpd.conf index 9f828de..2695231 100644 --- a/piratebox/piratebox/conf/lighttpd/lighttpd.conf +++ b/piratebox/piratebox/conf/lighttpd/lighttpd.conf @@ -27,7 +27,7 @@ index-file.names = ( "index.php", "index.html", url.access-deny = ( "~", ".inc" ) # added .cgi .py -static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" , ".cgi" , ".py" ) +static-file.exclude-extensions = ( ".pl", ".fcgi" , ".cgi" , ".py" ) #include_shell "/usr/share/lighttpd/use-ipv6.pl" @@ -53,6 +53,11 @@ $HTTP["url"] =~ "^/cgi-bin/" { cgi.assign = ( ".py" => "/usr/bin/python" ) } +#Only allow PHP in foldere which where not related to Shared +$HTTP["url"] !~ "^/Shared/" { + cgi.assign = ( ".php" => "php-cgi" ) # Let's see if it is possible to not use full path +} + ## Warning this represents a security risk, as it allow to execute any file ## with a .pl/.py even outside of /usr/lib/cgi-bin. # From 06071d29a3239ca1991a90b44af1e67e7428d0ec Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 10 Jul 2013 17:19:22 +0200 Subject: [PATCH 005/183] . --- README | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README b/README index 7d6a20f..f719066 100644 --- a/README +++ b/README @@ -11,6 +11,10 @@ # Contains: Shoutbox, Forum # # + +--------------- This release is the dev. base for LibraryBox 2.0 --------------- + + PirateBox is a collection of scripts / programs that allows you to use your wireless card as a local network to share files and chat anonymously. For more information please visit http://daviddarts.com/ From 83e7136dfca841b7005b05f6dd1cf34c4b22d387 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 30 Jul 2013 17:13:09 +0200 Subject: [PATCH 006/183] only save new-date & time if the old one is "behind" the current date&time. That solves issues during bootup, when cron starts to save before the date&time recover is done --- piratebox/piratebox/bin/timesave.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/piratebox/piratebox/bin/timesave.sh b/piratebox/piratebox/bin/timesave.sh index a733247..324c2ca 100755 --- a/piratebox/piratebox/bin/timesave.sh +++ b/piratebox/piratebox/bin/timesave.sh @@ -57,6 +57,13 @@ if [ "$2" = "install" ] ; then fi if [ "$2" = "save" ] ; then + if [ -e $TIMESAVE ] ; then + if [ `date +%C%g%m%d%H%M` -lt `cat $TIMESAVE` ] ; then + logger -s "$0 : sorry, current date-time is lower then saved one, don't save it this time" + exit 1 + fi + fi + #Save Datetime in a recoverable format... date +%C%g%m%d%H%M > $TIMESAVE exit 0 From 010bcc93f0c292b7f5b91bb6955140d170077686 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 30 Jul 2013 17:17:57 +0200 Subject: [PATCH 007/183] Added fix to changelog --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 2d7d6f6..fa9486d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,7 +10,7 @@ NOTE: This may only be a partial changelog, check github / your package manager * [New] can now use restart in init * [Fixed] General cleaning * [Removed] [Testing] Executable, we will stick to service based - +* [Fixed] Overwritten saved timestamp with 1970 one === v0.6G === * [Fixed] Hide dot files in directory-listing which are usually hidden files From cafbbb8cea0b9b7ab7cab910cd5aa37e030b7bb4 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 14 Aug 2013 16:56:04 +0200 Subject: [PATCH 008/183] moved Config entry from timesave to piratebox.conf emptied out the openwrt section in timesave script, which wasn't called anymore --- piratebox/piratebox/bin/timesave.sh | 31 +++++++++++-------------- piratebox/piratebox/conf/piratebox.conf | 3 +++ 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/piratebox/piratebox/bin/timesave.sh b/piratebox/piratebox/bin/timesave.sh index 324c2ca..3d69d0b 100755 --- a/piratebox/piratebox/bin/timesave.sh +++ b/piratebox/piratebox/bin/timesave.sh @@ -27,7 +27,6 @@ fi . $1 -TIMESAVE="$PIRATEBOX_FOLDER/timesave_file" if [ "$2" = "install" ] ; then crontab -l > $PIRATEBOX_FOLDER/tmp/crontab 2> /dev/null @@ -38,19 +37,10 @@ if [ "$2" = "install" ] ; then touch $TIMESAVE chmod a+rw $TIMESAVE - if [ "$OPENWRT" = "yes" ] ; then - echo "Placing Timerecover on Startup" - echo " $0 $1 recover " >> /etc/rc.local - sed 's:exit:#exit:g' -i /etc/rc.local - echo "Activating cron-service.." - /etc/init.d/cron enable - /etc/init.d/cron start - echo "done" - else - echo "Remember to have cron active..." - echo " on OpenWrt run: /etc/init.d/cron enable" - echo " /etc/init.d/cron start" - fi + echo "Remember to have cron active..." + echo " on OpenWrt run: /etc/init.d/cron enable" + echo " /etc/init.d/cron start" + #Save the current time $0 $1 "save" exit 0 @@ -70,9 +60,14 @@ if [ "$2" = "save" ] ; then fi if [ "$2" = "recover" ] ; then - date `cat $TIMESAVE ` - [ "$?" != "0" ] && echo "error in recovering time" && exit 255 - echo "Time recovered" - exit 0 + if [ `date +%C%g%m%d%H%M` -lt `cat $TIMESAVE` ] ; + date `cat $TIMESAVE ` + [ "$?" != "0" ] && echo "error in recovering time" && exit 255 + echo "Time recovered" + exit 0 + else + echo "Sorry, changing timebackward via timesave is not possible" + exit 1 + fi fi diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index 97d6bf5..ea9b2df 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -7,6 +7,7 @@ ## 2012-06-08 Changed IP Stuff to generating dnsmasq.conf stuff ## ADDed SubConfig for IPV6 config ## Changed Order of config +## 2013-08-14 Added timesave url ## ######## @@ -110,6 +111,8 @@ IP=$NET.$IP_SHORT #----------------- Configuration for the pure piratebox -------------------# ## droopy, webserver, shoutbox- and forum-server +## Timesave file for non RTC devices +TIMESAVE="$PIRATEBOX_FOLDER/share/timesave_file" #Start droopy? - Enable upload? DROOPY_ENABLED="yes" From f51be25000a2bc2edbde374de2469ca1014085f6 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 15 Aug 2013 12:50:46 +0200 Subject: [PATCH 009/183] install_piratebox.sh now uses schema based generation for redirect.html --- piratebox/piratebox/bin/install_piratebox.sh | 13 ++----------- piratebox/piratebox/src/redirect.html.schema | 11 +++++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 piratebox/piratebox/src/redirect.html.schema diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh index e0bcad7..5ecbe08 100755 --- a/piratebox/piratebox/bin/install_piratebox.sh +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -153,17 +153,8 @@ fi set_Hostname() { local name=$1 ; shift; - echo " - - Redirect... - - - - - Redirect - - " > $WWW_FOLDER/redirect.html + sed "s|#####HOST#####|$name|g" $PIRATEBOX_FOLDER/src/redirect.html.schema > $WWW_FOLDER/redirect.html sed "s|HOST=\"$HOST\"|HOST=\"$name\"|" -i $PIRATEBOX_CONFIG } @@ -171,5 +162,5 @@ if [ $2 = "hostname" ] ; then echo "Switching hostname to $3" set_hostname "$3" echo "..done" -fi +fi diff --git a/piratebox/piratebox/src/redirect.html.schema b/piratebox/piratebox/src/redirect.html.schema new file mode 100644 index 0000000..2ce7385 --- /dev/null +++ b/piratebox/piratebox/src/redirect.html.schema @@ -0,0 +1,11 @@ + + Redirect... + + + + + Redirect + + + + From 8e60dd53c24f56a372d4be1968b1743654efa765 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 19 Aug 2013 11:17:17 +0200 Subject: [PATCH 010/183] added mimetype for json files --- piratebox/piratebox/conf/lighttpd/mime.types | 1 + 1 file changed, 1 insertion(+) diff --git a/piratebox/piratebox/conf/lighttpd/mime.types b/piratebox/piratebox/conf/lighttpd/mime.types index aeda915..ea8b09a 100644 --- a/piratebox/piratebox/conf/lighttpd/mime.types +++ b/piratebox/piratebox/conf/lighttpd/mime.types @@ -80,6 +80,7 @@ mimetype.assign = ( ".oti" => "application/vnd.oasis.opendocument.image-template", ".oth" => "application/vnd.oasis.opendocument.text-web", + ".json" => "application/json", ".epub" => "application/epub+zip", ".fb2" => "text/xml", From 155829f831ffe00ad56c6cbe99db594725a0e7fa Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 19 Aug 2013 13:26:14 +0200 Subject: [PATCH 011/183] overwork of calls of "date" and better initialize of timesave file (less error messages) --- piratebox/piratebox/bin/timesave.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/piratebox/piratebox/bin/timesave.sh b/piratebox/piratebox/bin/timesave.sh index 3d69d0b..839af38 100755 --- a/piratebox/piratebox/bin/timesave.sh +++ b/piratebox/piratebox/bin/timesave.sh @@ -11,6 +11,11 @@ # Licenced under GPL-2 @ 2012 # Matthias Strubel matthias.strubel@aod-rgp.de +##function for similar saving & getting time +get_datetime() { + date +%C%g%m%d%H%M +} + # Load configfile @@ -34,33 +39,33 @@ if [ "$2" = "install" ] ; then echo " */5 * * * * $PIRATEBOX_FOLDER/bin/timesave.sh $PIRATEBOX_FOLDER/conf/piratebox.conf save " >> $PIRATEBOX_FOLDER/tmp/crontab crontab $PIRATEBOX_FOLDER/tmp/crontab + echo "initialize timesave file" touch $TIMESAVE chmod a+rw $TIMESAVE + get_datetime > $TIMESAVE - echo "Remember to have cron active..." - echo " on OpenWrt run: /etc/init.d/cron enable" - echo " /etc/init.d/cron start" - #Save the current time - $0 $1 "save" + echo "Remember MAY have to cron active..." + echo " on OpenWrt run: /etc/init.d/piratebox enable" + exit 0 fi if [ "$2" = "save" ] ; then if [ -e $TIMESAVE ] ; then - if [ `date +%C%g%m%d%H%M` -lt `cat $TIMESAVE` ] ; then + if [ `get_datetime` -lt `cat $TIMESAVE` ] ; then logger -s "$0 : sorry, current date-time is lower then saved one, don't save it this time" exit 1 fi fi #Save Datetime in a recoverable format... - date +%C%g%m%d%H%M > $TIMESAVE + get_datetime > $TIMESAVE exit 0 fi if [ "$2" = "recover" ] ; then - if [ `date +%C%g%m%d%H%M` -lt `cat $TIMESAVE` ] ; + if [ `get_datetime` -lt `cat $TIMESAVE` ] ; date `cat $TIMESAVE ` [ "$?" != "0" ] && echo "error in recovering time" && exit 255 echo "Time recovered" From b6d38cac24f437ff1ea89f830e8eb1be39197fac Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 19 Aug 2013 17:13:37 +0200 Subject: [PATCH 012/183] fix for calling change hostname service --- piratebox/piratebox/bin/install_piratebox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh index 5ecbe08..99cd59b 100755 --- a/piratebox/piratebox/bin/install_piratebox.sh +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -151,7 +151,7 @@ if [ $2 = "flush_dns_reg" ] ; then echo "Installed crontab for flushing dnsmasq requlary" fi -set_Hostname() { +set_hostname() { local name=$1 ; shift; sed "s|#####HOST#####|$name|g" $PIRATEBOX_FOLDER/src/redirect.html.schema > $WWW_FOLDER/redirect.html From 0d0c37f3d40f31e7a8fd58b6829b6c239316d961 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 11 Aug 2013 17:09:03 +0200 Subject: [PATCH 013/183] Generating lease-file location based on config file. Place it on OpenWRT into /tmp => memory Conflicts: CHANGELOG --- CHANGELOG | 2 ++ Makefile | 1 + piratebox/piratebox/bin/generate_config_files.sh | 2 +- piratebox/piratebox/conf/piratebox.conf | 4 ++++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index ac5801c..b58de39 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,8 @@ NOTE: This may only be a partial changelog, check github / your package manager * [Removed] [Testing] Executable, we will stick to service based * [Fixed] Overwritten saved timestamp with 1970 one * [New] possibility in install_piratebox.sh to exchange the hostname easily +* [Fixed] Hide dot files in directory-listing which are usually hidden files +* [New] Moved DHCP leasefile into memory on OpenWRT system (/tmp is memory) === v0.6G === * [Fixed] Hide dot files in directory-listing which are usually hidden files diff --git a/Makefile b/Makefile index 09c9628..c2c043b 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ $(OPENWRT_CONFIG_FOLDER): sed 's:DNSMASQ_INTERFACE="wlan0":DNSMASQ_INTERFACE="br-lan":' -i $@/piratebox.conf sed 's:192.168.77:192.168.1:g' -i $@/piratebox.conf sed 's:DROOPY_USE_USER="yes":DROOPY_USE_USER="no":' -i $@/piratebox.conf + sed 's:LEASE_FILE_LOCATION=$PIRATEBOX_FOLDER/tmp/lease.file:LEASE_FILE_LOCATION=/tmp/lease.file:' -i $@/piratebox.conf $(TGZ_IMAGE_FILE): tar czf $(TGZ_IMAGE_FILE) $(SRC_IMAGE_UNPACKED) diff --git a/piratebox/piratebox/bin/generate_config_files.sh b/piratebox/piratebox/bin/generate_config_files.sh index 94ac288..52e4aa9 100755 --- a/piratebox/piratebox/bin/generate_config_files.sh +++ b/piratebox/piratebox/bin/generate_config_files.sh @@ -45,7 +45,7 @@ set_pathnames() { DEFAULT_HOSTS=$CONFIG_PATH/hosts DEFAULT_DNSMASQ=$CONFIG_PATH/dnsmasq_default.conf RADVD_CONFIG=$CONFIG_PATH/radvd_generated.conf - LEASE_FILE=$1/tmp/leases + LEASE_FILE=$LEASE_FILE_LOCATION LIGHTTPD_ENV_CONFIG=$CONFIG_PATH/lighttpd/env } diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index 97d6bf5..9ad9a5d 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -97,6 +97,10 @@ END_LEASE=250 #Leasetime (When should the client renew it's IP) LEASE_DURATION=12h +# Where is the leasefile stored to? +LEASE_FILE_LOCATION=$PIRATEBOX_FOLDER/tmp/lease.file + + # Define the netmask NETMASK=255.255.255.0 From 057aacea2c405b00e4173559b57350792e487fbf Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 11 Aug 2013 16:55:43 +0200 Subject: [PATCH 014/183] Fix for droopy on OpenWRT #49 --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c2c043b..e7804e8 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ SRC_IMAGE_UNPACKED=image_stuff/piratebox_img MOUNT_POINT=image_stuff/image OPENWRT_FOLDER=image_stuff/openwrt OPENWRT_CONFIG_FOLDER=$(OPENWRT_FOLDER)/conf - +OPENWRT_BIN_FOLDER=$(OPENWRT_FOLDER)/bin .DEFAULT_GOAL = package @@ -26,7 +26,7 @@ $(PACKAGE): $(VERSION) tar czf $@ $(PB_FOLDER) -$(IMAGE_FILE): $(VERSION) $(SRC_IMAGE_UNPACKED) $(OPENWRT_CONFIG_FOLDER) +$(IMAGE_FILE): $(VERSION) $(SRC_IMAGE_UNPACKED) $(OPENWRT_CONFIG_FOLDER) $(OPENWRT_BIN_FOLDER) mkdir -p $(MOUNT_POINT) echo "#### Mounting image-file" sudo mount -o loop,rw,sync $(SRC_IMAGE_UNPACKED) $(MOUNT_POINT) @@ -50,6 +50,11 @@ $(OPENWRT_CONFIG_FOLDER): sed 's:DROOPY_USE_USER="yes":DROOPY_USE_USER="no":' -i $@/piratebox.conf sed 's:LEASE_FILE_LOCATION=$PIRATEBOX_FOLDER/tmp/lease.file:LEASE_FILE_LOCATION=/tmp/lease.file:' -i $@/piratebox.conf +$(OPENWRT_BIN_FOLDER): + mkdir -p $@ + cp -v $(PB_SRC_FOLDER)/bin/droopy $@ + sed "s:libc.so.6:libc.so.0:" -i $@/droopy + $(TGZ_IMAGE_FILE): tar czf $(TGZ_IMAGE_FILE) $(SRC_IMAGE_UNPACKED) From c5ae25d7b1d4fa13feba1dc425d0f5dcf26a5090 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 11 Aug 2013 16:22:06 +0200 Subject: [PATCH 015/183] removal of service Conflicts: CHANGELOG --- CHANGELOG | 1 - piratebox/piratebox/bin/piratebox.sh | 406 ------------------- piratebox/piratebox/init.d/piratebox.service | 12 - 3 files changed, 419 deletions(-) delete mode 100755 piratebox/piratebox/bin/piratebox.sh delete mode 100755 piratebox/piratebox/init.d/piratebox.service diff --git a/CHANGELOG b/CHANGELOG index b58de39..9a76b69 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,7 +7,6 @@ NOTE: This may only be a partial changelog, check github / your package manager * [New] push of systemd structure * [New] install method * [New] install dependencies - * [New] can now use restart in init * [Fixed] General cleaning * [Removed] [Testing] Executable, we will stick to service based * [Fixed] Overwritten saved timestamp with 1970 one diff --git a/piratebox/piratebox/bin/piratebox.sh b/piratebox/piratebox/bin/piratebox.sh deleted file mode 100755 index 5cb4caf..0000000 --- a/piratebox/piratebox/bin/piratebox.sh +++ /dev/null @@ -1,406 +0,0 @@ -#!/bin/bash - -#=============================================================================== -# -# FILE: piratebox.sh -# -# USAGE: systemctl piratebox start -# -# DESCRIPTION: systemd file that piratebox.service points to. The systemd -#+ alternative to init.d -# -# OPTIONS: start stop restart -# REQUIREMENTS: --- -# BUGS: --- -# NOTES: --- -# AUTHOR: Cale 'TerrorByte' Black (cablack@rams.colostate.edu) -# ORGANIZATION: -# CREATED: 02/02/2013 07:37:35 PM MST -# REVISION: 0.2.0 -#=============================================================================== - -#TODO Make ExecStop in service file kill dnsmasq, lighttpd, hostapd, droopy -#TODO Fully modular with new systemd standards -#TODO Add lock -set -o nounset # Treat unset variables as an error - -# PATH for /opt piratebox folder -PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin/:/usr/local/sbin:/opt/piratebox/bin - -PIDFILE_DROOPY=/var/run/piratebox_droopy.pid -PIDFILE_HOSTAPN=/var/run/piratebox_hostapn.pid -PIDFILE_DNSMASQ=/var/run/piratebox_dnsmasq.pid -PIDFILE_LIGHTTPD=/opt/piratebox/tmp/lighttpd.pid -PIDFILE_SHOUTBOX=/opt/piratebox/tmp/shoutbox_daemon.pid - -PIRATEBOX=/opt/piratebox -CONF=$PIRATEBOX/conf/piratebox.conf -#CONF_DROOPY=/opt/piratebox/conf/droopy.conf #not used -CONF_APN=$PIRATEBOX/conf/hostapd.conf - -#Some extra config files for dnsmasq -CONF_DNSMASQ=$PIRATEBOX/conf/dnsmasq_generated.conf - -CONF_LIGHTTPD=$PIRATEBOX/conf/lighttpd/lighttpd.conf - -export PYTHONPATH=:$PYTHONPATH:$PIRATEBOX_PYTHONPATH - -#Check for config file -if [ -f $CONF ] ; then - . $CONF -else - log_failure_msg "Configuration file not found" - exit 1 -fi - -# Do basic initialization on non-openWRT Systems, too -if [ -f $PIRATEBOX/conf/init_done ] ; then - INIT=OK -else - $PIRATEBOX/bin/hooks/hook_pre_init.sh "$CONF" - $PIRATEBOX/bin/install_piratebox.sh "$CONF" part2 - $PIRATEBOX/bin/hooks/hook_post_init.sh "$CONF" - touch $PIRATEBOX/conf/init_done -fi - -# Command Line for DNSMASQ, use extra config file generated from command above -CMD_DNSMASQ="-x $PIDFILE_DNSMASQ -C $CONF_DNSMASQ " - -# Carry out specific functions when asked to by the system -case "$1" in - start) - echo "Starting script piratebox " - echo "" - - # Generate hosts & dnsmasq file - $PIRATEBOX/bin/generate_config_files.sh "$CONF" - $PIRATEBOX/bin/hooks/hook_piratebox_start.sh "$CONF" - - echo "Empty tmp folder" - find $PIRATEBOX/tmp/ -exec rm {} \; - - if [ "$DO_IW" = "yes" ] ; then - echo " Setting up Interface (iw) " - iw $PHY_IF interface add $INTERFACE type managed - fi - - if [ "$DO_IFCONFIG" = yes ] ; then - echo "Setting up wlan" - #Setting up WLAN Interface - #TODO Why not place the few lines from piratebox_setup_wlan.sh in here? - piratebox_setup_wlan.sh $CONF start - fi - if [ $? -ne 0 ] ; then - echo "Failed setting up Interface" - else - - # Only activate - if [ "$USE_APN" = "yes" ] ; then - echo "Starting hostap... " - /usr/sbin/hostapd -- $CONF_APN & #TODO Possible to change PIDFILE of hostapd? - if [ $? -ne 0 ]; then - echo $? - fi - fi - - #BRIDGE - if [ "$DO_BRIDGE" = "yes" ] ; then - echo "Adding $INTERFACE to bridge $BRIDGE // brctl addif $BRIDGE $INTERFACE " - sleep 1 - BR_CMD="brctl addif $BRIDGE $INTERFACE" - ( $BR_CMD ; ) - if [ $? -ne 0 ]; then - echo $? - fi - fi - - if [ "$USE_DNSMASQ" = "yes" ] ; then - echo "Starting dnsmasq... " - # pidfile is written by dnsmasq - /usr/sbin/dnsmasq -- $CMD_DNSMASQ - if [ $? -ne 0 ]; then - echo $? - fi - fi - - - if [ "$DROOPY_ENABLED" = "yes" ] ; then - #Start here the PirateBox-Parts droopy i.e. - #TODO More elegant way of doing this with: find -name 'file*' -size 0 -delete - #Delete 0 Byte Files - delete_empty.sh $UPLOADFOLDER - find $UPLOADFOLDER/ -iname tmp\* -exec rm {} \; - - DROOPY_USER="" - if [ "$DROOPY_USE_USER" = "yes" ] ; then - DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP " - fi - echo "Starting droopy..." - $PIRATEBOX/bin/droopy -- -H $HOST -d $UPLOADFOLDER -c "" -m "$DROOPY_TXT" $DROOPY_USERDIR $DROOPY_PORT - echo $? - fi - - #Do shoutbox stuff - $PIRATEBOX/bin/shoutbox_stuff.sh $WWW_FOLDER $CONF - - - #Start here the lighttpd i.e. - echo "Starting lighttpd..." - /usr/sbin/lighttpd -- -f $CONF_LIGHTTPD - if [ $? -ne 0 ]; then - echo $? - fi - - #Start Global Chat daemon if needed. - if [ "$GLOBAL_CHAT" = "yes" ] ; then - echo "Starting global chat service..." - $PIRATEBOX/bin/shoutbox_daemon.sh -- $CONF - if [ $? -ne 0 ]; then - echo $? - fi - fi -fi - -$PIRATEBOX/bin/hooks/hook_piratebox_start_done.sh "$CONF" - -;; - -stop) - echo "Stopping script piratebox" - echo "" - - $PIRATEBOX/bin/hooks/hook_piratebox_stop.sh "$CONF" - - if [ "$USE_APN" = "yes" ] ; then - echo "Stopping hostapd... " - systemctl stop hostapd - if [ $? -ne 0 ]; then - echo $? - fi - fi - - if [ "$USE_DNSMASQ" = "yes" ] ; then - echo "Stopping dnsmasq..." - systemctl stop dnsmasq - if [ $? -ne 0 ]; then - echo $? - fi - fi - - #Stop Global Chat daemon - if [ "$GLOBAL_CHAT" = "yes" ] ; then - echo "Stopping global chat service..." - kill $PIDFILE_SHOUTBOX #TODO better way? - if [ $? -ne 0 ]; then - echo $? - fi - fi - - echo "Stopping lighttpd..." - systemctl stop lighttpd - if [ $? -ne 0 ]; then - echo $? - fi - - if [ "$DROOPY_ENABLED" = "yes" ] ; then - #Kill Droopy - echo "Stopping droopy... " - pkill -9 -f python /opt/piratebox/bin/droopy - if [ $? -ne 0 ]; then - echo $? - fi - fi - - if [ "$DO_IFCONFIG" = yes ] ; then - piratebox_setup_wlan.sh $CONF stop - fi - - if [ "$DO_IW" = "yes" ] ; then - iw dev $INTERFACE del - fi - - # REMOVE BRIDGE - if [ "$DO_BRIDGE" = "yes" ] ; then - echo "Remove Bridge..." - BR_CMD="brctl delif $BRIDGE $INTERFACE" - ( $BR_CMD ; ) - if [ $? -ne 0 ]; then - echo $? - fi - fi - -$PIRATEBOX/bin/hooks/hook_piratebox_stop_done.sh "$CONF" - - -;; - -restart) - echo "Stopping script piratebox" - echo "" - - $PIRATEBOX/bin/hooks/hook_piratebox_stop.sh "$CONF" - - if [ "$USE_APN" = "yes" ] ; then - echo "Stopping hostapd... " - systemctl stop hostapd - if [ $? -ne 0 ]; then - echo $? - fi - fi - - if [ "$USE_DNSMASQ" = "yes" ] ; then - echo "Stopping dnsmasq..." - systemctl stop dnsmasq - if [ $? -ne 0 ]; then - echo $? - fi - fi - - #Stop Global Chat daemon - if [ "$GLOBAL_CHAT" = "yes" ] ; then - echo "Stopping global chat service..." - kill $PIDFILE_SHOUTBOX #TODO better way? - if [ $? -ne 0 ]; then - echo $? - fi - fi - - echo "Stopping lighttpd..." - systemctl stop lighttpd - if [ $? -ne 0 ]; then - echo $? - fi - - if [ "$DROOPY_ENABLED" = "yes" ] ; then - #Kill Droopy - echo "Stopping droopy... " - pkill -9 -f python /opt/piratebox/bin/droopy - if [ $? -ne 0 ]; then - echo $? - fi - fi - - if [ "$DO_IFCONFIG" = yes ] ; then - piratebox_setup_wlan.sh $CONF stop - fi - - if [ "$DO_IW" = "yes" ] ; then - iw dev $INTERFACE del - fi - - # REMOVE BRIDGE - if [ "$DO_BRIDGE" = "yes" ] ; then - echo "Remove Bridge..." - BR_CMD="brctl delif $BRIDGE $INTERFACE" - ( $BR_CMD ; ) - if [ $? -ne 0 ]; then - echo $? - fi - fi - -$PIRATEBOX/bin/hooks/hook_piratebox_stop_done.sh "$CONF" - -### Now start ### - -echo "Starting script piratebox " - echo "" - - # Generate hosts & dnsmasq file - $PIRATEBOX/bin/generate_config_files.sh "$CONF" - $PIRATEBOX/bin/hooks/hook_piratebox_start.sh "$CONF" - - echo "Empty tmp folder" - find $PIRATEBOX/tmp/ -exec rm {} \; - - if [ "$DO_IW" = "yes" ] ; then - echo " Setting up Interface (iw) " - iw $PHY_IF interface add $INTERFACE type managed - fi - - if [ "$DO_IFCONFIG" = yes ] ; then - echo "Setting up wlan" - #Setting up WLAN Interface - #TODO Why not place the few lines from piratebox_setup_wlan.sh in here? - piratebox_setup_wlan.sh $CONF start - fi - if [ $? -ne 0 ] ; then - echo "Failed setting up Interface" - else - - # Only activate - if [ "$USE_APN" = "yes" ] ; then - echo "Starting hostap... " - /usr/sbin/hostapd -- $CONF_APN & #TODO Possible to change PIDFILE of hostapd? - if [ $? -ne 0 ]; then - echo $? - fi - fi - - #BRIDGE - if [ "$DO_BRIDGE" = "yes" ] ; then - echo "Adding $INTERFACE to bridge $BRIDGE // brctl addif $BRIDGE $INTERFACE " - sleep 1 - BR_CMD="brctl addif $BRIDGE $INTERFACE" - ( $BR_CMD ; ) - if [ $? -ne 0 ]; then - echo $? - fi - fi - - if [ "$USE_DNSMASQ" = "yes" ] ; then - echo "Starting dnsmasq... " - # pidfile is written by dnsmasq - /usr/sbin/dnsmasq -- $CMD_DNSMASQ - if [ $? -ne 0 ]; then - echo $? - fi - fi - - - if [ "$DROOPY_ENABLED" = "yes" ] ; then - #Start here the PirateBox-Parts droopy i.e. - #TODO More elegant way of doing this with: find -name 'file*' -size 0 -delete - #Delete 0 Byte Files - delete_empty.sh $UPLOADFOLDER - find $UPLOADFOLDER/ -iname tmp\* -exec rm {} \; - - DROOPY_USER="" - if [ "$DROOPY_USE_USER" = "yes" ] ; then - DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP " - fi - echo "Starting droopy..." - $PIRATEBOX/bin/droopy -- -H $HOST -d $UPLOADFOLDER -c "" -m "$DROOPY_TXT" $DROOPY_USERDIR $DROOPY_PORT - if [ $? -ne 0 ]; then - echo $? - fi - fi - - #Do shoutbox stuff - $PIRATEBOX/bin/shoutbox_stuff.sh $WWW_FOLDER $CONF - - - #Start here the lighttpd i.e. - echo "Starting lighttpd..." - /usr/sbin/lighttpd -- -f $CONF_LIGHTTPD - if [ $? -ne 0 ]; then - echo $? - fi - - #Start Global Chat daemon if needed. - if [ "$GLOBAL_CHAT" = "yes" ] ; then - echo "Starting global chat service..." - $PIRATEBOX/bin/shoutbox_daemon.sh -- $CONF - if [ $? -ne 0 ]; then - echo $? - fi - fi -fi - -$PIRATEBOX/bin/hooks/hook_piratebox_start_done.sh "$CONF" - -;; -*) - echo "Usage: /etc/init.d/piratebox {start|stop|restart}" - exit 1 - ;; -esac -exit 0 diff --git a/piratebox/piratebox/init.d/piratebox.service b/piratebox/piratebox/init.d/piratebox.service deleted file mode 100755 index b3accff..0000000 --- a/piratebox/piratebox/init.d/piratebox.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=PirateBox Service - -[Service] -Type=forking -ExecStart=/opt/piratebox/bin/piratebox.sh start -ExecStop=/opt/piratebox/bin/piratebox.sh stop -Restart=/opt/piratebox/bin/piratebox.sh restart -PIDFile=/var/run/piratebox.pid - -[Install] -WantedBy=multi-user.target From 91c8864b40548f7d34c4ad40eaa75beb2dc207eb Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 26 Aug 2013 08:20:55 +0200 Subject: [PATCH 016/183] Fixes issue in package generation + initialition on Debian --- piratebox/piratebox/init.d/piratebox | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index 6a07c69..2723119 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -53,6 +53,19 @@ else exit 1 fi + +if [[ -f $PIRATEBOX/conf/init_done ]] ; then + INIT=OK +else + $PIRATEBOX/bin/hooks/hook_pre_init.sh "$CONF" + $PIRATEBOX/bin/install_piratebox.sh "$CONF" part2 + $PIRATEBOX/bin/hooks/hook_post_init.sh "$CONF" + touch $PIRATEBOX/conf/init_done +fi + + + + # Command Line for DNSMASQ, use extra config file generated from command above CMD_DNSMASQ="-x $PIDFILE_DNSMASQ -C $CONF_DNSMASQ " From 0073803eac61853cfa21904cb40008a06e96b1ef Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 27 Sep 2013 15:29:56 +0200 Subject: [PATCH 017/183] Fixed captive Portal detection for iOS7 Conflicts: CHANGELOG --- CHANGELOG | 1 + piratebox/piratebox/conf/lighttpd/lighttpd.conf | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 9a76b69..70c3b74 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -16,3 +16,4 @@ NOTE: This may only be a partial changelog, check github / your package manager === v0.6G === * [Fixed] Hide dot files in directory-listing which are usually hidden files +* [Fixed] captive Portal detection for iOS7 diff --git a/piratebox/piratebox/conf/lighttpd/lighttpd.conf b/piratebox/piratebox/conf/lighttpd/lighttpd.conf index 9f828de..06b867a 100644 --- a/piratebox/piratebox/conf/lighttpd/lighttpd.conf +++ b/piratebox/piratebox/conf/lighttpd/lighttpd.conf @@ -77,4 +77,13 @@ server.error-handler-404 = "/redirect.html" #accesslog.filename = "/opt/piratebox/tmp/access.log" +# Fix for iOS7 +# It ask especially different domains without a specific URL. +# It want to get a "success" message, to allow full system/internet access +$HTTP["useragent"] =~ "CaptiveNetworkSupport" { + server.document-root = "/opt/piratebox/www/library/test/" + index-file.names = ( "success.html" ) + dir-listing.activate = "disable" + server.error-handler-404 = "/success.html" +} From c1e5a9c351aaae940863f5bedab26e62b2cdfe23 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 9 Oct 2013 12:17:07 +0200 Subject: [PATCH 018/183] Changes for enabling working IPv6 configuration and Mesh-Node configs --- .../piratebox/bin/generate_config_files.sh | 12 ++++++++-- .../piratebox/bin/piratebox_setup_wlan.sh | 14 ++++++++++- piratebox/piratebox/conf/ipv6.conf | 14 +++++------ .../piratebox/conf/lighttpd/lighttpd.conf | 4 +++- piratebox/piratebox/conf/node.conf | 23 +++++++++++++++++++ piratebox/piratebox/conf/piratebox.conf | 12 ++++++++-- piratebox/piratebox/init.d/piratebox | 15 ++++++++++++ piratebox/piratebox/init.d/piratebox_alt | 22 ++++++++++++++++-- 8 files changed, 101 insertions(+), 15 deletions(-) create mode 100644 piratebox/piratebox/conf/node.conf diff --git a/piratebox/piratebox/bin/generate_config_files.sh b/piratebox/piratebox/bin/generate_config_files.sh index 52e4aa9..d97be94 100755 --- a/piratebox/piratebox/bin/generate_config_files.sh +++ b/piratebox/piratebox/bin/generate_config_files.sh @@ -57,6 +57,7 @@ generate_hosts() { cat $DEFAULT_HOSTS > $HOSTS_CONFIG echo "$set_ipv4 $set_hostname " >> $HOSTS_CONFIG echo "$set_ipv6 $set_hostname " >> $HOSTS_CONFIG + } generate_dnsmasq() { @@ -97,6 +98,7 @@ generate_radvd(){ mask=$2 interface=$3 + echo "Generating config for radvd.." echo "#---- generated file ---" > $RADVD_CONFIG echo " interface $interface { @@ -159,6 +161,9 @@ fi . $1 +. $NODE_CONFIG + + IPV6="#" set_pathnames $PIRATEBOX_FOLDER @@ -166,12 +171,15 @@ set_pathnames $PIRATEBOX_FOLDER ipv6_call='' if [ "$IPV6_ENABLE" = "yes" ] ; then ipv6_call=$IPV6_PREFIX - IPV6=$IPV6_PREFIX:$IPV6_IP + IPV6=$IPV6_IP [[ "$IPV6_ADVERT" = "radvd" ]] && generate_radvd $IPV6_PREFIX $IPV6_MASK $DNSMASQ_INTERFACE fi generate_hosts $HOST $IP $IPV6 generate_dnsmasq $NET $IP_SHORT $START_LEASE $END_LEASE $LEASE_DURATION $DNSMASQ_INTERFACE generate_lighttpd_env $GLOBAL_CHAT "$GLOBAL_DEST" $PIRATEBOX_PYTHONPATH $GEN_CHATFILE $PIRATEBOX_FOLDER $CHATFILE - +if [ "$NODE_CONFIG_ACTIVE" == "yes" ] ; then + echo "Appending local node-name hosts entry" + echo $NODE_NAME"."$HOST $NODE_IPV6_IP" >> "$HOSTS_CONFIG +fi diff --git a/piratebox/piratebox/bin/piratebox_setup_wlan.sh b/piratebox/piratebox/bin/piratebox_setup_wlan.sh index dc89f08..08b1e2e 100755 --- a/piratebox/piratebox/bin/piratebox_setup_wlan.sh +++ b/piratebox/piratebox/bin/piratebox_setup_wlan.sh @@ -68,14 +68,26 @@ if [ $2 = "start" ] ; then if [ $IPV6_ENABLE = "yes" ] ; then echo "Setting up IPv6 stuff" - IPv6="$IPV6_PREFIX:$IPV6_IP"/"$IPV6_MASK" + IPv6="$IPV6_IP"/"$IPV6_MASK" echo " $INTERFACE -->$IPv6<--" ifconfig $INTERFACE add $IPv6 fi + . $NODE_CONFIG + + if [ "$NODE_CONFIG_ACTIVE" == "yes" ] && [ "$NODE_IPV6_SET_IP" == "yes" ]; then + echo "Setting up IPv6 Mesh-Node IP on interface $NODE_INTERFACE" + ifconfig $NODE_INTERFACE add $NODE_IPV6_IP"$NODE_IPV6_MASK" + fi + elif [ $2 = "stop" ] ; then echo "Stopping wifi interface $INTERFACE " ifconfig $INTERFACE down + + if [ "$NODE_CONFIG_ACTIVE" == "yes" ] && [ "$NODE_IPV6_SET_IP" == "yes" ] ; then + echo "Removing the Node-Address again..." + ifconfig $NODE_INTERFACE del $NODE_IPV6_IP"$NODE_IPV6_MASK" + fi elif [ $ = "probe" ] ; then # simply check if the interface is available probe diff --git a/piratebox/piratebox/conf/ipv6.conf b/piratebox/piratebox/conf/ipv6.conf index bb71933..e175ae5 100644 --- a/piratebox/piratebox/conf/ipv6.conf +++ b/piratebox/piratebox/conf/ipv6.conf @@ -2,18 +2,18 @@ # Config file will be filled up partly on init-step ####-------------- -#Enable IPv6 Setup (yes|no) +#Enable IPv6 Setup (yes|no) on you interface IPV6_ENABLE="no" -# Which kind of router-adverticement should be used ( radvd | dnsmasq ) -IPV6_ADVERT="dnsmasq" +# Which kind of router-adverticement should be used ( radvd | dnsmasq | none ) +# +IPV6_ADVERT="radvd" -#Node-Adress - Is stringed together with the IPV6_PREFIX below to -# .. the Prefix is generated on init-setup -IPV6_IP=":1" +#absolute Node-Adress +IPV6_IP="fdc0:ffea::1" #Netmask without / IPV6_MASK="64" # Prefix to piratebox ipv6 adress -IPV6_PREFIX="fd00" +IPV6_PREFIX="fdc0:ffea" diff --git a/piratebox/piratebox/conf/lighttpd/lighttpd.conf b/piratebox/piratebox/conf/lighttpd/lighttpd.conf index 06b867a..d9302a1 100644 --- a/piratebox/piratebox/conf/lighttpd/lighttpd.conf +++ b/piratebox/piratebox/conf/lighttpd/lighttpd.conf @@ -29,7 +29,9 @@ url.access-deny = ( "~", ".inc" ) # added .cgi .py static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" , ".cgi" , ".py" ) -#include_shell "/usr/share/lighttpd/use-ipv6.pl" + +# Enable lighttpd on ipv6 +$SERVER["socket"] == "[::]:80" { } dir-listing.encoding = "utf-8" server.dir-listing = "enable" diff --git a/piratebox/piratebox/conf/node.conf b/piratebox/piratebox/conf/node.conf new file mode 100644 index 0000000..b900e4d --- /dev/null +++ b/piratebox/piratebox/conf/node.conf @@ -0,0 +1,23 @@ +# Mesh-Node configuration +# Contains the configuration which makes this node individual, like +# random hostname & and specific IPv6 IP. +NODE_CONFIG_ACTIVE='no' + +# +NODE_IPV6_IP='' +NODE_IPV6_MASK='/64' +# Node-Name without domain suffix, like +# foobar = Node-name +# piratebox.lan = Host-Name (and base Domain-Name) +# Fully Name will be later +# foobar.piratebox.lan +NODE_NAME='' + +## Node-Interface +# Currently the same interface then the other wlan interface +# But had to be used if mesh node interface is different and +# initialized by PBx scripts. +# If the node_interface is different, it has to be up and running. +NODE_INTERFACE='$INTERFACE' +# Should the Node-Interface setup via the PirateBox-Scripts +NODE_IPV6_SET_IP='no' diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index c1d999d..3582d14 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -8,6 +8,8 @@ ## ADDed SubConfig for IPV6 config ## Changed Order of config ## 2013-08-14 Added timesave url +## 2013-10-07 Added Link to node.conf and comment about hostname +## Cleanup ## ######## @@ -69,8 +71,9 @@ USE_APN="yes" USE_DNSMASQ="yes" #HOSTNAME ... if you really want to change it, plz change: -# bin/droopy -# conf/hosts +# www/index.html +# +# That is the Domain-Specifi part, where you reach always the local box HOST="piratebox.lan" #----------------- Configuration for DNSMASQ & IF-Setup -------------------# @@ -112,6 +115,11 @@ IP=$NET.$IP_SHORT . $PIRATEBOX_FOLDER/conf/ipv6.conf +#--------------------------------------------------------------------------# +# Node-Config path + +NODE_CONFIG="$PIRATEBOX_FOLDER/conf/node.conf" + #----------------- Configuration for the pure piratebox -------------------# ## droopy, webserver, shoutbox- and forum-server diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index 2723119..7773c6a 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -29,6 +29,7 @@ PIDFILE_HOSTAPN=/var/run/piratebox_hostapn.pid PIDFILE_DNSMASQ=/var/run/piratebox_dnsmasq.pid PIDFILE_LIGHTTPD=/opt/piratebox/tmp/lighttpd.pid PIDFILE_SHOUTBOX=/opt/piratebox/tmp/shoutbox_daemon.pid +PIDFILE_RADVD=/opt/piratebox/tmp/radvd.pid PIRATEBOX=/opt/piratebox CONF=$PIRATEBOX/conf/piratebox.conf @@ -38,6 +39,8 @@ CONF_APN=$PIRATEBOX/conf/hostapd.conf #Some extra config files for dnsmasq CONF_DNSMASQ=$PIRATEBOX/conf/dnsmasq_generated.conf +CONF_RADVD=$PIRATEBOX/conf/radvd_generated.conf + CONF_LIGHTTPD=$PIRATEBOX/conf/lighttpd/lighttpd.conf export PYTHONPATH=:$PYTHONPATH:$PIRATEBOX_PYTHONPATH @@ -130,6 +133,12 @@ case "$1" in log_end_msg $? fi + if [ "$IPV6_ENABLE" == "yes" ] && [ "$IPV6_ADVERT" == "radvd" ] ; then + log_daemon_msg "Starting radvd..." + start-stop-daemon --start --quiet --exec radvd -- -p $PIDFILE_RADVD -C $CONF_RADVD + log_end_msg $? + fi + if [ "$DROOPY_ENABLED" = "yes" ] ; then #Start here the PirateBox-Parts droopy i.e. @@ -183,6 +192,12 @@ case "$1" in log_end_msg $? fi + if [ -e $PIDFILE_RADVD ] ; then + log_daemon_msg "Stopping radvd..." + start-stop-daemon --stop --quite --pidfile $PIDFILE_RADVD + log_end_msg $? + fi + #Stop Global Chat daemon if [ "$GLOBAL_CHAT" = "yes" ] ; then log_daemon_msg "Stopping global chat service..." diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index 0905ad8..083720d 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -27,6 +27,8 @@ PIDFILE_HOSTAPN=/var/run/piratebox_hostapn.pid PIDFILE_DNSMASQ=/var/run/piratebox_dnsmasq.pid PIDFILE_LIGHTTPD=/opt/piratebox/tmp/lighttpd.pid PIDFILE_SHOUTBOX=/opt/piratebox/tmp/shoutbox_daemon.pid +PIDFILE_RADVD=/opt/piratebox/tmp/radvd.pid + PIRATEBOX=/opt/piratebox @@ -37,6 +39,8 @@ CONF_APN=$PIRATEBOX/conf/hostapd.conf #Some extra config files for dnsmasq CONF_DNSMASQ=$PIRATEBOX/conf/dnsmasq_generated.conf +CONF_RADVD=$PIRATEBOX/conf/radvd_generated.conf + CONF_LIGHTTPD=$PIRATEBOX/conf/lighttpd/lighttpd.conf export PYTHONPATH=:$PYTHONPATH:$PIRATEBOX_PYTHONPATH @@ -124,9 +128,16 @@ case "$1" in echo $? fi + if [ "$IPV6_ENABLE" == "yes" ] && [ "$IPV6_ADVERT" == "radvd" ] ; then + echo "Starting radvd..." + start-stop-daemon -S -q -x radvd -- -p $PIDFILE_RADVD -C $CONF_RADVD + echo $? + fi + + + if [ "$DROOPY_ENABLED" = "yes" ] ; then - #Start here the PirateBox-Parts droopy i.e. - echo "Starting droopy..." + #Start here the PirateBox-Parts droopy i.e. echo "Starting droopy..." find $UPLOADFOLDER/ -iname tmp\* -exec rm {} \; #Delete 0 Byte Files delete_empty.sh $UPLOADFOLDER @@ -173,8 +184,15 @@ case "$1" in echo "Stopping dnsmasq..." start-stop-daemon -K -q -p $PIDFILE_DNSMASQ echo $? + fi + + if [ -e $PIDFILE_RADVD ] ; then + echo "Stopping radvd..." + start-stop-daemon -K -q -p $PIDFILE_RADVD + echo $? fi + if [ "$DROOPY_ENABLED" = "yes" ] ; then #Kill Droopy echo "Stopping droopy... " From a764fb7a0c9d409c81c793b741d9d9427b38e043 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 23 Oct 2013 07:31:21 +0200 Subject: [PATCH 019/183] Make the node-name generation into hosts member more flexible. --- piratebox/piratebox/bin/generate_config_files.sh | 15 +++++++++++++-- piratebox/piratebox/conf/node.conf | 4 ++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/piratebox/piratebox/bin/generate_config_files.sh b/piratebox/piratebox/bin/generate_config_files.sh index d97be94..a5ab755 100755 --- a/piratebox/piratebox/bin/generate_config_files.sh +++ b/piratebox/piratebox/bin/generate_config_files.sh @@ -178,8 +178,19 @@ generate_hosts $HOST $IP $IPV6 generate_dnsmasq $NET $IP_SHORT $START_LEASE $END_LEASE $LEASE_DURATION $DNSMASQ_INTERFACE generate_lighttpd_env $GLOBAL_CHAT "$GLOBAL_DEST" $PIRATEBOX_PYTHONPATH $GEN_CHATFILE $PIRATEBOX_FOLDER $CHATFILE -if [ "$NODE_CONFIG_ACTIVE" == "yes" ] ; then +if [ "$NODE_CONFIG_ACTIVE" = "yes" ] ; then echo "Appending local node-name hosts entry" - echo $NODE_NAME"."$HOST $NODE_IPV6_IP" >> "$HOSTS_CONFIG + local complete_node_name=$NODE_NAME"."$HOST + if [ "$NODE_GEN" = "no" ] : then + complete_node_name=$NODE_NAME + fi + if [ "$NODE_NAME" = "" ] ; then + complete_node_name=$HOST + fi + if [ "$complete_node_name" != "" ] ; then + echo $complete_node_name $NODE_IPV6_IP" >> "$HOSTS_CONFIG + else + echo "Error: No valid node-config found, skipping" + fi fi diff --git a/piratebox/piratebox/conf/node.conf b/piratebox/piratebox/conf/node.conf index b900e4d..5971d0a 100644 --- a/piratebox/piratebox/conf/node.conf +++ b/piratebox/piratebox/conf/node.conf @@ -11,7 +11,11 @@ NODE_IPV6_MASK='/64' # piratebox.lan = Host-Name (and base Domain-Name) # Fully Name will be later # foobar.piratebox.lan +# If your leave the nodename empty, that will result in publishing hostname only. +# Setting NODE_GEN to "no" it will take the NODE_NAME 1:1 for anouncements etc. without +# adding the hostname as a suffix NODE_NAME='' +NODE_GEN="yes" ## Node-Interface # Currently the same interface then the other wlan interface From 24fdcc6805b4af15c427cdb3cd4c466153478225 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 23 Oct 2013 07:55:25 +0200 Subject: [PATCH 020/183] moved node-name rules to a lib for later reuse --- .../piratebox/bin/generate_config_files.sh | 30 +++++++++-------- .../piratebox/lib/node_name_generation.sh | 32 +++++++++++++++++++ 2 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 piratebox/piratebox/lib/node_name_generation.sh diff --git a/piratebox/piratebox/bin/generate_config_files.sh b/piratebox/piratebox/bin/generate_config_files.sh index a5ab755..64dc67a 100755 --- a/piratebox/piratebox/bin/generate_config_files.sh +++ b/piratebox/piratebox/bin/generate_config_files.sh @@ -24,7 +24,18 @@ # GEN_CHATFILE = generated html chatfile # PIRATEBOX = PirateBox Folder # CHATFILE = data store for Shoutbox-content -# +# NODE_CONFIG = Config file for Mesh-Node parameters +# - +# ipv6.conf (loaded within piratebox.conf) +# IPV6_ENABLE = enables IPv6 config +# IPV6_ADVERT = which service for advertising IPv6 Prefix +# IPV6_MASK = Netmask +# IPV6_PREFIX = Which prefix should be announced. +# - +# node.conf +# NODE_CONFIG_ACTIVE = if yes, configure special ipv6-node-hostname +# NODE_IPV6_IP = Device specific IP +# NODE_NAME & NODE_GEN = Settings for setting up Hostname # # Matthias Strubel -- 08.06.2012 # licenced with GPL-3 @@ -162,7 +173,7 @@ fi . $1 . $NODE_CONFIG - +. $PIRATEBOX_FOLDER/lib/node_name_generation.sh IPV6="#" @@ -180,17 +191,10 @@ generate_lighttpd_env $GLOBAL_CHAT "$GLOBAL_DEST" $PIRATEBOX_PYTHONPATH $GEN_CHA if [ "$NODE_CONFIG_ACTIVE" = "yes" ] ; then echo "Appending local node-name hosts entry" - local complete_node_name=$NODE_NAME"."$HOST - if [ "$NODE_GEN" = "no" ] : then - complete_node_name=$NODE_NAME - fi - if [ "$NODE_NAME" = "" ] ; then - complete_node_name=$HOST - fi - if [ "$complete_node_name" != "" ] ; then - echo $complete_node_name $NODE_IPV6_IP" >> "$HOSTS_CONFIG - else - echo "Error: No valid node-config found, skipping" + if generate_node_name "$HOST" "$NODE_NAME" "$NODE_GEN" ; then + echo $NODE_GEN_OUTPUT $NODE_IPV6_IP" >> "$HOSTS_CONFIG + else + echo "Error: No valid node-name-config found, skipping" fi fi diff --git a/piratebox/piratebox/lib/node_name_generation.sh b/piratebox/piratebox/lib/node_name_generation.sh new file mode 100644 index 0000000..95b9c09 --- /dev/null +++ b/piratebox/piratebox/lib/node_name_generation.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# Script for node name generation. +# Requires: +# argument 1: HOST (hostname) +# argument 2: NODE_NAME +# argument 3: NODE_GEN +#- +# Output in var NODE_GEN_OUTPUT +# + +generate_node_name() { + local in_host=$1 + local in_node_name=$2 + local in_node_gen=$3 + + local complete_node_name=$in_node_name"."$in_host + + if [ "$in_node_gen" = "no" ] : then + complete_node_name=$in_node_name + fi + if [ "$in_node_name" = "" ] ; then + complete_node_name=$in_host + fi + if [ "$complete_node_name" != "" ] ; then + export NODE_GEN_OUTPUT=$output_name + return 0 + else + echo "Error: No valid node-name found" + return 1 + fi +} From 8fe10fe646f3eb8019dce132b6f08c5e5120deac Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 23 Oct 2013 21:11:12 +0200 Subject: [PATCH 021/183] fixed typo and issue with var-name --- piratebox/piratebox/bin/generate_config_files.sh | 5 +++-- piratebox/piratebox/lib/node_name_generation.sh | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/piratebox/piratebox/bin/generate_config_files.sh b/piratebox/piratebox/bin/generate_config_files.sh index 64dc67a..e87486a 100755 --- a/piratebox/piratebox/bin/generate_config_files.sh +++ b/piratebox/piratebox/bin/generate_config_files.sh @@ -190,9 +190,10 @@ generate_dnsmasq $NET $IP_SHORT $START_LEASE $END_LEASE $LEASE_DURATION $DNSM generate_lighttpd_env $GLOBAL_CHAT "$GLOBAL_DEST" $PIRATEBOX_PYTHONPATH $GEN_CHATFILE $PIRATEBOX_FOLDER $CHATFILE if [ "$NODE_CONFIG_ACTIVE" = "yes" ] ; then - echo "Appending local node-name hosts entry" + echo -n "Appending local node-name hosts entry" if generate_node_name "$HOST" "$NODE_NAME" "$NODE_GEN" ; then - echo $NODE_GEN_OUTPUT $NODE_IPV6_IP" >> "$HOSTS_CONFIG + echo $NODE_GEN_OUTPUT + echo "$NODE_IPV6_IP $NODE_GEN_OUTPUT " >> $HOSTS_CONFIG else echo "Error: No valid node-name-config found, skipping" fi diff --git a/piratebox/piratebox/lib/node_name_generation.sh b/piratebox/piratebox/lib/node_name_generation.sh index 95b9c09..a8050f3 100644 --- a/piratebox/piratebox/lib/node_name_generation.sh +++ b/piratebox/piratebox/lib/node_name_generation.sh @@ -16,14 +16,14 @@ generate_node_name() { local complete_node_name=$in_node_name"."$in_host - if [ "$in_node_gen" = "no" ] : then + if [ "$in_node_gen" = "no" ] ; then complete_node_name=$in_node_name fi if [ "$in_node_name" = "" ] ; then complete_node_name=$in_host fi if [ "$complete_node_name" != "" ] ; then - export NODE_GEN_OUTPUT=$output_name + export NODE_GEN_OUTPUT=$complete_node_name return 0 else echo "Error: No valid node-name found" From a08a14487b76b9f8f438f5478ad97426d6ea3120 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 7 Nov 2013 19:55:31 +0100 Subject: [PATCH 022/183] Deliver and generate avahi configuration files --- .../piratebox/bin/generate_config_files.sh | 16 +++++++++ .../conf/avahi/avahi-daemon.conf.schema | 30 ++++++++++++++++ .../conf/avahi/services/http.service | 10 ++++++ .../piratebox/conf/avahi/services/ssh.service | 34 +++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 piratebox/piratebox/conf/avahi/avahi-daemon.conf.schema create mode 100644 piratebox/piratebox/conf/avahi/services/http.service create mode 100644 piratebox/piratebox/conf/avahi/services/ssh.service diff --git a/piratebox/piratebox/bin/generate_config_files.sh b/piratebox/piratebox/bin/generate_config_files.sh index e87486a..04b10d6 100755 --- a/piratebox/piratebox/bin/generate_config_files.sh +++ b/piratebox/piratebox/bin/generate_config_files.sh @@ -47,6 +47,8 @@ DEFAULT_HOSTS="" LEASE_FILE="" RADVD_CONFIG="" LIGHTTPD_ENV_CONFIG="" +AVAHI_SRC="" +AVAHI_CONFIG="" set_pathnames() { CONFIG_PATH=$1/conf @@ -58,6 +60,9 @@ set_pathnames() { RADVD_CONFIG=$CONFIG_PATH/radvd_generated.conf LEASE_FILE=$LEASE_FILE_LOCATION LIGHTTPD_ENV_CONFIG=$CONFIG_PATH/lighttpd/env + AVAHI_CONFIG=$CONFIG_PATH/avahi/avahi-daemon.conf + AVAHI_SRC=$CONFIG_PATH/avahi/avahi-daemon.conf.schema + } generate_hosts() { @@ -189,13 +194,24 @@ generate_hosts $HOST $IP $IPV6 generate_dnsmasq $NET $IP_SHORT $START_LEASE $END_LEASE $LEASE_DURATION $DNSMASQ_INTERFACE generate_lighttpd_env $GLOBAL_CHAT "$GLOBAL_DEST" $PIRATEBOX_PYTHONPATH $GEN_CHATFILE $PIRATEBOX_FOLDER $CHATFILE +COMPLETE_HOST=$HOST + if [ "$NODE_CONFIG_ACTIVE" = "yes" ] ; then echo -n "Appending local node-name hosts entry" if generate_node_name "$HOST" "$NODE_NAME" "$NODE_GEN" ; then echo $NODE_GEN_OUTPUT echo "$NODE_IPV6_IP $NODE_GEN_OUTPUT " >> $HOSTS_CONFIG + COMPLETE_HOST=$NODE_GEN_OUTPUT else echo "Error: No valid node-name-config found, skipping" fi fi +#We want a long hostname and not only the hostname itself... +### PirateBox Scripts generates its own config in /opt/piratebox/conf/avahi +### but, the daemon works per default only on /etc/avahi +### If you want to enable avahi, then you have to link /etc/avahi to /opt/piratebox/conf/avahi +### On OpenWRT this should happen, if avahi is available before installing the piratebox +### automtically. +AVAHI_HOST=$( echo $COMPLETE_HOST | sed 's|\.|_|g' ) +sed "s|#####MASKED_HOSTNAME#####|$AVAHI_HOST|" $AVAHI_SRC > $AVAHI_CONFIG diff --git a/piratebox/piratebox/conf/avahi/avahi-daemon.conf.schema b/piratebox/piratebox/conf/avahi/avahi-daemon.conf.schema new file mode 100644 index 0000000..0b7c1e2 --- /dev/null +++ b/piratebox/piratebox/conf/avahi/avahi-daemon.conf.schema @@ -0,0 +1,30 @@ +[server] +host-name=#####MASKED_HOSTNAME##### +use-ipv4=yes +use-ipv6=yes +check-response-ttl=no +use-iff-running=no + + +[publish] +publish-addresses=yes +publish-hinfo=yes +publish-workstation=no +publish-domain=yes + + +[reflector] +enable-reflector=no +reflect-ipv=no + +[rlimits] +#rlimit-as= +rlimit-core=0 +rlimit-data=4194304 +rlimit-fsize=0 +rlimit-nofile=30 +rlimit-stack=4194304 +rlimit-nproc=3 + + + diff --git a/piratebox/piratebox/conf/avahi/services/http.service b/piratebox/piratebox/conf/avahi/services/http.service new file mode 100644 index 0000000..7e9be2d --- /dev/null +++ b/piratebox/piratebox/conf/avahi/services/http.service @@ -0,0 +1,10 @@ + + + + Web Server on %h + + _http._tcp + 80 + path=/ + + diff --git a/piratebox/piratebox/conf/avahi/services/ssh.service b/piratebox/piratebox/conf/avahi/services/ssh.service new file mode 100644 index 0000000..c66e0c1 --- /dev/null +++ b/piratebox/piratebox/conf/avahi/services/ssh.service @@ -0,0 +1,34 @@ + + + + + + + + + + %h + + + _ssh._tcp + 22 + + + From b05c4e2c641a119d59fcc9f556fde7f8c33c6569 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 18 Nov 2013 21:32:06 +0100 Subject: [PATCH 023/183] more details about a better and seamless synchro --- .../piratebox/lib/node_name_resolution.sh | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 piratebox/piratebox/lib/node_name_resolution.sh diff --git a/piratebox/piratebox/lib/node_name_resolution.sh b/piratebox/piratebox/lib/node_name_resolution.sh new file mode 100644 index 0000000..8984067 --- /dev/null +++ b/piratebox/piratebox/lib/node_name_resolution.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +## Library for some kind of avahi-node name resolution +## over piratebox mesh network +NODE_IP="" + +## This function takes the normal +# gjgtjtjt.piratebox.lan +# hostname converts it to: +# gjgtjtjt_piratebox_lan.local +# makes an avahi resolution and gives back the IP in NODE_IP +# uf it was found +resolve_node_hostname() { + local in_nodename=$1 + + local AVAHI_HOST=$( echo $in_nodename | sed 's|\.|_|g' ) + local bonjour_hostname="$AVAHI_HOST"".local" + local output=$( avahi-resolve-host-name $bonjour_hostname ) + + if [ ! -z "$output" ] ; then + echo "Found host: $output" + #Sorry for that worse splitup of name and IP + NODE_IP=$( echo $output | sed "s|$bonjour_hostname||" ) + return 0 + else + return 1 + fi + + +} From 22d4e8010346c444ec24a69c0046f892191619fc Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 21 Nov 2013 21:45:41 +0100 Subject: [PATCH 024/183] Fix on scope - link ip for non openwrt --- piratebox/piratebox/bin/piratebox_setup_wlan.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/piratebox/piratebox/bin/piratebox_setup_wlan.sh b/piratebox/piratebox/bin/piratebox_setup_wlan.sh index 08b1e2e..b402d7b 100755 --- a/piratebox/piratebox/bin/piratebox_setup_wlan.sh +++ b/piratebox/piratebox/bin/piratebox_setup_wlan.sh @@ -71,6 +71,8 @@ if [ $2 = "start" ] ; then IPv6="$IPV6_IP"/"$IPV6_MASK" echo " $INTERFACE -->$IPv6<--" ifconfig $INTERFACE add $IPv6 + #That ip is a local IP only + ip addr change $IPv6 dev $INTERFACE scope link fi . $NODE_CONFIG From c8684255ffde9f3e35289405918ac1b0b856bec4 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 21 Nov 2013 22:16:29 +0100 Subject: [PATCH 025/183] Resolve IPv6 domain names via CLI for ftp sync client --- piratebox/piratebox/lib/node_name_resolution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piratebox/piratebox/lib/node_name_resolution.sh b/piratebox/piratebox/lib/node_name_resolution.sh index 8984067..25ee43e 100644 --- a/piratebox/piratebox/lib/node_name_resolution.sh +++ b/piratebox/piratebox/lib/node_name_resolution.sh @@ -15,7 +15,7 @@ resolve_node_hostname() { local AVAHI_HOST=$( echo $in_nodename | sed 's|\.|_|g' ) local bonjour_hostname="$AVAHI_HOST"".local" - local output=$( avahi-resolve-host-name $bonjour_hostname ) + local output=$( avahi-resolve-host-name -6 $bonjour_hostname ) if [ ! -z "$output" ] ; then echo "Found host: $output" From b362a60619be48617f6e46619f555862b7c0aade Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 24 Nov 2013 14:02:15 +0100 Subject: [PATCH 026/183] avahi IPv6 only --- piratebox/piratebox/conf/avahi/avahi-daemon.conf.schema | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piratebox/piratebox/conf/avahi/avahi-daemon.conf.schema b/piratebox/piratebox/conf/avahi/avahi-daemon.conf.schema index 0b7c1e2..a8ba2a4 100644 --- a/piratebox/piratebox/conf/avahi/avahi-daemon.conf.schema +++ b/piratebox/piratebox/conf/avahi/avahi-daemon.conf.schema @@ -1,6 +1,6 @@ [server] host-name=#####MASKED_HOSTNAME##### -use-ipv4=yes +use-ipv4=no use-ipv6=yes check-response-ttl=no use-iff-running=no From d27237d691a0c56206d7ce415b5787c68e9d0b31 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 24 Nov 2013 14:06:14 +0100 Subject: [PATCH 027/183] fixed output issue --- piratebox/piratebox/bin/generate_config_files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piratebox/piratebox/bin/generate_config_files.sh b/piratebox/piratebox/bin/generate_config_files.sh index 04b10d6..5cd94b3 100755 --- a/piratebox/piratebox/bin/generate_config_files.sh +++ b/piratebox/piratebox/bin/generate_config_files.sh @@ -197,7 +197,7 @@ generate_lighttpd_env $GLOBAL_CHAT "$GLOBAL_DEST" $PIRATEBOX_PYTHONPATH $GEN_CHA COMPLETE_HOST=$HOST if [ "$NODE_CONFIG_ACTIVE" = "yes" ] ; then - echo -n "Appending local node-name hosts entry" + echo -n "Appending local node-name hosts entry " if generate_node_name "$HOST" "$NODE_NAME" "$NODE_GEN" ; then echo $NODE_GEN_OUTPUT echo "$NODE_IPV6_IP $NODE_GEN_OUTPUT " >> $HOSTS_CONFIG From 51fc672eaf0462e84d1ece43e360dd62a99581a2 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 11 Aug 2013 16:17:13 +0200 Subject: [PATCH 028/183] Version beta1 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 09c9628..941af29 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME = piratebox-ws -VERSION = 1.0.0 +VERSION = 1.0.0_beta1 ARCH = all PB_FOLDER=piratebox PB_SRC_FOLDER=$(PB_FOLDER)/$(PB_FOLDER) From a268c395b5b3b4b34e6a55eca14b9dcd794dba18 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 11 Aug 2013 16:22:06 +0200 Subject: [PATCH 029/183] removal of service Conflicts: CHANGELOG --- CHANGELOG | 1 - piratebox/piratebox/bin/piratebox.sh | 406 ------------------- piratebox/piratebox/init.d/piratebox.service | 12 - 3 files changed, 419 deletions(-) delete mode 100755 piratebox/piratebox/bin/piratebox.sh delete mode 100755 piratebox/piratebox/init.d/piratebox.service diff --git a/CHANGELOG b/CHANGELOG index 798ff1f..f927bcc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,7 +8,6 @@ NOTE: This may only be a partial changelog, check github / your package manager * [New] push of systemd structure * [New] install method * [New] install dependencies - * [New] can now use restart in init * [Fixed] General cleaning * [Removed] [Testing] Executable, we will stick to service based * [New] possibility in install_piratebox.sh to exchange the hostname easily diff --git a/piratebox/piratebox/bin/piratebox.sh b/piratebox/piratebox/bin/piratebox.sh deleted file mode 100755 index 5cb4caf..0000000 --- a/piratebox/piratebox/bin/piratebox.sh +++ /dev/null @@ -1,406 +0,0 @@ -#!/bin/bash - -#=============================================================================== -# -# FILE: piratebox.sh -# -# USAGE: systemctl piratebox start -# -# DESCRIPTION: systemd file that piratebox.service points to. The systemd -#+ alternative to init.d -# -# OPTIONS: start stop restart -# REQUIREMENTS: --- -# BUGS: --- -# NOTES: --- -# AUTHOR: Cale 'TerrorByte' Black (cablack@rams.colostate.edu) -# ORGANIZATION: -# CREATED: 02/02/2013 07:37:35 PM MST -# REVISION: 0.2.0 -#=============================================================================== - -#TODO Make ExecStop in service file kill dnsmasq, lighttpd, hostapd, droopy -#TODO Fully modular with new systemd standards -#TODO Add lock -set -o nounset # Treat unset variables as an error - -# PATH for /opt piratebox folder -PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin/:/usr/local/sbin:/opt/piratebox/bin - -PIDFILE_DROOPY=/var/run/piratebox_droopy.pid -PIDFILE_HOSTAPN=/var/run/piratebox_hostapn.pid -PIDFILE_DNSMASQ=/var/run/piratebox_dnsmasq.pid -PIDFILE_LIGHTTPD=/opt/piratebox/tmp/lighttpd.pid -PIDFILE_SHOUTBOX=/opt/piratebox/tmp/shoutbox_daemon.pid - -PIRATEBOX=/opt/piratebox -CONF=$PIRATEBOX/conf/piratebox.conf -#CONF_DROOPY=/opt/piratebox/conf/droopy.conf #not used -CONF_APN=$PIRATEBOX/conf/hostapd.conf - -#Some extra config files for dnsmasq -CONF_DNSMASQ=$PIRATEBOX/conf/dnsmasq_generated.conf - -CONF_LIGHTTPD=$PIRATEBOX/conf/lighttpd/lighttpd.conf - -export PYTHONPATH=:$PYTHONPATH:$PIRATEBOX_PYTHONPATH - -#Check for config file -if [ -f $CONF ] ; then - . $CONF -else - log_failure_msg "Configuration file not found" - exit 1 -fi - -# Do basic initialization on non-openWRT Systems, too -if [ -f $PIRATEBOX/conf/init_done ] ; then - INIT=OK -else - $PIRATEBOX/bin/hooks/hook_pre_init.sh "$CONF" - $PIRATEBOX/bin/install_piratebox.sh "$CONF" part2 - $PIRATEBOX/bin/hooks/hook_post_init.sh "$CONF" - touch $PIRATEBOX/conf/init_done -fi - -# Command Line for DNSMASQ, use extra config file generated from command above -CMD_DNSMASQ="-x $PIDFILE_DNSMASQ -C $CONF_DNSMASQ " - -# Carry out specific functions when asked to by the system -case "$1" in - start) - echo "Starting script piratebox " - echo "" - - # Generate hosts & dnsmasq file - $PIRATEBOX/bin/generate_config_files.sh "$CONF" - $PIRATEBOX/bin/hooks/hook_piratebox_start.sh "$CONF" - - echo "Empty tmp folder" - find $PIRATEBOX/tmp/ -exec rm {} \; - - if [ "$DO_IW" = "yes" ] ; then - echo " Setting up Interface (iw) " - iw $PHY_IF interface add $INTERFACE type managed - fi - - if [ "$DO_IFCONFIG" = yes ] ; then - echo "Setting up wlan" - #Setting up WLAN Interface - #TODO Why not place the few lines from piratebox_setup_wlan.sh in here? - piratebox_setup_wlan.sh $CONF start - fi - if [ $? -ne 0 ] ; then - echo "Failed setting up Interface" - else - - # Only activate - if [ "$USE_APN" = "yes" ] ; then - echo "Starting hostap... " - /usr/sbin/hostapd -- $CONF_APN & #TODO Possible to change PIDFILE of hostapd? - if [ $? -ne 0 ]; then - echo $? - fi - fi - - #BRIDGE - if [ "$DO_BRIDGE" = "yes" ] ; then - echo "Adding $INTERFACE to bridge $BRIDGE // brctl addif $BRIDGE $INTERFACE " - sleep 1 - BR_CMD="brctl addif $BRIDGE $INTERFACE" - ( $BR_CMD ; ) - if [ $? -ne 0 ]; then - echo $? - fi - fi - - if [ "$USE_DNSMASQ" = "yes" ] ; then - echo "Starting dnsmasq... " - # pidfile is written by dnsmasq - /usr/sbin/dnsmasq -- $CMD_DNSMASQ - if [ $? -ne 0 ]; then - echo $? - fi - fi - - - if [ "$DROOPY_ENABLED" = "yes" ] ; then - #Start here the PirateBox-Parts droopy i.e. - #TODO More elegant way of doing this with: find -name 'file*' -size 0 -delete - #Delete 0 Byte Files - delete_empty.sh $UPLOADFOLDER - find $UPLOADFOLDER/ -iname tmp\* -exec rm {} \; - - DROOPY_USER="" - if [ "$DROOPY_USE_USER" = "yes" ] ; then - DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP " - fi - echo "Starting droopy..." - $PIRATEBOX/bin/droopy -- -H $HOST -d $UPLOADFOLDER -c "" -m "$DROOPY_TXT" $DROOPY_USERDIR $DROOPY_PORT - echo $? - fi - - #Do shoutbox stuff - $PIRATEBOX/bin/shoutbox_stuff.sh $WWW_FOLDER $CONF - - - #Start here the lighttpd i.e. - echo "Starting lighttpd..." - /usr/sbin/lighttpd -- -f $CONF_LIGHTTPD - if [ $? -ne 0 ]; then - echo $? - fi - - #Start Global Chat daemon if needed. - if [ "$GLOBAL_CHAT" = "yes" ] ; then - echo "Starting global chat service..." - $PIRATEBOX/bin/shoutbox_daemon.sh -- $CONF - if [ $? -ne 0 ]; then - echo $? - fi - fi -fi - -$PIRATEBOX/bin/hooks/hook_piratebox_start_done.sh "$CONF" - -;; - -stop) - echo "Stopping script piratebox" - echo "" - - $PIRATEBOX/bin/hooks/hook_piratebox_stop.sh "$CONF" - - if [ "$USE_APN" = "yes" ] ; then - echo "Stopping hostapd... " - systemctl stop hostapd - if [ $? -ne 0 ]; then - echo $? - fi - fi - - if [ "$USE_DNSMASQ" = "yes" ] ; then - echo "Stopping dnsmasq..." - systemctl stop dnsmasq - if [ $? -ne 0 ]; then - echo $? - fi - fi - - #Stop Global Chat daemon - if [ "$GLOBAL_CHAT" = "yes" ] ; then - echo "Stopping global chat service..." - kill $PIDFILE_SHOUTBOX #TODO better way? - if [ $? -ne 0 ]; then - echo $? - fi - fi - - echo "Stopping lighttpd..." - systemctl stop lighttpd - if [ $? -ne 0 ]; then - echo $? - fi - - if [ "$DROOPY_ENABLED" = "yes" ] ; then - #Kill Droopy - echo "Stopping droopy... " - pkill -9 -f python /opt/piratebox/bin/droopy - if [ $? -ne 0 ]; then - echo $? - fi - fi - - if [ "$DO_IFCONFIG" = yes ] ; then - piratebox_setup_wlan.sh $CONF stop - fi - - if [ "$DO_IW" = "yes" ] ; then - iw dev $INTERFACE del - fi - - # REMOVE BRIDGE - if [ "$DO_BRIDGE" = "yes" ] ; then - echo "Remove Bridge..." - BR_CMD="brctl delif $BRIDGE $INTERFACE" - ( $BR_CMD ; ) - if [ $? -ne 0 ]; then - echo $? - fi - fi - -$PIRATEBOX/bin/hooks/hook_piratebox_stop_done.sh "$CONF" - - -;; - -restart) - echo "Stopping script piratebox" - echo "" - - $PIRATEBOX/bin/hooks/hook_piratebox_stop.sh "$CONF" - - if [ "$USE_APN" = "yes" ] ; then - echo "Stopping hostapd... " - systemctl stop hostapd - if [ $? -ne 0 ]; then - echo $? - fi - fi - - if [ "$USE_DNSMASQ" = "yes" ] ; then - echo "Stopping dnsmasq..." - systemctl stop dnsmasq - if [ $? -ne 0 ]; then - echo $? - fi - fi - - #Stop Global Chat daemon - if [ "$GLOBAL_CHAT" = "yes" ] ; then - echo "Stopping global chat service..." - kill $PIDFILE_SHOUTBOX #TODO better way? - if [ $? -ne 0 ]; then - echo $? - fi - fi - - echo "Stopping lighttpd..." - systemctl stop lighttpd - if [ $? -ne 0 ]; then - echo $? - fi - - if [ "$DROOPY_ENABLED" = "yes" ] ; then - #Kill Droopy - echo "Stopping droopy... " - pkill -9 -f python /opt/piratebox/bin/droopy - if [ $? -ne 0 ]; then - echo $? - fi - fi - - if [ "$DO_IFCONFIG" = yes ] ; then - piratebox_setup_wlan.sh $CONF stop - fi - - if [ "$DO_IW" = "yes" ] ; then - iw dev $INTERFACE del - fi - - # REMOVE BRIDGE - if [ "$DO_BRIDGE" = "yes" ] ; then - echo "Remove Bridge..." - BR_CMD="brctl delif $BRIDGE $INTERFACE" - ( $BR_CMD ; ) - if [ $? -ne 0 ]; then - echo $? - fi - fi - -$PIRATEBOX/bin/hooks/hook_piratebox_stop_done.sh "$CONF" - -### Now start ### - -echo "Starting script piratebox " - echo "" - - # Generate hosts & dnsmasq file - $PIRATEBOX/bin/generate_config_files.sh "$CONF" - $PIRATEBOX/bin/hooks/hook_piratebox_start.sh "$CONF" - - echo "Empty tmp folder" - find $PIRATEBOX/tmp/ -exec rm {} \; - - if [ "$DO_IW" = "yes" ] ; then - echo " Setting up Interface (iw) " - iw $PHY_IF interface add $INTERFACE type managed - fi - - if [ "$DO_IFCONFIG" = yes ] ; then - echo "Setting up wlan" - #Setting up WLAN Interface - #TODO Why not place the few lines from piratebox_setup_wlan.sh in here? - piratebox_setup_wlan.sh $CONF start - fi - if [ $? -ne 0 ] ; then - echo "Failed setting up Interface" - else - - # Only activate - if [ "$USE_APN" = "yes" ] ; then - echo "Starting hostap... " - /usr/sbin/hostapd -- $CONF_APN & #TODO Possible to change PIDFILE of hostapd? - if [ $? -ne 0 ]; then - echo $? - fi - fi - - #BRIDGE - if [ "$DO_BRIDGE" = "yes" ] ; then - echo "Adding $INTERFACE to bridge $BRIDGE // brctl addif $BRIDGE $INTERFACE " - sleep 1 - BR_CMD="brctl addif $BRIDGE $INTERFACE" - ( $BR_CMD ; ) - if [ $? -ne 0 ]; then - echo $? - fi - fi - - if [ "$USE_DNSMASQ" = "yes" ] ; then - echo "Starting dnsmasq... " - # pidfile is written by dnsmasq - /usr/sbin/dnsmasq -- $CMD_DNSMASQ - if [ $? -ne 0 ]; then - echo $? - fi - fi - - - if [ "$DROOPY_ENABLED" = "yes" ] ; then - #Start here the PirateBox-Parts droopy i.e. - #TODO More elegant way of doing this with: find -name 'file*' -size 0 -delete - #Delete 0 Byte Files - delete_empty.sh $UPLOADFOLDER - find $UPLOADFOLDER/ -iname tmp\* -exec rm {} \; - - DROOPY_USER="" - if [ "$DROOPY_USE_USER" = "yes" ] ; then - DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP " - fi - echo "Starting droopy..." - $PIRATEBOX/bin/droopy -- -H $HOST -d $UPLOADFOLDER -c "" -m "$DROOPY_TXT" $DROOPY_USERDIR $DROOPY_PORT - if [ $? -ne 0 ]; then - echo $? - fi - fi - - #Do shoutbox stuff - $PIRATEBOX/bin/shoutbox_stuff.sh $WWW_FOLDER $CONF - - - #Start here the lighttpd i.e. - echo "Starting lighttpd..." - /usr/sbin/lighttpd -- -f $CONF_LIGHTTPD - if [ $? -ne 0 ]; then - echo $? - fi - - #Start Global Chat daemon if needed. - if [ "$GLOBAL_CHAT" = "yes" ] ; then - echo "Starting global chat service..." - $PIRATEBOX/bin/shoutbox_daemon.sh -- $CONF - if [ $? -ne 0 ]; then - echo $? - fi - fi -fi - -$PIRATEBOX/bin/hooks/hook_piratebox_start_done.sh "$CONF" - -;; -*) - echo "Usage: /etc/init.d/piratebox {start|stop|restart}" - exit 1 - ;; -esac -exit 0 diff --git a/piratebox/piratebox/init.d/piratebox.service b/piratebox/piratebox/init.d/piratebox.service deleted file mode 100755 index b3accff..0000000 --- a/piratebox/piratebox/init.d/piratebox.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=PirateBox Service - -[Service] -Type=forking -ExecStart=/opt/piratebox/bin/piratebox.sh start -ExecStop=/opt/piratebox/bin/piratebox.sh stop -Restart=/opt/piratebox/bin/piratebox.sh restart -PIDFile=/var/run/piratebox.pid - -[Install] -WantedBy=multi-user.target From 8821cdc4ac08d8dc3ef1d3cb2098a837abf4ddf8 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 11 Aug 2013 16:28:27 +0200 Subject: [PATCH 030/183] fixed changelog .. --- CHANGELOG | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f927bcc..93e39a4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,12 +5,12 @@ CHANGELOG NOTE: This may only be a partial changelog, check github / your package manager for more info. * Overwork into new Responsive design -* [New] push of systemd structure * [New] install method - * [New] install dependencies + * [New] install dependencies * [Fixed] General cleaning * [Removed] [Testing] Executable, we will stick to service based * [New] possibility in install_piratebox.sh to exchange the hostname easily + === v0.6G === * [Fixed] Hide dot files in directory-listing which are usually hidden files From 007ba8806d7eb1504943e4a69f99d26b738ba1ef Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 24 Jun 2013 11:37:38 +0200 Subject: [PATCH 031/183] added temporary-function for changing PirateBox-Hostname Conflicts: piratebox/piratebox/bin/install_piratebox.sh --- piratebox/piratebox/bin/install_piratebox.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh index e0bcad7..70e5b4e 100755 --- a/piratebox/piratebox/bin/install_piratebox.sh +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -173,3 +173,4 @@ if [ $2 = "hostname" ] ; then echo "..done" fi + From 224f8bb0a48686e8532f1c88ef0d0baa1341ce56 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 1 Jul 2013 13:28:37 +0200 Subject: [PATCH 032/183] added option to change hostname via command line Conflicts: piratebox/piratebox/bin/install_piratebox.sh --- piratebox/piratebox/bin/install_piratebox.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh index 70e5b4e..e0bcad7 100755 --- a/piratebox/piratebox/bin/install_piratebox.sh +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -173,4 +173,3 @@ if [ $2 = "hostname" ] ; then echo "..done" fi - From 3a3aa7c28e6a7c989d039a496b4a56d408d8accc Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 1 Jul 2013 13:31:27 +0200 Subject: [PATCH 033/183] added changelog entry Conflicts: CHANGELOG --- CHANGELOG | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 93e39a4..30c1c6c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,5 @@ NOTE: This may only be a partial changelog, check github / your package manager * [Removed] [Testing] Executable, we will stick to service based * [New] possibility in install_piratebox.sh to exchange the hostname easily - === v0.6G === * [Fixed] Hide dot files in directory-listing which are usually hidden files From de5318e2f3265d84e5a8c1d43a04a5209b9c22f2 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 11 Aug 2013 16:55:43 +0200 Subject: [PATCH 034/183] Fix for droopy on OpenWRT #49 --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 941af29..6c406dd 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ SRC_IMAGE_UNPACKED=image_stuff/piratebox_img MOUNT_POINT=image_stuff/image OPENWRT_FOLDER=image_stuff/openwrt OPENWRT_CONFIG_FOLDER=$(OPENWRT_FOLDER)/conf - +OPENWRT_BIN_FOLDER=$(OPENWRT_FOLDER)/bin .DEFAULT_GOAL = package @@ -26,7 +26,7 @@ $(PACKAGE): $(VERSION) tar czf $@ $(PB_FOLDER) -$(IMAGE_FILE): $(VERSION) $(SRC_IMAGE_UNPACKED) $(OPENWRT_CONFIG_FOLDER) +$(IMAGE_FILE): $(VERSION) $(SRC_IMAGE_UNPACKED) $(OPENWRT_CONFIG_FOLDER) $(OPENWRT_BIN_FOLDER) mkdir -p $(MOUNT_POINT) echo "#### Mounting image-file" sudo mount -o loop,rw,sync $(SRC_IMAGE_UNPACKED) $(MOUNT_POINT) @@ -49,6 +49,11 @@ $(OPENWRT_CONFIG_FOLDER): sed 's:192.168.77:192.168.1:g' -i $@/piratebox.conf sed 's:DROOPY_USE_USER="yes":DROOPY_USE_USER="no":' -i $@/piratebox.conf +$(OPENWRT_BIN_FOLDER): + mkdir -p $@ + cp -v $(PB_SRC_FOLDER)/bin/droopy $@ + sed "s:libc.so.6:libc.so.0:" -i $@/droopy + $(TGZ_IMAGE_FILE): tar czf $(TGZ_IMAGE_FILE) $(SRC_IMAGE_UNPACKED) From 7fd7840ff403ff56d568ba49f07507ccf402c4e8 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 11 Aug 2013 17:09:03 +0200 Subject: [PATCH 035/183] Generating lease-file location based on config file. Place it on OpenWRT into /tmp => memory Conflicts: CHANGELOG --- CHANGELOG | 2 ++ Makefile | 1 + piratebox/piratebox/bin/generate_config_files.sh | 2 +- piratebox/piratebox/conf/piratebox.conf | 4 ++++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 30c1c6c..9347566 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,8 @@ NOTE: This may only be a partial changelog, check github / your package manager * [Fixed] General cleaning * [Removed] [Testing] Executable, we will stick to service based * [New] possibility in install_piratebox.sh to exchange the hostname easily +* [Fixed] Hide dot files in directory-listing which are usually hidden files +* [New] Moved DHCP leasefile into memory on OpenWRT system (/tmp is memory) === v0.6G === * [Fixed] Hide dot files in directory-listing which are usually hidden files diff --git a/Makefile b/Makefile index 6c406dd..06195f4 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ $(OPENWRT_CONFIG_FOLDER): sed 's:DNSMASQ_INTERFACE="wlan0":DNSMASQ_INTERFACE="br-lan":' -i $@/piratebox.conf sed 's:192.168.77:192.168.1:g' -i $@/piratebox.conf sed 's:DROOPY_USE_USER="yes":DROOPY_USE_USER="no":' -i $@/piratebox.conf + sed 's:LEASE_FILE_LOCATION=$PIRATEBOX_FOLDER/tmp/lease.file:LEASE_FILE_LOCATION=/tmp/lease.file:' -i $@/piratebox.conf $(OPENWRT_BIN_FOLDER): mkdir -p $@ diff --git a/piratebox/piratebox/bin/generate_config_files.sh b/piratebox/piratebox/bin/generate_config_files.sh index 94ac288..52e4aa9 100755 --- a/piratebox/piratebox/bin/generate_config_files.sh +++ b/piratebox/piratebox/bin/generate_config_files.sh @@ -45,7 +45,7 @@ set_pathnames() { DEFAULT_HOSTS=$CONFIG_PATH/hosts DEFAULT_DNSMASQ=$CONFIG_PATH/dnsmasq_default.conf RADVD_CONFIG=$CONFIG_PATH/radvd_generated.conf - LEASE_FILE=$1/tmp/leases + LEASE_FILE=$LEASE_FILE_LOCATION LIGHTTPD_ENV_CONFIG=$CONFIG_PATH/lighttpd/env } diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index 5d55e1a..892164b 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -97,6 +97,10 @@ END_LEASE=250 #Leasetime (When should the client renew it's IP) LEASE_DURATION=12h +# Where is the leasefile stored to? +LEASE_FILE_LOCATION=$PIRATEBOX_FOLDER/tmp/lease.file + + # Define the netmask NETMASK=255.255.255.0 From b69632ca4129e240cc2d78ca3a959ec75ec09e77 Mon Sep 17 00:00:00 2001 From: dsbrooks Date: Wed, 21 Aug 2013 14:57:53 +0900 Subject: [PATCH 036/183] Custom directory listing Pull Request Conflicts: piratebox/piratebox/conf/lighttpd/lighttpd.conf --- .../piratebox/conf/lighttpd/lighttpd.conf | 19 + piratebox/piratebox/src/HEADER.txt | 28 ++ piratebox/piratebox/src/README.txt | 12 + piratebox/piratebox/www/index.html | 140 ++++---- piratebox/piratebox/www/jquery.min.js | 0 piratebox/piratebox/www/menu.png | Bin 0 -> 2992 bytes .../www/piratebox-logo-horizontal-white.png | Bin 8776 -> 6607 bytes piratebox/piratebox/www/scripts.js | 79 +++- piratebox/piratebox/www/style.css | 336 +++++++++++------- 9 files changed, 415 insertions(+), 199 deletions(-) create mode 100644 piratebox/piratebox/src/HEADER.txt create mode 100644 piratebox/piratebox/src/README.txt mode change 100755 => 100644 piratebox/piratebox/www/index.html mode change 100644 => 100755 piratebox/piratebox/www/jquery.min.js create mode 100644 piratebox/piratebox/www/menu.png mode change 100755 => 100644 piratebox/piratebox/www/piratebox-logo-horizontal-white.png mode change 100755 => 100644 piratebox/piratebox/www/style.css diff --git a/piratebox/piratebox/conf/lighttpd/lighttpd.conf b/piratebox/piratebox/conf/lighttpd/lighttpd.conf index 9f828de..a9357ae 100644 --- a/piratebox/piratebox/conf/lighttpd/lighttpd.conf +++ b/piratebox/piratebox/conf/lighttpd/lighttpd.conf @@ -35,6 +35,25 @@ dir-listing.encoding = "utf-8" server.dir-listing = "enable" dir-listing.hide-dotfiles = "enable" +# Grabs main css +dir-listing.external-css = "../style.css" + +# Header +# Enables header section +dir-listing.show-header = "enable" +dir-listing.encode-header = "disable" +# Hides HEADER.txt from listing +dir-listing.hide-header-file = "enable" + +# Footer +# Enables footer section +dir-listing.show-readme = "enable" +dir-listing.encode-readme = "disable" +# Hides README.txt from listing +dir-listing.hide-readme-file = "enable" +# Diables default footer text +dir-listing.set-footer = " " + # Disabled, maybe fixes reload problem on imageboard #compress.cache-dir = "/var/cache/lighttpd/compress/" #compress.filetype = ( "application/x-javascript", "text/css", "text/html", "text/plain" ) diff --git a/piratebox/piratebox/src/HEADER.txt b/piratebox/piratebox/src/HEADER.txt new file mode 100644 index 0000000..3fe11c7 --- /dev/null +++ b/piratebox/piratebox/src/HEADER.txt @@ -0,0 +1,28 @@ + + PirateBox - Share Freely! + + + + + +
+
\ No newline at end of file diff --git a/piratebox/piratebox/src/README.txt b/piratebox/piratebox/src/README.txt new file mode 100644 index 0000000..e0700a7 --- /dev/null +++ b/piratebox/piratebox/src/README.txt @@ -0,0 +1,12 @@ + +
+
+
+
+

Back to top

+

About PirateBox

+

Inspired by pirate radio and the free culture movment, PirateBox is a self-contained mobile collaboration and file sharing device. PirateBox utilizes Free, Libre and Open Source software (FLOSS) to create mobile wireless file sharing networks where users can anonymously share images, video, audio, documents, and other digital content.

+

PirateBox is designed to be safe and secure. No logins are required and no user data is logged. The system is purposely not connected to the Internet in order to prevent tracking and preserve user privacy.

+ PirateBox is licensed under GPLv3. +
+
\ No newline at end of file diff --git a/piratebox/piratebox/www/index.html b/piratebox/piratebox/www/index.html old mode 100755 new mode 100644 index aa3cbdf..78a3cdb --- a/piratebox/piratebox/www/index.html +++ b/piratebox/piratebox/www/index.html @@ -1,89 +1,85 @@ - - PirateBox - Share Freely + PirateBox - Share Freely! - -
-
- - - + + + + +
+
-
-
- - -
-
-
-

Chat

-

100% Anonymous!

-
-
-
-
- - - -
- -
-

Choose a color:

- - | - - | - - | - - | - - -
-
-
+
+
+
+

Welcome

+

Now, first of all, there is nothing illegal or scary going on here. This is a social place where you can chat and share files with people around you, anonymously! This is an off-line network, specially designed and developed for file-sharing and chat services. Staying off the grid is a precaution to maintain your full anonymity. Please have fun, chat with people, and feel free to share any files you may like.

+ +
+ -
-
-
-

About PirateBox

-

Inspired by pirate radio and the free culture movment, PirateBox is a self-contained mobile collaboration and file sharing device. PirateBox utilizes Free, Libre and Open Source software (FLOSS) to create mobile wireless file sharing networks where users can anonymously share images, video, audio, documents, and other digital content.

-

PirateBox is designed to be safe and secure. No logins are required and no user data is logged. The system is purposely not connected to the Internet in order to prevent tracking and preserve user privacy.

-

To learn more about the project or to find out how to build your own PirateBox system, please visit http://wiki.daviddarts.com/piratebox.

- - PirateBox is licensed under GPLv3. +
+
+

Chat

+
+
+
+ + + +
+
+

Text Color:

+ + + + + +
+
+
-
+
+
+ +
+
+

Back to top

+

About PirateBox

+

Inspired by pirate radio and the free culture movment, PirateBox is a self-contained mobile collaboration and file sharing device. PirateBox utilizes Free, Libre and Open Source software (FLOSS) to create mobile wireless file sharing networks where users can anonymously share images, video, audio, documents, and other digital content.

+

PirateBox is designed to be safe and secure. No logins are required and no user data is logged. The system is purposely not connected to the Internet in order to prevent tracking and preserve user privacy.

+ PirateBox is licensed under GPLv3. +
+
+ \ No newline at end of file diff --git a/piratebox/piratebox/www/jquery.min.js b/piratebox/piratebox/www/jquery.min.js old mode 100644 new mode 100755 diff --git a/piratebox/piratebox/www/menu.png b/piratebox/piratebox/www/menu.png new file mode 100644 index 0000000000000000000000000000000000000000..63396253889f7f86d7e0272ee17395e19a567d22 GIT binary patch literal 2992 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 diff --git a/piratebox/piratebox/www/scripts.js b/piratebox/piratebox/www/scripts.js index 36c70d9..c185390 100755 --- a/piratebox/piratebox/www/scripts.js +++ b/piratebox/piratebox/www/scripts.js @@ -23,6 +23,83 @@ $(document).ready(function() { }); display_shoutbox(); + + // Spin menu icon and toggle nav + $('#menu-icon').click(function() { + $(this).toggleClass('rotate'); + $('#top-nav').slideToggle(); + }); + + // Closes the mobile nav + $('#top-nav a').click(function() { + if ($('#top-nav').is(':visible') + && $('#menu-icon').is(':visible')) { + $('#top-nav').slideUp(); + $('#menu-icon').toggleClass('rotate'); + } + }); + + // Hides the welcome + $('#thanks').click(function() { + $('#welcome').slideUp(); + }); + + // Detects window size + $(window).resize(function() { + if ($('#menu-icon').is(':visible')) { + $('#top-nav').hide(); + } else { + $('#top-nav').show(); + } + }); + + + // smooth scrolling for internal links + function filterPath(string) { + return string + .replace(/^\//,'') + .replace(/(index|default).[a-zA-Z]{3,4}$/,'') + .replace(/\/$/,''); + } + var locationPath = filterPath(location.pathname); + var scrollElem = scrollableElement('html', 'body'); + + $('a[href*=#]').each(function() { + var thisPath = filterPath(this.pathname) || locationPath; + if ( locationPath == thisPath + && (location.hostname == this.hostname || !this.hostname) + && this.hash.replace(/#/,'') ) { + var $target = $(this.hash), target = this.hash; + if (target) { + var targetOffset = $target.offset().top; + $(this).click(function(event) { + event.preventDefault(); + $(scrollElem).animate({scrollTop: targetOffset}, 400, function() { + location.hash = target; + }); + }); + } + } + }); + + // use the first element that is "scrollable" + function scrollableElement(els) { + for (var i = 0, argLength = arguments.length; i 0) { + return el; + } else { + $scrollElement.scrollTop(1); + var isScrollable = $scrollElement.scrollTop()> 0; + $scrollElement.scrollTop(0); + if (isScrollable) { + return el; + } + } + } + return []; + } }); function refresh_shoutbox () { @@ -41,7 +118,7 @@ function post_shoutbox () { .success(function() { refresh_shoutbox(); }); - $('#shoutbox_message').val(''); + $('#shoutbox-input .message').val(''); } function display_shoutbox() { diff --git a/piratebox/piratebox/www/style.css b/piratebox/piratebox/www/style.css old mode 100755 new mode 100644 index 3225d79..3152012 --- a/piratebox/piratebox/www/style.css +++ b/piratebox/piratebox/www/style.css @@ -3,17 +3,15 @@ -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; + margin: 0; + padding: 0; } html, body, div, object, iframe, fieldset { - margin: 0; - padding: 0; border: 0; } ol, ul { - margin: 0; - padding: 0; list-style: none; } @@ -22,7 +20,7 @@ table { border-collapse: collapse; } -header, footer, nav, section, article, hgroup, figure { +header, footer, footer, nav, section, article, hgroup, figure { display: block; } @@ -31,24 +29,19 @@ legend { } body { + color: black; + font-family: sans-serif; font-size: 100%; - font-family: sans-serif; } -h1, h2, h3, h4, h5, h6, p { - margin: 0; -} - -body { - color: #1b1d1e; - font-family: sans-serif; +h1 { font-size: 1em; - font-weight: normal; - line-height: 1.5em; + font-weight: bold; + line-height: auto; margin: 0; } -h1, h2 { +h2 { font-size: 1.3em; font-weight: bold; line-height: auto; @@ -59,18 +52,14 @@ h3 { font-size: 1em; font-weight: bold; line-height: auto; - margin: 0 0 1em; + margin: 0 0 0.25em; } p { font-size: 1em; font-weight: normal; - line-height: 1.4em; - margin: 0; -} - -p + p { - margin: 1em 0; + line-height: 1.5em; + margin: 0 0 1em; } a { @@ -78,6 +67,47 @@ a { text-decoration: none; } +a:hover { + text-decoration: underline; +} + +.current { + color: white; +} + +#top-nav a { + display: block; + font-size: 1.5em; + font-weight: normal; + line-height: 1.5em; + margin: 0; +} + +input { + font-size: .75em; +} + +label { + color: white; + font-size: .75em; +} + +footer { + color: #e7e9ea; +} + +.message date { + font-size: .625em; + color: #979ea1; +} +.message name { + font-size: .75em; + font-weight: bold; +} +.message data { + font-size: .75em; +} + .red { color: red; } @@ -94,178 +124,232 @@ a { color: #ff8040; } -html, body { - background: #e5e5e5; -} - -.container { - padding: 1em; - width: 100%; -} - -img { - width: 100%; +body { + background: #e7e9ea; } header, footer { background: #1b1d1e; } +header img, footer img { + vertical-align: bottom; +} + +#logo { + float: left; + overflow: hidden; +} + +#menu-icon { + float: right; + width: 36px; + -webkit-transition: all 0.5s ease-in-out; + -moz-transition: all 0.5s ease-in-out; + -o-transition: all 0.5s ease-in-out; + transition: all 0.5s ease-in-out; +} + +.rotate { + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + transform: rotate(-90deg); + -webkit-transition: all 0.5s ease-in-out; + -moz-transition: all 0.5s ease-in-out; + -o-transition: all 0.5s ease-in-out; + transition: all 0.5s ease-in-out; +} #top-nav { - width: 100%; -} -#top-nav ul { - margin: 0 auto; - text-align: center; -} -#top-nav li { - display: inline; -} -#top-nav li a { - font-size: 1.5em; - margin: 0 .5em; + clear: both; + display: none; + padding: 1em 0 0 0; } -#content .container { - padding: 1em 0; +#thanks { + float: right; } -#upload, #chat { - background: white; +#upload iframe { + border: 1px solid #979ea1; border-radius: 3px; margin: 0 0 1em; - padding: 1em; - -webkit-box-shadow: #a8a8a8 0px 3px 0px; - -moz-box-shadow: #a8a8a8 0px 3px 0px; - box-shadow: #a8a8a8 0px 3px 0px; } #shoutbox { - border: 1px solid #a8a8a8; height: 350px; overflow: auto; width: 100%; + border: 1px solid #979ea1; + border-radius: 3px; margin: 0 0 1em; - padding: 0 1em; + padding: 0.5em; +} +#shoutbox .message { + margin: 0 0 .25em 0; } -.message { - margin: 0 0 .25em; +#shoutbox-input { + margin: 0 0 1em 0; } - -date { - color: #a8a8a8; - font-size: .75em; - font-weight: 700; -} - -name { - font-weight: bold; -} - -data { - line-height: 1.2em; -} - -#shoutbox_input { - margin: 0 0 1em; -} - -#shoutbox_nickname, #shoutbox_message, #shoutbox_submit { - margin: 0 0 1em; +#shoutbox-input .nickname, +#shoutbox-input .message, +#shoutbox-input .button { width: 100%; } -footer { - color: #e5e5e5; +#shoutbox-options label { + float: left; + overflow: hidden; + border-radius: 3px; + margin: 0 0.5em 0.5em 0; + padding: 0.5em 1em; +} +#shoutbox-options label input { + margin: 0 .5em 0 0; +} +#shoutbox-options .bg-black { + background: #1b1d1e; +} +#shoutbox-options .bg-blue { + background: blue; +} +#shoutbox-options .bg-green { + background: green; +} +#shoutbox-options .bg-orange { + background: #ff8040; +} +#shoutbox-options .bg-red { + background: red; } input { - background-color: white; - border: 1px solid #a8a8a8; - color: #1b1d1e; - cursor: text; - font-size: .75em; height: 3em; - padding: 0 .5em; - vertical-align: baseline; -} - -input[type=submit] { - background: #a8a8a8; - border: none; - color: white; - padding: 0; + border: 1px solid #979ea1; + border-radius: 3px; + margin: 0 0 1em; + padding: 0 0.5em; } input[type=radio] { height: 1.3em; - margin: 0 .2em; + margin: 0 .5em 0 0; } -@media screen and (min-width: 769px) { +.button { + background: #979ea1; + border: 0; + color: white; + margin: 0; + padding: 1em; +} + +.button:active { + background: #7c8589; + color: #cccccc; + -webkit-box-shadow: #4b5154 0px -3px 0px inset; + -moz-box-shadow: #4b5154 0px -3px 0px inset; + box-shadow: #4b5154 0px -3px 0px inset; +} + +.card { + background: white; + border-radius: 3px; + -webkit-box-shadow: #979ea1 0px 3px 0px; + -moz-box-shadow: #979ea1 0px 3px 0px; + box-shadow: #979ea1 0px 3px 0px; + margin: 0 0 1em; + padding: 1em; +} + +.container { + height: 100%; + padding: 1em; + width: 100%; +} + +.list table { + width: 100%; +} +.list table thead { + text-align: left; +} +.list table tbody tr { + height: 2em; + vertical-align: middle; +} +.list table tbody tr:hover { + background: #e7e9ea; +} +.list table .m, .list table .s, .list table .t { + display: none; +} + +@media screen and (min-width: 801px) { #logo { - float: left; - margin: 0; - width: 60%; + margin: 0 2em 0 0; } - #logo img { - width: 80%; + #menu-icon { + display: none; } #top-nav { - float: right; - margin: 1em 0; - width: 40%; + clear: none; + display: table-cell; + padding: 0; + vertical-align: middle; } - #top-nav ul { - text-align: left; + #top-nav ul li { + float: left; } - #top-nav li a { + #top-nav ul li a { margin: 0 1em 0 0; - } - - #content .container { - padding: 1em; + padding: 0; } #sidebar { float: right; - margin: 0 0 1em; width: 40%; } #main { float: left; + padding: 0 1em 0 0; width: 60%; } - #chat { - margin: 0 1em 1em 0; - } - - #shoutbox_nickname { + #shoutbox-input .nickname { float: left; margin: 0 1em 0 0; width: 20%; } - - #shoutbox_message { + #shoutbox-input .message { float: left; - margin: 0; + margin: 0 1em 0 0; width: 60%; } - - #shoutbox_submit { + #shoutbox-input .button { float: right; margin: 0; width: 15%; } -} -@media screen and (min-width: 1025px) { + + .to-top { + display: none; + } + .container { margin: 0 auto; - width: 80%; + max-width: 1280px; + width: 90%; + } + + .list table .m, + .list table .s, + .list table .t { + display: table-cell; } } From 87137b27df2dc959f009cab7223ab38ca668c9a7 Mon Sep 17 00:00:00 2001 From: dsbrooks Date: Wed, 21 Aug 2013 15:05:19 +0900 Subject: [PATCH 037/183] Quick-fix + body style needed a variable added --- piratebox/piratebox/www/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piratebox/piratebox/www/style.css b/piratebox/piratebox/www/style.css index 3152012..282ff73 100644 --- a/piratebox/piratebox/www/style.css +++ b/piratebox/piratebox/www/style.css @@ -29,7 +29,7 @@ legend { } body { - color: black; + color: #1b1d1e; font-family: sans-serif; font-size: 100%; } From 5e3896a4e14953ac70813dc4b91373e1d86e8cd6 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 21 Aug 2013 09:59:58 +0200 Subject: [PATCH 038/183] Distribute Files which are responsible for the new design in directory listing --- .../bin/distribute_file_into_directory.sh | 29 ++++++++++++ piratebox/piratebox/bin/distribute_files.sh | 47 +++++++++++++++++++ piratebox/piratebox/init.d/piratebox | 3 ++ piratebox/piratebox/init.d/piratebox_alt | 3 ++ 4 files changed, 82 insertions(+) create mode 100755 piratebox/piratebox/bin/distribute_file_into_directory.sh create mode 100755 piratebox/piratebox/bin/distribute_files.sh diff --git a/piratebox/piratebox/bin/distribute_file_into_directory.sh b/piratebox/piratebox/bin/distribute_file_into_directory.sh new file mode 100755 index 0000000..746b648 --- /dev/null +++ b/piratebox/piratebox/bin/distribute_file_into_directory.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# The following script is used to distribute a specific file into directoried of the givien folder + +directory=$1 +src_file=$2 +overwrite=$3 +overwrite=${overwrite:=false} + +# To enable DEBUG mode, run the following line before startint this script +# export DEBUG=true +DEBUG=${DEBUG:=false} + +TEST_RUN=false + +filename="${src_file##*/}" + + $DEBUG && echo "filename: $filename" + $DEBUG && echo "Overwrite mode : $overwrite " + +if [ ! -e $directory/$filename ] || [ "$overwrite" == "true" ] ; then + echo "Distribute $filename into $directory " + $DEBUG && echo " cp $src_file $directory " + $TEST_RUN || cp $src_file $directory +else + $DEBUG && echo "File exists" +fi + + diff --git a/piratebox/piratebox/bin/distribute_files.sh b/piratebox/piratebox/bin/distribute_files.sh new file mode 100755 index 0000000..a43846f --- /dev/null +++ b/piratebox/piratebox/bin/distribute_files.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# This script distributes a set of files into $1 folder + +#Script for single stuff +PIRATEBOX_FOLDER=${4:=/opt/piratebox} +script=$PIRATEBOX_FOLDER/bin/distribute_file_into_directory.sh + + +# To enable DEBUG mode, run the following line before startint this script +# export DEBUG=true +DEBUG=${DEBUG:=false} + +work_on_file() { + local destination_root_folder=$1 + local src_file=$2 + + find $destination_root_folder -type d -exec $script "{}" $src_file $overwrite ';' + +} + + + +#------------- + +destination=$1 +overwrite=$2 +overwrite=${overwrite:=false} +src_file=$3 +src_file=${src_file:=all} + +$DEBUG && echo "parameters: + destination $destination + overwrite $overwrite + src_file $src_file + PirateBox_folder=$PIRATEBOX_FOLDER + call script: $script + "; + +if [ "$src_file" == "all" ] ; then + work_on_file $destination $PIRATEBOX_FOLDER/src/HEADER.txt + work_on_file $destination $PIRATEBOX_FOLDER/src/README.txt +else + work_on_file $destination $src_file +fi + + diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index 6a07c69..19e2bed 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -70,6 +70,9 @@ case "$1" in echo "Empty tmp folder" find $PIRATEBOX/tmp/ -exec rm {} \; + echo "Copy over design files" + $PIRATEBOX/bin/distribute_files.sh $SHARE_FOLDER/Shared + if [ "$DO_IW" = "yes" ] ; then log_daemon_msg " Setting up Interface (iw) " iw $PHY_IF interface add $INTERFACE type managed diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index 0905ad8..2525916 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -74,6 +74,9 @@ case "$1" in echo "Empty tmp folder" find $PIRATEBOX/tmp/ -exec rm {} \; + echo "Copy over design files" + $PIRATEBOX/bin/distribute_files.sh $SHARE_FOLDER/Shared + if [ "$DO_IW" = "yes" ] ; then From ae6e171281cd6435cd9fa32d28b5737f404e6286 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 21 Aug 2013 10:08:11 +0200 Subject: [PATCH 039/183] Added new directory-Design to CHANGELOG and David Brooks to Authors --- AUTHORS | 3 +++ CHANGELOG | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/AUTHORS b/AUTHORS index 8e76041..5a69383 100644 --- a/AUTHORS +++ b/AUTHORS @@ -14,6 +14,9 @@ Contributors for modifications: # someguy - Modifications for running on OpenWRT # ToM'aSs - Languag-Support +Design: + * David Brooks + Based on Software: * Droopy - http://stackp.online.fr/?p=28 * forest.py - http://www.triv.org.uk/~nelis/forest/ diff --git a/CHANGELOG b/CHANGELOG index 9347566..c0e81a4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,12 @@ CHANGELOG NOTE: This may only be a partial changelog, check github / your package manager for more info. * Overwork into new Responsive design + * New Frontpage + * Directory Listing in design + * Configuration in lighttpd.conf + * During startup README.txt & HEADER.txt get copied into /opt/piratebox/share/Shared folder + -> Exisiting files won't be overwritten! + -> Scripts can be used in console with overwrite parameter do distribute your own files * [New] install method * [New] install dependencies * [Fixed] General cleaning From 6b435954a18ed3ae49751be8b2a0350da56a76e3 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 21 Aug 2013 10:19:20 +0200 Subject: [PATCH 040/183] Get back to PirateBox-Logo for kareha --- .../piratebox/www/piratebox-logo-small.png | Bin 0 -> 12637 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100755 piratebox/piratebox/www/piratebox-logo-small.png diff --git a/piratebox/piratebox/www/piratebox-logo-small.png b/piratebox/piratebox/www/piratebox-logo-small.png new file mode 100755 index 0000000000000000000000000000000000000000..667a5d8ddf26a14f98083f91850482bceeaae56a GIT binary patch literal 12637 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 SMg1TEeQ2mYSE*OB4ErDSeE~=S literal 0 HcmV?d00001 From 3674f4710ef99f299b5df5549710d6e2eef8c5d6 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 21 Aug 2013 11:04:51 +0200 Subject: [PATCH 041/183] fix for OpenWRT systems --- piratebox/piratebox/bin/distribute_files.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/piratebox/piratebox/bin/distribute_files.sh b/piratebox/piratebox/bin/distribute_files.sh index a43846f..20530e5 100755 --- a/piratebox/piratebox/bin/distribute_files.sh +++ b/piratebox/piratebox/bin/distribute_files.sh @@ -3,7 +3,8 @@ # This script distributes a set of files into $1 folder #Script for single stuff -PIRATEBOX_FOLDER=${4:=/opt/piratebox} +PIRATEBOX_FOLDER=$4 +PIRATEBOX_FOLDER=${PIRATEBOX_FOLDER:=/opt/piratebox} script=$PIRATEBOX_FOLDER/bin/distribute_file_into_directory.sh From 9d463f95c7d3cb2b95a75a25739c5baa49021817 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 21 Aug 2013 11:06:39 +0200 Subject: [PATCH 042/183] Release beta2 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 06195f4..6bc2223 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME = piratebox-ws -VERSION = 1.0.0_beta1 +VERSION = 1.0.0_beta2 ARCH = all PB_FOLDER=piratebox PB_SRC_FOLDER=$(PB_FOLDER)/$(PB_FOLDER) From c096204ccf077064f2bdeb803ef1e54bd184bfcd Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 22 Aug 2013 12:53:24 +0200 Subject: [PATCH 043/183] Changes for working subdirectories with custom directory listing --- piratebox/piratebox/conf/lighttpd/lighttpd.conf | 2 +- piratebox/piratebox/src/HEADER.txt | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/piratebox/piratebox/conf/lighttpd/lighttpd.conf b/piratebox/piratebox/conf/lighttpd/lighttpd.conf index a9357ae..371ee94 100644 --- a/piratebox/piratebox/conf/lighttpd/lighttpd.conf +++ b/piratebox/piratebox/conf/lighttpd/lighttpd.conf @@ -36,7 +36,7 @@ server.dir-listing = "enable" dir-listing.hide-dotfiles = "enable" # Grabs main css -dir-listing.external-css = "../style.css" +dir-listing.external-css = "/style.css" # Header # Enables header section diff --git a/piratebox/piratebox/src/HEADER.txt b/piratebox/piratebox/src/HEADER.txt index 3fe11c7..22c785b 100644 --- a/piratebox/piratebox/src/HEADER.txt +++ b/piratebox/piratebox/src/HEADER.txt @@ -1,7 +1,7 @@ PirateBox - Share Freely! - - + +
-
\ No newline at end of file +
From f18806e963187aaf7541557d602bc743de61e71d Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 26 Aug 2013 08:20:55 +0200 Subject: [PATCH 044/183] Fixes issue in package generation + initialition on Debian --- piratebox/piratebox/init.d/piratebox | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index 19e2bed..34fe08d 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -53,6 +53,19 @@ else exit 1 fi + +if [[ -f $PIRATEBOX/conf/init_done ]] ; then + INIT=OK +else + $PIRATEBOX/bin/hooks/hook_pre_init.sh "$CONF" + $PIRATEBOX/bin/install_piratebox.sh "$CONF" part2 + $PIRATEBOX/bin/hooks/hook_post_init.sh "$CONF" + touch $PIRATEBOX/conf/init_done +fi + + + + # Command Line for DNSMASQ, use extra config file generated from command above CMD_DNSMASQ="-x $PIDFILE_DNSMASQ -C $CONF_DNSMASQ " From 0839fbdb85a1166f2daf12a3fc35dda197eaeee0 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 19 Aug 2013 17:13:37 +0200 Subject: [PATCH 045/183] fix for calling change hostname service --- piratebox/piratebox/bin/install_piratebox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh index e0bcad7..788e6f9 100755 --- a/piratebox/piratebox/bin/install_piratebox.sh +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -151,7 +151,7 @@ if [ $2 = "flush_dns_reg" ] ; then echo "Installed crontab for flushing dnsmasq requlary" fi -set_Hostname() { +set_hostname() { local name=$1 ; shift; echo " From d975b5e4f4421a1a24c5fad2215b22836d90f6cd Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 19 Aug 2013 13:26:14 +0200 Subject: [PATCH 046/183] OVERWORK of calls of "date" and better initialize of timesave file (less error messages) Conflicts: piratebox/piratebox/bin/timesave.sh --- piratebox/piratebox/bin/timesave.sh | 48 +++++++++++++++++------------ 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/piratebox/piratebox/bin/timesave.sh b/piratebox/piratebox/bin/timesave.sh index a733247..08f59f9 100755 --- a/piratebox/piratebox/bin/timesave.sh +++ b/piratebox/piratebox/bin/timesave.sh @@ -11,6 +11,11 @@ # Licenced under GPL-2 @ 2012 # Matthias Strubel matthias.strubel@aod-rgp.de +##function for similar saving & getting time +get_datetime() { + date +%C%g%m%d%H%M +} + # Load configfile @@ -35,37 +40,40 @@ if [ "$2" = "install" ] ; then echo " */5 * * * * $PIRATEBOX_FOLDER/bin/timesave.sh $PIRATEBOX_FOLDER/conf/piratebox.conf save " >> $PIRATEBOX_FOLDER/tmp/crontab crontab $PIRATEBOX_FOLDER/tmp/crontab + echo "initialize timesave file" touch $TIMESAVE chmod a+rw $TIMESAVE + get_datetime > $TIMESAVE - if [ "$OPENWRT" = "yes" ] ; then - echo "Placing Timerecover on Startup" - echo " $0 $1 recover " >> /etc/rc.local - sed 's:exit:#exit:g' -i /etc/rc.local - echo "Activating cron-service.." - /etc/init.d/cron enable - /etc/init.d/cron start - echo "done" - else - echo "Remember to have cron active..." - echo " on OpenWrt run: /etc/init.d/cron enable" - echo " /etc/init.d/cron start" - fi - #Save the current time - $0 $1 "save" + + echo "Remember MAY have to cron active..." + echo " on OpenWrt run: /etc/init.d/piratebox enable" + exit 0 fi if [ "$2" = "save" ] ; then + if [ -e $TIMESAVE ] ; then + if [ `get_datetime` -lt `cat $TIMESAVE` ] ; then + logger -s "$0 : sorry, current date-time is lower then saved one, don't save it this time" + exit 1 + fi + fi + #Save Datetime in a recoverable format... - date +%C%g%m%d%H%M > $TIMESAVE + get_datetime > $TIMESAVE exit 0 fi if [ "$2" = "recover" ] ; then - date `cat $TIMESAVE ` - [ "$?" != "0" ] && echo "error in recovering time" && exit 255 - echo "Time recovered" - exit 0 + if [ `get_datetime` -lt `cat $TIMESAVE` ] ; + date `cat $TIMESAVE ` + [ "$?" != "0" ] && echo "error in recovering time" && exit 255 + echo "Time recovered" + exit 0 + else + echo "Sorry, changing timebackward via timesave is not possible" + exit 1 + fi fi From 3b66f162ec01f50017ff443e6876ae756149badc Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 19 Aug 2013 11:17:17 +0200 Subject: [PATCH 047/183] added mimetype for json files --- piratebox/piratebox/conf/lighttpd/mime.types | 1 + 1 file changed, 1 insertion(+) diff --git a/piratebox/piratebox/conf/lighttpd/mime.types b/piratebox/piratebox/conf/lighttpd/mime.types index aeda915..ea8b09a 100644 --- a/piratebox/piratebox/conf/lighttpd/mime.types +++ b/piratebox/piratebox/conf/lighttpd/mime.types @@ -80,6 +80,7 @@ mimetype.assign = ( ".oti" => "application/vnd.oasis.opendocument.image-template", ".oth" => "application/vnd.oasis.opendocument.text-web", + ".json" => "application/json", ".epub" => "application/epub+zip", ".fb2" => "text/xml", From 346ce5b354b4a86fe0c34b40d74ae749bbb05424 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 15 Aug 2013 12:50:46 +0200 Subject: [PATCH 048/183] install_piratebox.sh now uses schema based generation for redirect.html --- piratebox/piratebox/bin/install_piratebox.sh | 13 ++----------- piratebox/piratebox/src/redirect.html.schema | 11 +++++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 piratebox/piratebox/src/redirect.html.schema diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh index 788e6f9..99cd59b 100755 --- a/piratebox/piratebox/bin/install_piratebox.sh +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -153,17 +153,8 @@ fi set_hostname() { local name=$1 ; shift; - echo " - - Redirect... - - - - - Redirect - - " > $WWW_FOLDER/redirect.html + sed "s|#####HOST#####|$name|g" $PIRATEBOX_FOLDER/src/redirect.html.schema > $WWW_FOLDER/redirect.html sed "s|HOST=\"$HOST\"|HOST=\"$name\"|" -i $PIRATEBOX_CONFIG } @@ -171,5 +162,5 @@ if [ $2 = "hostname" ] ; then echo "Switching hostname to $3" set_hostname "$3" echo "..done" -fi +fi diff --git a/piratebox/piratebox/src/redirect.html.schema b/piratebox/piratebox/src/redirect.html.schema new file mode 100644 index 0000000..2ce7385 --- /dev/null +++ b/piratebox/piratebox/src/redirect.html.schema @@ -0,0 +1,11 @@ + + Redirect... + + + + + Redirect + + + + From ae0eaeb2ca4edf604e41774fd5f8478c1543b141 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 14 Aug 2013 16:56:04 +0200 Subject: [PATCH 049/183] moved Config entry from timesave to piratebox.conf emptied out the openwrt section in timesave script, which wasn't called anymore Conflicts: piratebox/piratebox/bin/timesave.sh --- piratebox/piratebox/bin/timesave.sh | 1 - piratebox/piratebox/conf/piratebox.conf | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/piratebox/piratebox/bin/timesave.sh b/piratebox/piratebox/bin/timesave.sh index 08f59f9..839af38 100755 --- a/piratebox/piratebox/bin/timesave.sh +++ b/piratebox/piratebox/bin/timesave.sh @@ -32,7 +32,6 @@ fi . $1 -TIMESAVE="$PIRATEBOX_FOLDER/timesave_file" if [ "$2" = "install" ] ; then crontab -l > $PIRATEBOX_FOLDER/tmp/crontab 2> /dev/null diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index 892164b..a4ec328 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -7,6 +7,7 @@ ## 2012-06-08 Changed IP Stuff to generating dnsmasq.conf stuff ## ADDed SubConfig for IPV6 config ## Changed Order of config +## 2013-08-14 Added timesave url ## ######## @@ -114,6 +115,8 @@ IP=$NET.$IP_SHORT #----------------- Configuration for the pure piratebox -------------------# ## droopy, webserver, shoutbox- and forum-server +## Timesave file for non RTC devices +TIMESAVE="$PIRATEBOX_FOLDER/share/timesave_file" #Start droopy? - Enable upload? DROOPY_ENABLED="yes" From 09426f0c8e01a8e57239353e37a70ca804b6d90c Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 26 Aug 2013 09:36:49 +0200 Subject: [PATCH 050/183] update of beta3 changes Conflicts: CHANGELOG --- CHANGELOG | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index c0e81a4..9689a37 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -16,8 +16,13 @@ NOTE: This may only be a partial changelog, check github / your package manager * [Fixed] General cleaning * [Removed] [Testing] Executable, we will stick to service based * [New] possibility in install_piratebox.sh to exchange the hostname easily -* [Fixed] Hide dot files in directory-listing which are usually hidden files * [New] Moved DHCP leasefile into memory on OpenWRT system (/tmp is memory) +* [Fix] Timesave script does not contain parts for OpenWRT anymore +* [Fix] Timesave-file location is now configured in piratebox.conf +* [Fix] Fix in Changing hostname functionality +* [New] Hostname changing generates the redirect.html now based on a Schema file +* [New] Added JSON Mime-Type === v0.6G === * [Fixed] Hide dot files in directory-listing which are usually hidden files + From abc97d1e441d2af01c782963f55611417c530d34 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 12 Sep 2013 20:38:08 +0200 Subject: [PATCH 051/183] Enable unescaped blanks in upload-folder variable Conflicts: CHANGELOG --- CHANGELOG | 1 + piratebox/piratebox/init.d/piratebox | 2 +- piratebox/piratebox/init.d/piratebox_alt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9689a37..193a5c4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -22,6 +22,7 @@ NOTE: This may only be a partial changelog, check github / your package manager * [Fix] Fix in Changing hostname functionality * [New] Hostname changing generates the redirect.html now based on a Schema file * [New] Added JSON Mime-Type +* [Fix] Enable unescaped blanks in Upload-Folder === v0.6G === * [Fixed] Hide dot files in directory-listing which are usually hidden files diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index 34fe08d..f35aeae 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -145,7 +145,7 @@ case "$1" in DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP " fi log_daemon_msg "Starting droopy..." - start-stop-daemon $DROOPY_USER -m --start --background --pidfile $PIDFILE_DROOPY --exec $PIRATEBOX/bin/droopy -- -H $HOST -d $UPLOADFOLDER -c "" -m "$DROOPY_TXT" $DROOPY_USERDIR $DROOPY_PORT + start-stop-daemon $DROOPY_USER -m --start --background --pidfile $PIDFILE_DROOPY --exec $PIRATEBOX/bin/droopy -- -H $HOST -d "$UPLOADFOLDER" -c "" -m "$DROOPY_TXT" $DROOPY_USERDIR $DROOPY_PORT log_end_msg $? fi diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index 2525916..66e2489 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -138,7 +138,7 @@ case "$1" in if [ "$DROOPY_USE_USER" = "yes" ] ; then DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP " fi - start-stop-daemon $DROOPY_USER -m -S -b -p $PIDFILE_DROOPY -x $PIRATEBOX/bin/droopy -- -H $HOST -d $UPLOADFOLDER -m "$DROOPY_TXT" -c "" $DROOPY_USERDIR $DROOPY_PORT + start-stop-daemon $DROOPY_USER -m -S -b -p $PIDFILE_DROOPY -x $PIRATEBOX/bin/droopy -- -H $HOST -d "$UPLOADFOLDER" -m "$DROOPY_TXT" -c "" $DROOPY_USERDIR $DROOPY_PORT echo $? fi From c7f4fc4a7a62eebd4b24f3545e42ed2947c29da2 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 17 Sep 2013 07:25:26 +0200 Subject: [PATCH 052/183] Release 1.0-beta3 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6bc2223..50cc9e2 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME = piratebox-ws -VERSION = 1.0.0_beta2 +VERSION = 1.0.0_beta3 ARCH = all PB_FOLDER=piratebox PB_SRC_FOLDER=$(PB_FOLDER)/$(PB_FOLDER) From 10d185c7bdeddf20a1349aca7c9ecf58d7140f15 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 27 Sep 2013 15:29:56 +0200 Subject: [PATCH 053/183] Fixed captive Portal detection for iOS7 Conflicts: CHANGELOG Conflicts: CHANGELOG --- CHANGELOG | 2 +- piratebox/piratebox/conf/lighttpd/lighttpd.conf | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 193a5c4..b5f4d54 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -26,4 +26,4 @@ NOTE: This may only be a partial changelog, check github / your package manager === v0.6G === * [Fixed] Hide dot files in directory-listing which are usually hidden files - +* [Fix] Fixed captive Portal detection for iOS7 diff --git a/piratebox/piratebox/conf/lighttpd/lighttpd.conf b/piratebox/piratebox/conf/lighttpd/lighttpd.conf index 371ee94..2500b03 100644 --- a/piratebox/piratebox/conf/lighttpd/lighttpd.conf +++ b/piratebox/piratebox/conf/lighttpd/lighttpd.conf @@ -96,4 +96,13 @@ server.error-handler-404 = "/redirect.html" #accesslog.filename = "/opt/piratebox/tmp/access.log" +# Fix for iOS7 +# It ask especially different domains without a specific URL. +# It want to get a "success" message, to allow full system/internet access +$HTTP["useragent"] =~ "CaptiveNetworkSupport" { + server.document-root = "/opt/piratebox/www/library/test/" + index-file.names = ( "success.html" ) + dir-listing.activate = "disable" + server.error-handler-404 = "/success.html" +} From eeeeff850d1cad8d8b52d9f3d1e6daa1d1a9a0bc Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 27 Sep 2013 15:37:14 +0200 Subject: [PATCH 054/183] Release 1.0.0-beta4 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 50cc9e2..0aad71c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME = piratebox-ws -VERSION = 1.0.0_beta3 +VERSION = 1.0.0_beta4 ARCH = all PB_FOLDER=piratebox PB_SRC_FOLDER=$(PB_FOLDER)/$(PB_FOLDER) From 98d1061a8abf5a6a6983ebcbd07cfef37fb227e8 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 10 Nov 2013 11:25:58 +0100 Subject: [PATCH 055/183] deliver sample configuration of minidlna within PirateBox release --- .../piratebox/src/linux.example.minidlna.conf | 17 +++++++++++++++++ .../piratebox/src/openwrt.example.minidlna | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 piratebox/piratebox/src/linux.example.minidlna.conf create mode 100644 piratebox/piratebox/src/openwrt.example.minidlna diff --git a/piratebox/piratebox/src/linux.example.minidlna.conf b/piratebox/piratebox/src/linux.example.minidlna.conf new file mode 100644 index 0000000..a88bb63 --- /dev/null +++ b/piratebox/piratebox/src/linux.example.minidlna.conf @@ -0,0 +1,17 @@ +port=8200 +# Adjust the interfaces u are using +# network_interface=wlan0 +friendly_name=PirateBox DLNA +db_dir=/opt/piratebox/tmp +log_dir=/opt/piratebox/tmp +inotify=yes +enable_tivo=no +strict_dlna=no +album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg +presentation_url=http://piratebox.lan +notify_interval=900 +serial=12345678 +model_number=1 +root_container=B +media_dir=/opt/piratebox/share/Shared + diff --git a/piratebox/piratebox/src/openwrt.example.minidlna b/piratebox/piratebox/src/openwrt.example.minidlna new file mode 100644 index 0000000..d8f25a4 --- /dev/null +++ b/piratebox/piratebox/src/openwrt.example.minidlna @@ -0,0 +1,17 @@ +config minidlna config + option 'enabled' '1' + option port '8200' + option interface 'br-lan' + option friendly_name 'PirateBox DLNA' + option db_dir '/var/run/minidlna' + option log_dir '/var/log' + option inotify '1' + option enable_tivo '0' + option strict_dlna '0' + option presentation_url 'http://piratebox.lan' + option notify_interval '900' + option serial '12345678' + option model_number '1' + option root_container '.' + list media_dir '/mnt/usb/PirateBox/Shared/' + option album_art_names 'Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg' From 0832c317948a068f2fe942b47f6fef1c15b3c04f Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 10 Nov 2013 11:28:56 +0100 Subject: [PATCH 056/183] updated Changelog for mising points --- CHANGELOG | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index b5f4d54..4c5b5b4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -24,6 +24,14 @@ NOTE: This may only be a partial changelog, check github / your package manager * [New] Added JSON Mime-Type * [Fix] Enable unescaped blanks in Upload-Folder +=== 1.0.0 beta4 === + +* [Fix] iOS 7 captive Portal fix + +=== 1.0.0 beta5 === + +* [New] Sample configuration for UPnP Server + === v0.6G === * [Fixed] Hide dot files in directory-listing which are usually hidden files * [Fix] Fixed captive Portal detection for iOS7 From 39371ff7011947ea0f2af84a4724684846bcb724 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 29 Nov 2013 08:57:11 +0100 Subject: [PATCH 057/183] Release 1.0.0-beta5 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0aad71c..915ca79 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME = piratebox-ws -VERSION = 1.0.0_beta4 +VERSION = 1.0.0_beta5 ARCH = all PB_FOLDER=piratebox PB_SRC_FOLDER=$(PB_FOLDER)/$(PB_FOLDER) From f9371903753f41243d0df09b05c26cc83818b5d9 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 16 Jan 2014 22:53:42 +0100 Subject: [PATCH 058/183] Upgrade opt/piratebox image from ext3 to ext4 and 50MB file --- Makefile | 2 +- image_stuff/OpenWRT.img.gz | Bin 23573 -> 0 bytes image_stuff/OpenWRT_ext4_100MB.img.gz | Bin 0 -> 107404 bytes image_stuff/OpenWRT_ext4_50MB.img.gz | Bin 0 -> 54561 bytes 4 files changed, 1 insertion(+), 1 deletion(-) delete mode 100755 image_stuff/OpenWRT.img.gz create mode 100644 image_stuff/OpenWRT_ext4_100MB.img.gz create mode 100644 image_stuff/OpenWRT_ext4_50MB.img.gz diff --git a/Makefile b/Makefile index 915ca79..535e883 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ VERSION_FILE=$(PB_FOLDER)/$(PB_FOLDER)/version IMAGE_FILE=piratebox_ws_1.0_img.gz TGZ_IMAGE_FILE=piratebox_ws_1.0_img.tar.gz -SRC_IMAGE=image_stuff/OpenWRT.img.gz +SRC_IMAGE=image_stuff/OpenWRT_ext4_50MB.img.gz SRC_IMAGE_UNPACKED=image_stuff/piratebox_img MOUNT_POINT=image_stuff/image OPENWRT_FOLDER=image_stuff/openwrt diff --git a/image_stuff/OpenWRT.img.gz b/image_stuff/OpenWRT.img.gz deleted file mode 100755 index be31df89bd2558c41ca67af864564144afdd0ae7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23573 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 GH~n9y*+oA9 diff --git a/image_stuff/OpenWRT_ext4_100MB.img.gz b/image_stuff/OpenWRT_ext4_100MB.img.gz new file mode 100644 index 0000000000000000000000000000000000000000..edc0825a4c3c4f8df8306fb3ac06c6d68548a9f9 GIT binary patch literal 107404 zcmeI*c~n!^x&Uxm^Tn8=?2w1IxqNETM83HQfks$;E8Ax)TdSCW=>;CuFx@%o+zx-pezO%pm z?cd&KpM-VR(JXQDA~b%a<*4|7Pjl13`NI;?EkaqbXI= zo>I97^ZA};xoXRIb9dHwUcH`Tb$a())wG3YzB#sF{`k@_eI8rSymEcvc=gs3=Vsqh zAJ5vdV6R9KAM|E+Y0o*YQW;B78`Ivymf()^n87Fb2&eYRr3-89^!WBTN!cBcps(*u zwJRAoYG62cX?*AuHNdycD~Znb4{v+GTw_-vs~_=?if$67rHWJII>ytJmu@WHP)t1- zK6JU9RaX!?)alZ$iYjEOBSYC^`I6ZD$aas)^!v7&!(N3$ngoZTn^j@M_s9H?(s0Ym2i0C@J^M2+?H}y&lr|D=}`Y=^_=+!_+aK>eC zH(Pfm|ILgfv(kH?W`wKv2pzUsPs8|4(!Q{5g`eWe-&l{OBbjloq_Xw=$93wvSF5=6 zSJDLfsB29BMXX_`Wh|~=*%?hL+sc={IN64O!F624^&<<0&&?3vO9mO+No5|fSjzB( zMvkb8K2jp;i=+w3>@0a@M}BSf&PF#OWz^XWkCof6rF4pH|RbzfP=s$bu(t=(zsN~@h(#|x^&3h@R}TYu)-=*1?cdvjBw#Fna4lgcgZ zSJ!V`Jis3?wJyTC`UZMe8r_<@ptB z)*0n-ZA7kRq2mclYiGaDIcDg0X$?vkf)aM2G)*W?BueA`m9DYxA=IP@HF@Tu>#q^@ z;v0z$EIodT)AtWf?`ts;Uam`C(uKkl6z)mVb<>8xrEQ2=jws3{sI>;! z7thhzm*Xfr0fo)%bbTu>qsj|V-^D0-{19rrj%aPKYh5yc!cnNS7PNdE_v?72uTYqa z^y52G>ue%91tq_a!bzw#`LvG3agQ!}1Ti^PNX;=+7nVvKqi`b zMJEEvLo;7%rsHizOIu2uN;G2>K7gvgP!&R=3YIRs9CdAkdT~T&gVYB#jw8Zxy2cSg zRHFbvX0FshDq4v!>L$}x7cLPZfDsgy|8qBad*-)>>AI0lLRDCs=tdY{hgxef>O3S>QY9(Kw&ZwMtf|u0)@*^`2U9vUq{Q9jI$6+AkD0 zi7;AfRHULfiNZ7lov{p|z1CIsI*&+>_6x-Y)LMvIvx#kB1Wl7A8W=kORZg7eUMP7b zv3iM%r!_Hdw24UbQF1yu`PC{^Zx$*o46XePg5@a@CQ3u6x0H;Mx1-b2f!JAOsI`P> z%|QdxN3DZU-&%B8l)4aMq^3pJMd@{v{5F~~&I&XowP=VmB1~NPh&(;0n@Y6(IiRb! zG?fUWOP6{SB@aVWf>a_N5mBORw5vrE+q#m-jrMIdad9DbH6sMzkM{p)De7h(%9Dx? z)J7oZTS$tEra>En!q!A&bPMPoL`R)r}LK7Y^#`#%e=Kubq%PriZ2~Y0FtLMG{-nbAq6!-3;9*EYL zc4zE$p^aHi)+>LiR2k}N6e>fOfXAs)4s`9pwO4N27SrhXCofI8g}9!c-V$HMKa_cP zYR;j*(vGY&G~l+b2(!ku$ri;=BGy;nN3!$GN`;z1{D&Q_BW%NR3B_Y@#(zb(zIqK|Gjr@dxfrp^KMMP&S=>E9|qBRM4TINE@iKX$u6>H=# zZsJ-s*}?8$_YQdo6}w(M)M0ih@<2`M^=88qzuS!4fK?}-R zDe}P{WBm*dzAJwpe>*>xzn;H`zm*@w_uz-}{rPOZ6F-2zX%6-fn~&vU>GkA1<_23g z$;Hr&wk6`Zg1A^Nqehm2waWZ4foMEO?k-6UO=+XD)~fExoUrHEYV4>eA;-|Y*uB`T zm}Yj~(ShZxs+MiSvPGu#rlR!vsvL42*WE1D(UJ8H-_72d6{yOQJ;J=|mDml;OO(ee zWyp_79wio71G*&s#wnQQgzFgU^_&`yfB)f zTYGZFN{R!^JJwk>D5GG>Se!`ClhCL?ky1$M>}3VApJnT?1Q9o)9)dQIumMSXDp}SX}XH)#nu`MX8G<#G9 zvKEY4FUig0<>j@zRc30f3WG-GpvJ8YffxwZL4kOt3&;C-|$tMzb^4N0lcNV)XhN(c=2bT<=_tTcK;A zN8yG-_d+*3!#{JWyMB}A)vHhb-HQ+MfdB}A00@8p2!H?xfB*=900@AW0Az#@A5a>RQ`SQ$-%Xqk)^>} z1!EQeXtLpin*n!<@v+O#E5@qx%Y(J*)L4c^@@dyPrOOS&^|o_j{FhwJWZBOYZ|mGp z5Ug!0Gp#%A^8C%W8rAm}{QJo%(bJ3O2&y=n#WMYguwFm_1V8`;KmY_l00ck)1V8`; zKmY_l00ck)1V8`;KmY_l00ck)1VG>;5qN177jFK()=s>6@-OfL0T2KI5C8!X009sH z0T2KI5C8!X009sH0T2KI5C8!X009sH0T2KI5C8!X_}B#&^*0DYW<<=^A8KEf@ zP8CYGvOiH`cc{)ue5d5ayd#$=i5ic8nN}l~XOvAXC4VHhLO_{+P637CcJGdksPpwV&UrlDjm2LN5|B4W z-9E$ge)}whr8y0u!ub9{W|us+vAuMC=hj8Mvo{@9{#5U4)$VcH+B(Bdqj^=6{j|_1 zFDa}}_()~DIj%z3UXp1R8#y*AIA)Z}@eQNY21>3_{d$-U)ZN!w$tH`N-t6(HWOYn^ zLt5?k%l__?zprwQI6C;FNzz8HRo4Ux?XD-g)2DP~-wBfwJ&GRZo+U$)hklQC^riGh zxkQ}{yuT|?7^fmz9IYETxw+=s5!?2jx`ESo-oBff_^fyATSxCx-CXy^tQIrnvf0KD zRpViXZ_-1!<&P7)g{-~KwsU+6XQgvw&EGS2CifI&DVy@{zkLEiMnht^q@rb(*m+mc zriQ|4w%O#_K1oKK%9=Q8m!fI-+CS&|fKh`02!H?xfB*=900@8p2!H?xfB*=900@8p z2!H?xfB*=900@8p2>dAp6c0!yli!bAS-JYi$9_8q)DHq600JNY0w4eaAOHd&00JNY z0w4eaAOHd&00JNY0w4eaAOHd&00JNY0wD0q6!IZSv$M&=Pt?o<^)+rGcPd(p5>1_b zFY$XXhi>=n|I+FABjzRKnN|wR$)4eR;b{tg%3DT0ut95&b{8p1&hqY9@5WNZ{OYXoX4M#EbPisc8H$!8mxEx{I}zE zZQ7Qj+sB(N3Wu|lBlI_Qr=3?X`nJcc)N!^rxHG0Gm_3HQdn|(G+s7irNur!>Nj~{T zqkZd6_Zqltef@32J{bw$bVx*<{((&#lmh}F00JNY0w4eaAOHd&00JNY0w4eaAOHd& z00JNY0w4eaAOHd&00JMdfa1XolQg}_6P@&&6|GaO?mp>ta=i69dF6`YPeoz(=J&7N zIJ4oqC!YuXcd4J<2RsZY?IRappYbAJvh-c-P*gH<>)}3vLi>>q49W)q z5C8!X009sH0T2KI5C8!X009sH0T2KI5C8!X009sH0T2KI5CDOXLck#EO=9 z^U~Phh~l{PQY#&44!t5`B_k+Xm0jC1iK(cpComy!<+Pi+PaZ1(**VpXFP@CcM?KaeL#sdD$ z>a*MH)B+|s%b0upS)yw6%6dkE#bW8)eXC-*_*Fh;_Rs$;6^9MEE*l7#AKmY_l z00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1U`0wW9fY6fw=}9 zdfKwpSQl^A_V$6q2L^MOdiXKEw_UO{>ZEzF)AUx;DYMiwCN3SxU~?!i zjqUNg>`MJ8OWUncSEof58X5WfDkHL$c8LOgoH5Y8Y5W||QyzYOSICYvn%bw_T|=(+3`T@)Xz3P?NB)DsnF5%RH)T(&Q=?aM4Z(7&?00si_NZ*90w4eaAOHd&00JNY0w4eaAOHd&00JNY0w4ea zAOHd&00JNY0w4eaAn-2&$0&Bw-`}b*%sDXeUt;hP1V8`;KmY_l00ck)1V8`;KmY_l z00ck)1V8`;KmY_l00ck)1V8`;KmY_l;NufW8GHHDyL$oF{*E_hEQ5!@f4GlufXYAs m1V8`;KmY_l00ck)1V8`;KmY_j6oI>QRi3j3-u^x1FaHCTS;0jB literal 0 HcmV?d00001 diff --git a/image_stuff/OpenWRT_ext4_50MB.img.gz b/image_stuff/OpenWRT_ext4_50MB.img.gz new file mode 100644 index 0000000000000000000000000000000000000000..61a50cff2cd1520ab05d1aec4d5d7b295dacff6d GIT binary patch literal 54561 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 r-hVB^ud3?7L!W=D4Dj3_00JNY0w4eaAn Date: Fri, 17 Jan 2014 16:35:15 +0100 Subject: [PATCH 059/183] First bunch of license headers and overworked documentations --- LICENSE | 674 ++++++++++++++++++ piratebox/install.sh | 1 + piratebox/piratebox/bin/delete_empty.sh | 5 + .../bin/distribute_file_into_directory.sh | 5 +- piratebox/piratebox/bin/distribute_files.sh | 4 + piratebox/readme.txt | 77 +- 6 files changed, 690 insertions(+), 76 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5a89860 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ +GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. {http://fsf.org/} + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see {http://www.gnu.org/licenses/}. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + LibraryBox-core Copyright (C) 2013 LibraryBox Development + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +{http://www.gnu.org/licenses/}. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +{http://www.gnu.org/philosophy/why-not-lgpl.html}. diff --git a/piratebox/install.sh b/piratebox/install.sh index 5cc6936..739b08f 100755 --- a/piratebox/install.sh +++ b/piratebox/install.sh @@ -15,6 +15,7 @@ # COMPANY: --- # CREATED: 02.02.2013 19:50:34 MST # REVISION: 0.3.1 +# LICENCE: (c) Cale Black, 2013 GPL-3 #======================================================================= #Import PirateBox conf CURRENT_CONF=piratebox/conf/piratebox.conf diff --git a/piratebox/piratebox/bin/delete_empty.sh b/piratebox/piratebox/bin/delete_empty.sh index 1cb1b55..70d5740 100755 --- a/piratebox/piratebox/bin/delete_empty.sh +++ b/piratebox/piratebox/bin/delete_empty.sh @@ -1,5 +1,10 @@ #!/bin/sh +# Matthias Strubel (c) 2014 - GPL3 +# matthias.strubel@aod-rpg.de +# +# This script deletes 0 Byte files + IFS=' ' diff --git a/piratebox/piratebox/bin/distribute_file_into_directory.sh b/piratebox/piratebox/bin/distribute_file_into_directory.sh index 746b648..e982c30 100755 --- a/piratebox/piratebox/bin/distribute_file_into_directory.sh +++ b/piratebox/piratebox/bin/distribute_file_into_directory.sh @@ -1,6 +1,9 @@ #!/bin/sh -# The following script is used to distribute a specific file into directoried of the givien folder +# Matthias Strubel (c) 2014 - GPL3 +# matthias.strubel@aod-rpg.de +# +# The following script is used to distribute a specific file into directories of the givien folder directory=$1 src_file=$2 diff --git a/piratebox/piratebox/bin/distribute_files.sh b/piratebox/piratebox/bin/distribute_files.sh index 20530e5..5809e43 100755 --- a/piratebox/piratebox/bin/distribute_files.sh +++ b/piratebox/piratebox/bin/distribute_files.sh @@ -1,5 +1,9 @@ #!/bin/sh + +# Matthias Strubel (c) 2014 - GPL3 +# matthias.strubel@aod-rpg.de +# # This script distributes a set of files into $1 folder #Script for single stuff diff --git a/piratebox/readme.txt b/piratebox/readme.txt index 06b1a73..d33c9f7 100755 --- a/piratebox/readme.txt +++ b/piratebox/readme.txt @@ -1,77 +1,4 @@ ## Piratebox for laptop (eeePc) script collection WITH LIGHTTPD -## created by Matthias Strubel (matthias.strubel@aod-rpg.de) 2011-03-19 -## licenced by gpl ;; please feel for improvements or feedback :) -## Changes: -## 2011-03-19 First concept release with shoutbox left in python and droopy in perl -## 2011-08-04 Image-Board integration +## created by Matthias Strubel (matthias.strubel@aod-rpg.de) 2014-01-17 +## licenced by GPL-3 ;; please feel for improvements or feedback :) ## - - -####### OLD ########### - - -What to do? / Install ---------------------- - > Install debian - > Install following Packages: - - Perl - # apt-get install perl - - lighttpd - # apt-get install lighttpd - - if needed : hostapn and/or dnsmasq - # apt-get install hostapn - # apt-get install dnsmasq - - > copy over the piratebox folder into /opt/ (as root) - # sudo mkdir /opt - # sudo cp -rv piratebox /opt - > create a symlink /opt/piratebox/init.d/piratebox /etc/init.d/ - # sudo ln -s /opt/piratebox/init.d/piratebox /etc/init.d/piratebox - > add piratebox to you runlevel (optional) - # sudo update-rc.d piratebox defaults - > create a link from your share-device to /opt/piratebox/share - # sudo ln -s /mnt/usbstick /opt/piratebox/share - > define your personall options in - # /opt/piratebox/conf/piratebox.conf # Start which services, IPs etc - # /opt/piratebox/conf/hostapd.conf # Some stuff about beeing an APN - - > Now please mount your usb-stick, share drive .. - - > Run the follow script - # /opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf part2 - - > If you want to install kareha, please do the following steps: - # /opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf imageboard - >> This step installs a basic configuration for the board... - >> Edit /opt/piratebox/share/board/config.pl and change ADMIN_PASS and SECRET - -I created -/opt/piratebox/bin - Binarys and Scripts -/opt/piratebox/conf - Piratebox related configs (seperated from the normal system-configs!) -/opt/piratebox/share - Mountpoint (with the first start of piratebox, the correct permissions will be set) -/opt/piratebox/share/Shared - Unsorted upload folder -/opt/piratebox/share/board - imageboard location -/opt/piratebox/init.d - the init-script (later more?) -/opt/piratebox/www - Webfolder with cgi-scripts and static html pages -/opt/piratebox/tmp - Folder with the error-log - - - - -Change directory? -------------------- -If you decide not to run piratebox under /opt you have to change following scripts: -piratebox/conf/piratebox.conf -piratebox/init.d/piratebox -piratebox/conf/lighttpd/lighttpd.conf - - -Seperate Runlevel ------------------ -I'm using the piratebox on another runlevel, because I don't want to use it on daily work. So do not use the above update-rc.d command if you don't intend to start it always. -If you want to use it on another runlevel you can use - # update-rc.d piratebox enable 4 -and disable other services, you don't need - i.e. # update-rc.d acpid disable 4 -These examples are for debian based distributions. - From 898e98e55f620df92e58f90496e9c9863730cfe5 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 17 Jan 2014 16:37:23 +0100 Subject: [PATCH 060/183] enable / disable file copy into share folder via config --- CHANGELOG | 2 ++ piratebox/piratebox/conf/piratebox.conf | 3 +++ piratebox/piratebox/init.d/piratebox | 6 ++++-- piratebox/piratebox/init.d/piratebox_alt | 7 +++++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 4c5b5b4..4842906 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ CHANGELOG +=== 1.1.0 === +* Enable / Disable file provisioning for custom lighttpd directory listing === 1.0.0 === NOTE: This may only be a partial changelog, check github / your package manager for more info. diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index a4ec328..a89d45a 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -144,6 +144,9 @@ RESET_CHAT="yes" #Inititiation Chat-Message CHATMSG="
00:00:00 PirateBox: Chat and share files anonymously!
" +#Provide files needed for PirateBox custom dirlisting +CUSTOM_DIRLIST_COPY="yes" + #Activate Global chat # Still experimentall! GLOBAL_CHAT="no" diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index f35aeae..bb568cc 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -83,8 +83,10 @@ case "$1" in echo "Empty tmp folder" find $PIRATEBOX/tmp/ -exec rm {} \; - echo "Copy over design files" - $PIRATEBOX/bin/distribute_files.sh $SHARE_FOLDER/Shared + if [ "$CUSTOM_DIRLIST_COPY" = "yes" ]; then + echo "Copy over design files" + $PIRATEBOX/bin/distribute_files.sh $SHARE_FOLDER/Shared + fi if [ "$DO_IW" = "yes" ] ; then log_daemon_msg " Setting up Interface (iw) " diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index 66e2489..62bd6b7 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -74,8 +74,11 @@ case "$1" in echo "Empty tmp folder" find $PIRATEBOX/tmp/ -exec rm {} \; - echo "Copy over design files" - $PIRATEBOX/bin/distribute_files.sh $SHARE_FOLDER/Shared + + if [ "$CUSTOM_DIRLIST_COPY" = "yes" ]; then + echo "Copy over design files" + $PIRATEBOX/bin/distribute_files.sh $SHARE_FOLDER/Shared + fi From f6429cd24167f149b2d43de43500e88ac49780ed Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 17 Jan 2014 16:41:48 +0100 Subject: [PATCH 061/183] move chat message to extra config file --- CHANGELOG | 3 ++- piratebox/piratebox/bin/shoutbox_stuff.sh | 2 +- piratebox/piratebox/conf/chat_init.txt | 1 + piratebox/piratebox/conf/piratebox.conf | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 piratebox/piratebox/conf/chat_init.txt diff --git a/CHANGELOG b/CHANGELOG index 4842906..bb84c56 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,8 @@ CHANGELOG === 1.1.0 === -* Enable / Disable file provisioning for custom lighttpd directory listing +* [New] Enable / Disable file provisioning for custom lighttpd directory listing +* [New] ChatBox message is now in conf/chat_init.txt === 1.0.0 === NOTE: This may only be a partial changelog, check github / your package manager for more info. diff --git a/piratebox/piratebox/bin/shoutbox_stuff.sh b/piratebox/piratebox/bin/shoutbox_stuff.sh index 8bf5f5a..248a984 100755 --- a/piratebox/piratebox/bin/shoutbox_stuff.sh +++ b/piratebox/piratebox/bin/shoutbox_stuff.sh @@ -22,7 +22,7 @@ export SHOUTBOX_GEN_HTMLFILE=$GEN_CHATFILE #Writing init-message and reset chat.. if [ "$RESET_CHAT" = "yes" ] ; then - echo $CHATMSG > $CHATFILE + cat $PIRATEBOX_FOLDER/conf/chat_init.txt > $CHATFILE fi #Generate content file diff --git a/piratebox/piratebox/conf/chat_init.txt b/piratebox/piratebox/conf/chat_init.txt new file mode 100644 index 0000000..84b0ac0 --- /dev/null +++ b/piratebox/piratebox/conf/chat_init.txt @@ -0,0 +1 @@ +
00:00:00 PirateBox: Chat and share files anonymously!
diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index a89d45a..e76e2bd 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -142,7 +142,7 @@ GEN_CHATFILE="$WWW_FOLDER/chat_content.html" RESET_CHAT="yes" #Inititiation Chat-Message -CHATMSG="
00:00:00 PirateBox: Chat and share files anonymously!
" +### This option was removed, you can find the chat message in conf/chat_init.txt #Provide files needed for PirateBox custom dirlisting CUSTOM_DIRLIST_COPY="yes" From 4a344ec7207e25bf16bbe4033416cb43f4cb6357 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 17 Jan 2014 16:47:47 +0100 Subject: [PATCH 062/183] 2nd bunch of license headers --- piratebox/piratebox/bin/generate_config_files.sh | 8 ++++---- piratebox/piratebox/bin/install_piratebox.sh | 10 ++-------- piratebox/piratebox/bin/piratebox_setup_wlan.sh | 4 ++-- piratebox/piratebox/bin/shoutbox_daemon.sh | 4 ++-- piratebox/piratebox/bin/shoutbox_stuff.sh | 2 +- piratebox/piratebox/bin/station_cnt.sh | 3 +++ piratebox/piratebox/bin/timesave.sh | 2 +- 7 files changed, 15 insertions(+), 18 deletions(-) diff --git a/piratebox/piratebox/bin/generate_config_files.sh b/piratebox/piratebox/bin/generate_config_files.sh index 52e4aa9..17e9bd3 100755 --- a/piratebox/piratebox/bin/generate_config_files.sh +++ b/piratebox/piratebox/bin/generate_config_files.sh @@ -1,10 +1,14 @@ #!/bin/sh +# Matthias Strubel (c) 2013-2014 +# licenced with GPL-3 +# # Generate severall configuration files out of piratebox.conf # conf/hosts_generated # conf/dnsmasq_generated.conf # conf/radvd_generated.conf # conf/lighttpd/env +# conf/hosts_mesh # # There are files for default configuration or adding custom stuff: # conf/hosts @@ -25,10 +29,6 @@ # PIRATEBOX = PirateBox Folder # CHATFILE = data store for Shoutbox-content # -# -# Matthias Strubel -- 08.06.2012 -# licenced with GPL-3 - CONFIG_PATH="conf" DNSMASQ_CONFIG="" HOSTS_CONFIG="" diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh index 99cd59b..81624a4 100755 --- a/piratebox/piratebox/bin/install_piratebox.sh +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -1,14 +1,8 @@ #!/bin/sh -## PirateBox installer script v.01 -## created by Matthias Strubel 2011-08-04 +## PirateBox installer script +## created by Matthias Strubel (c)2011-2014 GPL-3 ## -## ASH does not support arrays, so no nice foreach -# All Perl packages for kareha -##OPENWRT_PACKAGES_IMAGEBOARD=( perl perlbase-base perlbase-cgi perlbase-essential perlbase-file perlbase-bytes perlbase-config perlbase-data perlbase-db-file perlbase-digest perlbase-encode perlbase-encoding perlbase-fcntl perlbase-gdbm-file perlbase-integer perlbase-socket perlbase-unicode perlbase-utf8 perlbase-xsloader ) - - - # Load configfile if [ -z $1 ] || [ -z $2 ]; then diff --git a/piratebox/piratebox/bin/piratebox_setup_wlan.sh b/piratebox/piratebox/bin/piratebox_setup_wlan.sh index dc89f08..581a192 100755 --- a/piratebox/piratebox/bin/piratebox_setup_wlan.sh +++ b/piratebox/piratebox/bin/piratebox_setup_wlan.sh @@ -1,10 +1,10 @@ #!/bin/bash -# Author: Matthias Strubel / Feb. 2011 +# Author: Matthias Strubel (c) 2011-2014 GPL-3 # Script for setting up the wlan interface # Parameter 1 i used for the config file providing the parameters -# IP-Adress +# IP-Adress IPv4 + IPv6 # Netmask # Interface diff --git a/piratebox/piratebox/bin/shoutbox_daemon.sh b/piratebox/piratebox/bin/shoutbox_daemon.sh index a6fb83d..68b758e 100755 --- a/piratebox/piratebox/bin/shoutbox_daemon.sh +++ b/piratebox/piratebox/bin/shoutbox_daemon.sh @@ -3,8 +3,8 @@ # Starts deamon for global shoutbox service # requires piratebox.conf as first parameter # -# Matthias Strubel - 2012 -# Licenced with GPL +# Matthias Strubel - 2012-2014 +# Licenced with GPL-3 . $1 diff --git a/piratebox/piratebox/bin/shoutbox_stuff.sh b/piratebox/piratebox/bin/shoutbox_stuff.sh index 8bf5f5a..db56c0f 100755 --- a/piratebox/piratebox/bin/shoutbox_stuff.sh +++ b/piratebox/piratebox/bin/shoutbox_stuff.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Matthias Strubel - 2012-09-15 +# Matthias Strubel - (c)2012-2014 with GPL-3 # # Only calls generate-Routing in piratebox-folder # gets Piratebox-Folder into www diff --git a/piratebox/piratebox/bin/station_cnt.sh b/piratebox/piratebox/bin/station_cnt.sh index 3135df2..652714b 100755 --- a/piratebox/piratebox/bin/station_cnt.sh +++ b/piratebox/piratebox/bin/station_cnt.sh @@ -1,4 +1,7 @@ #!/bin/sh + +## By Matthias Strubel , Licenced by GPL-3 (c)2012-2014 + CNT=`iw wlan0 station dump | grep Station | wc -l` #DATE=`date` #echo $DATE - $CNT diff --git a/piratebox/piratebox/bin/timesave.sh b/piratebox/piratebox/bin/timesave.sh index 839af38..01d307f 100755 --- a/piratebox/piratebox/bin/timesave.sh +++ b/piratebox/piratebox/bin/timesave.sh @@ -8,7 +8,7 @@ # gives a sort of stability to complete standalone # systems. # -# Licenced under GPL-2 @ 2012 +# Licenced under GPL-3 @ 2012-2014 # Matthias Strubel matthias.strubel@aod-rgp.de ##function for similar saving & getting time From 01d10be31eb7cfedee5e7d20df5292993ca4efac Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 17 Jan 2014 16:52:26 +0100 Subject: [PATCH 063/183] 3rd bunch of license headers --- piratebox/piratebox/conf/piratebox.conf | 12 +++--------- piratebox/piratebox/python_lib/broadcast.py | 2 +- piratebox/piratebox/python_lib/discover.py | 3 +++ piratebox/piratebox/python_lib/messages.py | 2 ++ piratebox/piratebox/python_lib/psogen.py | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index a4ec328..38674ef 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -1,14 +1,8 @@ ######### ## Config for pirate-box WWW Release -## written by Matthias Strubel (matthias.strubel@aod-rpg.de) 2011-02-22 -## licenced by gpl ; feel free to improve or send me feedback +## written by Matthias Strubel (matthias.strubel@aod-rpg.de) (c)2011-2014 +## licenced by GPL-3 ; feel free to improve or send me feedback ## -## 2012-04-12 Created -## 2012-06-08 Changed IP Stuff to generating dnsmasq.conf stuff -## ADDed SubConfig for IPV6 config -## Changed Order of config -## 2013-08-14 Added timesave url -## ######## ####### @@ -20,7 +14,7 @@ ## Set DO_IFCONFIG , USE_APN, USE_DNSMASQ to no ## Configure your ethernet eth0 (or whatever) to a static IP ## force your router to publish the HOST Option with your static IP; in case of dnsmasq add the /etc/hosts entrys -## Have a look at http://wiki.daviddarts.com/piratebox for futher instructions +## Have a look at http://www.piratebox.cc for futher instructions ## ## You may deactivated severall option as needed. It's flexible. diff --git a/piratebox/piratebox/python_lib/broadcast.py b/piratebox/piratebox/python_lib/broadcast.py index e2916f2..7517b53 100644 --- a/piratebox/piratebox/python_lib/broadcast.py +++ b/piratebox/piratebox/python_lib/broadcast.py @@ -1,4 +1,4 @@ -# PirateBox send Message lib +# PirateBox send Message lib (C)2012-2014 # modified by Matthias Strubel # # Original Version by diff --git a/piratebox/piratebox/python_lib/discover.py b/piratebox/piratebox/python_lib/discover.py index 4cdee2f..eba7427 100644 --- a/piratebox/piratebox/python_lib/discover.py +++ b/piratebox/piratebox/python_lib/discover.py @@ -1,3 +1,6 @@ +# PirateBox Message broadcasting lib (C)2012-2014 +# Matthias Strubel + import SocketServer import socket import sys diff --git a/piratebox/piratebox/python_lib/messages.py b/piratebox/piratebox/python_lib/messages.py index dae0843..ab0dd33 100644 --- a/piratebox/piratebox/python_lib/messages.py +++ b/piratebox/piratebox/python_lib/messages.py @@ -1,3 +1,5 @@ +# PirateBox Message lib (C)2012-2014 +# Matthias Strubel import string import socket diff --git a/piratebox/piratebox/python_lib/psogen.py b/piratebox/piratebox/python_lib/psogen.py index 70911f5..1c102a4 100755 --- a/piratebox/piratebox/python_lib/psogen.py +++ b/piratebox/piratebox/python_lib/psogen.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Modificated ShoutBox Library +# Modificated ShoutBox Library (C)2013-2014 # enables further modifications for the ShoutBox # Run without to generate htmlfile # Run the following to enter a new line from command line From 41f9bb4ffdf041561549e2a5e40982cf1e3f0a0e Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 17 Jan 2014 17:13:50 +0100 Subject: [PATCH 064/183] first version of json generation transfered from LibraryBox 2.0 --- piratebox/piratebox/bin/json_generation.sh | 46 ++++++++++++++++++++++ piratebox/piratebox/conf/json.conf | 9 +++++ piratebox/piratebox/conf/piratebox.conf | 4 ++ piratebox/piratebox/init.d/piratebox | 4 ++ piratebox/piratebox/init.d/piratebox_alt | 4 +- piratebox/piratebox/lib/json_func.sh | 12 ++++++ 6 files changed, 78 insertions(+), 1 deletion(-) create mode 100755 piratebox/piratebox/bin/json_generation.sh create mode 100644 piratebox/piratebox/conf/json.conf create mode 100755 piratebox/piratebox/lib/json_func.sh diff --git a/piratebox/piratebox/bin/json_generation.sh b/piratebox/piratebox/bin/json_generation.sh new file mode 100755 index 0000000..4cea13c --- /dev/null +++ b/piratebox/piratebox/bin/json_generation.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# Matthias Strubel (c) 2013 - GPL3 +# Generate a JSON file, which relfects some part of the current configuration + +# First parameter is the piratebox.conf +### Used parameter : JSON_FILE + +. $1 + +# json.conf contains some information about modules on the frontend +. $PIRATEBOX_FOLDER/conf/json.conf + +### JSON convert functions +. $PIRATEBOX_FOLDER/lib/json_func.sh + +JSON_FILE=$PBX_JSON_FILE + +#### +# DROOPY_ENABLED => upload_droopy +# DROOPY_PORT => droopy_port +# HOST => droopy_host + +json_droopy_enabled=`convert_yn_to_tf $DROOPY_ENABLED` +json_shoutbox_enabled=`convert_yn_to_tf $SHOUTBOX_ENABLED` + +echo "Generating json configuration file: $JSON_FILE" + +echo "" > $PBX_JSON_FILE +echo "{ \"piratebox\" : { \"module\" : { " >> $JSON_FILE +#------------ upload configuration +echo -n " \"upload\" : { \"status\" : $json_droopy_enabled , \"file\" : \"$UPLOAD_MODULE_FILE\" " >> $JSON_FILE +#----------- droopy specialities +if [ "$DROOPY_ENABLED" == "yes" ] ; then + echo -n ", " >> $JSON_FILE + echo -n " \"upload_style\" : \"droopy\" , " >> $JSON_FILE + echo -n " \"droopy_port\" : \"$DROOPY_PORT\", \"droopy_host\" : \"$HOST\" " >> $JSON_FILE +fi +echo " } " >> $JSON_FILE + +#--------------- Shoutbox config file +echo ", \"shoutbox\" : { \"status\" : $json_shoutbox_enabled , \"file\" : \"$CHAT_MODULE_FILE\" } " >> $JSON_FILE + +#--------------- + echo ", \"version\" : \""$(cat $PIRATEBOX_FOLDER/version )"\" >> $JSON_FILE +echo " } } }" >> $JSON_FILE diff --git a/piratebox/piratebox/conf/json.conf b/piratebox/piratebox/conf/json.conf new file mode 100644 index 0000000..d0ceb9d --- /dev/null +++ b/piratebox/piratebox/conf/json.conf @@ -0,0 +1,9 @@ +#!/bin/sh +### +# This file contains some valid informations for the content +## + + +CHAT_MODULE_FILE="modules/chat.html" +UPLOAD_MODULE_FILE="modules/upload.html" + diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index e76e2bd..fe06c80 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -147,6 +147,10 @@ RESET_CHAT="yes" #Provide files needed for PirateBox custom dirlisting CUSTOM_DIRLIST_COPY="yes" +#Generate config json for frontend +PBX_JSON_GENERATION="yes" +PBX_JSON_FILE="$WWW_FOLDER/piratebox_config.json" + #Activate Global chat # Still experimentall! GLOBAL_CHAT="no" diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index bb568cc..6cc0555 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -88,6 +88,10 @@ case "$1" in $PIRATEBOX/bin/distribute_files.sh $SHARE_FOLDER/Shared fi + if [ "$PBX_JSON_GENERATION" = "yes" ]; then + $PIRATEBOX_FOLDER/bin/json_generation.sh $CONF + fi + if [ "$DO_IW" = "yes" ] ; then log_daemon_msg " Setting up Interface (iw) " iw $PHY_IF interface add $INTERFACE type managed diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index 62bd6b7..d1031ee 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -80,7 +80,9 @@ case "$1" in $PIRATEBOX/bin/distribute_files.sh $SHARE_FOLDER/Shared fi - + if [ "$PBX_JSON_GENERATION" = "yes" ]; then + $PIRATEBOX_FOLDER/bin/json_generation.sh $CONF + fi if [ "$DO_IW" = "yes" ] ; then log_daemon_msg " Setting up Interface (iw) " diff --git a/piratebox/piratebox/lib/json_func.sh b/piratebox/piratebox/lib/json_func.sh new file mode 100755 index 0000000..968e7f0 --- /dev/null +++ b/piratebox/piratebox/lib/json_func.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Matthias Strubel (c) 2013 - GPL3 + +convert_yn_to_tf(){ + local value=$1 ; shift + if [ "$value" == "yes" ] ; then + echo "true" + else + echo "false" + fi +} From 696917d50da95878f4ac84e77d99c5a6edd8540a Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 17 Jan 2014 17:28:05 +0100 Subject: [PATCH 065/183] added configuration for fast-cgi server running php-cgi daemon forked by lighttpd --- piratebox/piratebox/conf/lighttpd/fastcgi.conf | 11 +++++++++++ piratebox/piratebox/conf/lighttpd/lighttpd.conf | 1 + 2 files changed, 12 insertions(+) create mode 100644 piratebox/piratebox/conf/lighttpd/fastcgi.conf diff --git a/piratebox/piratebox/conf/lighttpd/fastcgi.conf b/piratebox/piratebox/conf/lighttpd/fastcgi.conf new file mode 100644 index 0000000..ce6866b --- /dev/null +++ b/piratebox/piratebox/conf/lighttpd/fastcgi.conf @@ -0,0 +1,11 @@ +#-------------------- FAST CGI stuff + +server.modules += ( "mod_fastcgi" ) +fastcgi.server = ( + ".php" => (( + "bin-path" => "/usr/bin/php-cgi", + "socket" => "/tmp/php.socket", + "max-procs" => 1 + )) +) + diff --git a/piratebox/piratebox/conf/lighttpd/lighttpd.conf b/piratebox/piratebox/conf/lighttpd/lighttpd.conf index 2500b03..43d5a51 100644 --- a/piratebox/piratebox/conf/lighttpd/lighttpd.conf +++ b/piratebox/piratebox/conf/lighttpd/lighttpd.conf @@ -106,3 +106,4 @@ $HTTP["useragent"] =~ "CaptiveNetworkSupport" { server.error-handler-404 = "/success.html" } +include "/opt/piratebox/conf/lighttpd/fastcgi.conf From 31d025de4b7ff4e0ff1029a71d1f145dd8126975 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 17 Jan 2014 17:37:57 +0100 Subject: [PATCH 066/183] toggle shoutbox read-writable --- piratebox/piratebox/bin/shoutbox_stuff.sh | 7 +++++++ piratebox/piratebox/conf/piratebox.conf | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/piratebox/piratebox/bin/shoutbox_stuff.sh b/piratebox/piratebox/bin/shoutbox_stuff.sh index 248a984..3e7ab88 100755 --- a/piratebox/piratebox/bin/shoutbox_stuff.sh +++ b/piratebox/piratebox/bin/shoutbox_stuff.sh @@ -28,6 +28,13 @@ fi #Generate content file python psogen.py generate +if [ "$SHOUTBOX_ENABLED" = "no" ] ; then + # If the shoutbox is disabled, we remove the writable flag + echo -n "Making shoutbox readonly..." + chmod a-w $CHATFILE + echo "done" +fi + #Set correct permissions chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $SHOUTBOX_CHATFILE chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $SHOUTBOX_GEN_HTMLFILE diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index e76e2bd..57024a7 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -141,6 +141,12 @@ GEN_CHATFILE="$WWW_FOLDER/chat_content.html" # Reset Shoutbox on Startup? RESET_CHAT="yes" +### Shoutbox is enabled. +# When you set this option to "no", then the shoutbox file is not writable anymore +# and in the json file the module is disabled. You should adjust the chat_init.txt +# to make clear, that the box is not working anymore. +SHOUTBOX_ENABLED="yes" + #Inititiation Chat-Message ### This option was removed, you can find the chat message in conf/chat_init.txt From 6f747bf6e44f642ac99d7aef91574331a2c0034b Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 2 Apr 2014 18:52:01 +0200 Subject: [PATCH 067/183] Ensure Shoutbox File is always writable --- piratebox/piratebox/bin/shoutbox_stuff.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piratebox/piratebox/bin/shoutbox_stuff.sh b/piratebox/piratebox/bin/shoutbox_stuff.sh index 248a984..292f55c 100755 --- a/piratebox/piratebox/bin/shoutbox_stuff.sh +++ b/piratebox/piratebox/bin/shoutbox_stuff.sh @@ -31,6 +31,6 @@ python psogen.py generate #Set correct permissions chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $SHOUTBOX_CHATFILE chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $SHOUTBOX_GEN_HTMLFILE - +chmod ug+rw $SHOUTBOX_CHATFILchmod ug+rw $SHOUTBOX_CHATFILEE From 533f61d827913230cda23eaeb49223424ff87928 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 7 Apr 2014 08:57:45 +0200 Subject: [PATCH 068/183] only download kareha-zip file when it is not available --- piratebox/piratebox/bin/install_piratebox.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh index 99cd59b..4976a16 100755 --- a/piratebox/piratebox/bin/install_piratebox.sh +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -90,12 +90,15 @@ if [ $2 = 'imageboard' ] ; then exit 0; fi - echo " Wgetting kareha-zip file " + cd $PIRATEBOX_FOLDER/tmp KAREHA_RELEASE=kareha_3.1.4.zip - wget http://wakaba.c3.cx/releases/$KAREHA_RELEASE - if [ "$?" != "0" ] ; then - echo "wget kareha failed.. you can place the current file your to $PIRATEBOX_FOLDER/tmp " + if [ ! -e $PIRATEBOX_FOLDER/tmp/$KAREHA_RELEASE ] ; then + echo " Wgetting kareha-zip file " + wget http://wakaba.c3.cx/releases/$KAREHA_RELEASE + if [ "$?" != "0" ] ; then + echo "wget kareha failed.. you can place the current file your to $PIRATEBOX_FOLDER/tmp " + fi fi if [ -e $PIRATEBOX_FOLDER/tmp/$KAREHA_RELEASE ] ; then From f43c749a6a237c177f840f0dfbbe9bfe7da094ff Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 7 Apr 2014 10:04:36 +0200 Subject: [PATCH 069/183] Cleanup old included shoutbox in droopy, exchanged it with an "include" option. --- piratebox/piratebox/bin/droopy | 32 ++++++++++-------------- piratebox/piratebox/init.d/piratebox | 2 +- piratebox/piratebox/init.d/piratebox_alt | 2 +- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/piratebox/piratebox/bin/droopy b/piratebox/piratebox/bin/droopy index abb8650..58ac48b 100755 --- a/piratebox/piratebox/bin/droopy +++ b/piratebox/piratebox/bin/droopy @@ -6,6 +6,8 @@ # Licensed under the New BSD License. # Changelog +# 20140407 * Chat-Box is now optional again and empty on default +# Renamed into include_box # 20130206 * CBlack; changed from os.getenv to ctypes # 20120421 * Added Directory create.. Thank you "someguy" # 20120402 * Return success Message for iOS devices # Thank you "Reventlov" @@ -88,7 +90,7 @@ Usage: droopy [options] [PORT] Options: -h, --help show this help message and exit -H, --hostname set hostname - -c, --chatbox include something + -i, --include include something -m MESSAGE, --message MESSAGE set the message -p PICTURE, --picture PICTURE set the picture -d DIRECTORY, --directory DIRECTORY set the directory to upload files to @@ -136,15 +138,7 @@ userdirform=''' # -- HTML templates # 20110310 - Piratebox Chat template -piratebox_chat = ''' - +piratebox_include = ''' ''' @@ -220,7 +214,7 @@ function onunload() {
-%(pb_chat)s +%(pb_include)s ''' @@ -238,7 +232,7 @@ successtmpl = ''' Date: Thu, 5 Jun 2014 11:13:51 +0200 Subject: [PATCH 070/183] uncommon line mix fixed --- piratebox/piratebox/bin/shoutbox_stuff.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/piratebox/piratebox/bin/shoutbox_stuff.sh b/piratebox/piratebox/bin/shoutbox_stuff.sh index 292f55c..0c2d884 100755 --- a/piratebox/piratebox/bin/shoutbox_stuff.sh +++ b/piratebox/piratebox/bin/shoutbox_stuff.sh @@ -31,6 +31,7 @@ python psogen.py generate #Set correct permissions chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $SHOUTBOX_CHATFILE chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $SHOUTBOX_GEN_HTMLFILE -chmod ug+rw $SHOUTBOX_CHATFILchmod ug+rw $SHOUTBOX_CHATFILEE +chmod ug+rw $SHOUTBOX_CHATFILE +chmod ug+rw $SHOUTBOX_CHATFILE From 13eb2243a223364974d203ab6f9540b780ac7f58 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Wed, 11 Jun 2014 13:08:23 +0200 Subject: [PATCH 071/183] Added German translation Issue #60 multi languages --- piratebox/piratebox/www/index.de.html | 85 +++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 piratebox/piratebox/www/index.de.html diff --git a/piratebox/piratebox/www/index.de.html b/piratebox/piratebox/www/index.de.html new file mode 100644 index 0000000..4e9f276 --- /dev/null +++ b/piratebox/piratebox/www/index.de.html @@ -0,0 +1,85 @@ + + + + + PirateBox - Share Freely! + + + + + + + + +
+
+
+

Wilkommen

+

Das Wichtigste vorweg: Hier geht nichts Illegales oder Unheimliches vor. Dies ist ein sozialer Platz, wo jeder chatten und Dateien austauschen kann und zwar anonym! Dies ist ein Offline-Netzwerk, speziell zum Filesharing und Chatten entwickelt. Vom Netz getrennt zu sein, ist die Voraussetzung fuer volle Anonymitaet. Hab Spass, chatte mit Menschen und teile Dateien, die du magst.

+ +
+ + +
+
+

Chat

+
+
+
+ + + +
+
+

Text Color:

+ + + + + +
+
+
+
+
+
+ +
+
+

Back to top

+

About PirateBox

+

Inspiriert durch Piratensender und der Freien Kultur Bewegung, ist die PirateBox ein in sich abgeschlossenes Geraet zur mobilen Zusammenarbeit und zum Filesharing. Die PirateBox nutzt freie, offene Software (FLOSS) um mobile, drahtlose Filesharing-Netzwerke aufzubauen, wo Nutzer Bilder, Video-, Audio-Dateien, Dokumente und andere digitale Inhalte teilen koennen.

+

Die PirateBox wurde designt um sicher und ungefaehrlich zu sein. Es sind keine Logins/Anmeldungen erforderlich und keine Benutzer-Daten werden geloggt. Um Tracking zu vermeiden und Datenschutz sicherzustellen, ist das System absichtlich nicht mit dem Internet verbunden.

+ PirateBox ist lizensiert unter GPLv3. +
+
+ + + From 2d230bf727349b91061d3c3fff430a34fc8eeb8b Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 27 Jun 2014 16:16:05 +0200 Subject: [PATCH 072/183] Add more verbose repository output to version file fo tracking dev. versions --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 535e883..8768b1f 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,8 @@ OPENWRT_BIN_FOLDER=$(OPENWRT_FOLDER)/bin $(VERSION): echo "$(PACKAGE_NAME)" > $(VERSION_FILE) + echo `git status -sb --porcelain` >> $(VERSION_FILE) + echo ` git log -1 --oneline` >> $(VERSION_FILE) $(PACKAGE): $(VERSION) tar czf $@ $(PB_FOLDER) From 67f66c88861190692a305661557058a8b75fc12a Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 27 Jun 2014 16:39:07 +0200 Subject: [PATCH 073/183] Revert "Merge branch 'php_enabling' into development" This reverts commit a843f0a86783f7f78c99dfabe708ff006c04821f, reversing changes made to b6dabf9643b90f49ac354ba3af47f1bd609c07b6. --- CHANGELOG | 2 -- piratebox/piratebox/conf/lighttpd/lighttpd.conf | 7 +------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ad08d29..058b1ec 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,7 +3,6 @@ CHANGELOG === 1.1.0 === * [New] Enable / Disable file provisioning for custom lighttpd directory listing * [New] ChatBox message is now in conf/chat_init.txt -* [New] Enables PHP Support per default === 1.0.0 === NOTE: This may only be a partial changelog, check github / your package manager for more info. @@ -31,7 +30,6 @@ NOTE: This may only be a partial changelog, check github / your package manager * [Fix] iOS 7 captive Portal fix * [New] Sample configuration for UPnP Server - === v0.6G === * [Fixed] Hide dot files in directory-listing which are usually hidden files * [Fix] Fixed captive Portal detection for iOS7 diff --git a/piratebox/piratebox/conf/lighttpd/lighttpd.conf b/piratebox/piratebox/conf/lighttpd/lighttpd.conf index 0da261a..a5b4f41 100644 --- a/piratebox/piratebox/conf/lighttpd/lighttpd.conf +++ b/piratebox/piratebox/conf/lighttpd/lighttpd.conf @@ -27,7 +27,7 @@ index-file.names = ( "index.php", "index.html", url.access-deny = ( "~", ".inc" ) # added .cgi .py -static-file.exclude-extensions = ( ".pl", ".fcgi" , ".cgi" , ".py" ) +static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" , ".cgi" , ".py" ) # Enable lighttpd on ipv6 @@ -74,11 +74,6 @@ $HTTP["url"] =~ "^/cgi-bin/" { cgi.assign = ( ".py" => "/usr/bin/python" ) } -#Only allow PHP in foldere which where not related to Shared -$HTTP["url"] !~ "^/Shared/" { - cgi.assign = ( ".php" => "php-cgi" ) # Let's see if it is possible to not use full path -} - ## Warning this represents a security risk, as it allow to execute any file ## with a .pl/.py even outside of /usr/lib/cgi-bin. # From 982fc252945c68c0d7ea54022aa078095b2e14c6 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 27 Jun 2014 17:27:59 +0200 Subject: [PATCH 074/183] Changlog: documented merged features --- CHANGELOG | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 058b1ec..c1d2165 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,14 @@ CHANGELOG === 1.1.0 === * [New] Enable / Disable file provisioning for custom lighttpd directory listing * [New] ChatBox message is now in conf/chat_init.txt +* [New] Disable the Shoutbox to prevent writing into it +* [New] Enable PHP using as default parsing language to enable easier modification +* [New] Mesh implementation +* [New] JSON config file to direct client side applications, like "share apps" +* [New] Simply python IRC Server installed and prepareable for automatic start +* [Fix] License Adjustments + + === 1.0.0 === NOTE: This may only be a partial changelog, check github / your package manager for more info. From 5f9d4cbb69a82b606ed2cc69df9cad4d803d75a5 Mon Sep 17 00:00:00 2001 From: Chris Jung Date: Sat, 14 Jun 2014 13:25:31 +0200 Subject: [PATCH 075/183] Update hosts Typos corrected --- piratebox/piratebox/conf/hosts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piratebox/piratebox/conf/hosts b/piratebox/piratebox/conf/hosts index d363cb1..115a88f 100644 --- a/piratebox/piratebox/conf/hosts +++ b/piratebox/piratebox/conf/hosts @@ -4,6 +4,6 @@ ### commented because this will cause the default redirect. ### left here for documentary the stuff ### dns.msftncsi.com 131.107.255.255 -#------- Satic end ... Gernated stuff now +#------- Static end ... Generated stuff now From 3af906a62f4eec8d6ad0e3ee83aec7c49f8a75e2 Mon Sep 17 00:00:00 2001 From: taffy-nay Date: Tue, 17 Jun 2014 10:25:05 +0100 Subject: [PATCH 076/183] Removed thanks button padding. The padding for .button was causing it to display scroll bars. Removing padding: 1em; fixes this. --- piratebox/piratebox/www/style.css | 1 - 1 file changed, 1 deletion(-) diff --git a/piratebox/piratebox/www/style.css b/piratebox/piratebox/www/style.css index 282ff73..cef92ac 100644 --- a/piratebox/piratebox/www/style.css +++ b/piratebox/piratebox/www/style.css @@ -243,7 +243,6 @@ input[type=radio] { border: 0; color: white; margin: 0; - padding: 1em; } .button:active { From f301358cf265d64d847e584d20675258a76c8e3c Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 23 Jun 2014 21:35:21 +0200 Subject: [PATCH 077/183] Added changelog and Version bump from hotfix-1.0.1 branch Conflicts: CHANGELOG Makefile --- CHANGELOG | 11 +++++++++++ Makefile | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index c1d2165..f17cf4c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,17 @@ CHANGELOG * [Fix] License Adjustments +=== 1.0.1 === +* [Fix] Fixed setting permissions of shoutbox datafile +* [New] Service File for RPi image +* [Fix] Several typos in scripts +* [Fix] Typo in front page and directory listing +* [Fix] in timsave.sh while restoring date&time +* [Fix] [OpenWRT] Timesave create bootup restore +* [Fix] No dublicates symlink after double "part2" via install_piratebox.sh +* [New] Remove # in front of secret & password to force user to change it before using the board +* [Fix] Button padding in UI +* [Fix] Board Link out of nested Shared folder === 1.0.0 === NOTE: This may only be a partial changelog, check github / your package manager for more info. diff --git a/Makefile b/Makefile index 8768b1f..6537cb5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME = piratebox-ws -VERSION = 1.0.0_beta5 +VERSION = 1.0.1 ARCH = all PB_FOLDER=piratebox PB_SRC_FOLDER=$(PB_FOLDER)/$(PB_FOLDER) From a04eaf98a8394197155cac8d6956adb81e4fc592 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 27 Jun 2014 15:46:11 +0200 Subject: [PATCH 078/183] Added more fixes on depended packages --- CHANGELOG | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index f17cf4c..4fdc42e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -18,6 +18,10 @@ CHANGELOG * [Fix] Typo in front page and directory listing * [Fix] in timsave.sh while restoring date&time * [Fix] [OpenWRT] Timesave create bootup restore +* [Fix] [OpenWRT] Fix for not working "already installed" recognition to skip parts +* [Fix] [OpenWRT] Fix for errors during installing piratebox-mod-imageboard because of duplicate links +* [Fix] [OpenWRT] Fix for LED flashing during auto install (box-installer on image) +* [Fix] [OpenWRT] Fix error messages on package reinstall. (extendRoot) * [Fix] No dublicates symlink after double "part2" via install_piratebox.sh * [New] Remove # in front of secret & password to force user to change it before using the board * [Fix] Button padding in UI From 4b1f6dd4ecc73a8abdc0b9a9de2f940a4c354384 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 5 Jun 2014 14:00:23 +0200 Subject: [PATCH 079/183] Fixed typo in generate config script --- piratebox/piratebox/bin/generate_config_files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piratebox/piratebox/bin/generate_config_files.sh b/piratebox/piratebox/bin/generate_config_files.sh index 4b679b9..900a876 100755 --- a/piratebox/piratebox/bin/generate_config_files.sh +++ b/piratebox/piratebox/bin/generate_config_files.sh @@ -146,7 +146,7 @@ generate_lighttpd_env() { local PIRATEBOX=$5 local SHOUTBOX_CHATFILE=$6 - echo "Generating Environment-config for ligttpd ....." + echo "Generating Environment-config for lighttpd ....." LIGHTTPD_ENV_BR_LINE="" if [ "$GLOBAL_CHAT" = "yes" ] ; then From 94638ac3180a723333a38c3887b411368952c746 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 5 Jun 2014 14:26:54 +0200 Subject: [PATCH 080/183] Adding systemd file for RPi Image --- BuildScripts/piratebox.service | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 BuildScripts/piratebox.service diff --git a/BuildScripts/piratebox.service b/BuildScripts/piratebox.service new file mode 100644 index 0000000..1951d48 --- /dev/null +++ b/BuildScripts/piratebox.service @@ -0,0 +1,13 @@ +[Unit] +Description=PirateBox Service + +[Service] +Type=forking +ExecStart=/opt/piratebox/init.d/piratebox_alt start +ExecStop=/opt/piratebox/init.d/piratebox_alt stop +#Restart=/opt/piratebox/init.d/piratebox_alt restart +#PIDFile=/var/run/piratebox.pid + +[Install] +WantedBy=multi-user.target + From e85b1ea0e020beafe3baa8853d4d22a999830788 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 5 Jun 2014 15:29:56 +0200 Subject: [PATCH 081/183] fixed missing then --- piratebox/piratebox/bin/timesave.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piratebox/piratebox/bin/timesave.sh b/piratebox/piratebox/bin/timesave.sh index 01d307f..943319b 100755 --- a/piratebox/piratebox/bin/timesave.sh +++ b/piratebox/piratebox/bin/timesave.sh @@ -65,7 +65,7 @@ if [ "$2" = "save" ] ; then fi if [ "$2" = "recover" ] ; then - if [ `get_datetime` -lt `cat $TIMESAVE` ] ; + if [ `get_datetime` -lt `cat $TIMESAVE` ] ; then date `cat $TIMESAVE ` [ "$?" != "0" ] && echo "error in recovering time" && exit 255 echo "Time recovered" From f38666803d3f278cbc0186a05b98bb75c6da0e4c Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 6 Jun 2014 10:51:21 +0200 Subject: [PATCH 082/183] Fix for duplicate symlinks --- piratebox/piratebox/bin/install_piratebox.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh index 993317f..2e72e6a 100755 --- a/piratebox/piratebox/bin/install_piratebox.sh +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -67,9 +67,9 @@ if [ $2 = 'part2' ] ; then if [ ! -f $PIRATEBOX_FOLDER/share/board/kareha.pl ] ; then cp $PIRATEBOX_FOLDER/src/kareha.pl $PIRATEBOX_FOLDER/share/board fi - - ln -s $PIRATEBOX_FOLDER/share/board $PIRATEBOX_FOLDER/www/board - ln -s $UPLOADFOLDER $PIRATEBOX_FOLDER/www/Shared + + [[ ! -L $PIRATEBOX_FOLDER/www/board ]] && ln -s $PIRATEBOX_FOLDER/share/board $PIRATEBOX_FOLDER/www/board + [[ ! -L $PIRATEBOX_FOLDER/www/Shared ]] && ln -s $UPLOADFOLDER $PIRATEBOX_FOLDER/www/Shared fi #Install the image-board From 81871fe7b3657392a22696432f68eabfe7895d27 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 27 Jun 2014 22:01:14 +0200 Subject: [PATCH 083/183] Draft for mapping avahi browse results to a hosts file --- piratebox/piratebox/bin/avahi_to_sdns.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 piratebox/piratebox/bin/avahi_to_sdns.sh diff --git a/piratebox/piratebox/bin/avahi_to_sdns.sh b/piratebox/piratebox/bin/avahi_to_sdns.sh new file mode 100644 index 0000000..678be35 --- /dev/null +++ b/piratebox/piratebox/bin/avahi_to_sdns.sh @@ -0,0 +1,23 @@ +PIRATEBOX_HOSTS_MESH=.../hosts_mesh +DNSMASQ_PID=.... + +SLEEPTIME=$((60 * 5 )) # Sleep for 5 Minutes before doing a refresh + + +while true; do + + ## Browse Avahi discover results and format them into a hosts file + avahi-browse -f rtp_http._tcp | grep "=" > /tmp/avahi.browse + grep \= /tmp/avahi-browse | \ + sed -e 's|\.local||g' \ + -e 's|_|\.|g' | \ + awk 'BEGIN { FS=";" } { print $8 " " $7; }' > /tmp/avahi.browse.hosts + + + echo "# Updated " `date` >> /tmp/avahi.browse.hosts + cp /tmp/avahi.browse.hosts $PIRATEBOX_HOSTS_MESH + + # Send SIGHUP to dnsmasq for refreshing its cache + kill -1 `cat $DNSMASQ_PID` + sleep $SLEEPTIME +done From c3a69ad83a5081127c1df51de9e4343535187a44 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 6 Jul 2014 17:48:06 +0200 Subject: [PATCH 084/183] switch version to 1.1 --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6537cb5..7021d7a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME = piratebox-ws -VERSION = 1.0.1 +VERSION = 1.1.0 ARCH = all PB_FOLDER=piratebox PB_SRC_FOLDER=$(PB_FOLDER)/$(PB_FOLDER) @@ -8,8 +8,8 @@ PACKAGE_NAME=$(NAME)_$(VERSION) PACKAGE=$(PACKAGE_NAME).tar.gz VERSION_FILE=$(PB_FOLDER)/$(PB_FOLDER)/version -IMAGE_FILE=piratebox_ws_1.0_img.gz -TGZ_IMAGE_FILE=piratebox_ws_1.0_img.tar.gz +IMAGE_FILE=piratebox_ws_1.1_img.gz +TGZ_IMAGE_FILE=piratebox_ws_1.1_img.tar.gz SRC_IMAGE=image_stuff/OpenWRT_ext4_50MB.img.gz SRC_IMAGE_UNPACKED=image_stuff/piratebox_img MOUNT_POINT=image_stuff/image From b1382377b9f40c881781b9ee466dbd877b8f44b4 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 6 Jul 2014 19:54:21 +0200 Subject: [PATCH 085/183] Fixing coding issues --- piratebox/piratebox/bin/json_generation.sh | 2 +- .../piratebox/conf/lighttpd/lighttpd.conf | 23 ++----------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/piratebox/piratebox/bin/json_generation.sh b/piratebox/piratebox/bin/json_generation.sh index 4cea13c..cfcf27b 100755 --- a/piratebox/piratebox/bin/json_generation.sh +++ b/piratebox/piratebox/bin/json_generation.sh @@ -42,5 +42,5 @@ echo " } " >> $JSON_FILE echo ", \"shoutbox\" : { \"status\" : $json_shoutbox_enabled , \"file\" : \"$CHAT_MODULE_FILE\" } " >> $JSON_FILE #--------------- - echo ", \"version\" : \""$(cat $PIRATEBOX_FOLDER/version )"\" >> $JSON_FILE + echo ", \"version\" : \""$(cat $PIRATEBOX_FOLDER/version )"\"" >> $JSON_FILE echo " } } }" >> $JSON_FILE diff --git a/piratebox/piratebox/conf/lighttpd/lighttpd.conf b/piratebox/piratebox/conf/lighttpd/lighttpd.conf index 6243ec0..b371016 100644 --- a/piratebox/piratebox/conf/lighttpd/lighttpd.conf +++ b/piratebox/piratebox/conf/lighttpd/lighttpd.conf @@ -2,7 +2,7 @@ server.modules = ( # "mod_access", not needed! -# "mod_alias", + "mod_alias", # "mod_compress", Disabled, fixing reload Problem?? "mod_redirect", # "mod_rewrite", @@ -55,25 +55,6 @@ dir-listing.hide-readme-file = "enable" # Diables default footer text dir-listing.set-footer = " " -# Grabs main css -dir-listing.external-css = "/style.css" - -# Header -# Enables header section -dir-listing.show-header = "enable" -dir-listing.encode-header = "disable" -# Hides HEADER.txt from listing -dir-listing.hide-header-file = "enable" - -# Footer -# Enables footer section -dir-listing.show-readme = "enable" -dir-listing.encode-readme = "disable" -# Hides README.txt from listing -dir-listing.hide-readme-file = "enable" -# Diables default footer text -dir-listing.set-footer = " " - # Disabled, maybe fixes reload problem on imageboard #compress.cache-dir = "/var/cache/lighttpd/compress/" #compress.filetype = ( "application/x-javascript", "text/css", "text/html", "text/plain" ) @@ -126,4 +107,4 @@ $HTTP["useragent"] =~ "CaptiveNetworkSupport" { server.error-handler-404 = "/success.html" } -include "/opt/piratebox/conf/lighttpd/fastcgi.conf +include "/opt/piratebox/conf/lighttpd/fastcgi.conf" From 74aaae0594bbfff920d062031c84df886a39958c Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sat, 12 Jul 2014 16:30:48 +0200 Subject: [PATCH 086/183] enable IPV6 on openwrt per default --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 7021d7a..eac72b8 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,7 @@ $(OPENWRT_CONFIG_FOLDER): cp -rv $(PB_SRC_FOLDER)/conf/* $@ sed 's:OPENWRT="no":OPENWRT="yes":' -i $@/piratebox.conf sed 's:DO_IFCONFIG="yes":DO_IFCONFIG="no":' -i $@/piratebox.conf + sed 's:IPV6_ENABLE="no":IPV6_ENABLE="yes":' -i $@/piratebox.conf sed 's:USE_APN="yes":USE_APN="no":' -i $@/piratebox.conf sed 's:DNSMASQ_INTERFACE="wlan0":DNSMASQ_INTERFACE="br-lan":' -i $@/piratebox.conf sed 's:192.168.77:192.168.1:g' -i $@/piratebox.conf From 4d09cc7f0c5458488d44e7feff9763a3a3fbc8e8 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sat, 12 Jul 2014 16:51:41 +0200 Subject: [PATCH 087/183] Fix favicon --- piratebox/piratebox/bin/droopy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/piratebox/piratebox/bin/droopy b/piratebox/piratebox/bin/droopy index ec919b6..1982124 100755 --- a/piratebox/piratebox/bin/droopy +++ b/piratebox/piratebox/bin/droopy @@ -166,7 +166,7 @@ userinfo = '''
%(message)s
''' -maintmpl = '''%(maintitle)s +maintmpl = '''%(maintitle)s ''' + style + '''
''' + userinfo + ''' @@ -219,7 +219,7 @@ function onunload() { ''' -successtmpl = '''%(successtitle)s +successtmpl = '''%(successtitle)s ''' + style + ''' @@ -239,7 +239,7 @@ successtmpl = '''%(errortitle)s +errortmpl = '''%(errortitle)s ''' + style + ''' From ab9357ea72aac5ff26c9de3aa95f3931a36b0038 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sat, 12 Jul 2014 17:13:28 +0200 Subject: [PATCH 088/183] Fix cleanup settings --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index eac72b8..ce6deb1 100644 --- a/Makefile +++ b/Makefile @@ -79,6 +79,7 @@ cleanimage: - rm -f $(SRC_IMAGE_UNPACKED) - rm -fr $(OPENWRT_CONFIG_FOLDER) - rm -v $(IMAGE_FILE) + - rm -rv $(OPENWRT_BIN_FOLDER) shortimage: $(IMAGE_FILE) $(TGZ_IMAGE_FILE) From bab68b70ce3ac52c314dc685e1bfd943387dabbd Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 13 Jul 2014 10:35:09 +0200 Subject: [PATCH 089/183] Fixing Building image --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ce6deb1..124dc5d 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ $(OPENWRT_CONFIG_FOLDER): cp -rv $(PB_SRC_FOLDER)/conf/* $@ sed 's:OPENWRT="no":OPENWRT="yes":' -i $@/piratebox.conf sed 's:DO_IFCONFIG="yes":DO_IFCONFIG="no":' -i $@/piratebox.conf - sed 's:IPV6_ENABLE="no":IPV6_ENABLE="yes":' -i $@/piratebox.conf + sed 's:IPV6_ENABLE="no":IPV6_ENABLE="yes":' -i $@/ipv6.conf sed 's:USE_APN="yes":USE_APN="no":' -i $@/piratebox.conf sed 's:DNSMASQ_INTERFACE="wlan0":DNSMASQ_INTERFACE="br-lan":' -i $@/piratebox.conf sed 's:192.168.77:192.168.1:g' -i $@/piratebox.conf From c8986663c8d61a2f2ee51bf9d86e195bc5debeeb Mon Sep 17 00:00:00 2001 From: Tobias Trumm Date: Mon, 28 Jul 2014 01:35:27 +0200 Subject: [PATCH 090/183] Get timestamp for Shoutbox from the client/browser on systems with no real time clock --- piratebox/piratebox/python_lib/psogen.py | 13 +++++++------ piratebox/piratebox/www/cgi-bin/psowrte.py | 3 ++- piratebox/piratebox/www/index.html | 17 ++++++++++++++++- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/piratebox/piratebox/python_lib/psogen.py b/piratebox/piratebox/python_lib/psogen.py index 1c102a4..3e143ce 100755 --- a/piratebox/piratebox/python_lib/psogen.py +++ b/piratebox/piratebox/python_lib/psogen.py @@ -71,8 +71,8 @@ def read_data_file(): #-------------- # Function for saving new Shoubox-Content & Regenerate static HTML file -- usually called by HTML-Form #-------------- -def process_form( name , indata , color ): - content = save_input( name , indata , color ) +def process_form( name , indata , color , time ): + content = save_input( name , indata , color , time ) if broadcast_destination == False: generate_html_into_file ( content ) @@ -81,9 +81,9 @@ def process_form( name , indata , color ): #-------------- # Acutally Saves SB-Content to datafile #-------------- -def save_input( name , indata , color ): +def save_input( name , indata , color , time ): - content = prepare_line ( name, indata, color ) + content = prepare_line ( name, indata, color , time ) if broadcast_destination != False: return writeToNetwork( content , broadcast_destination ) @@ -109,7 +109,7 @@ def writeToDisk ( content ): return finalcontent -def prepare_line ( name, indata, color ): +def prepare_line ( name, indata, color , time ): datapass = re.sub("<", "<", indata) data = re.sub(">", ">", datapass) curdate = datetime.datetime.now() @@ -117,7 +117,8 @@ def prepare_line ( name, indata, color ): #
# 00:00:00 Nickname: Lorem ipsum dolor sit amet #
- content = "
" + curdate.strftime("%H:%M:%S") + " " + name + ": " + data + "
\n" + #content = "
" + curdate.strftime("%H:%M:%S") + " " + name + ": " + data + "
\n" + content = "
" + time + " " + name + ": " + data + "
\n" return content #-------------- diff --git a/piratebox/piratebox/www/cgi-bin/psowrte.py b/piratebox/piratebox/www/cgi-bin/psowrte.py index 0a9d96f..c43229d 100755 --- a/piratebox/piratebox/www/cgi-bin/psowrte.py +++ b/piratebox/piratebox/www/cgi-bin/psowrte.py @@ -21,9 +21,10 @@ else: datapass = re.sub("<", "<", rawdata) data = re.sub(">", ">", datapass) color = values["color"].value +time = values["time"].value curdate = datetime.datetime.now() -process_form( name , rawdata , color ) +process_form( name , rawdata , color , time ) print """ok""" diff --git a/piratebox/piratebox/www/index.html b/piratebox/piratebox/www/index.html index bb30b75..e6292d8 100644 --- a/piratebox/piratebox/www/index.html +++ b/piratebox/piratebox/www/index.html @@ -51,7 +51,7 @@

Chat

-
+
@@ -65,6 +65,21 @@
+ +
From d308a46c32a3bf9fc5fea5b08761e674cfd78de6 Mon Sep 17 00:00:00 2001 From: Tobias Trumm Date: Mon, 28 Jul 2014 04:32:53 +0200 Subject: [PATCH 091/183] Use POSIX timestamp. --- piratebox/piratebox/python_lib/psogen.py | 16 ++++++++-------- piratebox/piratebox/www/cgi-bin/psowrte.py | 4 ++-- piratebox/piratebox/www/index.html | 13 +++---------- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/piratebox/piratebox/python_lib/psogen.py b/piratebox/piratebox/python_lib/psogen.py index 3e143ce..b43b3af 100755 --- a/piratebox/piratebox/python_lib/psogen.py +++ b/piratebox/piratebox/python_lib/psogen.py @@ -71,8 +71,8 @@ def read_data_file(): #-------------- # Function for saving new Shoubox-Content & Regenerate static HTML file -- usually called by HTML-Form #-------------- -def process_form( name , indata , color , time ): - content = save_input( name , indata , color , time ) +def process_form( name , indata , color , timestamp ): + content = save_input( name , indata , color , timestamp ) if broadcast_destination == False: generate_html_into_file ( content ) @@ -81,9 +81,9 @@ def process_form( name , indata , color , time ): #-------------- # Acutally Saves SB-Content to datafile #-------------- -def save_input( name , indata , color , time ): +def save_input( name , indata , color , timestamp ): - content = prepare_line ( name, indata, color , time ) + content = prepare_line ( name, indata, color , timestamp ) if broadcast_destination != False: return writeToNetwork( content , broadcast_destination ) @@ -109,16 +109,16 @@ def writeToDisk ( content ): return finalcontent -def prepare_line ( name, indata, color , time ): +def prepare_line ( name, indata, color , timestamp ): datapass = re.sub("<", "<", indata) data = re.sub(">", ">", datapass) - curdate = datetime.datetime.now() + curdate = datetime.datetime.fromtimestamp(timestamp) # Trying to make it look like this: #
# 00:00:00 Nickname: Lorem ipsum dolor sit amet #
- #content = "
" + curdate.strftime("%H:%M:%S") + " " + name + ": " + data + "
\n" - content = "
" + time + " " + name + ": " + data + "
\n" + # + content = "
" + curdate.strftime("%H:%M:%S") + " " + name + ": " + data + "
\n" return content #-------------- diff --git a/piratebox/piratebox/www/cgi-bin/psowrte.py b/piratebox/piratebox/www/cgi-bin/psowrte.py index c43229d..b32ff4f 100755 --- a/piratebox/piratebox/www/cgi-bin/psowrte.py +++ b/piratebox/piratebox/www/cgi-bin/psowrte.py @@ -21,10 +21,10 @@ else: datapass = re.sub("<", "<", rawdata) data = re.sub(">", ">", datapass) color = values["color"].value -time = values["time"].value +timestamp = float(values["timestamp"].value) curdate = datetime.datetime.now() -process_form( name , rawdata , color , time ) +process_form( name , rawdata , color , timestamp ) print """ok""" diff --git a/piratebox/piratebox/www/index.html b/piratebox/piratebox/www/index.html index e6292d8..8f737d4 100644 --- a/piratebox/piratebox/www/index.html +++ b/piratebox/piratebox/www/index.html @@ -65,19 +65,12 @@ - + From 1256c62c38ada531bcf6fb9a5a4777a44df3b830 Mon Sep 17 00:00:00 2001 From: Tobias Trumm Date: Mon, 4 Aug 2014 21:46:17 +0200 Subject: [PATCH 092/183] Try to add a configuration variable to enable the use of client timestamps in the chat window. Doesn't work yet. --- piratebox/piratebox/bin/generate_config_files.sh | 4 +++- piratebox/piratebox/bin/shoutbox_stuff.sh | 1 + piratebox/piratebox/conf/piratebox.conf | 2 ++ piratebox/piratebox/python_lib/psogen.py | 6 +++++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/piratebox/piratebox/bin/generate_config_files.sh b/piratebox/piratebox/bin/generate_config_files.sh index 900a876..cbe6060 100755 --- a/piratebox/piratebox/bin/generate_config_files.sh +++ b/piratebox/piratebox/bin/generate_config_files.sh @@ -145,6 +145,7 @@ generate_lighttpd_env() { local SHOUTBOX_GEN_HTMLFILE=$4 local PIRATEBOX=$5 local SHOUTBOX_CHATFILE=$6 + local SHOUTBOX_CLIENT_TIMESTAMP=$7 echo "Generating Environment-config for lighttpd ....." @@ -157,6 +158,7 @@ generate_lighttpd_env() { \"PYTHONPATH\" => \"$PYTHONPATH:$PIRATEBOX/python_lib\", \"SHOUTBOX_GEN_HTMLFILE\" => \"$SHOUTBOX_GEN_HTMLFILE\" , \"SHOUTBOX_CHATFILE\" => \"$SHOUTBOX_CHATFILE\" , + \"SHOUTBOX_CLIENT_TIMESTAMP\" => \"$SHOUTBOX_CLIENT_TIMESTAMP\" , $LIGHTTPD_ENV_BR_LINE )" @@ -197,7 +199,7 @@ if [ "$IPV6_ENABLE" = "yes" ] ; then fi generate_hosts $HOST $IP $IPV6 generate_dnsmasq $NET $IP_SHORT $START_LEASE $END_LEASE $LEASE_DURATION $DNSMASQ_INTERFACE -generate_lighttpd_env $GLOBAL_CHAT "$GLOBAL_DEST" $PIRATEBOX_PYTHONPATH $GEN_CHATFILE $PIRATEBOX_FOLDER $CHATFILE +generate_lighttpd_env $GLOBAL_CHAT "$GLOBAL_DEST" $PIRATEBOX_PYTHONPATH $GEN_CHATFILE $PIRATEBOX_FOLDER $CHATFILE $SHOUTBOX_CLIENT_TIMESTAMP COMPLETE_HOST=$HOST diff --git a/piratebox/piratebox/bin/shoutbox_stuff.sh b/piratebox/piratebox/bin/shoutbox_stuff.sh index 9d80a6e..dee4c65 100755 --- a/piratebox/piratebox/bin/shoutbox_stuff.sh +++ b/piratebox/piratebox/bin/shoutbox_stuff.sh @@ -18,6 +18,7 @@ cd python_lib export SHOUTBOX_CHATFILE=$CHATFILE export SHOUTBOX_GEN_HTMLFILE=$GEN_CHATFILE +export SHOUTBOX_CLIENT_TIMESTAMP=$SHOUTBOX_CLIENT_TIMESTAMP #Writing init-message and reset chat.. diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index f8ebc03..cd531c3 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -145,6 +145,8 @@ RESET_CHAT="yes" # to make clear, that the box is not working anymore. SHOUTBOX_ENABLED="yes" +SHOUTBOX_CLIENT_TIMESTAMP="no" + #Inititiation Chat-Message ### This option was removed, you can find the chat message in conf/chat_init.txt diff --git a/piratebox/piratebox/python_lib/psogen.py b/piratebox/piratebox/python_lib/psogen.py index b43b3af..796f473 100755 --- a/piratebox/piratebox/python_lib/psogen.py +++ b/piratebox/piratebox/python_lib/psogen.py @@ -12,6 +12,7 @@ import messages, broadcast datafilename = os.environ["SHOUTBOX_CHATFILE"] htmlfilename = os.environ["SHOUTBOX_GEN_HTMLFILE"] +clienttimestamp =os.environ["SHOUTBOX_CLIENT_TIMESTAMP"] try: raw_dest = os.environ["SHOUTBOX_BROADCAST_DESTINATIONS"] @@ -112,7 +113,10 @@ def writeToDisk ( content ): def prepare_line ( name, indata, color , timestamp ): datapass = re.sub("<", "<", indata) data = re.sub(">", ">", datapass) - curdate = datetime.datetime.fromtimestamp(timestamp) + if clienttimestamp == 'yes': + curdate = datetime.datetime.fromtimestamp(timestamp) + else: + curdate = datetime.datetime.now() # Trying to make it look like this: #
# 00:00:00 Nickname: Lorem ipsum dolor sit amet From b2b53d61d2e6168afaa75d610d3a494ae1b12152 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 11 Aug 2014 18:36:26 +0200 Subject: [PATCH 093/183] included correct pathes for hosts-mesh file and dnsmasq pid --- piratebox/piratebox/bin/avahi_to_sdns.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/piratebox/piratebox/bin/avahi_to_sdns.sh b/piratebox/piratebox/bin/avahi_to_sdns.sh index 678be35..a6de98a 100644 --- a/piratebox/piratebox/bin/avahi_to_sdns.sh +++ b/piratebox/piratebox/bin/avahi_to_sdns.sh @@ -1,5 +1,5 @@ -PIRATEBOX_HOSTS_MESH=.../hosts_mesh -DNSMASQ_PID=.... +PIRATEBOX_HOSTS_MESH=/opt/piratebox/conf/hosts_mesh +DNSMASQ_PID=/var/run/piratebox_dnsmasq.pid SLEEPTIME=$((60 * 5 )) # Sleep for 5 Minutes before doing a refresh From 7b7b4f6d090d1c2612e02195eebb8627435ea445 Mon Sep 17 00:00:00 2001 From: Gilles Coulais Date: Fri, 29 Aug 2014 13:00:16 +0200 Subject: [PATCH 094/183] Add webl10n library Add data-l10n-id keys in index page --- piratebox/piratebox/www/index.html | 58 +- piratebox/piratebox/www/l10n.js | 1157 ++++++++++++++++++++++++++++ 2 files changed, 1188 insertions(+), 27 deletions(-) create mode 100644 piratebox/piratebox/www/l10n.js diff --git a/piratebox/piratebox/www/index.html b/piratebox/piratebox/www/index.html index 8f737d4..b601235 100644 --- a/piratebox/piratebox/www/index.html +++ b/piratebox/piratebox/www/index.html @@ -6,6 +6,10 @@ + + + + @@ -14,17 +18,17 @@
@@ -33,37 +37,37 @@
-

Welcome

-

Now, first of all, there is nothing illegal or scary going on here. This is a social place where you can chat and share files with people around you, anonymously! This is an off-line network, specially designed and developed for file-sharing and chat services. Staying off the grid is a precaution to maintain your full anonymity. Please have fun, chat with people, and feel free to share any files you may like.

- +

Welcome

+

Now, first of all, there is nothing illegal or scary going on here. This is a social place where you can chat and share files with people around you, anonymously! This is an off-line network, specially designed and developed for file-sharing and chat services. Staying off the grid is a precaution to maintain your full anonymity. Please have fun, chat with people, and feel free to share any files you may like.

+
-

Chat

+

Chat

- - - + + +
-

Text Color:

- - - - - +

Text Color:

+ + + + +
- + +
diff --git a/piratebox/piratebox/www/jquery.min.js b/piratebox/piratebox/www/jquery.min.js deleted file mode 100755 index 16ad06c..0000000 --- a/piratebox/piratebox/www/jquery.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.2 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
"+""+"
",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
t
",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( -a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f -.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/piratebox/piratebox/www/js/bootstrap.min.js b/piratebox/piratebox/www/js/bootstrap.min.js new file mode 100644 index 0000000..7c1561a --- /dev/null +++ b/piratebox/piratebox/www/js/bootstrap.min.js @@ -0,0 +1,6 @@ +/*! + * Bootstrap v3.2.0 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.2.0",d.prototype.close=function(b){function c(){f.detach().trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",c).emulateTransitionEnd(150):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.2.0",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),d[e](null==f[b]?this.options[b]:f[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b).on("keydown.bs.carousel",a.proxy(this.keydown,this)),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.2.0",c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},c.prototype.keydown=function(a){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.to=function(b){var c=this,d=this.getItemIndex(this.$active=this.$element.find(".item.active"));return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=e[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:g});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,f&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(e)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:g});return a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one("bsTransitionEnd",function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger(m)),f&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(b=!b),e||d.data("bs.collapse",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};c.VERSION="3.2.0",c.DEFAULTS={toggle:!0},c.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},c.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var c=a.Event("show.bs.collapse");if(this.$element.trigger(c),!c.isDefaultPrevented()){var d=this.$parent&&this.$parent.find("> .panel > .in");if(d&&d.length){var e=d.data("bs.collapse");if(e&&e.transitioning)return;b.call(d,"hide"),e||d.data("bs.collapse",null)}var f=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[f](0),this.transitioning=1;var g=function(){this.$element.removeClass("collapsing").addClass("collapse in")[f](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return g.call(this);var h=a.camelCase(["scroll",f].join("-"));this.$element.one("bsTransitionEnd",a.proxy(g,this)).emulateTransitionEnd(350)[f](this.$element[0][h])}}},c.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},c.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var d=a.fn.collapse;a.fn.collapse=b,a.fn.collapse.Constructor=c,a.fn.collapse.noConflict=function(){return a.fn.collapse=d,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(c){var d,e=a(this),f=e.attr("data-target")||c.preventDefault()||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),g=a(f),h=g.data("bs.collapse"),i=h?"toggle":e.data(),j=e.attr("data-parent"),k=j&&a(j);h&&h.transitioning||(k&&k.find('[data-toggle="collapse"][data-parent="'+j+'"]').not(e).addClass("collapsed"),e[g.hasClass("in")?"addClass":"removeClass"]("collapsed")),b.call(g,i)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.2.0",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('
a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/\s*$/g,rb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:k.htmlSerialize?[0,"",""]:[1,"X
","
"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?""!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m(" -

Stöbere Dateien ->

- - - -
-
-

Chat

-
-
-
- - - -
-
-

Text Color:

- - - - - -
- -
-
- - - -
-
-

Back to top

-

About PirateBox

-

Inspiriert durch Piratensender und der Freien Kultur Bewegung, ist die PirateBox ein in sich abgeschlossenes Geraet zur mobilen Zusammenarbeit und zum Filesharing. Die PirateBox nutzt freie, offene Software (FLOSS) um mobile, drahtlose Filesharing-Netzwerke aufzubauen, wo Nutzer Bilder, Video-, Audio-Dateien, Dokumente und andere digitale Inhalte teilen koennen.

-

Die PirateBox wurde designt um sicher und ungefaehrlich zu sein. Es sind keine Logins/Anmeldungen erforderlich und keine Benutzer-Daten werden geloggt. Um Tracking zu vermeiden und Datenschutz sicherzustellen, ist das System absichtlich nicht mit dem Internet verbunden.

- PirateBox ist lizensiert unter GPLv3. -
-
- - - diff --git a/piratebox/piratebox/www/index.html b/piratebox/piratebox/www/index.html index f475e8a..9ce33b2 100644 --- a/piratebox/piratebox/www/index.html +++ b/piratebox/piratebox/www/index.html @@ -18,11 +18,11 @@ - +
- -
-
-
-

User Notes

-
-
-
    - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/piratebox/piratebox/www/upload-basic-plus.html b/piratebox/piratebox/www/upload-basic-plus.html deleted file mode 100644 index e26c78e..0000000 --- a/piratebox/piratebox/www/upload-basic-plus.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - -jQuery File Upload Demo - Basic Plus version - - - - - - - - - - -
-
- - - - Add files... - - - -
-
- -
-
-
- -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/piratebox/piratebox/www/upload-basic.html b/piratebox/piratebox/www/upload-basic.html deleted file mode 100644 index 2113d89..0000000 --- a/piratebox/piratebox/www/upload-basic.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - -jQuery File Upload Demo - Basic version - - - - - - - - - - -
-
- - - - Select files... - - - -
-
- -
-
-
- -
-
-
-
-

Demo Notes

-
-
-
    -
  • The maximum file size for uploads in this demo is 5 MB (default file size is unlimited).
  • -
  • Only image files (JPG, GIF, PNG) are allowed in this demo (by default there is no file type restriction).
  • -
  • Uploaded files will be deleted automatically after 5 minutes (demo setting).
  • -
  • You can drag & drop files from your desktop on this webpage (see Browser support).
  • -
  • Please refer to the project website and documentation for more information.
  • -
  • Built with Bootstrap and Icons from Glyphicons.
  • -
-
-
-
- - - - - - - - - - - - diff --git a/piratebox/piratebox/www/upload_handler/UploadHandler.php b/piratebox/piratebox/www/upload_handler/UploadHandler.php deleted file mode 100755 index 0f3ae4b..0000000 --- a/piratebox/piratebox/www/upload_handler/UploadHandler.php +++ /dev/null @@ -1,1371 +0,0 @@ - 'The uploaded file exceeds the upload_max_filesize directive in php.ini', - 2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form', - 3 => 'The uploaded file was only partially uploaded', - 4 => 'No file was uploaded', - 6 => 'Missing a temporary folder', - 7 => 'Failed to write file to disk', - 8 => 'A PHP extension stopped the file upload', - 'post_max_size' => 'The uploaded file exceeds the post_max_size directive in php.ini', - 'max_file_size' => 'File is too big', - 'min_file_size' => 'File is too small', - 'accept_file_types' => 'Filetype not allowed', - 'max_number_of_files' => 'Maximum number of files exceeded', - 'max_width' => 'Image exceeds maximum width', - 'min_width' => 'Image requires a minimum width', - 'max_height' => 'Image exceeds maximum height', - 'min_height' => 'Image requires a minimum height', - 'abort' => 'File upload aborted', - 'image_resize' => 'Failed to resize image' - ); - - protected $image_objects = array(); - - function __construct($options = null, $initialize = true, $error_messages = null) { - $this->response = array(); - - // This is a failsafe function, if the web-UI runs in an - // non-piratebox script environment. That should help - // developing the website more easier. - $t_upload_dir = dirname($this->get_server_var('SCRIPT_FILENAME')).'/../Shared/'; - if ( $this->get_server_var('UPLOAD_PATH') <> "" ) { - $t_upload_dir = $this->get_server_var('UPLOAD_PATH') . '/' ; - } - - $this->options = array( - 'script_url' => $this->get_full_url().'/', - 'upload_dir' => $t_upload_dir , -// this works only, if the upload directory is Shared --->>> TODO - 'upload_url' => $this->get_full_url().'/../Shared/', - 'user_dirs' => false, - 'mkdir_mode' => 0775, - 'param_name' => 'files', - // Set the following option to 'POST', if your server does not support - // DELETE requests. This is a parameter sent to the client: - //'delete_type' => 'DELETE', - 'delete_type' => 'DELETE', - 'access_control_allow_origin' => '*', - 'access_control_allow_credentials' => false, - 'access_control_allow_methods' => array( - 'OPTIONS', - 'HEAD', - 'GET', - 'POST', - 'PUT', - 'PATCH', - 'DELETE' - ), - 'access_control_allow_headers' => array( - 'Content-Type', - 'Content-Range', - 'Content-Disposition' - ), - // Enable to provide file downloads via GET requests to the PHP script: - // 1. Set to 1 to download files via readfile method through PHP - // 2. Set to 2 to send a X-Sendfile header for lighttpd/Apache - // 3. Set to 3 to send a X-Accel-Redirect header for nginx - // If set to 2 or 3, adjust the upload_url option to the base path of - // the redirect parameter, e.g. '/files/'. - 'download_via_php' => false, - // Read files in chunks to avoid memory limits when download_via_php - // is enabled, set to 0 to disable chunked reading of files: - 'readfile_chunk_size' => 10 * 1024 * 1024, // 10 MiB - // Defines which files can be displayed inline when downloaded: - 'inline_file_types' => '/\.(gif|jpe?g|png)$/i', - // Defines which files (based on their names) are accepted for upload: - 'accept_file_types' => '/$/i', - // The php.ini settings upload_max_filesize and post_max_size - // take precedence over the following max_file_size setting: - 'max_file_size' => null, - 'min_file_size' => 1, - // The maximum number of files for the upload directory: - 'max_number_of_files' => null, - // Defines which files are handled as image files: - 'image_file_types' => '/\.(gif|jpe?g|png)$/i', //TODO PIrateBox, maybe empty that out - // Use exif_imagetype on all files to correct file extensions: - 'correct_image_extensions' => false, - // Image resolution restrictions: - 'max_width' => null, - 'max_height' => null, - 'min_width' => 1, - 'min_height' => 1, - // Set the following option to false to enable resumable uploads: - 'discard_aborted_uploads' => true, - // Set to 0 to use the GD library to scale and orient images, - // set to 1 to use imagick (if installed, falls back to GD), - // set to 2 to use the ImageMagick convert binary directly: - 'image_library' => 0, - // Uncomment the following to define an array of resource limits - // for imagick: - /* - 'imagick_resource_limits' => array( - imagick::RESOURCETYPE_MAP => 32, - imagick::RESOURCETYPE_MEMORY => 32 - ), - */ - // Command or path for to the ImageMagick convert binary: - 'convert_bin' => 'convert', - // Uncomment the following to add parameters in front of each - // ImageMagick convert call (the limit constraints seem only - // to have an effect if put in front): - /* - 'convert_params' => '-limit memory 32MiB -limit map 32MiB', - */ - // Command or path for to the ImageMagick identify binary: - 'identify_bin' => 'identify', - 'image_versions' => array( - // The empty image version key defines options for the original image: - '' => array( - // Automatically rotate images based on EXIF meta data: - 'auto_orient' => true - ), - // Uncomment the following to create medium sized images: - /* - 'medium' => array( - 'max_width' => 800, - 'max_height' => 600 - ), - */ - 'thumbnail' => array( - // Uncomment the following to use a defined directory for the thumbnails - // instead of a subdirectory based on the version identifier. - // Make sure that this directory doesn't allow execution of files if you - // don't pose any restrictions on the type of uploaded files, e.g. by - // copying the .htaccess file from the files directory for Apache: - //'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')).'/thumb/', - //'upload_url' => $this->get_full_url().'/thumb/', - // Uncomment the following to force the max - // dimensions and e.g. create square thumbnails: - //'crop' => true, - 'max_width' => 80, - 'max_height' => 80 - ) - ), - 'print_response' => true - ); - if ($options) { - $this->options = $options + $this->options; - } - if ($error_messages) { - $this->error_messages = $error_messages + $this->error_messages; - } - if ($initialize) { - $this->initialize(); - } - } - - protected function initialize() { - switch ($this->get_server_var('REQUEST_METHOD')) { - case 'OPTIONS': - case 'HEAD': - $this->head(); - break; - case 'GET': - $this->get($this->options['print_response']); - break; - case 'PATCH': - case 'PUT': - case 'POST': - $this->post($this->options['print_response']); - break; - case 'DELETE': - $this->delete($this->options['print_response']); - break; - default: - $this->header('HTTP/1.1 405 Method Not Allowed'); - } - } - - protected function get_full_url() { - $https = !empty($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'], 'on') === 0 || - !empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && - strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0; - return - ($https ? 'https://' : 'http://'). - (!empty($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : ''). - (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME']. - ($https && $_SERVER['SERVER_PORT'] === 443 || - $_SERVER['SERVER_PORT'] === 80 ? '' : ':'.$_SERVER['SERVER_PORT']))). - substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], '/')); - } - - protected function get_user_id() { - @session_start(); - return session_id(); - } - - protected function get_user_path() { - if ($this->options['user_dirs']) { - return $this->get_user_id().'/'; - } - return ''; - } - - protected function get_upload_path($file_name = null, $version = null) { - $file_name = $file_name ? $file_name : ''; - if (empty($version)) { - $version_path = ''; - } else { - $version_dir = @$this->options['image_versions'][$version]['upload_dir']; - if ($version_dir) { - return $version_dir.$this->get_user_path().$file_name; - } - $version_path = $version.'/'; - } - return $this->options['upload_dir'].$this->get_user_path() - .$version_path.$file_name; - } - - protected function get_query_separator($url) { - return strpos($url, '?') === false ? '?' : '&'; - } - - protected function get_download_url($file_name, $version = null, $direct = false) { - if (!$direct && $this->options['download_via_php']) { - $url = $this->options['script_url'] - .$this->get_query_separator($this->options['script_url']) - .$this->get_singular_param_name() - .'='.rawurlencode($file_name); - if ($version) { - $url .= '&version='.rawurlencode($version); - } - return $url.'&download=1'; - } - if (empty($version)) { - $version_path = ''; - } else { - $version_url = @$this->options['image_versions'][$version]['upload_url']; - if ($version_url) { - return $version_url.$this->get_user_path().rawurlencode($file_name); - } - $version_path = rawurlencode($version).'/'; - } - return $this->options['upload_url'].$this->get_user_path() - .$version_path.rawurlencode($file_name); - } - - protected function set_additional_file_properties($file) { - $file->deleteUrl = $this->options['script_url'] - .$this->get_query_separator($this->options['script_url']) - .$this->get_singular_param_name() - .'='.rawurlencode($file->name); - $file->deleteType = $this->options['delete_type']; - if ($file->deleteType !== 'DELETE') { - $file->deleteUrl .= '&_method=DELETE'; - } - if ($this->options['access_control_allow_credentials']) { - $file->deleteWithCredentials = true; - } - } - - // Fix for overflowing signed 32 bit integers, - // works for sizes up to 2^32-1 bytes (4 GiB - 1): - protected function fix_integer_overflow($size) { - if ($size < 0) { - $size += 2.0 * (PHP_INT_MAX + 1); - } - return $size; - } - - protected function get_file_size($file_path, $clear_stat_cache = false) { - if ($clear_stat_cache) { - if (version_compare(PHP_VERSION, '5.3.0') >= 0) { - clearstatcache(true, $file_path); - } else { - clearstatcache(); - } - } - return $this->fix_integer_overflow(filesize($file_path)); - } - - protected function is_valid_file_object($file_name) { - $file_path = $this->get_upload_path($file_name); - if (is_file($file_path) && $file_name[0] !== '.') { - return true; - } - return false; - } - - protected function get_file_object($file_name) { - if ($this->is_valid_file_object($file_name)) { - $file = new \stdClass(); - $file->name = $file_name; - $file->size = $this->get_file_size( - $this->get_upload_path($file_name) - ); - $file->url = $this->get_download_url($file->name); - foreach($this->options['image_versions'] as $version => $options) { - if (!empty($version)) { - if (is_file($this->get_upload_path($file_name, $version))) { - $file->{$version.'Url'} = $this->get_download_url( - $file->name, - $version - ); - } - } - } - $this->set_additional_file_properties($file); - return $file; - } - return null; - } - - protected function get_file_objects($iteration_method = 'get_file_object') { - $upload_dir = $this->get_upload_path(); - if (!is_dir($upload_dir)) { - return array(); - } - return array_values(array_filter(array_map( - array($this, $iteration_method), - scandir($upload_dir) - ))); - } - - protected function count_file_objects() { - return count($this->get_file_objects('is_valid_file_object')); - } - - protected function get_error_message($error) { - return isset($this->error_messages[$error]) ? - $this->error_messages[$error] : $error; - } - - function get_config_bytes($val) { - $val = trim($val); - $last = strtolower($val[strlen($val)-1]); - switch($last) { - case 'g': - $val *= 1024; - case 'm': - $val *= 1024; - case 'k': - $val *= 1024; - } - return $this->fix_integer_overflow($val); - } - - protected function validate($uploaded_file, $file, $error, $index) { - if ($error) { - $file->error = $this->get_error_message($error); - return false; - } - $content_length = $this->fix_integer_overflow( - (int)$this->get_server_var('CONTENT_LENGTH') - ); - $post_max_size = $this->get_config_bytes(ini_get('post_max_size')); - if ($post_max_size && ($content_length > $post_max_size)) { - $file->error = $this->get_error_message('post_max_size'); - return false; - } - if (!preg_match($this->options['accept_file_types'], $file->name)) { - $file->error = $this->get_error_message('accept_file_types'); - return false; - } - if ($uploaded_file && is_uploaded_file($uploaded_file)) { - $file_size = $this->get_file_size($uploaded_file); - } else { - $file_size = $content_length; - } - if ($this->options['max_file_size'] && ( - $file_size > $this->options['max_file_size'] || - $file->size > $this->options['max_file_size']) - ) { - $file->error = $this->get_error_message('max_file_size'); - return false; - } - if ($this->options['min_file_size'] && - $file_size < $this->options['min_file_size']) { - $file->error = $this->get_error_message('min_file_size'); - return false; - } - if (is_int($this->options['max_number_of_files']) && - ($this->count_file_objects() >= $this->options['max_number_of_files']) && - // Ignore additional chunks of existing files: - !is_file($this->get_upload_path($file->name))) { - $file->error = $this->get_error_message('max_number_of_files'); - return false; - } - $max_width = @$this->options['max_width']; - $max_height = @$this->options['max_height']; - $min_width = @$this->options['min_width']; - $min_height = @$this->options['min_height']; - if (($max_width || $max_height || $min_width || $min_height) - && preg_match($this->options['image_file_types'], $file->name)) { - list($img_width, $img_height) = $this->get_image_size($uploaded_file); - } - if (!empty($img_width)) { - if ($max_width && $img_width > $max_width) { - $file->error = $this->get_error_message('max_width'); - return false; - } - if ($max_height && $img_height > $max_height) { - $file->error = $this->get_error_message('max_height'); - return false; - } - if ($min_width && $img_width < $min_width) { - $file->error = $this->get_error_message('min_width'); - return false; - } - if ($min_height && $img_height < $min_height) { - $file->error = $this->get_error_message('min_height'); - return false; - } - } - return true; - } - - protected function upcount_name_callback($matches) { - $index = isset($matches[1]) ? ((int)$matches[1]) + 1 : 1; - $ext = isset($matches[2]) ? $matches[2] : ''; - return ' ('.$index.')'.$ext; - } - - protected function upcount_name($name) { - return preg_replace_callback( - '/(?:(?: \(([\d]+)\))?(\.[^.]+))?$/', - array($this, 'upcount_name_callback'), - $name, - 1 - ); - } - - protected function get_unique_filename($file_path, $name, $size, $type, $error, - $index, $content_range) { - while(is_dir($this->get_upload_path($name))) { - $name = $this->upcount_name($name); - } - // Keep an existing filename if this is part of a chunked upload: - $uploaded_bytes = $this->fix_integer_overflow((int)$content_range[1]); - while(is_file($this->get_upload_path($name))) { - if ($uploaded_bytes === $this->get_file_size( - $this->get_upload_path($name))) { - break; - } - $name = $this->upcount_name($name); - } - return $name; - } - - protected function fix_file_extension($file_path, $name, $size, $type, $error, - $index, $content_range) { - // Add missing file extension for known image types: - if (strpos($name, '.') === false && - preg_match('/^image\/(gif|jpe?g|png)/', $type, $matches)) { - $name .= '.'.$matches[1]; - } - if ($this->options['correct_image_extensions'] && - function_exists('exif_imagetype')) { - switch(@exif_imagetype($file_path)){ - case IMAGETYPE_JPEG: - $extensions = array('jpg', 'jpeg'); - break; - case IMAGETYPE_PNG: - $extensions = array('png'); - break; - case IMAGETYPE_GIF: - $extensions = array('gif'); - break; - } - // Adjust incorrect image file extensions: - if (!empty($extensions)) { - $parts = explode('.', $name); - $extIndex = count($parts) - 1; - $ext = strtolower(@$parts[$extIndex]); - if (!in_array($ext, $extensions)) { - $parts[$extIndex] = $extensions[0]; - $name = implode('.', $parts); - } - } - } - return $name; - } - - protected function trim_file_name($file_path, $name, $size, $type, $error, - $index, $content_range) { - // Remove path information and dots around the filename, to prevent uploading - // into different directories or replacing hidden system files. - // Also remove control characters and spaces (\x00..\x20) around the filename: - $name = trim(basename(stripslashes($name)), ".\x00..\x20"); - // Use a timestamp for empty filenames: - if (!$name) { - $name = str_replace('.', '-', microtime(true)); - } - return $name; - } - - protected function get_file_name($file_path, $name, $size, $type, $error, - $index, $content_range) { - $name = $this->trim_file_name($file_path, $name, $size, $type, $error, - $index, $content_range); - return $this->get_unique_filename( - $file_path, - $this->fix_file_extension($file_path, $name, $size, $type, $error, - $index, $content_range), - $size, - $type, - $error, - $index, - $content_range - ); - } - - protected function get_scaled_image_file_paths($file_name, $version) { - $file_path = $this->get_upload_path($file_name); - if (!empty($version)) { - $version_dir = $this->get_upload_path(null, $version); - if (!is_dir($version_dir)) { - mkdir($version_dir, $this->options['mkdir_mode'], true); - } - $new_file_path = $version_dir.'/'.$file_name; - } else { - $new_file_path = $file_path; - } - return array($file_path, $new_file_path); - } - - protected function gd_get_image_object($file_path, $func, $no_cache = false) { - if (empty($this->image_objects[$file_path]) || $no_cache) { - $this->gd_destroy_image_object($file_path); - $this->image_objects[$file_path] = $func($file_path); - } - return $this->image_objects[$file_path]; - } - - protected function gd_set_image_object($file_path, $image) { - $this->gd_destroy_image_object($file_path); - $this->image_objects[$file_path] = $image; - } - - protected function gd_destroy_image_object($file_path) { - $image = (isset($this->image_objects[$file_path])) ? $this->image_objects[$file_path] : null ; - return $image && imagedestroy($image); - } - - protected function gd_imageflip($image, $mode) { - if (function_exists('imageflip')) { - return imageflip($image, $mode); - } - $new_width = $src_width = imagesx($image); - $new_height = $src_height = imagesy($image); - $new_img = imagecreatetruecolor($new_width, $new_height); - $src_x = 0; - $src_y = 0; - switch ($mode) { - case '1': // flip on the horizontal axis - $src_y = $new_height - 1; - $src_height = -$new_height; - break; - case '2': // flip on the vertical axis - $src_x = $new_width - 1; - $src_width = -$new_width; - break; - case '3': // flip on both axes - $src_y = $new_height - 1; - $src_height = -$new_height; - $src_x = $new_width - 1; - $src_width = -$new_width; - break; - default: - return $image; - } - imagecopyresampled( - $new_img, - $image, - 0, - 0, - $src_x, - $src_y, - $new_width, - $new_height, - $src_width, - $src_height - ); - return $new_img; - } - - protected function gd_orient_image($file_path, $src_img) { - if (!function_exists('exif_read_data')) { - return false; - } - $exif = @exif_read_data($file_path); - if ($exif === false) { - return false; - } - $orientation = (int)@$exif['Orientation']; - if ($orientation < 2 || $orientation > 8) { - return false; - } - switch ($orientation) { - case 2: - $new_img = $this->gd_imageflip( - $src_img, - defined('IMG_FLIP_VERTICAL') ? IMG_FLIP_VERTICAL : 2 - ); - break; - case 3: - $new_img = imagerotate($src_img, 180, 0); - break; - case 4: - $new_img = $this->gd_imageflip( - $src_img, - defined('IMG_FLIP_HORIZONTAL') ? IMG_FLIP_HORIZONTAL : 1 - ); - break; - case 5: - $tmp_img = $this->gd_imageflip( - $src_img, - defined('IMG_FLIP_HORIZONTAL') ? IMG_FLIP_HORIZONTAL : 1 - ); - $new_img = imagerotate($tmp_img, 270, 0); - imagedestroy($tmp_img); - break; - case 6: - $new_img = imagerotate($src_img, 270, 0); - break; - case 7: - $tmp_img = $this->gd_imageflip( - $src_img, - defined('IMG_FLIP_VERTICAL') ? IMG_FLIP_VERTICAL : 2 - ); - $new_img = imagerotate($tmp_img, 270, 0); - imagedestroy($tmp_img); - break; - case 8: - $new_img = imagerotate($src_img, 90, 0); - break; - default: - return false; - } - $this->gd_set_image_object($file_path, $new_img); - return true; - } - - protected function gd_create_scaled_image($file_name, $version, $options) { - if (!function_exists('imagecreatetruecolor')) { - error_log('Function not found: imagecreatetruecolor'); - return false; - } - list($file_path, $new_file_path) = - $this->get_scaled_image_file_paths($file_name, $version); - $type = strtolower(substr(strrchr($file_name, '.'), 1)); - switch ($type) { - case 'jpg': - case 'jpeg': - $src_func = 'imagecreatefromjpeg'; - $write_func = 'imagejpeg'; - $image_quality = isset($options['jpeg_quality']) ? - $options['jpeg_quality'] : 75; - break; - case 'gif': - $src_func = 'imagecreatefromgif'; - $write_func = 'imagegif'; - $image_quality = null; - break; - case 'png': - $src_func = 'imagecreatefrompng'; - $write_func = 'imagepng'; - $image_quality = isset($options['png_quality']) ? - $options['png_quality'] : 9; - break; - default: - return false; - } - $src_img = $this->gd_get_image_object( - $file_path, - $src_func, - !empty($options['no_cache']) - ); - $image_oriented = false; - if (!empty($options['auto_orient']) && $this->gd_orient_image( - $file_path, - $src_img - )) { - $image_oriented = true; - $src_img = $this->gd_get_image_object( - $file_path, - $src_func - ); - } - $max_width = $img_width = imagesx($src_img); - $max_height = $img_height = imagesy($src_img); - if (!empty($options['max_width'])) { - $max_width = $options['max_width']; - } - if (!empty($options['max_height'])) { - $max_height = $options['max_height']; - } - $scale = min( - $max_width / $img_width, - $max_height / $img_height - ); - if ($scale >= 1) { - if ($image_oriented) { - return $write_func($src_img, $new_file_path, $image_quality); - } - if ($file_path !== $new_file_path) { - return copy($file_path, $new_file_path); - } - return true; - } - if (empty($options['crop'])) { - $new_width = $img_width * $scale; - $new_height = $img_height * $scale; - $dst_x = 0; - $dst_y = 0; - $new_img = imagecreatetruecolor($new_width, $new_height); - } else { - if (($img_width / $img_height) >= ($max_width / $max_height)) { - $new_width = $img_width / ($img_height / $max_height); - $new_height = $max_height; - } else { - $new_width = $max_width; - $new_height = $img_height / ($img_width / $max_width); - } - $dst_x = 0 - ($new_width - $max_width) / 2; - $dst_y = 0 - ($new_height - $max_height) / 2; - $new_img = imagecreatetruecolor($max_width, $max_height); - } - // Handle transparency in GIF and PNG images: - switch ($type) { - case 'gif': - case 'png': - imagecolortransparent($new_img, imagecolorallocate($new_img, 0, 0, 0)); - case 'png': - imagealphablending($new_img, false); - imagesavealpha($new_img, true); - break; - } - $success = imagecopyresampled( - $new_img, - $src_img, - $dst_x, - $dst_y, - 0, - 0, - $new_width, - $new_height, - $img_width, - $img_height - ) && $write_func($new_img, $new_file_path, $image_quality); - $this->gd_set_image_object($file_path, $new_img); - return $success; - } - - protected function imagick_get_image_object($file_path, $no_cache = false) { - if (empty($this->image_objects[$file_path]) || $no_cache) { - $this->imagick_destroy_image_object($file_path); - $image = new \Imagick(); - if (!empty($this->options['imagick_resource_limits'])) { - foreach ($this->options['imagick_resource_limits'] as $type => $limit) { - $image->setResourceLimit($type, $limit); - } - } - $image->readImage($file_path); - $this->image_objects[$file_path] = $image; - } - return $this->image_objects[$file_path]; - } - - protected function imagick_set_image_object($file_path, $image) { - $this->imagick_destroy_image_object($file_path); - $this->image_objects[$file_path] = $image; - } - - protected function imagick_destroy_image_object($file_path) { - $image = (isset($this->image_objects[$file_path])) ? $this->image_objects[$file_path] : null ; - return $image && $image->destroy(); - } - - protected function imagick_orient_image($image) { - $orientation = $image->getImageOrientation(); - $background = new \ImagickPixel('none'); - switch ($orientation) { - case \imagick::ORIENTATION_TOPRIGHT: // 2 - $image->flopImage(); // horizontal flop around y-axis - break; - case \imagick::ORIENTATION_BOTTOMRIGHT: // 3 - $image->rotateImage($background, 180); - break; - case \imagick::ORIENTATION_BOTTOMLEFT: // 4 - $image->flipImage(); // vertical flip around x-axis - break; - case \imagick::ORIENTATION_LEFTTOP: // 5 - $image->flopImage(); // horizontal flop around y-axis - $image->rotateImage($background, 270); - break; - case \imagick::ORIENTATION_RIGHTTOP: // 6 - $image->rotateImage($background, 90); - break; - case \imagick::ORIENTATION_RIGHTBOTTOM: // 7 - $image->flipImage(); // vertical flip around x-axis - $image->rotateImage($background, 270); - break; - case \imagick::ORIENTATION_LEFTBOTTOM: // 8 - $image->rotateImage($background, 270); - break; - default: - return false; - } - $image->setImageOrientation(\imagick::ORIENTATION_TOPLEFT); // 1 - return true; - } - - protected function imagick_create_scaled_image($file_name, $version, $options) { - list($file_path, $new_file_path) = - $this->get_scaled_image_file_paths($file_name, $version); - $image = $this->imagick_get_image_object( - $file_path, - !empty($options['no_cache']) - ); - if ($image->getImageFormat() === 'GIF') { - // Handle animated GIFs: - $images = $image->coalesceImages(); - foreach ($images as $frame) { - $image = $frame; - $this->imagick_set_image_object($file_name, $image); - break; - } - } - $image_oriented = false; - if (!empty($options['auto_orient'])) { - $image_oriented = $this->imagick_orient_image($image); - } - $new_width = $max_width = $img_width = $image->getImageWidth(); - $new_height = $max_height = $img_height = $image->getImageHeight(); - if (!empty($options['max_width'])) { - $new_width = $max_width = $options['max_width']; - } - if (!empty($options['max_height'])) { - $new_height = $max_height = $options['max_height']; - } - if (!($image_oriented || $max_width < $img_width || $max_height < $img_height)) { - if ($file_path !== $new_file_path) { - return copy($file_path, $new_file_path); - } - return true; - } - $crop = !empty($options['crop']); - if ($crop) { - $x = 0; - $y = 0; - if (($img_width / $img_height) >= ($max_width / $max_height)) { - $new_width = 0; // Enables proportional scaling based on max_height - $x = ($img_width / ($img_height / $max_height) - $max_width) / 2; - } else { - $new_height = 0; // Enables proportional scaling based on max_width - $y = ($img_height / ($img_width / $max_width) - $max_height) / 2; - } - } - $success = $image->resizeImage( - $new_width, - $new_height, - isset($options['filter']) ? $options['filter'] : \imagick::FILTER_LANCZOS, - isset($options['blur']) ? $options['blur'] : 1, - $new_width && $new_height // fit image into constraints if not to be cropped - ); - if ($success && $crop) { - $success = $image->cropImage( - $max_width, - $max_height, - $x, - $y - ); - if ($success) { - $success = $image->setImagePage($max_width, $max_height, 0, 0); - } - } - $type = strtolower(substr(strrchr($file_name, '.'), 1)); - switch ($type) { - case 'jpg': - case 'jpeg': - if (!empty($options['jpeg_quality'])) { - $image->setImageCompression(\imagick::COMPRESSION_JPEG); - $image->setImageCompressionQuality($options['jpeg_quality']); - } - break; - } - if (!empty($options['strip'])) { - $image->stripImage(); - } - return $success && $image->writeImage($new_file_path); - } - - protected function imagemagick_create_scaled_image($file_name, $version, $options) { - list($file_path, $new_file_path) = - $this->get_scaled_image_file_paths($file_name, $version); - $resize = @$options['max_width'] - .(empty($options['max_height']) ? '' : 'X'.$options['max_height']); - if (!$resize && empty($options['auto_orient'])) { - if ($file_path !== $new_file_path) { - return copy($file_path, $new_file_path); - } - return true; - } - $cmd = $this->options['convert_bin']; - if (!empty($this->options['convert_params'])) { - $cmd .= ' '.$this->options['convert_params']; - } - $cmd .= ' '.escapeshellarg($file_path); - if (!empty($options['auto_orient'])) { - $cmd .= ' -auto-orient'; - } - if ($resize) { - // Handle animated GIFs: - $cmd .= ' -coalesce'; - if (empty($options['crop'])) { - $cmd .= ' -resize '.escapeshellarg($resize.'>'); - } else { - $cmd .= ' -resize '.escapeshellarg($resize.'^'); - $cmd .= ' -gravity center'; - $cmd .= ' -crop '.escapeshellarg($resize.'+0+0'); - } - // Make sure the page dimensions are correct (fixes offsets of animated GIFs): - $cmd .= ' +repage'; - } - if (!empty($options['convert_params'])) { - $cmd .= ' '.$options['convert_params']; - } - $cmd .= ' '.escapeshellarg($new_file_path); - exec($cmd, $output, $error); - if ($error) { - error_log(implode('\n', $output)); - return false; - } - return true; - } - - protected function get_image_size($file_path) { - if ($this->options['image_library']) { - if (extension_loaded('imagick')) { - $image = new \Imagick(); - try { - if (@$image->pingImage($file_path)) { - $dimensions = array($image->getImageWidth(), $image->getImageHeight()); - $image->destroy(); - return $dimensions; - } - return false; - } catch (Exception $e) { - error_log($e->getMessage()); - } - } - if ($this->options['image_library'] === 2) { - $cmd = $this->options['identify_bin']; - $cmd .= ' -ping '.escapeshellarg($file_path); - exec($cmd, $output, $error); - if (!$error && !empty($output)) { - // image.jpg JPEG 1920x1080 1920x1080+0+0 8-bit sRGB 465KB 0.000u 0:00.000 - $infos = preg_split('/\s+/', $output[0]); - $dimensions = preg_split('/x/', $infos[2]); - return $dimensions; - } - return false; - } - } - if (!function_exists('getimagesize')) { - error_log('Function not found: getimagesize'); - return false; - } - return @getimagesize($file_path); - } - - protected function create_scaled_image($file_name, $version, $options) { - if ($this->options['image_library'] === 2) { - return $this->imagemagick_create_scaled_image($file_name, $version, $options); - } - if ($this->options['image_library'] && extension_loaded('imagick')) { - return $this->imagick_create_scaled_image($file_name, $version, $options); - } - return $this->gd_create_scaled_image($file_name, $version, $options); - } - - protected function destroy_image_object($file_path) { - if ($this->options['image_library'] && extension_loaded('imagick')) { - return $this->imagick_destroy_image_object($file_path); - } - } - - protected function is_valid_image_file($file_path) { - if (!preg_match($this->options['image_file_types'], $file_path)) { - return false; - } - if (function_exists('exif_imagetype')) { - return @exif_imagetype($file_path); - } - $image_info = $this->get_image_size($file_path); - return $image_info && $image_info[0] && $image_info[1]; - } - - protected function handle_image_file($file_path, $file) { - $failed_versions = array(); - foreach($this->options['image_versions'] as $version => $options) { - if ($this->create_scaled_image($file->name, $version, $options)) { - if (!empty($version)) { - $file->{$version.'Url'} = $this->get_download_url( - $file->name, - $version - ); - } else { - $file->size = $this->get_file_size($file_path, true); - } - } else { - $failed_versions[] = $version ? $version : 'original'; - } - } - if (count($failed_versions)) { - $file->error = $this->get_error_message('image_resize') - .' ('.implode($failed_versions,', ').')'; - } - // Free memory: - $this->destroy_image_object($file_path); - } - - protected function handle_file_upload($uploaded_file, $name, $size, $type, $error, - $index = null, $content_range = null) { - $file = new \stdClass(); - $file->name = $this->get_file_name($uploaded_file, $name, $size, $type, $error, - $index, $content_range); - $file->size = $this->fix_integer_overflow((int)$size); - $file->type = $type; - if ($this->validate($uploaded_file, $file, $error, $index)) { - $this->handle_form_data($file, $index); - $upload_dir = $this->get_upload_path(); - if (!is_dir($upload_dir)) { - mkdir($upload_dir, $this->options['mkdir_mode'], true); - } - $file_path = $this->get_upload_path($file->name); - $append_file = $content_range && is_file($file_path) && - $file->size > $this->get_file_size($file_path); - if ($uploaded_file && is_uploaded_file($uploaded_file)) { - // multipart/formdata uploads (POST method uploads) - if ($append_file) { - file_put_contents( - $file_path, - fopen($uploaded_file, 'r'), - FILE_APPEND - ); - } else { - move_uploaded_file($uploaded_file, $file_path); - } - } else { - // Non-multipart uploads (PUT method support) - file_put_contents( - $file_path, - fopen('php://input', 'r'), - $append_file ? FILE_APPEND : 0 - ); - } - $file_size = $this->get_file_size($file_path, $append_file); - if ($file_size === $file->size) { - $file->url = $this->get_download_url($file->name); - if ($this->is_valid_image_file($file_path)) { - $this->handle_image_file($file_path, $file); - } - } else { - $file->size = $file_size; - if (!$content_range && $this->options['discard_aborted_uploads']) { - unlink($file_path); - $file->error = $this->get_error_message('abort'); - } - } - $this->set_additional_file_properties($file); - } - return $file; - } - - protected function readfile($file_path) { - $file_size = $this->get_file_size($file_path); - $chunk_size = $this->options['readfile_chunk_size']; - if ($chunk_size && $file_size > $chunk_size) { - $handle = fopen($file_path, 'rb'); - while (!feof($handle)) { - echo fread($handle, $chunk_size); - @ob_flush(); - @flush(); - } - fclose($handle); - return $file_size; - } - return readfile($file_path); - } - - protected function body($str) { - echo $str; - } - - protected function header($str) { - header($str); - } - - protected function get_upload_data($id) { - return @$_FILES[$id]; - } - - protected function get_query_param($id) { - return @$_GET[$id]; - } - - protected function get_server_var($id) { - return @$_SERVER[$id]; - } - - protected function handle_form_data($file, $index) { - // Handle form data, e.g. $_POST['description'][$index] - } - - protected function get_version_param() { - return basename(stripslashes($this->get_query_param('version'))); - } - - protected function get_singular_param_name() { - return substr($this->options['param_name'], 0, -1); - } - - protected function get_file_name_param() { - $name = $this->get_singular_param_name(); - return basename(stripslashes($this->get_query_param($name))); - } - - protected function get_file_names_params() { - $params = $this->get_query_param($this->options['param_name']); - if (!$params) { - return null; - } - foreach ($params as $key => $value) { - $params[$key] = basename(stripslashes($value)); - } - return $params; - } - - protected function get_file_type($file_path) { - switch (strtolower(pathinfo($file_path, PATHINFO_EXTENSION))) { - case 'jpeg': - case 'jpg': - return 'image/jpeg'; - case 'png': - return 'image/png'; - case 'gif': - return 'image/gif'; - default: - return ''; - } - } - - protected function download() { - switch ($this->options['download_via_php']) { - case 1: - $redirect_header = null; - break; - case 2: - $redirect_header = 'X-Sendfile'; - break; - case 3: - $redirect_header = 'X-Accel-Redirect'; - break; - default: - return $this->header('HTTP/1.1 403 Forbidden'); - } - $file_name = $this->get_file_name_param(); - if (!$this->is_valid_file_object($file_name)) { - return $this->header('HTTP/1.1 404 Not Found'); - } - if ($redirect_header) { - return $this->header( - $redirect_header.': '.$this->get_download_url( - $file_name, - $this->get_version_param(), - true - ) - ); - } - $file_path = $this->get_upload_path($file_name, $this->get_version_param()); - // Prevent browsers from MIME-sniffing the content-type: - $this->header('X-Content-Type-Options: nosniff'); - if (!preg_match($this->options['inline_file_types'], $file_name)) { - $this->header('Content-Type: application/octet-stream'); - $this->header('Content-Disposition: attachment; filename="'.$file_name.'"'); - } else { - $this->header('Content-Type: '.$this->get_file_type($file_path)); - $this->header('Content-Disposition: inline; filename="'.$file_name.'"'); - } - $this->header('Content-Length: '.$this->get_file_size($file_path)); - $this->header('Last-Modified: '.gmdate('D, d M Y H:i:s T', filemtime($file_path))); - $this->readfile($file_path); - } - - protected function send_content_type_header() { - $this->header('Vary: Accept'); - if (strpos($this->get_server_var('HTTP_ACCEPT'), 'application/json') !== false) { - $this->header('Content-type: application/json'); - } else { - $this->header('Content-type: text/plain'); - } - } - - protected function send_access_control_headers() { - $this->header('Access-Control-Allow-Origin: '.$this->options['access_control_allow_origin']); - $this->header('Access-Control-Allow-Credentials: ' - .($this->options['access_control_allow_credentials'] ? 'true' : 'false')); - $this->header('Access-Control-Allow-Methods: ' - .implode(', ', $this->options['access_control_allow_methods'])); - $this->header('Access-Control-Allow-Headers: ' - .implode(', ', $this->options['access_control_allow_headers'])); - } - - public function generate_response($content, $print_response = true) { - $this->response = $content; - if ($print_response) { - $json = json_encode($content); - $redirect = stripslashes($this->get_query_param('redirect')); - if ($redirect) { - $this->header('Location: '.sprintf($redirect, rawurlencode($json))); - return; - } - $this->head(); - if ($this->get_server_var('HTTP_CONTENT_RANGE')) { - $files = isset($content[$this->options['param_name']]) ? - $content[$this->options['param_name']] : null; - if ($files && is_array($files) && is_object($files[0]) && $files[0]->size) { - $this->header('Range: 0-'.( - $this->fix_integer_overflow((int)$files[0]->size) - 1 - )); - } - } - $this->body($json); - } - return $content; - } - - public function get_response () { - return $this->response; - } - - public function head() { - $this->header('Pragma: no-cache'); - $this->header('Cache-Control: no-store, no-cache, must-revalidate'); - $this->header('Content-Disposition: inline; filename="files.json"'); - // Prevent Internet Explorer from MIME-sniffing the content-type: - $this->header('X-Content-Type-Options: nosniff'); - if ($this->options['access_control_allow_origin']) { - $this->send_access_control_headers(); - } - $this->send_content_type_header(); - } - - public function get($print_response = true) { - if ($print_response && $this->get_query_param('download')) { - return $this->download(); - } - $file_name = $this->get_file_name_param(); - if ($file_name) { - $response = array( - $this->get_singular_param_name() => $this->get_file_object($file_name) - ); - } else { - $response = array( - $this->options['param_name'] => $this->get_file_objects() - ); - } - return $this->generate_response($response, $print_response); - } - - public function post($print_response = true) { - if ($this->get_query_param('_method') === 'DELETE') { - return $this->delete($print_response); - } - $upload = $this->get_upload_data($this->options['param_name']); - // Parse the Content-Disposition header, if available: - $content_disposition_header = $this->get_server_var('HTTP_CONTENT_DISPOSITION'); - $file_name = $content_disposition_header ? - rawurldecode(preg_replace( - '/(^[^"]+")|("$)/', - '', - $content_disposition_header - )) : null; - // Parse the Content-Range header, which has the following form: - // Content-Range: bytes 0-524287/2000000 - $content_range_header = $this->get_server_var('HTTP_CONTENT_RANGE'); - $content_range = $content_range_header ? - preg_split('/[^0-9]+/', $content_range_header) : null; - $size = $content_range ? $content_range[3] : null; - $files = array(); - if ($upload) { - if (is_array($upload['tmp_name'])) { - // param_name is an array identifier like "files[]", - // $upload is a multi-dimensional array: - foreach ($upload['tmp_name'] as $index => $value) { - $files[] = $this->handle_file_upload( - $upload['tmp_name'][$index], - $file_name ? $file_name : $upload['name'][$index], - $size ? $size : $upload['size'][$index], - $upload['type'][$index], - $upload['error'][$index], - $index, - $content_range - ); - } - } else { - // param_name is a single object identifier like "file", - // $upload is a one-dimensional array: - $files[] = $this->handle_file_upload( - isset($upload['tmp_name']) ? $upload['tmp_name'] : null, - $file_name ? $file_name : (isset($upload['name']) ? - $upload['name'] : null), - $size ? $size : (isset($upload['size']) ? - $upload['size'] : $this->get_server_var('CONTENT_LENGTH')), - isset($upload['type']) ? - $upload['type'] : $this->get_server_var('CONTENT_TYPE'), - isset($upload['error']) ? $upload['error'] : null, - null, - $content_range - ); - } - } - $response = array($this->options['param_name'] => $files); - return $this->generate_response($response, $print_response); - } - - public function delete($print_response = true) { - $file_names = $this->get_file_names_params(); - if (empty($file_names)) { - $file_names = array($this->get_file_name_param()); - } - $response = array(); - foreach($file_names as $file_name) { - $file_path = $this->get_upload_path($file_name); - $success = is_file($file_path) && $file_name[0] !== '.' && unlink($file_path); - if ($success) { - foreach($this->options['image_versions'] as $version => $options) { - if (!empty($version)) { - $file = $this->get_upload_path($file_name, $version); - if (is_file($file)) { - unlink($file); - } - } - } - } - $response[$file_name] = $success; - } - return $this->generate_response($response, $print_response); - } - -} diff --git a/piratebox/piratebox/www/upload_handler/files/.htaccess b/piratebox/piratebox/www/upload_handler/files/.htaccess deleted file mode 100644 index 6c53add..0000000 --- a/piratebox/piratebox/www/upload_handler/files/.htaccess +++ /dev/null @@ -1,23 +0,0 @@ -# The following directives prevent the execution of script files -# in the context of the website. -# They also force the content-type application/octet-stream and -# force browsers to display a download dialog for non-image files. -SetHandler None -ForceType application/octet-stream -Header set Content-Disposition attachment - -# The following unsets the forced type and Content-Disposition headers -# for known image files: - - ForceType none - Header unset Content-Disposition - - -# The following directive prevents browsers from MIME-sniffing the content-type. -# This is an important complement to the ForceType directive above: -Header set X-Content-Type-Options nosniff - -# Uncomment the following lines to prevent unauthorized download of files: -#AuthName "Authorization required" -#AuthType Basic -#require valid-user diff --git a/piratebox/piratebox/www/upload_handler/index.php b/piratebox/piratebox/www/upload_handler/index.php deleted file mode 100644 index 3ae1295..0000000 --- a/piratebox/piratebox/www/upload_handler/index.php +++ /dev/null @@ -1,15 +0,0 @@ - Date: Thu, 14 Apr 2016 20:10:26 +0200 Subject: [PATCH 149/183] added client isolation --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 2a2a8ee..3a40415 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,7 @@ CHANGELOG * [New] [OpenWrt] Redirect all DNS requests to local box * [New] [OpenWrt] Redirect all web request option (disabled) * [New] [OpenWrt] Enable all wifi devices with the PirateBox SSID +* [New] [OpenWrt] AP Client isolation activated per default === 1.0.7 === * [New] Lock shoutbox when you send a message. From 143e14d3100f2912ffd2cee059bc34c1011f4901 Mon Sep 17 00:00:00 2001 From: Cas de Reuver Date: Sun, 17 Apr 2016 22:10:03 +0200 Subject: [PATCH 150/183] Droopy: block index.php uploads Merge pull request #148 from casdr/hotfix-droopy-block-index-php --- AUTHORS | 1 + piratebox/piratebox/bin/droopy | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 5fce44b..34eea75 100644 --- a/AUTHORS +++ b/AUTHORS @@ -23,6 +23,7 @@ Contributors for modifications: # Jess Stubenbord # Mike Weaver # bartschat - RTC RPi feature + # casdr # ... and all others I might have forgotten. diff --git a/piratebox/piratebox/bin/droopy b/piratebox/piratebox/bin/droopy index 43f55e7..503ca77 100755 --- a/piratebox/piratebox/bin/droopy +++ b/piratebox/piratebox/bin/droopy @@ -6,6 +6,7 @@ # Licensed under the New BSD License. # Changelog +# 20160417 * Block index.php uploads # 20131121 * Update HTML/CSS for mobile devices # * Add HTTPS support # * Add HTTP basic authentication @@ -836,7 +837,7 @@ class HTTPUploadHandler(BaseHTTPServer.BaseHTTPRequestHandler): continue - if filename.lower() == "index.html" or filename.lower() == "index.htm": + if filename.lower() == "index.html" or filename.lower() == "index.htm" or filename.lower() == "index.php": self.send_response(303) self.send_header('Location', '/') self.end_headers() From cfae4ebfb69c64547db19a9715b2db840f6a8a40 Mon Sep 17 00:00:00 2001 From: geekspourjesus Date: Mon, 25 Apr 2016 16:47:33 +0200 Subject: [PATCH 151/183] Update data.fr.properties fixed accentuation --- piratebox/piratebox/www/locales/data.fr.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piratebox/piratebox/www/locales/data.fr.properties b/piratebox/piratebox/www/locales/data.fr.properties index a48c3d8..f4e44d1 100644 --- a/piratebox/piratebox/www/locales/data.fr.properties +++ b/piratebox/piratebox/www/locales/data.fr.properties @@ -18,7 +18,7 @@ sidebarBrowseFiles = Parcourir les fichiers -> diskUsage = Espace de stockage refreshButton.value = Rafra chir -refreshButton.title = Le taux d'utilisation du disque ne peut tre rafra chi que toutes les 5 minutes +refreshButton.title = Le taux d'utilisation du disque ne peut être rafraîchi que toutes les 5 minutes mainChatChat = Chat mainChatSend.value = Envoyer From 5f98a0dcf25d989ce5cb5d7b6cc8d96f4974f06b Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 26 Apr 2016 20:41:14 +0200 Subject: [PATCH 152/183] Fix message problems with droopy startup --- piratebox/piratebox/init.d/piratebox | 2 +- piratebox/piratebox/init.d/piratebox_alt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index f9634b9..817fabb 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -153,6 +153,7 @@ case "$1" in if [ "$DROOPY_ENABLED" = "yes" ] ; then #Start here the PirateBox-Parts droopy i.e. + log_daemon_msg "Starting droopy..." #Delete 0 Byte Files delete_empty.sh $UPLOADFOLDER find $UPLOADFOLDER/ -iname tmp\* -exec rm {} \; @@ -161,7 +162,6 @@ case "$1" in if [ "$DROOPY_USE_USER" = "yes" ] ; then DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP " fi - log_daemon_msg "Starting droopy..." start-stop-daemon $DROOPY_USER -m --start --background --pidfile $PIDFILE_DROOPY --exec $PIRATEBOX/bin/droopy -- -d "$UPLOADFOLDER" -m "$DROOPY_TXT" --chmod $DROOPY_CHMOD $DROOPY_USERDIR $DROOPY_PORT log_end_msg $? fi diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index 9dc4262..2158bb0 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -144,7 +144,8 @@ case "$1" in if [ "$DROOPY_ENABLED" = "yes" ] ; then - #Start here the PirateBox-Parts droopy i.e. echo "Starting droopy..." + #Start here the PirateBox-Parts droopy i.e. + echo "Starting droopy..." find $UPLOADFOLDER/ -iname tmp\* -exec rm {} \; #Delete 0 Byte Files delete_empty.sh $UPLOADFOLDER From 6c2c691b40de0032fe7f68fd81abfd07487c7341 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 26 Apr 2016 21:05:20 +0200 Subject: [PATCH 153/183] PHP feature: We ship it disabled per default. - User needs to opt-in - Unrestricted, execution, currently Fixed #130 --- .../piratebox/conf/lighttpd/fastcgi.conf | 25 ------------------- .../piratebox/conf/lighttpd/lighttpd.conf | 8 +++++- 2 files changed, 7 insertions(+), 26 deletions(-) delete mode 100644 piratebox/piratebox/conf/lighttpd/fastcgi.conf diff --git a/piratebox/piratebox/conf/lighttpd/fastcgi.conf b/piratebox/piratebox/conf/lighttpd/fastcgi.conf deleted file mode 100644 index 87ba268..0000000 --- a/piratebox/piratebox/conf/lighttpd/fastcgi.conf +++ /dev/null @@ -1,25 +0,0 @@ -#-------------------- FAST CGI stuff - -server.modules += ( "mod_fastcgi" ) -fastcgi.server = ( - ".php" => (( - "bin-path" => "/usr/bin/php-cgi", - "socket" => "/tmp/php.socket", - "max-procs" => 1 - )) -) - -# Run a specific php script when the URL /generate_204 is requested. -# Android clients request this URL to check for a full working -# internet connection, we want to fake a reply. This config section is -# a hack to make a php script without the ".php" extension work when -# mod_rewrite is not available. -$HTTP["url"] =~ "^/generate_204$" { - fastcgi.server = ( - "" => (( - "bin-path" => "/usr/bin/php-cgi", - "socket" => "/tmp/php.socket", - "max-procs" => 1 - )) - ) -} diff --git a/piratebox/piratebox/conf/lighttpd/lighttpd.conf b/piratebox/piratebox/conf/lighttpd/lighttpd.conf index eccf386..cf20728 100644 --- a/piratebox/piratebox/conf/lighttpd/lighttpd.conf +++ b/piratebox/piratebox/conf/lighttpd/lighttpd.conf @@ -7,6 +7,7 @@ server.modules = ( "mod_redirect", # "mod_rewrite", "mod_setenv", + "mod_fastcgi" ) server.document-root = "/opt/piratebox/www" @@ -114,4 +115,9 @@ $HTTP["useragent"] =~ "CaptiveNetworkSupport" { server.error-handler-404 = "/success.html" } -include "/opt/piratebox/conf/lighttpd/fastcgi.conf" + +include "/opt/piratebox/conf/lighttpd/fastcgi-php-generate203.conf" + +## Uncommenting the following line enables PHP for the +## complete PirateBox +#include "/opt/piratebox/conf/lighttpd/fastcgi-php.conf" From 5238737137a8db2961b3d13ec19baa9ccfff388c Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 26 Apr 2016 21:09:50 +0200 Subject: [PATCH 154/183] Cleanup Changelog --- CHANGELOG | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3a40415..aa397a6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,22 +4,19 @@ CHANGELOG * [New] Enable / Disable file provisioning for custom lighttpd directory listing * [New] ChatBox message is now in conf/chat_init.txt * [New] Disable the Shoutbox to prevent writing into it -* [New] Enable PHP using as default parsing language to enable easier modification -* [New] Mesh implementation +* [New] PHP configuration shipped, to enable easily for modifications +* [New] Mesh implementation, technical preview. * [New] JSON config file to direct client side applications, like "share apps" * [New] Simply python IRC Server installed and prepareable for automatic start * [New] Shoutbox-Time via Client-Date possible -* [New] jQuery Upload form with multi-chunk upload (Still TODO for better integration) -* [New] IRC Server Option * [New] [RPi] Service files for using a RTC at PiratBox -* [Changed] Send HTTP-Code 204 via PHP, much cleaner. -* [Changed] Droopy is now disabled per default -* [Fix] License Adjustments -* [Fix] Prevent JS Injection in Shoutbox * [New] [OpenWrt] Redirect all DNS requests to local box * [New] [OpenWrt] Redirect all web request option (disabled) * [New] [OpenWrt] Enable all wifi devices with the PirateBox SSID * [New] [OpenWrt] AP Client isolation activated per default +* [Changed] Send HTTP-Code 204 via PHP, much cleaner. +* [Fix] License Adjustments +* [Fix] Prevent JS Injection in Shoutbox === 1.0.7 === * [New] Lock shoutbox when you send a message. From 0c357e1184ac347b9a0b9a7a103395ad209ed678 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 26 Apr 2016 21:12:18 +0200 Subject: [PATCH 155/183] jQuery Update to 2.2.3 Closed: #129 --- piratebox/piratebox/www/js/jquery.min.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/piratebox/piratebox/www/js/jquery.min.js b/piratebox/piratebox/www/js/jquery.min.js index ab28a24..b8c4187 100644 --- a/piratebox/piratebox/www/js/jquery.min.js +++ b/piratebox/piratebox/www/js/jquery.min.js @@ -1,4 +1,4 @@ -/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; -if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/\s*$/g,rb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:k.htmlSerialize?[0,"",""]:[1,"X
","
"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?""!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m(" -

Browse Files ->

-
- -
-

Disk Usage

-
-
-
- - -
-
- - - -
-
-

Chat

-
-
-
- - - -
-
-

Text Color:

- - - - - -
- - - -
-
- - - -
-
-
-

Back to top

-

About PirateBox

-

Inspired by pirate radio and the free culture movement, PirateBox is a self-contained mobile collaboration and file sharing device. PirateBox utilizes Free, Libre and Open Source software (FLOSS) to create mobile wireless file sharing networks where users can anonymously share images, video, audio, documents, and other digital content.

-

PirateBox is designed to be safe and secure. No logins are required and no user data is logged. The system is purposely not connected to the Internet in order to prevent tracking and preserve user privacy.

- PirateBox is licensed under GPLv3. -
-
-
- + +Redirect diff --git a/piratebox/piratebox/www/redirect.html b/piratebox/piratebox/www/redirect.html index 500a68b..81848cc 100755 --- a/piratebox/piratebox/www/redirect.html +++ b/piratebox/piratebox/www/redirect.html @@ -1,6 +1,6 @@ Redirect... - + diff --git a/piratebox/piratebox/www/css/jquery-ui.min.css b/piratebox/piratebox/www_content/css/jquery-ui.min.css similarity index 100% rename from piratebox/piratebox/www/css/jquery-ui.min.css rename to piratebox/piratebox/www_content/css/jquery-ui.min.css diff --git a/piratebox/piratebox/www/css/page_style.css b/piratebox/piratebox/www_content/css/page_style.css similarity index 100% rename from piratebox/piratebox/www/css/page_style.css rename to piratebox/piratebox/www_content/css/page_style.css diff --git a/piratebox/piratebox/www/favicon.ico b/piratebox/piratebox/www_content/favicon.ico similarity index 100% rename from piratebox/piratebox/www/favicon.ico rename to piratebox/piratebox/www_content/favicon.ico diff --git a/piratebox/piratebox/www/img/menu.png b/piratebox/piratebox/www_content/img/menu.png similarity index 100% rename from piratebox/piratebox/www/img/menu.png rename to piratebox/piratebox/www_content/img/menu.png diff --git a/piratebox/piratebox/www/img/piratebox-logo-horizontal-white.png b/piratebox/piratebox/www_content/img/piratebox-logo-horizontal-white.png similarity index 100% rename from piratebox/piratebox/www/img/piratebox-logo-horizontal-white.png rename to piratebox/piratebox/www_content/img/piratebox-logo-horizontal-white.png diff --git a/piratebox/piratebox/www/img/piratebox-logo-small.png b/piratebox/piratebox/www_content/img/piratebox-logo-small.png similarity index 100% rename from piratebox/piratebox/www/img/piratebox-logo-small.png rename to piratebox/piratebox/www_content/img/piratebox-logo-small.png diff --git a/piratebox/piratebox/www_content/index.html b/piratebox/piratebox/www_content/index.html new file mode 100644 index 0000000..f5800fe --- /dev/null +++ b/piratebox/piratebox/www_content/index.html @@ -0,0 +1,114 @@ + + + + + PirateBox - Share Freely! + + + + + + + + + + + + + + +
+
+
+
+

Welcome

+

Now, first of all, there is nothing illegal or scary going on here. This is a social place where you can chat and share files with people around you, anonymously! This is an off-line network, specially designed and developed for file-sharing and chat services. Staying off the grid is a precaution to maintain your full anonymity. Please have fun, chat with people, and feel free to share any files you may like.

+ +
+
+ + +
+
+

Chat

+
+
+
+ + + +
+
+

Text Color:

+ + + + + +
+ + + +
+
+
+
+ +
+
+
+

Back to top

+

About PirateBox

+

Inspired by pirate radio and the free culture movement, PirateBox is a self-contained mobile collaboration and file sharing device. PirateBox utilizes Free, Libre and Open Source software (FLOSS) to create mobile wireless file sharing networks where users can anonymously share images, video, audio, documents, and other digital content.

+

PirateBox is designed to be safe and secure. No logins are required and no user data is logged. The system is purposely not connected to the Internet in order to prevent tracking and preserve user privacy.

+ PirateBox is licensed under GPLv3. +
+
+
+ + + diff --git a/piratebox/piratebox/www/js/jquery-ui.min.js b/piratebox/piratebox/www_content/js/jquery-ui.min.js similarity index 100% rename from piratebox/piratebox/www/js/jquery-ui.min.js rename to piratebox/piratebox/www_content/js/jquery-ui.min.js diff --git a/piratebox/piratebox/www/js/jquery.min.js b/piratebox/piratebox/www_content/js/jquery.min.js similarity index 100% rename from piratebox/piratebox/www/js/jquery.min.js rename to piratebox/piratebox/www_content/js/jquery.min.js diff --git a/piratebox/piratebox/www/js/l10n.js b/piratebox/piratebox/www_content/js/l10n.js similarity index 100% rename from piratebox/piratebox/www/js/l10n.js rename to piratebox/piratebox/www_content/js/l10n.js diff --git a/piratebox/piratebox/www/js/scripts.js b/piratebox/piratebox/www_content/js/scripts.js similarity index 98% rename from piratebox/piratebox/www/js/scripts.js rename to piratebox/piratebox/www_content/js/scripts.js index 5f60bc2..81ad46d 100755 --- a/piratebox/piratebox/www/js/scripts.js +++ b/piratebox/piratebox/www_content/js/scripts.js @@ -104,7 +104,7 @@ $(document).ready(function() { }); function refresh_shoutbox () { - $.get('chat_content.html', function(data) { + $.get('/chat_content.html', function(data) { $('div#shoutbox').html(data); }); } @@ -133,7 +133,7 @@ function display_shoutbox() { } function refresh_diskusage() { - $.get('diskusage.html', function(data) { + $.get('/diskusage.html', function(data) { $('div#diskusage').html(data); }); } diff --git a/piratebox/piratebox/www/locales/data.de.properties b/piratebox/piratebox/www_content/locales/data.de.properties similarity index 100% rename from piratebox/piratebox/www/locales/data.de.properties rename to piratebox/piratebox/www_content/locales/data.de.properties diff --git a/piratebox/piratebox/www/locales/data.en.properties b/piratebox/piratebox/www_content/locales/data.en.properties similarity index 100% rename from piratebox/piratebox/www/locales/data.en.properties rename to piratebox/piratebox/www_content/locales/data.en.properties diff --git a/piratebox/piratebox/www/locales/data.fr.properties b/piratebox/piratebox/www_content/locales/data.fr.properties similarity index 100% rename from piratebox/piratebox/www/locales/data.fr.properties rename to piratebox/piratebox/www_content/locales/data.fr.properties diff --git a/piratebox/piratebox/www/locales/locales.ini b/piratebox/piratebox/www_content/locales/locales.ini similarity index 100% rename from piratebox/piratebox/www/locales/locales.ini rename to piratebox/piratebox/www_content/locales/locales.ini From 09d04d8ff7ea63c163840c7a64cc2625118664be Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 10 May 2016 20:09:49 +0200 Subject: [PATCH 160/183] Better handling of content folder and more dependeing changes --> Design-Stuff to USB Stick #107 --- piratebox/piratebox/bin/install_piratebox.sh | 26 ++++++++++++++------ piratebox/piratebox/conf/piratebox.conf | 1 + piratebox/piratebox/init.d/piratebox | 7 +++++- piratebox/piratebox/init.d/piratebox_alt | 8 ++++++ piratebox/piratebox/src/redirect.html.schema | 2 +- 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh index 30cc9f9..dd8248c 100755 --- a/piratebox/piratebox/bin/install_piratebox.sh +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -3,6 +3,22 @@ ## created by Matthias Strubel (c)2011-2014 GPL-3 ## +create_content_folder(){ + + echo "Creating 'content' folder on USB stick and move over stuff" + mkdir -p $WWW_CONTENT + cp -r $PIRATEBOX_FOLDER/www_content/* $WWW_CONTENT + + [ ! -L $PIRATEBOX_FOLDER/www/content ] && \ + ln -s $WWW_CONTENT $WWW_FOLDER/content + [ ! -e $WWW_FOLDER/favicon.ico ] && \ + ln -s $WWW_CONTENT/favicon.ico $WWW_FOLDER + + chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $WWW_CONTENT -R + chmod u+rw $WWW_CONTENT + return 0 +} + # Load configfile if [ -z $1 ] || [ -z $2 ]; then @@ -49,13 +65,6 @@ if [ $2 = 'part2' ] ; then mkdir -p $PIRATEBOX_FOLDER/share/tmp mkdir -p $PIRATEBOX_FOLDER/tmp - #Create a content folder copy to the USB Stick - cp -rv $PIRATEBOX_FOLDER/www_content $PIRATEBOX_FOLDER/share - [ ! -L $PIRATEBOX_FOLDER/www/content ] && \ - ln -s $PIRATEBOX_FOLDER/share/www_content $WWW_FOLDER/content - [ ! -e $WWW_FOLDER/favicon.ico ] && \ - ln -s $PIRATEBOX_FOLDER/share/www_content/favicon.ico $WWW_FOLDER - #Distribute the Directory Listing files $PIRATEBOX_FOLDER/bin/distribute_files.sh $SHARE_FOLDER/Shared true #Set permissions @@ -159,3 +168,6 @@ if [ $2 = "hostname" ] ; then echo "..done" fi +if [ $2 = "content" ] ; then + create_content_folder +fi diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index 21fd018..e4acc74 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -20,6 +20,7 @@ PIRATEBOX_FOLDER="/opt/piratebox" WWW_FOLDER="/opt/piratebox/www" +WWW_CONTENT="/opt/piratebox/share/content" #Do not change untill really needed. PIRATEBOX_PYTHONPATH="$PIRATEBOX_FOLDER/python_lib" diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index 817fabb..7b95fff 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -69,7 +69,12 @@ else fi - +# Recreate the content folder, if it was deleted +# only if it is not already existing. +# This can be any time. +if [ ! -d $WWW_CONTENT ] ; then + $PIRATEBOX/bin/install_piratebox.sh "$CONF" content +fi # Command Line for DNSMASQ, use extra config file generated from command above CMD_DNSMASQ="-x $PIDFILE_DNSMASQ -C $CONF_DNSMASQ " diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index 2158bb0..8c1be33 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -62,6 +62,14 @@ else fi +# Recreate the content folder, if it was deleted +# only if it is not already existing. +# This can be any time. +if [ ! -d $WWW_CONTENT ] ; then + $PIRATEBOX/bin/install_piratebox.sh "$CONF" content +fi + + # Command Line for DNSMASQ, use extra config file generated from command above CMD_DNSMASQ="-x $PIDFILE_DNSMASQ -C $CONF_DNSMASQ " diff --git a/piratebox/piratebox/src/redirect.html.schema b/piratebox/piratebox/src/redirect.html.schema index eeb2d67..7dd58cc 100644 --- a/piratebox/piratebox/src/redirect.html.schema +++ b/piratebox/piratebox/src/redirect.html.schema @@ -1,6 +1,6 @@ Redirect... - + From 70163b91765e77ca0db737b8df6b9809ade3864f Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 12 May 2016 18:10:51 +0200 Subject: [PATCH 161/183] Fixing missing path --- piratebox/piratebox/www_content/js/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piratebox/piratebox/www_content/js/scripts.js b/piratebox/piratebox/www_content/js/scripts.js index 81ad46d..e472cf0 100755 --- a/piratebox/piratebox/www_content/js/scripts.js +++ b/piratebox/piratebox/www_content/js/scripts.js @@ -1,5 +1,5 @@ $(document).ready(function() { - $.get('station_cnt.txt', function(data) { + $.get('/station_cnt.txt', function(data) { $('div#station').html(data); }); From 3ec6750049f0973ab54c5c6cded631b2b47d81d1 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 12 May 2016 18:11:32 +0200 Subject: [PATCH 162/183] Shoutbox: Add a space between name and text --- piratebox/piratebox/python_lib/psogen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piratebox/piratebox/python_lib/psogen.py b/piratebox/piratebox/python_lib/psogen.py index 0c17ce0..2fcdf30 100755 --- a/piratebox/piratebox/python_lib/psogen.py +++ b/piratebox/piratebox/python_lib/psogen.py @@ -148,7 +148,7 @@ def prepare_line(name, indata, color, timestamp): # Lorem ipsum dolor sit amet # # - content = "
%s %s:" \ + content = "
%s %s: " \ "%s
\n" \ % (curdate.strftime("%H:%M:%S"), name, color, data) return content From c3d68ab8d7f8a4b98c26251e8a50e8806a1eb0b3 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 12 May 2016 18:15:11 +0200 Subject: [PATCH 163/183] Limit PHP only to /content #130 --- .../piratebox/conf/lighttpd/fastcgi-php.conf | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/piratebox/piratebox/conf/lighttpd/fastcgi-php.conf b/piratebox/piratebox/conf/lighttpd/fastcgi-php.conf index 2242a95..810cf0b 100644 --- a/piratebox/piratebox/conf/lighttpd/fastcgi-php.conf +++ b/piratebox/piratebox/conf/lighttpd/fastcgi-php.conf @@ -1,10 +1,11 @@ #-------------------- FAST CGI stuff -fastcgi.server = ( - ".php" => (( - "bin-path" => "/usr/bin/php-cgi", - "socket" => "/tmp/php.socket", - "max-procs" => 1 - )) -) - +$HTTP["url"] =~ "^/content/" { + fastcgi.server = ( + ".php" => (( + "bin-path" => "/usr/bin/php-cgi", + "socket" => "/tmp/php.socket", + "max-procs" => 1 + )) + ) +} From 33d1d2bda9de3c0bff06ebf42a2dbb33b00a6c0c Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 12 May 2016 18:20:16 +0200 Subject: [PATCH 164/183] Adding freshly implemented features --- CHANGELOG | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1d86ce3..d03626f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,19 +5,22 @@ CHANGELOG * [New] ChatBox message is now in conf/chat_init.txt * [New] Disable the Shoutbox to prevent writing into it * [New] PHP configuration shipped, to enable easily for modifications -* [New] Mesh implementation, technical preview. +* [New] Mesh implementation, technical preview * [New] JSON config file to direct client side applications, like "share apps" * [New] Simply python IRC Server installed and prepareable for automatic start * [New] Shoutbox-Time via Client-Date possible +* [New] Website is now available under /content and /opt/piratebox/share * [New] [RPi] Service files for using a RTC at PiratBox * [New] [OpenWrt] Redirect all DNS requests to local box * [New] [OpenWrt] Redirect all web request option (disabled) * [New] [OpenWrt] Enable all wifi devices with the PirateBox SSID * [New] [OpenWrt] AP Client isolation activated per default -* [Changed] Send HTTP-Code 204 via PHP, much cleaner. +* [Changed] Send HTTP-Code 204 via PHP, much cleaner * [Changed] Update jQuery to 2.2.3, removes IE <=8 support +* [Changed] Redirect happens now always to wished domain name * [Fix] License Adjustments * [Fix] Prevent JS Injection in Shoutbox +* [Fix] Shoutbox: Missing blank between author and content === 1.0.7 === * [New] Lock shoutbox when you send a message. From f0c4b4ab384e4c480df4d4737ef6e175a1d0c5fb Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Thu, 12 May 2016 19:41:47 +0200 Subject: [PATCH 165/183] Feature: Firewall rules for non OpenWrt PirateBoxes - Per default we now collect all DNS requests even not the one which addresses us directly (like 8.8.8.8 ) - Disables is an all Port 80 catch Fixes: #137 --- CHANGELOG | 6 +- Makefile | 2 + piratebox/piratebox/bin/firewall.sh | 70 ++++++++++++++++++++++++ piratebox/piratebox/conf/firewall.conf | 12 ++++ piratebox/piratebox/init.d/piratebox | 10 ++++ piratebox/piratebox/init.d/piratebox_alt | 10 ++++ 6 files changed, 108 insertions(+), 2 deletions(-) create mode 100755 piratebox/piratebox/bin/firewall.sh create mode 100644 piratebox/piratebox/conf/firewall.conf diff --git a/CHANGELOG b/CHANGELOG index d03626f..92fe005 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,8 +11,10 @@ CHANGELOG * [New] Shoutbox-Time via Client-Date possible * [New] Website is now available under /content and /opt/piratebox/share * [New] [RPi] Service files for using a RTC at PiratBox -* [New] [OpenWrt] Redirect all DNS requests to local box -* [New] [OpenWrt] Redirect all web request option (disabled) +* [New] Redirect all DNS requests to local box via firewall (custom script) +* [New] Redirect all web request option via firewall (disabled) (custom script) +* [New] [OpenWrt] Redirect all DNS requests to local box via firewall +* [New] [OpenWrt] Redirect all web request option via firewall (disabled) * [New] [OpenWrt] Enable all wifi devices with the PirateBox SSID * [New] [OpenWrt] AP Client isolation activated per default * [Changed] Send HTTP-Code 204 via PHP, much cleaner diff --git a/Makefile b/Makefile index e5ed931..b1e94f0 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,8 @@ $(OPENWRT_CONFIG_FOLDER): sed 's:DROOPY_USE_USER="yes":DROOPY_USE_USER="no":' -i $@/piratebox.conf sed 's:LEASE_FILE_LOCATION=$$PIRATEBOX_FOLDER/tmp/lease.file:LEASE_FILE_LOCATION=/tmp/lease.file:' -i $@/piratebox.conf sed 's:TIMESAVE_FORMAT="":TIMESAVE_FORMAT="+%C%g%m%d%H%M":' -i $@/piratebox.conf + sed 's:FIREWALL_FETCH_DNS="yes":FIREWALL_FETCH_DNS="no":' -i $@/firewall.conf + sed 's:FIREWALL_FETCH_HTTP="yes":FIREWALL_FETCH_HTTP="no":' -i $@/firewall.conf $(OPENWRT_BIN_FOLDER): diff --git a/piratebox/piratebox/bin/firewall.sh b/piratebox/piratebox/bin/firewall.sh new file mode 100755 index 0000000..d10c368 --- /dev/null +++ b/piratebox/piratebox/bin/firewall.sh @@ -0,0 +1,70 @@ +#!/bin/sh + +# Matthias Strubel (c) 2016 - GPL3 +# Script for manipulating firewall rules during start and stop of PirateBox + +PIRATEBOX_CONFIG="/opt/piratebox/conf/piratebox.conf" +FIREWALL_CONFIG="/opt/piratebox/conf/firewall.conf" + +run="" + +help_text(){ + + echo "Script for setting up Firewall rules on PirateBox. (IPv4 only)" + echo " +Usage: + + -s : Start, add IPtables rules + -k : Stop , remove IPtables rules + + -c : different PirateBox config location + -f : different PirateBox firewall config location +" + exit 1 +} + + +while getopts "skc:f:" opt ; do + case $opt in + s) run="start" ;; + k) run="end" ;; + c) PIRATEBOX_CONFIG="$OPTARG" ;; + f) FIREWALL_CONFIG="$OPTARG" ;; + h) help_text ;; + \?) + echo "Invalid option: -$OPTARG" + help_text + ;; + esac +done + +if test -z "$run" ; then + echo "ERROR: You need to select -s (start) or -k (stop) " + help_text +fi +if test -z $PIRATEBOX_CONFIG || test -z "$FIREWALL_CONFIG" ; then + echo "ERROR: one of the config paths is empty, while it should not" + help_text +fi + + . $PIRATEBOX_CONFIG || exit 6 + . $FIREWALL_CONFIG || exit 5 + +if [ "$run" = "start" ] ; then + IPT_FLAG="-A" +else + IPT_FLAG="-D" +fi + +if [ "$FIREWALL_FETCH_DNS" = "yes" ] ; then + iptables -t nat $IPT_FLAG PREROUTING -i "$DNSMASQ_INTERFACE" -d 0/0 \ + -p tcp --dport 53 -j DNAT --to-destination "${IP}:53" + iptables -t nat $IPT_FLAG PREROUTING -i "$DNSMASQ_INTERFACE" -d 0/0 \ + -p udp --dport 53 -j DNAT --to-destination "${IP}:53" +fi + +if [ "$FIREWALL_FETCH_HTTP" = "yes" ] ; then + iptables -t nat $IPT_FLAG PREROUTING -i "$DNSMASQ_INTERFACE" -d 0/0 \ + -p tcp --dport 80 -j DNAT --to-destination "${IP}:80" +fi + diff --git a/piratebox/piratebox/conf/firewall.conf b/piratebox/piratebox/conf/firewall.conf new file mode 100644 index 0000000..f4187ba --- /dev/null +++ b/piratebox/piratebox/conf/firewall.conf @@ -0,0 +1,12 @@ +#!/bin/sh + +# Configuration file for PirateBox firewall configuration +# + +# Collect all incoming DNS requests, even these are not addressed +# to this machine. +FIREWALL_FETCH_DNS="yes" + +# Collect all incoming Port 80 request, even these should be +# relayed to a different machine +FIREWALL_FETCH_HTTP="no" diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index 7b95fff..870466c 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -149,6 +149,12 @@ case "$1" in log_end_msg $? fi + #Setting up firewall rules + log_daemon_msg "Setting up firewall rules..." + $PIRATEBOX_FOLDER/bin/firewall.sh -s + log_end_msg $? + + if [ "$IPV6_ENABLE" == "yes" ] && [ "$IPV6_ADVERT" == "radvd" ] ; then log_daemon_msg "Starting radvd..." start-stop-daemon --start --quiet --exec radvd -- -p $PIDFILE_RADVD -C $CONF_RADVD @@ -219,6 +225,10 @@ case "$1" in log_end_msg $? fi + log_daemon_msg "Removing firewall rules..." + $PIRATEBOX_FOLDER/bin/firewall.sh -k + log_end_msg $? + if [ "$USE_APN" = "yes" ] ; then log_daemon_msg "Stopping hostap... " start-stop-daemon --stop --quiet --pidfile $PIDFILE_HOSTAPN --oknodo --startas "hostapd" diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index 8c1be33..352acbf 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -143,6 +143,11 @@ case "$1" in echo $? fi + + echo "Setting up firewall rules..." + $PIRATEBOX_FOLDER/bin/firewall.sh -s + echo $? + if [ "$IPV6_ENABLE" == "yes" ] && [ "$IPV6_ADVERT" == "radvd" ] ; then echo "Starting radvd..." start-stop-daemon -S -q -x radvd -- -p $PIDFILE_RADVD -C $CONF_RADVD @@ -215,6 +220,11 @@ case "$1" in echo $? fi + + echo "Removing firewall rules..." + $PIRATEBOX_FOLDER/bin/firewall.sh -k + echo $? + if [ -e $PIDFILE_RADVD ] ; then echo "Stopping radvd..." start-stop-daemon -K -q -p $PIDFILE_RADVD From b9dfccd3646ed89c006e4dab1bdfecf2bdfc1d75 Mon Sep 17 00:00:00 2001 From: TheExpertNoob Date: Mon, 16 May 2016 07:29:32 -0500 Subject: [PATCH 166/183] Update start/stop of IRC in piratebox --- piratebox/piratebox/init.d/piratebox | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index 870466c..0378a90 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -205,7 +205,7 @@ case "$1" in fi log_daemon_msg "Starting Miniircd..." - start-stop-daemon -m --start --pidfile $PIDFILE_IRC --exec python $PIRATEBOX/bin/miniircd.py -- $IRC_PARMS + start-stop-daemon $DROOPY_USER -m -S -p $PIDFILE_IRC -x $PIRATEBOX/bin/miniircd.py -- $IRC_PARMS log_end_msg $? fi fi @@ -221,7 +221,7 @@ case "$1" in if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then log_daemon_msg "Stopping IRC..." - start-stop-daemon --stop --quiet --pidfile $PIDFILE_IRC + start-stop-daemon -K -q -p $PIDFILE_IRC log_end_msg $? fi From e74b2ade98fbcfdd8a0ac424946c1dfa9ce39b9e Mon Sep 17 00:00:00 2001 From: TheExpertNoob Date: Mon, 16 May 2016 07:31:42 -0500 Subject: [PATCH 167/183] Update start/stop for miniirc in piratebox_alt --- piratebox/piratebox/init.d/piratebox_alt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index 352acbf..7d382fc 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -196,7 +196,7 @@ case "$1" in IRC_PARMS=" $IRCPARMS --statedir $STATEDIR " fi echo "Starting Miniircd..." - start-stop-daemon -m -S -p $PIDFILE_IRC --exec python $PIRATEBOX/bin/miniircd.py -- $IRC_PARMS + start-stop-daemon $DROOPY_USER -m -S -p $PIDFILE_IRC -x $PIRATEBOX/bin/miniircd.py -- $IRC_PARMS echo $? fi fi @@ -248,7 +248,7 @@ case "$1" in if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then echo "Stopping IRC..." - start-stop-daemon --stop --quiet --pidfile $PIDFILE_IRC + start-stop-daemon -K -q -p $PIDFILE_IRC echo $? fi From eae10d22473f0c3505cce7067d307c3ce46d9d94 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 20 May 2016 20:29:27 +0200 Subject: [PATCH 168/183] lighttpd configuration: add xhtml mime type --- piratebox/piratebox/conf/lighttpd/mime.types | 1 + 1 file changed, 1 insertion(+) diff --git a/piratebox/piratebox/conf/lighttpd/mime.types b/piratebox/piratebox/conf/lighttpd/mime.types index 97a4793..1218720 100644 --- a/piratebox/piratebox/conf/lighttpd/mime.types +++ b/piratebox/piratebox/conf/lighttpd/mime.types @@ -38,6 +38,7 @@ mimetype.assign = ( ".xpm" => "image/x-xpixmap", ".xwd" => "image/x-xwindowdump", ".css" => "text/css", + ".xhtml" => "application/xhtml+xml", ".html" => "text/html", ".htm" => "text/html", ".js" => "text/javascript", From be7e088c36073aaa0ceb9db66dccac2ecda51d52 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 20 May 2016 20:30:01 +0200 Subject: [PATCH 169/183] lighttpd configuration: add xhtml mime type --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 5680009..7d022ff 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -25,6 +25,7 @@ CHANGELOG * [Fix] Prevent JS Injection in Shoutbox * [Fix] Shoutbox: Missing blank between author and content * [Fix] Fix problem when running in small display mode at direcotry listing. +* [Fix] Add xhtml mime type in lighttpd configuration === 1.0.7 === * [New] Lock shoutbox when you send a message. From 056970b45639a091ae82e97c16ed121b7ddf5ae1 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 29 May 2016 10:09:56 +0200 Subject: [PATCH 170/183] Adjust url to daviddarts.com --- AUTHORS | 2 +- piratebox/piratebox/www/.READ.ME.htm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 34eea75..4253372 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ -Based on idea of David Darts: http://wiki.daviddarts.com/PirateBox +Based on idea of David Darts: http://daviddarts.com Script collection by: Matthias Strubel http://piratebox.aod-rpg.de diff --git a/piratebox/piratebox/www/.READ.ME.htm b/piratebox/piratebox/www/.READ.ME.htm index 5bb7970..0337342 100755 --- a/piratebox/piratebox/www/.READ.ME.htm +++ b/piratebox/piratebox/www/.READ.ME.htm @@ -28,7 +28,7 @@ body {margin: 0; border: 0; padding: 0px; background-color: #fafafa;

PirateBox is designed to be safe and secure. No logins are required and no user data is logged. The system is purposely not connected to the Internet in order to prevent tracking and preserve user privacy.

-PirateBox was created by David Darts and is registered under a Free Art License (2011). To learn more about the project or to find out how to build your own PirateBox system, please visit http://wiki.daviddarts.com/piratebox +PirateBox was created by David Darts and is registered under a Free Art License (2011). To learn more about the project or to find out how to build your own PirateBox system, please visit http://daviddarts.com/piratebox

From dedc21e72d4925f0c9bf41e18002e67d2898ce5a Mon Sep 17 00:00:00 2001 From: TheExpertNoob Date: Thu, 2 Jun 2016 11:31:25 -0500 Subject: [PATCH 171/183] Update index.html --- piratebox/piratebox/www_content/index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/piratebox/piratebox/www_content/index.html b/piratebox/piratebox/www_content/index.html index f5800fe..6819675 100644 --- a/piratebox/piratebox/www_content/index.html +++ b/piratebox/piratebox/www_content/index.html @@ -3,6 +3,7 @@ PirateBox - Share Freely! + @@ -98,6 +99,12 @@ + +
From 2313a74aa01f21003eb92aac04ca2d3d0549df8f Mon Sep 17 00:00:00 2001 From: TheExpertNoob Date: Thu, 2 Jun 2016 11:32:12 -0500 Subject: [PATCH 172/183] Create nothing.html --- piratebox/piratebox/www_content/nothing.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 piratebox/piratebox/www_content/nothing.html diff --git a/piratebox/piratebox/www_content/nothing.html b/piratebox/piratebox/www_content/nothing.html new file mode 100644 index 0000000..bd05135 --- /dev/null +++ b/piratebox/piratebox/www_content/nothing.html @@ -0,0 +1 @@ +Goes Nowhere, Does Nothing. From 001062c9a95e821e84ddc2305e99d5955f27da24 Mon Sep 17 00:00:00 2001 From: TheExpertNoob Date: Thu, 2 Jun 2016 11:33:17 -0500 Subject: [PATCH 173/183] Update nothing.html --- piratebox/piratebox/www_content/nothing.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/piratebox/piratebox/www_content/nothing.html b/piratebox/piratebox/www_content/nothing.html index bd05135..13890ba 100644 --- a/piratebox/piratebox/www_content/nothing.html +++ b/piratebox/piratebox/www_content/nothing.html @@ -1 +1,6 @@ -Goes Nowhere, Does Nothing. + + + + +

Goes Nowhere, Does Nothing

+ From c09e32b7613118872940991fefbebb1297244cd7 Mon Sep 17 00:00:00 2001 From: TheExpertNoob Date: Thu, 2 Jun 2016 11:34:02 -0500 Subject: [PATCH 174/183] Create konami.js --- piratebox/piratebox/www_content/js/konami.js | 54 ++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 piratebox/piratebox/www_content/js/konami.js diff --git a/piratebox/piratebox/www_content/js/konami.js b/piratebox/piratebox/www_content/js/konami.js new file mode 100644 index 0000000..45466c2 --- /dev/null +++ b/piratebox/piratebox/www_content/js/konami.js @@ -0,0 +1,54 @@ +/* + * Konami Code in Javascript + * Andreas Grech + * http://knowledge-aholic.blogspot.com/ + * v 1.1 (20091119) + + Keycodes for the Konami Code + UP : 38 + DOWN : 40 + LEFT : 37 + RIGHT : 39 + B : 66 + A : 65 +*/ + +var konamiCode = function (combination, callback) { + var lastCorrectInput = -1, + isActive = 0, + o = {}; + if (typeof combination === "function") { + callback = combination; + } + if (Object.prototype.toString.call(combination) !== "[object Array]") { + combination = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65]; + } + o.start = function () { + if (isActive) { + return; + } + isActive = 1; + document.onkeyup = function (e) { + var code; + if (!isActive) { + return; + } + code = window.event ? window.event.keyCode : e.which; + if (combination[++lastCorrectInput] === code) { + if (lastCorrectInput === combination.length - 1) { + if (callback && typeof(callback) === "function") { + callback(); + } + } + return; + } + lastCorrectInput = -1; + }; + return o; + }; + o.stop = function () { + isActive = 0; + return o; + }; + return o; +}; From 1705dd1c88c0cd60c0ab9ba6187f032ad961227a Mon Sep 17 00:00:00 2001 From: TheExpertNoob Date: Thu, 2 Jun 2016 11:36:41 -0500 Subject: [PATCH 175/183] Update nothing.html --- piratebox/piratebox/www_content/nothing.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/piratebox/piratebox/www_content/nothing.html b/piratebox/piratebox/www_content/nothing.html index 13890ba..3ffedef 100644 --- a/piratebox/piratebox/www_content/nothing.html +++ b/piratebox/piratebox/www_content/nothing.html @@ -2,5 +2,8 @@ -

Goes Nowhere, Does Nothing

+ +

Goes Nowhere, Does Nothing

+

Read more Here

+ From 368331bd08aea18ff9ea45573ae7330ac14f43e5 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 14 Jun 2016 19:54:51 +0200 Subject: [PATCH 176/183] Fix merge leftover artifact --- CHANGELOG | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 7d022ff..5e14840 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,5 @@ CHANGELOG -<<<<<<< HEAD === 1.1.0 === * [New] Enable / Disable file provisioning for custom lighttpd directory listing * [New] ChatBox message is now in conf/chat_init.txt From 459dfa3e0d4befca6cee1c007c050866f97b0261 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 14 Jun 2016 19:55:04 +0200 Subject: [PATCH 177/183] First Checklist for PirateBox tests --- CHECKLIST.md | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 CHECKLIST.md diff --git a/CHECKLIST.md b/CHECKLIST.md new file mode 100644 index 0000000..36c229c --- /dev/null +++ b/CHECKLIST.md @@ -0,0 +1,84 @@ +# Image Testing Checklist +If you are part of the testing team, this Checklist is for you. + +## For RaspberryPi +Download the image, dump it to SD card, connect your PirateBox to the same network the computer you are testing from is connected to and then go through the checklist step by step to make sure everything is working as it should. +Before going through the checklist, make sure your USB WiFi is attached and is one of the supported types. Also make sure you have a *FAT32* formatted USB thumb drive attached to your RPi. + +## For OpenWrt +Download the corresponding install_piratebox.zip and .bin file for your device. If you have already a PirateBox running, follow the upgrade instructions. If you install your Software on a fresh device, follow the installation howto +Make sure you PirateBox stopped flashing (indicating the installation is running). On PirateBox 1.1.0 the installation happens in multiple interations. + + +## Checklist +(Skip sections which are not valid for your architecture). + +### Initial configuration setup +* [ ] PirateBox' WiFi is available +* [ ] Connection to PirateBox' WiFi could be established +* [ ] **RPi only** SSH connection to PirateBox with the username *alarm* and the password *alarm* could be established +* [ ] **RPi only** Message of the day containing information about *First Steps* is displayed correctly +* [ ] **RPi only** Change the password for the *alarm* user, log out and log back in +* [ ] **RPi only** Enable USB share +* [ ] Set some date and enable Fake-timeservice +* [ ] Enable Kareha Image and Discussion Board +* [ ] Enable UPnP media server (minidlna) +* [ ] It is possible to post to the chat +* [ ] It is possible to upload files +* [ ] It is possible to post to the board +* [ ] Reboot +* [ ] PirateBox' WiFi is available +* [ ] Connection to PirateBox' WiFi could be established +* [ ] Date matches the set date from the Fake-timeservice + +### Functional tests +**UI in General** +* [ ] UI looks proper, no ugly overlapping +* [ ] UI is responsive on small browser size; is adjusts the look +* [ ] Every URL is working, on main screen +* [ ] Title URLs to mainscreen and Forum are working in Directory-Listing + +**ImageBoard** +* [ ] It is possible to post new threads +* [ ] These threads can be answered on +* [ ] When I come back later to the imageboard and post a reply, the post order is correct. +* [ ] I can upload files (<5MB) to the posts as well + +**Shoutbox** +* [ ] Different color work in Shoutbox , Username can be changed +* [ ] Posting URLs or other HTML like special characters do not break Shoutbox + +**Upload** +* [ ] Upload of different filetypes works +* [ ] Multiple files can be uploaded +* [ ] The messages inside the upload box are in english or my language +* [ ] Special characters are correctly uploaded +* [ ] It is not possible to upload a file named index.html + +**Directory Listing** +* [ ] Download of files is possible +* [ ] Directory listing reacts responsive on screen size changes +* [ ] Created folders are accessiable (UI is deployed after reboot) +* [ ] URLs to mainpage and forum in subfolder work +* [ ] Special character files uploaded via upload functionality work + +**UPNP Server** +* [ ] Streaming of MP3 works via an UPNP client +* [ ] It is possible to stream videos via UPNP + +**IRC Server** +* [ ] Is started after activation in piratebox.conf +* [ ] With an IRC client, the IRC server is usable +* [ ] New channels can be created + +**Customization** +* [ ] Changes on the folder "content" on the USB Stick (**valid for OpenWrt** and RPI **with USB Storage mod**) are visible on the browser +* [ ] PHP was sucessfully enabled in lighttpd.conf and fastcgi processes are visible in "ps" +* [ ] My custom PHP script is working in /content folder +* [ ] Deleting the content folder creates a new folder after a reboot +* [ ] It is possible to change the visible hostname of piratebox using the install_piratebox.sh script + +**Enhanced Network Configuration** +* [ ] Clients with static DNS Server entries work while being connected to PirateBox (PirateBox interferes here) +* [ ] One Client can not ping or connect to another Client (directly via wifi) +* [ ] From 7950472e0e4cd3d55d18604a382a192e44a6749c Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 14 Jun 2016 20:09:28 +0200 Subject: [PATCH 178/183] Droopy: Make chmod optional. Droopy always does the chmod operation, if the option is set. On partitions with FAT it is not possible to execute this operation. Droopy may ran into issue in that situation. With that fix, the option won't be set on droopy start to prevent any chmod operation on FAT partitions. Fixes #154 --- CHANGELOG | 1 + Makefile | 1 + piratebox/piratebox/conf/piratebox.conf | 2 ++ piratebox/piratebox/init.d/piratebox | 4 +++- piratebox/piratebox/init.d/piratebox_alt | 4 +++- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5e14840..9bbe079 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -20,6 +20,7 @@ CHANGELOG * [Changed] Send HTTP-Code 204 via PHP, much cleaner * [Changed] Update jQuery to 2.2.3, removes IE <=8 support * [Changed] Redirect happens now always to wished domain name +* [Changed] Droopy, make chmod operation optional (prevent errors on OpenWRT) * [Fix] License Adjustments * [Fix] Prevent JS Injection in Shoutbox * [Fix] Shoutbox: Missing blank between author and content diff --git a/Makefile b/Makefile index b1e94f0..012f8a3 100644 --- a/Makefile +++ b/Makefile @@ -64,6 +64,7 @@ $(OPENWRT_CONFIG_FOLDER): sed 's:DNSMASQ_INTERFACE="wlan0":DNSMASQ_INTERFACE="br-lan":' -i $@/piratebox.conf sed 's:192.168.77:192.168.1:g' -i $@/piratebox.conf sed 's:DROOPY_USE_USER="yes":DROOPY_USE_USER="no":' -i $@/piratebox.conf + sed 's:DROOPY_CHMOD:#DROOPY_CHMOD:' -i $@/piratebox.conf sed 's:LEASE_FILE_LOCATION=$$PIRATEBOX_FOLDER/tmp/lease.file:LEASE_FILE_LOCATION=/tmp/lease.file:' -i $@/piratebox.conf sed 's:TIMESAVE_FORMAT="":TIMESAVE_FORMAT="+%C%g%m%d%H%M":' -i $@/piratebox.conf sed 's:FIREWALL_FETCH_DNS="yes":FIREWALL_FETCH_DNS="no":' -i $@/firewall.conf diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index e4acc74..87ac41c 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -129,7 +129,9 @@ IMAGE="$PIRATEBOX_FOLDER/src/$IMAGENAME" DROOPY_TXT="" DROOPY_PORT="8080" # Set correct permissions for an uploaded file +# The following line needs to be commented for FAT32 / vfat partitions DROOPY_CHMOD="755" + DROOPY_USERDIR="" # Uncomment line below for adding directory feature #DROOPY_USERDIR=" -u True " diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index 0378a90..40a3e8b 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -173,7 +173,9 @@ case "$1" in if [ "$DROOPY_USE_USER" = "yes" ] ; then DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP " fi - start-stop-daemon $DROOPY_USER -m --start --background --pidfile $PIDFILE_DROOPY --exec $PIRATEBOX/bin/droopy -- -d "$UPLOADFOLDER" -m "$DROOPY_TXT" --chmod $DROOPY_CHMOD $DROOPY_USERDIR $DROOPY_PORT + DROOPY_DO_CHMOD="" + test -n "$DROOPY_CHMOD" && DROOPY_DO_CHMOD="--chmod $DROOPY_CHMOD" + start-stop-daemon $DROOPY_USER -m --start --background --pidfile $PIDFILE_DROOPY --exec $PIRATEBOX/bin/droopy -- -d "$UPLOADFOLDER" -m "$DROOPY_TXT" $DROOPY_DO_CHMOD $DROOPY_USERDIR $DROOPY_PORT log_end_msg $? fi diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index 7d382fc..06d76eb 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -167,7 +167,9 @@ case "$1" in if [ "$DROOPY_USE_USER" = "yes" ] ; then DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP " fi - start-stop-daemon $DROOPY_USER -m -S -b -p $PIDFILE_DROOPY -x $PIRATEBOX/bin/droopy -- -d "$UPLOADFOLDER" -m "$DROOPY_TXT" --chmod $DROOPY_CHMOD $DROOPY_USERDIR $DROOPY_PORT + DROOPY_DO_CHMOD="" + test -n "$DROOPY_CHMOD" && DROOPY_DO_CHMOD="--chmod $DROOPY_CHMOD" + start-stop-daemon $DROOPY_USER -m -S -b -p $PIDFILE_DROOPY -x $PIRATEBOX/bin/droopy -- -d "$UPLOADFOLDER" -m "$DROOPY_TXT" $DROOPY_DO_CHMOD $DROOPY_USERDIR $DROOPY_PORT echo $? fi From 7d2f09116c6fda095e1551de1d956f54aa56fcd4 Mon Sep 17 00:00:00 2001 From: TheExpertNoob Date: Wed, 15 Jun 2016 12:38:02 -0500 Subject: [PATCH 179/183] Update motd.txt version Updated version from 1.0.7 to 1.1.0 --- piratebox/piratebox/rpi/motd.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/piratebox/piratebox/rpi/motd.txt b/piratebox/piratebox/rpi/motd.txt index d8f9b8a..86c4354 100644 --- a/piratebox/piratebox/rpi/motd.txt +++ b/piratebox/piratebox/rpi/motd.txt @@ -5,8 +5,8 @@ ____________________.__ __ __________ |____|_ /|____| |__||__| (____ /__| \___ >______ /\____/__/\_ \ \/ \/ \/ \/ \/ -Website: http://piratebox.cc PirateBox Version: 1.0.7 -Forum: http://forum.piratebox.cc RPi Image Version: 1.0.7-1 +Website: http://piratebox.cc PirateBox Version: 1.1.0 +Forum: http://forum.piratebox.cc RPi Image Version: 1.1.0-1 IRC: #piratebox irc.freenode.net Be open -- Share freely! First Steps After Flashing From 6fb6de55b703872469113e548a9c79bf5e5ce1f9 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Mon, 27 Jun 2016 21:45:07 +0200 Subject: [PATCH 180/183] hostapd.conf: default client isolation paramter Fixes #157 --- piratebox/piratebox/conf/hostapd.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/piratebox/piratebox/conf/hostapd.conf b/piratebox/piratebox/conf/hostapd.conf index 3f65ac4..7e93096 100644 --- a/piratebox/piratebox/conf/hostapd.conf +++ b/piratebox/piratebox/conf/hostapd.conf @@ -5,3 +5,7 @@ hw_mode=g channel=1 #auth_algs=1 #ieee80211n=1 + +# Put a # in front of the following line to allow +# direct client 2 client communication +ap_isolate=1 From 16eff9918310c81f094e6b432fa0d8430f87ba42 Mon Sep 17 00:00:00 2001 From: TheExpertNoob Date: Wed, 29 Jun 2016 10:56:45 -0500 Subject: [PATCH 181/183] Update page_style.css Made some changes so that there were no scrollbars appearing in IE10 --- piratebox/piratebox/www_content/css/page_style.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/piratebox/piratebox/www_content/css/page_style.css b/piratebox/piratebox/www_content/css/page_style.css index ccdec0c..3a8f15b 100644 --- a/piratebox/piratebox/www_content/css/page_style.css +++ b/piratebox/piratebox/www_content/css/page_style.css @@ -136,13 +136,19 @@ header img, footer img { } #logo { + background-image: url('/content/img/piratebox-logo-horizontal-white.png'); + width: 215px; + height: 36px; float: left; overflow: hidden; } #menu-icon { + background-image: url('/content/img/menu.png'); float: right; width: 36px; + height: 36px; + overflow: hdden; -webkit-transition: all 0.5s ease-in-out; -moz-transition: all 0.5s ease-in-out; -o-transition: all 0.5s ease-in-out; From 80b3e291d6f24d70227bfc00eb0a91cc0313611a Mon Sep 17 00:00:00 2001 From: TheExpertNoob Date: Wed, 29 Jun 2016 10:58:39 -0500 Subject: [PATCH 182/183] Update index.html Made some changes to remove unwanted scrollbars on the page logo and the iframe. --- piratebox/piratebox/www_content/index.html | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/piratebox/piratebox/www_content/index.html b/piratebox/piratebox/www_content/index.html index 6819675..2cd7ec9 100644 --- a/piratebox/piratebox/www_content/index.html +++ b/piratebox/piratebox/www_content/index.html @@ -18,14 +18,10 @@