From a34e3f49a33e6b6fccaff723afdafc77eb372991 Mon Sep 17 00:00:00 2001 From: Jason Griffey Date: Tue, 5 Jan 2016 21:20:15 -0600 Subject: [PATCH 01/21] Adding Danish to Languages --- .../www_content/locales/data.da.properties | 54 +++++++++++++++++++ .../www_content/locales/locales.ini | 3 ++ 2 files changed, 57 insertions(+) create mode 100644 LibraryBox-landingpage/www_content/locales/data.da.properties diff --git a/LibraryBox-landingpage/www_content/locales/data.da.properties b/LibraryBox-landingpage/www_content/locales/data.da.properties new file mode 100644 index 0000000..b8755da --- /dev/null +++ b/LibraryBox-landingpage/www_content/locales/data.da.properties @@ -0,0 +1,54 @@ +# Danish translation +# vim: ft=jproperties + +commonNavbarToggle = Skift navigation +commonNavbarHome = Start +commonNavbarText = Tekst +commonNavbarAudio = Audio +commonNavbarVideo = Video +commonNavbarApps = Apps +commonNavbarAll = Alt indhold +commonNavbarStats = Statistik +commonNavbarAbout = Om +commonFooterBackToTop = Tilbage til top +commonFooterLicenceMain = LibraryBox Projektet er udgifvet under softwarelicensen GPLv2, se https://www.gnu.org/licenses/gpl-2.0.html for detaljer om licensen. +commonFooterLicenceOther = Alt LibraryBox indhold er - hvis ikke andet er angivet - udgivet under Creative Commons NC-BY licens. For mere information, bes�g http://librarybox.us +commonFilestopNothingDownloaded = + +indexContentWelcome = Velkommen til LibraryBox v2.1 +indexContentWelcomeDescription = Surf og download en af de tilg�ngelige filer eller chat med en anden bruger nedenfor. +indexContentWelcomePrivate = LibraryBox tilbyder privat surfing. Ingen log eller andre identifikationsoplysninger om brugeren gemmes. +indexFilestopTop = Mest downloadede +indexChatChat = Chat +indexChatSend = Send +indexChatName.placeholder = Alias +indexChatName.value = Anonym +indexChatMessage.placeholder = Besked... +indexShoutboxDefault = Standard +indexShoutboxBlue = Bl� +indexShoutboxGreen = Gr�n +indexShoutboxOrange = Orange +indexShoutboxRed = R�d + +aboutWelcomeAboutLibrarybox = Om LibraryBox +aboutWelcomeDescription = LibraryBox er designet til at tilbyde distribution af digitalt indhold i omr�der med lidt eller ingen internetadagang eller, hvor der slet ikke findes internet. Det sker ved brug af open source software og meget billigt hardware. P� den m�de kan indhold spredes tr�dl�st p� en meget billigere m�de end i andre l�sninger. Hvis du vil l�se mere om projektet LibraryBox bedes du bes�ge http://librarybox.us n�r du igen har adgang til internettet. +aboutFilesTopThanks = Tak +aboutFilesTopKickstarter = LibraryBox v2.1 villle ikke have v�ret muligt uden st�tte fra mine Kickstarter Backers, som alle er listet nedenfor. Tak til min kone og datter for hj�lp og st�tte i mange timer. En speciel tak skal lyde til: Matt Neer, Ross Singer, Bo Baker, John Blyberg, og Andromeda Yelton for at give en h�nd tidliget i projektets start. Udvikling af n�sten alle de gode stumper fra version 2.0 og version 2.1 skyldes det store talent til at udvikle kode som Matthias Strubel besidder. Uden hans hj�lp og evner var projektet ikke muligt. +aboutFilesTopSafety = LibraryBox er udviklet til at v�re tryg og sikker. Der kr�ver ikke login og du bliver ikke bedt om at indtaste data om dig selv. Systemet er med overl�g ikke koblet til internettet for at forhindre sporing og sikre brugerens privatliv. +aboutFilesTopView = Vis downloads og bes�gsstatistik +aboutKickstarterBackers = LibraryBox v2.0 Kickstarter Backers + +statsWelcomeDownloads = LibraryBox downloads +statsWelcomeDescription = Nedenfor vises statistik over download og antal bes�g for denne LibraryBox. +statsFilesTopUserCounts = Bes�gst�ller +statsFilesTopNoVisitor = Ingen bes�gende endnu. Det betyder m�ske at du ikke har indstillet tid og dato p� LibraryBoxen. +statsFilesTopDownloads = Indhold downloadet +statsVisitors = Bes�gende: +statsDownloads = Downloads: + +filedirIndex = Indhold i / +filedirName = Navn +filedirSize = St�rrelse +filedirType = Type +filedirDownloads = Downloads +filedirParDir = Nuv�rende bibliotek \ No newline at end of file diff --git a/LibraryBox-landingpage/www_content/locales/locales.ini b/LibraryBox-landingpage/www_content/locales/locales.ini index 58980bf..ffb7a6c 100644 --- a/LibraryBox-landingpage/www_content/locales/locales.ini +++ b/LibraryBox-landingpage/www_content/locales/locales.ini @@ -45,3 +45,6 @@ [zh-tw] @import url(data.zh-tw.properties) + +[da] +@import url(data.da.properties) From 98cc81cae6596e87b410982e56e959bf7c05c8d2 Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 14 May 2017 11:16:57 +0200 Subject: [PATCH 02/21] Remove PirateBox Origin Source --- piratebox_origin/.gitignore | 8 - piratebox_origin/AUTHORS | 34 - piratebox_origin/BuildScripts/README | 1 - piratebox_origin/BuildScripts/RPi_motd.txt | 28 - .../BuildScripts/RaspberryPi/README | 81 -- .../BuildScripts/piratebox.service | 14 - .../BuildScripts/timesave.service | 10 - piratebox_origin/CHANGELOG | 100 -- piratebox_origin/Makefile | 88 -- piratebox_origin/README.md | 58 - .../image_stuff/OpenWRT_ext4_100MB.img.gz | Bin 107404 -> 0 bytes .../image_stuff/OpenWRT_ext4_50MB.img.gz | Bin 54561 -> 0 bytes piratebox_origin/piratebox/install.sh | 122 -- .../piratebox/piratebox/bin/board-autoconf.sh | 22 - .../piratebox/piratebox/bin/delete_empty.sh | 17 - .../bin/distribute_file_into_directory.sh | 29 - .../piratebox/bin/distribute_files.sh | 48 - .../piratebox/piratebox/bin/droopy | 1156 ----------------- .../piratebox/piratebox/bin/exchange_www.sh | 47 - .../piratebox/piratebox/bin/flush_dnsmasq.sh | 10 - .../piratebox/bin/generate_config_files.sh | 217 ---- .../bin/hooks/hook_piratebox_start.sh | 18 - .../bin/hooks/hook_piratebox_start_done.sh | 18 - .../bin/hooks/hook_piratebox_stop.sh | 18 - .../bin/hooks/hook_piratebox_stop_done.sh | 18 - .../piratebox/bin/hooks/hook_post_init.sh | 19 - .../piratebox/bin/hooks/hook_pre_init.sh | 19 - .../bin/hooks/hook_pre_openwrt_init.sh | 23 - .../piratebox/bin/install_piratebox.sh | 160 --- .../piratebox/bin/piratebox_setup_wlan.sh | 121 -- .../piratebox/bin/shoutbox_daemon.sh | 22 - .../piratebox/piratebox/bin/shoutbox_stuff.sh | 39 - .../piratebox/piratebox/bin/station_cnt.sh | 5 - .../piratebox/piratebox/bin/timesave.sh | 79 -- .../conf/avahi/avahi-daemon.conf.schema | 30 - .../conf/avahi/services/http.service | 10 - .../piratebox/conf/avahi/services/ssh.service | 34 - .../piratebox/conf/dnsmasq_default.conf | 15 - .../piratebox/piratebox/conf/hook_custom.conf | 6 - .../piratebox/piratebox/conf/hostapd.conf | 7 - .../piratebox/piratebox/conf/hosts | 9 - .../piratebox/piratebox/conf/hosts_mesh | 3 - .../piratebox/piratebox/conf/ipv6.conf | 19 - .../piratebox/piratebox/conf/lighttpd/env | 0 .../piratebox/conf/lighttpd/lighttpd.conf | 96 -- .../piratebox/conf/lighttpd/mime.types | 89 -- .../piratebox/piratebox/conf/node.conf | 27 - .../piratebox/piratebox/conf/piratebox.conf | 176 --- .../piratebox/piratebox/init.d/piratebox | 245 ---- .../piratebox/piratebox/init.d/piratebox_alt | 245 ---- .../piratebox/lib/node_name_generation.sh | 32 - .../piratebox/lib/node_name_resolution.sh | 30 - .../piratebox/piratebox/python_lib/.keep | 0 .../piratebox/python_lib/broadcast.py | 121 -- .../piratebox/python_lib/discover.py | 83 -- .../piratebox/python_lib/messages.py | 48 - .../piratebox/piratebox/python_lib/psogen.py | 142 -- .../piratebox/piratebox/python_lib/style.css | 8 - .../piratebox/piratebox/share/.keep | 0 .../piratebox/piratebox/src/HEADER.txt | 28 - .../piratebox/piratebox/src/README.txt | 12 - .../piratebox/piratebox/src/forest.css | 72 - .../piratebox/piratebox/src/forest.py | 552 -------- .../piratebox/piratebox/src/kareha.pl | 13 - .../piratebox/src/kareha_img_config.pl | 173 --- .../piratebox/src/linux.example.minidlna.conf | 17 - .../piratebox/piratebox/src/no_forum.html | 10 - .../piratebox/piratebox/src/no_link.html | 0 .../piratebox/src/openwrt.example.minidlna | 17 - .../piratebox/src/redirect.html.schema | 13 - .../piratebox/piratebox/tmp/.keep | 0 .../piratebox/piratebox/www/.READ.ME.htm | 44 - .../piratebox/piratebox/www/cgi-bin/data.pso | 0 .../piratebox/www/cgi-bin/psoread.py | 14 - .../piratebox/www/cgi-bin/psowrte.py | 29 - .../piratebox/piratebox/www/cgi-bin/style.css | 8 - .../piratebox/piratebox/www/favicon.ico | Bin 1406 -> 0 bytes .../piratebox/piratebox/www/generate_204 | 3 - .../piratebox/piratebox/www/index.html | 90 -- .../piratebox/piratebox/www/jquery.min.js | 4 - .../piratebox/www/library/test/success.html | 9 - .../piratebox/piratebox/www/menu.png | Bin 2992 -> 0 bytes .../piratebox/piratebox/www/ncsi.txt | 1 - .../www/piratebox-logo-horizontal-white.png | Bin 6607 -> 0 bytes .../piratebox/www/piratebox-logo-small.png | Bin 12637 -> 0 bytes .../piratebox/piratebox/www/redirect.html | 11 - .../piratebox/piratebox/www/scripts.js | 122 -- .../piratebox/piratebox/www/station_cnt.txt | 0 .../piratebox/piratebox/www/style.css | 354 ----- piratebox_origin/piratebox/readme.txt | 77 -- 90 files changed, 5797 deletions(-) delete mode 100644 piratebox_origin/.gitignore delete mode 100644 piratebox_origin/AUTHORS delete mode 100644 piratebox_origin/BuildScripts/README delete mode 100644 piratebox_origin/BuildScripts/RPi_motd.txt delete mode 100644 piratebox_origin/BuildScripts/RaspberryPi/README delete mode 100644 piratebox_origin/BuildScripts/piratebox.service delete mode 100644 piratebox_origin/BuildScripts/timesave.service delete mode 100644 piratebox_origin/CHANGELOG delete mode 100644 piratebox_origin/Makefile delete mode 100644 piratebox_origin/README.md delete mode 100644 piratebox_origin/image_stuff/OpenWRT_ext4_100MB.img.gz delete mode 100644 piratebox_origin/image_stuff/OpenWRT_ext4_50MB.img.gz delete mode 100755 piratebox_origin/piratebox/install.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/board-autoconf.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/delete_empty.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/distribute_file_into_directory.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/distribute_files.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/droopy delete mode 100755 piratebox_origin/piratebox/piratebox/bin/exchange_www.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/flush_dnsmasq.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/generate_config_files.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_start.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_start_done.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_stop.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_stop_done.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/hooks/hook_post_init.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/hooks/hook_pre_init.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/hooks/hook_pre_openwrt_init.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/install_piratebox.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/piratebox_setup_wlan.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/shoutbox_daemon.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/shoutbox_stuff.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/station_cnt.sh delete mode 100755 piratebox_origin/piratebox/piratebox/bin/timesave.sh delete mode 100644 piratebox_origin/piratebox/piratebox/conf/avahi/avahi-daemon.conf.schema delete mode 100644 piratebox_origin/piratebox/piratebox/conf/avahi/services/http.service delete mode 100644 piratebox_origin/piratebox/piratebox/conf/avahi/services/ssh.service delete mode 100644 piratebox_origin/piratebox/piratebox/conf/dnsmasq_default.conf delete mode 100644 piratebox_origin/piratebox/piratebox/conf/hook_custom.conf delete mode 100644 piratebox_origin/piratebox/piratebox/conf/hostapd.conf delete mode 100644 piratebox_origin/piratebox/piratebox/conf/hosts delete mode 100644 piratebox_origin/piratebox/piratebox/conf/hosts_mesh delete mode 100644 piratebox_origin/piratebox/piratebox/conf/ipv6.conf delete mode 100644 piratebox_origin/piratebox/piratebox/conf/lighttpd/env delete mode 100644 piratebox_origin/piratebox/piratebox/conf/lighttpd/lighttpd.conf delete mode 100644 piratebox_origin/piratebox/piratebox/conf/lighttpd/mime.types delete mode 100644 piratebox_origin/piratebox/piratebox/conf/node.conf delete mode 100644 piratebox_origin/piratebox/piratebox/conf/piratebox.conf delete mode 100755 piratebox_origin/piratebox/piratebox/init.d/piratebox delete mode 100755 piratebox_origin/piratebox/piratebox/init.d/piratebox_alt delete mode 100644 piratebox_origin/piratebox/piratebox/lib/node_name_generation.sh delete mode 100644 piratebox_origin/piratebox/piratebox/lib/node_name_resolution.sh delete mode 100644 piratebox_origin/piratebox/piratebox/python_lib/.keep delete mode 100644 piratebox_origin/piratebox/piratebox/python_lib/broadcast.py delete mode 100644 piratebox_origin/piratebox/piratebox/python_lib/discover.py delete mode 100644 piratebox_origin/piratebox/piratebox/python_lib/messages.py delete mode 100755 piratebox_origin/piratebox/piratebox/python_lib/psogen.py delete mode 100755 piratebox_origin/piratebox/piratebox/python_lib/style.css delete mode 100644 piratebox_origin/piratebox/piratebox/share/.keep delete mode 100644 piratebox_origin/piratebox/piratebox/src/HEADER.txt delete mode 100644 piratebox_origin/piratebox/piratebox/src/README.txt delete mode 100644 piratebox_origin/piratebox/piratebox/src/forest.css delete mode 100755 piratebox_origin/piratebox/piratebox/src/forest.py delete mode 100644 piratebox_origin/piratebox/piratebox/src/kareha.pl delete mode 100644 piratebox_origin/piratebox/piratebox/src/kareha_img_config.pl delete mode 100644 piratebox_origin/piratebox/piratebox/src/linux.example.minidlna.conf delete mode 100644 piratebox_origin/piratebox/piratebox/src/no_forum.html delete mode 100644 piratebox_origin/piratebox/piratebox/src/no_link.html delete mode 100644 piratebox_origin/piratebox/piratebox/src/openwrt.example.minidlna delete mode 100644 piratebox_origin/piratebox/piratebox/src/redirect.html.schema delete mode 100644 piratebox_origin/piratebox/piratebox/tmp/.keep delete mode 100755 piratebox_origin/piratebox/piratebox/www/.READ.ME.htm delete mode 100644 piratebox_origin/piratebox/piratebox/www/cgi-bin/data.pso delete mode 100755 piratebox_origin/piratebox/piratebox/www/cgi-bin/psoread.py delete mode 100755 piratebox_origin/piratebox/piratebox/www/cgi-bin/psowrte.py delete mode 100755 piratebox_origin/piratebox/piratebox/www/cgi-bin/style.css delete mode 100755 piratebox_origin/piratebox/piratebox/www/favicon.ico delete mode 100644 piratebox_origin/piratebox/piratebox/www/generate_204 delete mode 100644 piratebox_origin/piratebox/piratebox/www/index.html delete mode 100755 piratebox_origin/piratebox/piratebox/www/jquery.min.js delete mode 100644 piratebox_origin/piratebox/piratebox/www/library/test/success.html delete mode 100644 piratebox_origin/piratebox/piratebox/www/menu.png delete mode 100644 piratebox_origin/piratebox/piratebox/www/ncsi.txt delete mode 100644 piratebox_origin/piratebox/piratebox/www/piratebox-logo-horizontal-white.png delete mode 100755 piratebox_origin/piratebox/piratebox/www/piratebox-logo-small.png delete mode 100755 piratebox_origin/piratebox/piratebox/www/redirect.html delete mode 100755 piratebox_origin/piratebox/piratebox/www/scripts.js delete mode 100644 piratebox_origin/piratebox/piratebox/www/station_cnt.txt delete mode 100644 piratebox_origin/piratebox/piratebox/www/style.css delete mode 100755 piratebox_origin/piratebox/readme.txt diff --git a/piratebox_origin/.gitignore b/piratebox_origin/.gitignore deleted file mode 100644 index d529ca8..0000000 --- a/piratebox_origin/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -*.pyc -*.swp -piratebox/piratebox/version -piratebox/piratebox/www/chat_content.html -image_stuff/* -piratebox/piratebox/bin/miniircd.py -piratebox_ws_* -piratebox-ws_* diff --git a/piratebox_origin/AUTHORS b/piratebox_origin/AUTHORS deleted file mode 100644 index f90ff02..0000000 --- a/piratebox_origin/AUTHORS +++ /dev/null @@ -1,34 +0,0 @@ -Based on idea of David Darts: http://wiki.daviddarts.com/PirateBox - -Script collection by: - Matthias Strubel http://piratebox.aod-rpg.de - -Live CD & Installer by: - TerrorByte ~ Cale Blac k - -Contributors for modifications: - # stylesuxx - Makefile and development support - # FriedZombie - OpenWRT and scripting support - # someguy - Droopy Directory support - # Reventlov - Modification for better iOS Support - # someguy - Modifications for running on OpenWRT - # ToM'aSs - Languag-Support - # Liblor - Fixes - # Loris Reiff - # iamarf - # stylesuxx - # denis-d - # taffy-nay - # risca - # herr-gabriel - # Jess Stubenbord - # ... and all others I might have forgotten. - - -Design: - * David Brooks - -Based on Software: - * Droopy - http://stackp.online.fr/?p=28 - * forest.py - http://www.triv.org.uk/~nelis/forest/ - * kareha - http://wakaba.c3.cx/s/web/wakaba_kareha diff --git a/piratebox_origin/BuildScripts/README b/piratebox_origin/BuildScripts/README deleted file mode 100644 index 51eb5a8..0000000 --- a/piratebox_origin/BuildScripts/README +++ /dev/null @@ -1 +0,0 @@ -This folder contains the stuff needed to Build *nix packages like i.e. Debian, Fedora ... diff --git a/piratebox_origin/BuildScripts/RPi_motd.txt b/piratebox_origin/BuildScripts/RPi_motd.txt deleted file mode 100644 index c4f5ec8..0000000 --- a/piratebox_origin/BuildScripts/RPi_motd.txt +++ /dev/null @@ -1,28 +0,0 @@ -PirateBox RPi-Image 1.0.1 -PirateBox Version 1.0.1 - Website: http://piratebox.cc - Forum: http://forum.piratebox.cc - IRC: #piratebox on irc.Freenode.net - -Want to start a not enabled piratebox, run - # systemctl start piratebox - -Next Steps after first flashing: -0. Change password: - # passwd -1. If you want to have PirateBox enabled on startup: - # systemctl enable piratebox - # systemctl start piratebox -2. Enable Fake-Timeservice - 2.1 Set time like - # date 101016112014 for "Fri Oct 10 16:11:00 2014" format is: MMDDhhmmCCYY - # /opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf install -3. Activate the Kareha Image and Discussion Board by using editor - change the admin username and password (ADMIN_PASS and SECRET) - # nano /opt/piratebox/www/board/config.pl - # wget http://127.0.0.1/board/kareha.pl -4. If you want, enable UPnP Media Server - # cp /etc/minidlna.conf /etc/minidlna.conf.bkp - # cp /opt/piratebox/src/linux.example.minidlna.conf /etc/minidlna.conf - # systemctl start minidlna - # systemctl enable minidlna diff --git a/piratebox_origin/BuildScripts/RaspberryPi/README b/piratebox_origin/BuildScripts/RaspberryPi/README deleted file mode 100644 index d1e6b99..0000000 --- a/piratebox_origin/BuildScripts/RaspberryPi/README +++ /dev/null @@ -1,81 +0,0 @@ -http://blog.mx17.net/2012/07/13/raspberry-pi-tip-mount-raspbmc-images/ - -http://schloesser-edv.de/tips-und-tricks/linux/chroot-mount.html - -.. - -things done for image preparation - -Download: Raspbian “wheezy” -mount image (like first link) - - -mount -o bind /dev /mnt/dev -mount -t proc none /mnt/proc - -sudo chroot /mnt/ /bin/bash - -do: ---- - - apt-get -y install lighttpd - /etc/init.d/lighttpd stop - update-rc.d lighttpd remove - apt-get -y install dnsmasq - /etc/init.d/dnsmasq stop - update-rc.d dnsmasq remove - apt-get -y install hostapd - /etc/init.d/hostapd stop - update-rc.d hostapd remove - apt-get -y install iw - rm /bin/sh - ln /bin/bash /bin/sh - chmod a+rw /bin/sh - -Edit network config file /etc/network/interfaces - auto lo - - iface lo inet loopback - iface eth0 inet dhcp - - iface wlan0 inet manual - ### disalbed for PirateBox - #allow-hotplug wlan0 - #wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf - #iface default inet dhcp - - -wget http://downloads.piratebox.de/piratebox-ws_current.tar.gz -tar xzf piratebox-ws_current.tar.gz -cd piratebox -mkdir -p /opt -cp -rv piratebox /opt -cd /opt/piratebox -sed 's:DROOPY_USE_USER="no":DROOPY_USE_USER="yes":' -i /opt/piratebox/conf/piratebox.conf -sed 's:PROBE_INTERFACE="no":PROBE_INTERFACE="yes":' -i /opt/piratebox/conf/piratebox.conf -ln /opt/piratebox/init.d/piratebox /etc/init.d/piratebox -cd ../../ -rm -rv piratebox/ piratebox-ws_current.tar.gz - - - - ------------------------ - -Install Raspberry as normal: http://elinux.org/RPi_Easy_SD_Card_Setup - - Use my Image instead of the rpi.org one - Boot as normal with a Monitor, Keyboard & connected LAN (DHCP with Internet access) - Do the following steps in Raspi-Config - Enable SSH Server via raspberry-config - change Password - Expand FS - Finish & reboot now - -Wait until reboot is finished- needs a while because the OS is resizing the filesystem during this reboot - -If you want to run it via default: - - sudo update-rc.d piratebox defaults - sudo /etc/init.d/piratebox start - sudo touch /opt/piratebox/conf/init_done diff --git a/piratebox_origin/BuildScripts/piratebox.service b/piratebox_origin/BuildScripts/piratebox.service deleted file mode 100644 index ac7a1a9..0000000 --- a/piratebox_origin/BuildScripts/piratebox.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=PirateBox Service - -[Service] -Type=idle -RemainAfterExit=yes -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 - diff --git a/piratebox_origin/BuildScripts/timesave.service b/piratebox_origin/BuildScripts/timesave.service deleted file mode 100644 index 26a4c13..0000000 --- a/piratebox_origin/BuildScripts/timesave.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=PirateBox timesave service - -[Service] -Type=oneshot -ExecStart=/opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf recover -TimeoutSec=20 - -[Install] -WantedBy=multi-user.target diff --git a/piratebox_origin/CHANGELOG b/piratebox_origin/CHANGELOG deleted file mode 100644 index bc9f575..0000000 --- a/piratebox_origin/CHANGELOG +++ /dev/null @@ -1,100 +0,0 @@ -CHANGELOG - -=== 1.0.6 === -* [Fix] Styling of the upload box iframe was quite ugly. - -=== 1.0.5 === -* [New] Improved styling for droopy iframe. -* [New] Timesave script service file to run set the time during startup. -* [Fix] Droopy call in init.d/piratebox failed to use the correct port. -* [Fix] Timesave script behaviour fixed on full Linux systems. -* OpenWrt's date format is now customized during build & piratebox.conf . - -=== 1.0.4 === -* [New] New feature: /opt/piratebox/bin/board-autoconf.sh for setting up the imageboard -* [New] Droopy update: Multiple upload -* [New] Droopy update: In general user/password setting (non configurable via - PirateBox) -* [New] imageboard: inital dummy page for a not installed board. -* [New] Send HTTP-Code 204 for Android devices, avoids captive Portal and leaving devices. - -* [Fix] Some script cleanups -* [Fix] Improved Cachehandling -* [Fix] Modified index HTML structure for increased stylability -* [Fix] Droopy update: Language encoding -* [Fix] Droopy update: Uploaded filepermission can be configured. - PirateBox default: 755 -* [Fix] Fix not refreshing shoutbox after bootup -* [Fix] Show station count again, after it is enabled - -* [Removed] Droopy update: Include hostname to templates (not needed anymore) -* [Removed] Droopy update: Field including iframe for shoutbox (not needed anymore) -* [Removed] Droopy update: iOS fake answer code, which was included in lighttpd since - Piratebox 0.5.x -* [Removed] exchange_www.sh : This feature is not available anymore, because it breaks - more then it helps. -* [Removed] Unnessecary AJAX calls & files from pre 1.0 - -=== 1.0.3 === - - (skipped) - -=== 1.0.2 === -* [Fix] Settings for correct permission of shoutbox files -* [Fix] Broken probe function in some shells -* [Fix] Issues with Python scripts on some plattforms -* [Fix] Fixes in installation script -* [Fix] Distribute files did not work with folder containing whitespaces -* [Fix] Fixed CSS issue with the shoutbox - -=== 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] [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 -* [Fix] Board Link out of nested Shared folder -* [Fix] Russian Translation in Droopy -* [Fix] ReDistribute DirectoryListing files upon initialization on first Startup -* [Fix] [OpenWRT] Fixing customization of lease-file location for OpenWRT -* [Fix] [OpenWRT] Fixes issues when extendRoot couldn't get initilized correctly -* [New] [OpenWRT] Optimized handling of mount options in extendRoot -* [Fix] [RPi] Bootup issue with some USB-wifi sticks. -* [Fix] Prevent XSS in forest.py - -=== 1.0.0 === -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 -* [New] possibility in install_piratebox.sh to exchange the hostname easily -* [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 -* [Fix] Enable unescaped blanks in Upload-Folder -* [Fix] iOS 7 captive Portal fix -* [New] Sample configuration for UPnP Server -* [New] Image file is ext4 and 50MB - -=== v0.6G === -* [Fix] Hide dot files in directory-listing which are usually hidden files -* [Fix] Fixed captive Portal detection for iOS7 diff --git a/piratebox_origin/Makefile b/piratebox_origin/Makefile deleted file mode 100644 index 94dac15..0000000 --- a/piratebox_origin/Makefile +++ /dev/null @@ -1,88 +0,0 @@ -NAME = piratebox-ws -VERSION = 1.0.6 -ARCH = all -PB_FOLDER=piratebox -PB_SRC_FOLDER=$(PB_FOLDER)/$(PB_FOLDER) - -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 -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 -OPENWRT_CONFIG_FOLDER=$(OPENWRT_FOLDER)/conf -OPENWRT_BIN_FOLDER=$(OPENWRT_FOLDER)/bin - -.DEFAULT_GOAL = package - -$(VERSION): - echo "$(PACKAGE_NAME)" > $(VERSION_FILE) - -$(PACKAGE): $(VERSION) - tar czf $@ $(PB_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) - echo "#### Copy content to image file" - sudo cp -vr $(PB_SRC_FOLDER)/* $(MOUNT_POINT) - echo "#### Copy customizatiosns to image file" - sudo cp -rv $(OPENWRT_FOLDER)/* $(MOUNT_POINT)/ - echo "#### Umount Image file" - sudo umount $(MOUNT_POINT) - gzip -rc $(SRC_IMAGE_UNPACKED) > $(IMAGE_FILE) - - -$(OPENWRT_CONFIG_FOLDER): - mkdir -p $@ - 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: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 - 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 - - -$(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) - - -$(SRC_IMAGE_UNPACKED): - gunzip -dc $(SRC_IMAGE) > $(SRC_IMAGE_UNPACKED) - - -package: $(PACKAGE) - -all: package shortimage - -cleanimage: - - rm -f $(TGZ_IMAGE_FILE) - - rm -f $(SRC_IMAGE_UNPACKED) - - rm -fr $(OPENWRT_CONFIG_FOLDER) - - rm -v $(IMAGE_FILE) - - rm -rv $(OPENWRT_BIN_FOLDER) - -clean: cleanimage - rm -f $(PACKAGE) - rm -f $(VERSION_FILE) - -shortimage: $(IMAGE_FILE) $(TGZ_IMAGE_FILE) - - - -.PHONY: all clean package shortimage - diff --git a/piratebox_origin/README.md b/piratebox_origin/README.md deleted file mode 100644 index 368646a..0000000 --- a/piratebox_origin/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# PirateBoxScripts with Modifications for running in a Webserver - -[![Join the chat at https://gitter.im/PirateBox-Dev/PirateBoxScripts_Webserver](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/PirateBox-Dev/PirateBoxScripts_Webserver?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -© 2012-2014 [Matthias Strubel](mailto:matthias.strubel@aod-rpg.de) licenced under GPL-3 - -## Maintainers -* [Matthias Strubel](matthias.strubel@aod-rpg.de) - -Sources for Running PirateBox with Webserver lighttpd -Contains: Shoutbox, Forum - -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/ - -## Info -Packages contains only scripts based PirateBox scripts with running lighttpd webserver. - -PirateBox scripts can: -* Setup WLAN Interface via iw -* Setup hotspot functionality (hostapd) -* Setup IP Adresses of wlan interface -* Probing until USB-WLAN is available -* Can add wlan interface to an existing bridge -* Sets Up a DHCP Server with redirect to wlan-interface IP -* Upload landing page (via iframe droopy) -* Browse Uploaded files -* Announce "Internet yes" for iOS -* Announce "Internet yes" for MS devices -* ShoutBox -* Optional small python Forum -* Optional imageboard -* Optional Station counter -* 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) - -More information can be found on: http://piratebox.aod-rpg.de -Installation-HowTo and current Download-Link: http://piratebox.aod-rpg.de/dokuwiki/doku.php/piratebox_lighttpd - -Is supported by [mkPirateBox > v0.5 for OpenWRT Systems](https://github.com/MaStr/mkPirateBox) -and by [PirateBox Manager](https://github.com/TerrorByte/PirateBox-Manager). - -## Installation -PirateBox should be in most common repositories soon, but in the mean time you can use this method: - -### For alpha testing -Download the [development package](https://github.com/MaStr/PirateBoxScripts_Webserver/archive/development.zip). - -Unzip the package: - - unzip development.zip - -Run the installer in the unzipped folder: - - cd PirateBoxScripts_Webserver/piratebox - sudo ./install.sh default - #Default can be substituted with 'board' if you want an image board on your PirateBox diff --git a/piratebox_origin/image_stuff/OpenWRT_ext4_100MB.img.gz b/piratebox_origin/image_stuff/OpenWRT_ext4_100MB.img.gz deleted file mode 100644 index edc0825a4c3c4f8df8306fb3ac06c6d68548a9f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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- zK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+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 diff --git a/piratebox_origin/image_stuff/OpenWRT_ext4_50MB.img.gz b/piratebox_origin/image_stuff/OpenWRT_ext4_50MB.img.gz deleted file mode 100644 index 61a50cff2cd1520ab05d1aec4d5d7b295dacff6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 54561 zcmeI)c~Dc=9>8%dBKE0JtJP5!TX09At|%cy+p-8kR8%SyqD4Sumq262#OG|NlYOZf&`L>_MG?E`=ft2W8e65250#C%f07*&Po1q zGADlG#9?~-77a~$kXL}qmaPo01I(4Cd;NVhBm&lPsaJGuUs2NjshbKt*H`_xd3xb4 zmjc#w$v`2iz~zSmMW@))tUXdjy?ctCa%ZmhJ=*fK%e?Q6c&d&^nLZrf^ZL#*ONJLC z|ExkaD0xyTDx!#^7@IFDY%sb?T$UHejG}wApcp;|c0>wNz-B5np zQ%&*rccMtk(*09aF|-HL6`cdWb2`jYQ}WUSDm;tA?emgoL_wfbPG00hE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;KmY_l00ck)1V8`;KmY_l z00ck)1V8`;KmY{(!2+>nVXt>)9$omm=Fluh(a#g4e@I?z`^>D&cUSU^dE=Yz6_^)z zne9CPhi;c)buX$L=iAGXJBL`TWYE3D=(O5qf>0U8y(q)?Jyl`fYFhTA#-H zZ&&<-pZHT>T9EsI<>3bVOD35)^hJWBVcQKinQY<3_jb0o9K`RNBv1C0#Wq#_H5=C~kkz9JMS2n0RJWN^6|EZ)^ z!gClMwH0q>8JSUB8`!1AQ$x*{Kb^(S9Pv{Nc}Y>0pZYGt^Me2gfB*=900@8p2!H?x zfB*=900@8p2!H?xfB*=900@8p2!H?xfWRj#Fyf=DGydK4$Br=c)^CG9AOHd&00JNY z0w4eaAOHd&00JNY0w4eaAOHd&00JNY0w4eaAOHd&00JNY0{`yO=@6t z`<`56U_gCpQky7k5{5^g$jV8x$*{`KT&XwEIwIvz>2K&&mV4gB?D@UXy`Jb?kc#nCkRQHhho4 zhd(!PMGyc15C8!X009sH0T2KI5C8!X009sH0T2KI5C8!X009sH0T2KI5cpID^h>ql r-hVB^ud3?7L!W=D4Dj3_00JNY0w4eaAn -# REQUIREMENTS: --- -# BUGS: Link from install -# NOTES: --- -# AUTHOR: Cale 'TerrorByte' Black, cablack@rams.colostate.edu -# COMPANY: --- -# CREATED: 02.02.2013 19:50:34 MST -# REVISION: 0.3.1 -#======================================================================= -#Import PirateBox conf -CURRENT_CONF=piratebox/conf/piratebox.conf -scriptfile="$(readlink -f $0)" -CURRENT_DIR="$(dirname ${scriptfile})" - -#Must be root -if [[ $EUID -ne 0 ]]; then - echo "This script must be run as root" #1>&2 - exit 0 -fi - -if [[ $1 ]]; then - echo "Installing..." -else - echo "Useage: /bin/bash install.sh " - exit 0 -fi - -if [[ -f "$CURRENT_DIR"/$CURRENT_CONF ]]; then - . $CURRENT_CONF 2> /dev/null -else - echo "PirateBox config is not in its normal directory" - exit 0 -fi - -#begin setting up piratebox's home dir -if [[ ! -d /opt ]]; then - mkdir -p /opt -fi - -cp -rv "$CURRENT_DIR"/piratebox /opt &> /dev/null -echo "Finished copying files..." -echo "$NET.$IP_SHORT piratebox.lan">>/etc/hosts -echo "$NET.$IP_SHORT piratebox">>/etc/hosts - -if [[ -d /etc/init.d/ ]]; then - ln -s /opt/piratebox/init.d/piratebox /etc/init.d/piratebox - echo "To make PirateBox start at boot run: update-rc.d piratebox defaults" -# systemctl enable piratebox #This enables PirateBox at start up... could be useful for Live -else - #link between opt and etc/pb - ln -s /opt/piratebox/init.d/piratebox.service /etc/systemd/system/piratebox.service - echo "To make PirateBox start at boot run: systemctl enable piratebox" -fi - -#install dependencies -#TODO missing anything in $DEPENDENCIES? -# Modified Script by martedì at http://www.mirkopagliai.it/bash-scripting-check-for-and-install-missing-dependencies/ -PKGSTOINSTALL="hostapd lighttpd dnsmasq" - -# If some dependencies are missing, asks if user wants to install -if [ "$PKGSTOINSTALL" != "" ]; then - echo -n "Some dependencies may missing. Would you like to install them? (Y/n): " - read SURE - # If user want to install missing dependencies - if [[ $SURE = "Y" || $SURE = "y" || $SURE = "" ]]; then - # Debian, Ubuntu and derivatives (with apt-get) - if which apt-get &> /dev/null; then - apt-get install $PKGSTOINSTALL - # OpenSuse (with zypper) - #elif which zypper &> /dev/null; then - # zypper in $PKGSTOINSTALL - # Mandriva (with urpmi) - elif which urpmi &> /dev/null; then - urpmi $PKGSTOINSTALL - # Fedora and CentOS (with yum) - elif which yum &> /dev/null; then - yum install $PKGSTOINSTALL - # ArchLinux (with pacman) - elif which pacman &> /dev/null; then - pacman -Sy $PKGSTOINSTALL - # Else, if no package manager has been found - else - # Set $NOPKGMANAGER - NOPKGMANAGER=TRUE - echo "ERROR: No package manager found. Please, manually install: $PKGSTOINSTALL." - fi - fi -fi - -#install piratebox with the given option -case "$1" in - default) - /opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf part2 - ;; - board) - /opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf imageboard - echo "############################################################################" - echo "#Edit /opt/piratebox/share/board/config.pl and change ADMIN_PASS and SECRET#" - echo "############################################################################" - ;; - *) - echo "$1 is not an option. Useage: /bin/bash install.sh " - exit 0 - ;; -esac - -echo "##############################" -echo "#PirateBox has been installed#" -echo "##############################" -echo "" -echo "Use: sudo service piratebox " -echo "or for systemd systems Use: sudo systemctl piratebox" -exit 0 diff --git a/piratebox_origin/piratebox/piratebox/bin/board-autoconf.sh b/piratebox_origin/piratebox/piratebox/bin/board-autoconf.sh deleted file mode 100755 index 18f25e1..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/board-autoconf.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -if [[ ! -d /opt/piratebox/share/board ]]; then - echo "You have to install the imageboard first!" - echo "Run (as root):" - echo "\t/opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf imageboard" -else - echo -n "Imageboard admin password: " - read -s BOARDPASSWORD - echo - sed -i "s|xyzPASSWORDzyx|$BOARDPASSWORD|g" /opt/piratebox/share/board/config.pl - - TEMPRAND=$(< /dev/urandom tr -dc A-Za-z0-9_ | head -c128) - sed -i "s|xyzSECRETCODEzyx|$TEMPRAND|g" /opt/piratebox/share/board/config.pl - - sed -i "s|#use constant ADMIN_PASS|use constant ADMIN_PASS|" /opt/piratebox/share/board/config.pl - sed -i "s|#use constant SECRET|use constant SECRET|" /opt/piratebox/share/board/config.pl - - # Remove temporary index page and then try to initialize the board - test -e /opt/piratebox/share/board/index.htm && rm /opt/piratebox/share/board/index.htm - wget -q -s -O - http://127.0.0.1/board/kareha.pl 2>/dev/null -fi diff --git a/piratebox_origin/piratebox/piratebox/bin/delete_empty.sh b/piratebox_origin/piratebox/piratebox/bin/delete_empty.sh deleted file mode 100755 index 1cb1b55..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/delete_empty.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -IFS=' -' - - - -cd $1 -ls_list=$( find ./ ) - -for filename in $ls_list -do - if [ ! -s $filename ] ; then - echo "Deleting 0 Byte file $filename" - rm $filename - fi -done diff --git a/piratebox_origin/piratebox/piratebox/bin/distribute_file_into_directory.sh b/piratebox_origin/piratebox/piratebox/bin/distribute_file_into_directory.sh deleted file mode 100755 index d109885..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/distribute_file_into_directory.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/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_origin/piratebox/piratebox/bin/distribute_files.sh b/piratebox_origin/piratebox/piratebox/bin/distribute_files.sh deleted file mode 100755 index 45d59c4..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/distribute_files.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh - -# This script distributes a set of files into $1 folder - -#Script for single stuff -PIRATEBOX_FOLDER=$4 -PIRATEBOX_FOLDER=${PIRATEBOX_FOLDER:=/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_origin/piratebox/piratebox/bin/droopy b/piratebox_origin/piratebox/piratebox/bin/droopy deleted file mode 100755 index 43f55e7..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/droopy +++ /dev/null @@ -1,1156 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Droopy (http://stackp.online.fr/droopy) -# Copyright 2008-2013 (c) Pierre Duquesne -# Licensed under the New BSD License. - -# Changelog -# 20131121 * Update HTML/CSS for mobile devices -# * Add HTTPS support -# * Add HTTP basic authentication -# * Add option to change uploaded file permissions -# * Add support for HTML5 multiple file upload -# 20120108 * Taiwanese translation by Li-cheng Hsu. -# 20110928 * Correctly save message with --save-config. Fix by Sven Radde. -# 20110708 * Polish translation by Jacek Politowski. -# 20110625 * Fix bug regarding filesystem name encoding. -# * Save the --dl option when --save-config is passed. -# 20110501 * Add the --dl option to let clients download files. -# * CSS speech bubble. -# 20101130 * CSS and HTML update. Switch to the new BSD License. -# 20100523 * Simplified Chinese translation by Ye Wei. -# 20100521 * Hungarian translation by Csaba Szigetvári. -# * Russian translation by muromec. -# * Use %APPDATA% Windows environment variable -- fix by Maik. -# 20091229 * Brazilian Portuguese translation by -# Carlos Eduardo Moreira dos Santos and Toony Poony. -# * IE layout fix by Carlos Eduardo Moreira dos Santos. -# * Galician translation by Miguel Anxo Bouzada. -# 20090721 * Indonesian translation by Kemas. -# 20090205 * Japanese translation by Satoru Matsumoto. -# * Slovak translation by CyberBoBaK. -# 20090203 * Norwegian translation by Preben Olav Pedersen. -# 20090202 * Korean translation by xissy. -# * Fix for unicode filenames by xissy. -# * Relies on 127.0.0.1 instead of "localhost" hostname. -# 20090129 * Serbian translation by kotnik. -# 20090125 * Danish translation by jan. -# 20081210 * Greek translation by n2j3. -# 20081128 * Slovene translation by david. -# * Romanian translation by Licaon. -# 20081022 * Swedish translation by David Eurenius. -# 20081001 * Droopy gets pretty (css and html rework). -# * Finnish translation by ipppe. -# 20080926 * Configuration saving and loading. -# 20080906 * Extract the file base name (some browsers send the full path). -# 20080905 * File is uploaded directly into the specified directory. -# 20080904 * Arabic translation by Djalel Chefrour. -# * Italian translation by fabius and d1s4st3r. -# * Dutch translation by Tonio Voerman. -# * Portuguese translation by Pedro Palma. -# * Turkish translation by Heartsmagic. -# 20080727 * Spanish translation by Federico Kereki. -# 20080624 * Option -d or --directory to specify the upload directory. -# 20080622 * File numbering to avoid overwriting. -# 20080620 * Czech translation by Jiří. -# * German translation by Michael. -# 20080408 * First release. - -import BaseHTTPServer -import SocketServer -import cgi -import os -import posixpath -import macpath -import ntpath -import sys -import getopt -import mimetypes -import copy -import shutil -import tempfile -import socket -import locale -import urllib -import base64 -import string -from pickle import load,dump -from ctypes import CDLL, c_char_p - -LOGO = '''\ - _____ -| \.----.-----.-----.-----.--.--. -| -- | _| _ | _ | _ | | | -|_____/|__| |_____|_____| __|___ | - |__| |_____| -''' - -USAGE='''\ -Usage: droopy [options] [PORT] - -Options: - -h, --help show this help message and exit - -d DIRECTORY, --directory DIRECTORY set the directory to upload files to - -m MESSAGE, --message MESSAGE set the message - -p PICTURE, --picture PICTURE set the picture - --dl provide download links - -a USER:PASS, --auth USER:PASS set the authentication credentials - --ssl PEMFILE set up https using the certificate file - --chmod MODE set the file permissions (octal value) - --save-config save options in a configuration file - --delete-config delete the configuration file and exit - -Example: - droopy -m "Hi, this is Bob. You can send me a file." -p avatar.png -''' - -picture = None -message = "" -port = 8000 -directory = os.curdir -must_save_options = False -publish_files = False -auth = None -certfile = None -file_mode = None - -## User supplied subdirectory stuff -userdirs= False # disabled by default, overridden by command line -# where to store the password file for users -#password_file='/opt/piratebox/passwd' -password_file='/tmp/passwd' -# What name will be used if subdir isn't specified -# must be lower case -anondir="anonymous" -# If no subdir is specified, put in root (0), or anondir(1)? -useAnondir=1 - -userdirform=''' -
%(advanced)s -
- -
-''' - -# -- HTML templates - -style = ''' - -''' - -userinfo = ''' -
- %(message)s - %(divpicture)s -
-''' - -maintmpl = ''' - - - -%(maintitle)s -''' + style + ''' - - -%(linkurl)s -
-
-
-
- - - %(userdiropts)s -
-
- -
- - - -
- -
-
%(sending)s
-
-
-''' + userinfo + ''' -%(files)s -
- - -''' - -successtmpl = ''' - - - %(successtitle)s -''' + style + ''' - - -
-
-
- %(received)s - %(another)s -
-
-''' + userinfo + ''' -
- - -''' - -errortmpl = ''' - - - %(errortitle)s -''' + style + ''' - - -
-
-
- %(problem)s - %(retry)s -
-
-''' + userinfo + ''' -
- - -''' - -linkurltmpl = '''''' - - -templates = {"main": maintmpl, "success": successtmpl, "error": errortmpl} - -# -- Translations - -ar = {"maintitle": u"إرسال ملف", - "submit": u"إرسال", - "sending": u"الملف قيد الإرسال", - "successtitle": u"تم استقبال الملف", - "received": u"تم استقبال الملف !", - "another": u"إرسال ملف آخر", - "errortitle": u"مشكلة", - "problem": u"حدثت مشكلة !", - "retry": u"إعادة المحاولة", - "discover": u"اكتشاف عنوان هذه الصفحة"} - -cs = {"maintitle": u"Poslat soubor", - "submit": u"Poslat", - "sending": u"Posílám", - "successtitle": u"Soubor doručen", - "received": u"Soubor doručen !", - "another": u"Poslat další soubor", - "errortitle": u"Chyba", - "problem": u"Stala se chyba !", - "retry": u"Zkusit znova.", - "discover": u"Zjistit adresu stránky"} - -da = {"maintitle": u"Send en fil", - "submit": u"Send", - "sending": u"Sender", - "successtitle": u"Fil modtaget", - "received": u"Fil modtaget!", - "another": u"Send en fil til.", - "errortitle": u"Problem", - "problem": u"Det er opstået en fejl!", - "retry": u"Forsøg igen.", - "discover": u"Find adressen til denne side"} - -de = {"maintitle": "Datei senden", - "submit": "Senden", - "sending": "Sendet", - "successtitle": "Datei empfangen", - "received": "Datei empfangen!", - "another": "Weitere Datei senden", - "errortitle": "Fehler", - "problem": "Ein Fehler ist aufgetreten!", - "retry": "Wiederholen", - "discover": "Internet-Adresse dieser Seite feststellen"} - -el = {"maintitle": u"Στείλε ένα αρχείο", - "submit": u"Αποστολή", - "sending": u"Αποστέλλεται...", - "successtitle": u"Επιτυχής λήψη αρχείου ", - "received": u"Λήψη αρχείου ολοκληρώθηκε", - "another": u"Στείλε άλλο ένα αρχείο", - "errortitle": u"Σφάλμα", - "problem": u"Παρουσιάστηκε σφάλμα", - "retry": u"Επανάληψη", - "discover": u"Βρες την διεύθυνση της σελίδας"} - -en = {"maintitle": "Send a file", - "submit": "Send", - "sending": "Sending", - "successtitle": "File received", - "received": "File received!", - "another": "Send another file.", - "errortitle": "Problem", - "problem": "There has been a problem!", - "retry": "Retry.", - "discover": "Discover the address of this page", - "subdirerror": "There is a problem uploading to that subdirectory.
Check if that subdirectory already exits.
If it does not, make sure you are only using characters a-zA-Z0-9 for the username and password.
If the directory exists and the characters are valid, you probably are using the wrong password

", - "advanced": "advanced options", - "userdirname": "Name of directory to place files in ", - "userdirpassword": "Password for saving files to that directory (optional)" - } - -es = {"maintitle": u"Enviar un archivo", - "submit": u"Enviar", - "sending": u"Enviando", - "successtitle": u"Archivo recibido", - "received": u"¡Archivo recibido!", - "another": u"Enviar otro archivo.", - "errortitle": u"Error", - "problem": u"¡Hubo un problema!", - "retry": u"Reintentar", - "discover": u"Descubrir la dirección de esta página"} - -fi = {"maintitle": u"Lähetä tiedosto", - "submit": u"Lähetä", - "sending": u"Lähettää", - "successtitle": u"Tiedosto vastaanotettu", - "received": u"Tiedosto vastaanotettu!", - "another": u"Lähetä toinen tiedosto.", - "errortitle": u"Virhe", - "problem": u"Virhe lahetettäessä tiedostoa!", - "retry": u"Uudelleen.", - "discover": u"Näytä tämän sivun osoite"} - -fr = {"maintitle": u"Envoyer un fichier", - "submit": u"Envoyer", - "sending": u"Envoi en cours", - "successtitle": u"Fichier reçu", - "received": u"Fichier reçu !", - "another": u"Envoyer un autre fichier.", - "errortitle": u"Problème", - "problem": u"Il y a eu un problème !", - "retry": u"Réessayer.", - "discover": u"Découvrir l'adresse de cette page"} - -gl = {"maintitle": u"Enviar un ficheiro", - "submit": u"Enviar", - "sending": u"Enviando", - "successtitle": u"Ficheiro recibido", - "received": u"Ficheiro recibido!", - "another": u"Enviar outro ficheiro.", - "errortitle": u"Erro", - "problem": u"Xurdíu un problema!", - "retry": u"Reintentar", - "discover": u"Descubrir o enderezo desta páxina"} - -hu = {"maintitle": u"Állomány küldése", - "submit": u"Küldés", - "sending": u"Küldés folyamatban", - "successtitle": u"Az állomány beérkezett", - "received": u"Az állomány beérkezett!", - "another": u"További állományok küldése", - "errortitle": u"Hiba", - "problem": u"Egy hiba lépett fel!", - "retry": u"Megismételni", - "discover": u"Az oldal Internet-címének megállapítása"} - -id = {"maintitle": "Kirim sebuah berkas", - "submit": "Kirim", - "sending": "Mengirim", - "successtitle": "Berkas diterima", - "received": "Berkas diterima!", - "another": "Kirim berkas yang lain.", - "errortitle": "Permasalahan", - "problem": "Telah ditemukan sebuah kesalahan!", - "retry": "Coba kembali.", - "discover": "Kenali alamat IP dari halaman ini"} - -it = {"maintitle": u"Invia un file", - "submit": u"Invia", - "sending": u"Invio in corso", - "successtitle": u"File ricevuto", - "received": u"File ricevuto!", - "another": u"Invia un altro file.", - "errortitle": u"Errore", - "problem": u"Si è verificato un errore!", - "retry": u"Riprova.", - "discover": u"Scopri l’indirizzo di questa pagina"} - -ja = {"maintitle": u"ファイル送信", - "submit": u"送信", - "sending": u"送信中", - "successtitle": u"受信完了", - "received": u"ファイルを受信しました!", - "another": u"他のファイルを送信する", - "errortitle": u"問題発生", - "problem": u"問題が発生しました!", - "retry": u"リトライ", - "discover": u"このページのアドレスを確認する"} - -ko = {"maintitle": u"파일 보내기", - "submit": u"보내기", - "sending": u"보내는 중", - "successtitle": u"파일이 받아졌습니다", - "received": u"파일이 받아졌습니다!", - "another": u"다른 파일 보내기", - "errortitle": u"문제가 발생했습니다", - "problem": u"문제가 발생했습니다!", - "retry": u"다시 시도", - "discover": u"이 페이지 주소 알아보기"} - -nl = {"maintitle": "Verstuur een bestand", - "submit": "Verstuur", - "sending": "Bezig met versturen", - "successtitle": "Bestand ontvangen", - "received": "Bestand ontvangen!", - "another": "Verstuur nog een bestand.", - "errortitle": "Fout", - "problem": "Er is een fout opgetreden!", - "retry": "Nog eens.", - "discover": "Vind het adres van deze pagina"} - -no = {"maintitle": u"Send en fil", - "submit": u"Send", - "sending": u"Sender", - "successtitle": u"Fil mottatt", - "received": u"Fil mottatt !", - "another": u"Send en ny fil.", - "errortitle": u"Feil", - "problem": u"Det har skjedd en feil !", - "retry": u"Send på nytt.", - "discover": u"Finn addressen til denne siden"} - -pl = {"maintitle": u"Wyślij plik", - "submit": u"Wyślij", - "sending": u"Wysyłanie", - "successtitle": u"Plik wysłany", - "received": u"Plik wysłany!", - "another": u"Wyślij kolejny plik.", - "errortitle": u"Problem", - "problem": u"Wystąpił błąd!", - "retry": u"Spróbuj ponownie.", - "discover": u"Znajdź adres tej strony"} - -pt = {"maintitle": u"Enviar um ficheiro", - "submit": u"Enviar", - "sending": u"A enviar", - "successtitle": u"Ficheiro recebido", - "received": u"Ficheiro recebido !", - "another": u"Enviar outro ficheiro.", - "errortitle": u"Erro", - "problem": u"Ocorreu um erro !", - "retry": u"Tentar novamente.", - "discover": u"Descobrir o endereço desta página"} - -pt_br = { - "maintitle": u"Enviar um arquivo", - "submit": u"Enviar", - "sending": u"Enviando", - "successtitle": u"Arquivo recebido", - "received": u"Arquivo recebido!", - "another": u"Enviar outro arquivo.", - "errortitle": u"Erro", - "problem": u"Ocorreu um erro!", - "retry": u"Tentar novamente.", - "discover": u"Descobrir o endereço desta página"} - -ro = {"maintitle": u"Trimite un fişier", - "submit": u"Trimite", - "sending": u"Se trimite", - "successtitle": u"Fişier recepţionat", - "received": u"Fişier recepţionat !", - "another": u"Trimite un alt fişier.", - "errortitle": u"Problemă", - "problem": u"A intervenit o problemă !", - "retry": u"Reîncearcă.", - "discover": u"Descoperă adresa acestei pagini"} - -ru = {"maintitle": u"Отправить файл", - "submit": u"Отправить", - "sending": u"Отправляю", - "successtitle": u"Файл получен", - "received": u"Файл получен !", - "another": u"Отправить другой файл.", - "errortitle": u"Ошибка", - "problem": u"Произошла ошибка !", - "retry": u"Повторить.", - "discover": u"Посмотреть адрес этой страницы"} - -sk = {"maintitle": u"Pošli súbor", - "submit": u"Pošli", - "sending": u"Posielam", - "successtitle": u"Súbor prijatý", - "received": u"Súbor prijatý !", - "another": u"Poslať ďalší súbor.", - "errortitle": u"Chyba", - "problem": u"Vyskytla sa chyba!", - "retry": u"Skúsiť znova.", - "discover": u"Zisti adresu tejto stránky"} - -sl = {"maintitle": u"Pošlji datoteko", - "submit": u"Pošlji", - "sending": u"Pošiljam", - "successtitle": u"Datoteka prejeta", - "received": u"Datoteka prejeta !", - "another": u"Pošlji novo datoteko.", - "errortitle": u"Napaka", - "problem": u"Prišlo je do napake !", - "retry": u"Poizkusi ponovno.", - "discover": u"Poišči naslov na tej strani"} - -sr = {"maintitle": u"Pošalji fajl", - "submit": u"Pošalji", - "sending": u"Šaljem", - "successtitle": u"Fajl primljen", - "received": u"Fajl primljen !", - "another": u"Pošalji još jedan fajl.", - "errortitle": u"Problem", - "problem": u"Desio se problem !", - "retry": u"Pokušaj ponovo.", - "discover": u"Otkrij adresu ove stranice"} - -sv = {"maintitle": u"Skicka en fil", - "submit": u"Skicka", - "sending": u"Skickar...", - "successtitle": u"Fil mottagen", - "received": u"Fil mottagen !", - "another": u"Skicka en fil till.", - "errortitle": u"Fel", - "problem": u"Det har uppstått ett fel !", - "retry": u"Försök igen.", - "discover": u"Ta reda på adressen till denna sida"} - -tr = {"maintitle": u"Dosya gönder", - "submit": u"Gönder", - "sending": u"Gönderiliyor...", - "successtitle": u"Gönderildi", - "received": u"Gönderildi", - "another": u"Başka bir dosya gönder.", - "errortitle": u"Problem.", - "problem": u"Bir problem oldu !", - "retry": u"Yeniden dene.", - "discover": u"Bu sayfanın adresini bul"} - -zh_cn = { - "maintitle": u"发送文件", - "submit": u"发送", - "sending": u"发送中", - "successtitle": u"文件已收到", - "received": u"文件已收到!", - "another": u"发送另一个文件。", - "errortitle": u"问题", - "problem": u"出现问题!", - "retry": u"重试。", - "discover": u"查看本页面的地址"} - -zh_tw = { - "maintitle": u"上傳檔案", - "submit": u"上傳", - "sending": u"傳送中...", - "successtitle": u"已收到檔案", - "received": u"已收到檔案!", - "another": u"上傳另一個檔案。", - "errortitle": u"錯誤", - "problem": u"出現錯誤!", - "retry": u"重試。", - "discover": u"查閱本網頁的網址"} - -translations = {"ar": ar, "cs": cs, "da": da, "de": de, "el": el, "en": en, - "es": es, "fi": fi, "fr": fr, "gl": gl, "hu": hu, "id": id, - "it": it, "ja": ja, "ko": ko, "nl": nl, "no": no, "pl": pl, - "pt": pt, "pt-br": pt_br, "ro": ro, "ru": ru, "sk": sk, - "sl": sl, "sr": sr, "sv": sv, "tr": tr, "zh-cn": zh_cn, - "zh-tw": zh_tw} - - -class DroopyFieldStorage(cgi.FieldStorage): - """The file is created in the destination directory and its name is - stored in the tmpfilename attribute. - """ - - TMPPREFIX = 'tmpdroopy' - - def make_file(self, binary=None): - fd, name = tempfile.mkstemp(dir=directory, prefix=self.TMPPREFIX) - self.tmpfile = os.fdopen(fd, 'w+b') - self.tmpfilename = name - return self.tmpfile - - -class HTTPUploadHandler(BaseHTTPServer.BaseHTTPRequestHandler): - - protocol_version = 'HTTP/1.0' - form_field = 'upfile' - divpicture = '

' - - - def _safername(self,name): - """ Checking whether we can make a directory-name out of this name - Thanks to stackoverflow, Vinko Vrsalovic - """ - valid_chars = frozenset("-_() %s%s" % (string.letters, string.digits)) - name2 = ''.join(c for c in name if c in valid_chars) - if len(name) == 0: - return anondir - if name2 == name: - return name.encode('utf8') - else: - print('WARNING: name too complex; try %s'%name2) - return False - - - def _mkuserpath(self,userdir,filename): - mydir = directory + "/" + userdir - if (os.path.exists(mydir)): - localpath = os.path.join(mydir, filename).encode('utf-8') - else: - try: - os.mkdir(mydir) - except IOError: - print ("can't make directory") - else: - localpath = os.path.join(mydir, filename).encode('utf-8') - return localpath - - def _login(self,subdir, passwd ): - """ Allow user to provide subdirectory & write access password. - This offers little security, but helps organization - returns success,NAME - """ - name = self._safername( subdir.lower() ) - password = passwd #safename( passwd ) - - if (name == "" or name == anondir) : - return (True, anondir ) # don't let people set password on anon - try: - pairs = load(open(password_file)) - except IOError: - print('WARNING: No password file found. Starting from scratch.') - pairs = {} - if name in pairs: - if pairs[name] == password: - return True,name - else: - print('ERROR: wrong password') - return False,"BadPassword" - else: - print('INFO: Adding subdir %s to the system'%name) - pairs[name] = password - dump(pairs, open(password_file, 'w')) - return True,name - - - - def html(self, page, errormsg=""): - """ - page can be "main", "success", or "error" - returns an html page (in the appropriate language) as a string - """ - - # -- Parse accept-language header - if not self.headers.has_key("accept-language"): - a = [] - else: - a = self.headers["accept-language"] - a = a.split(',') - a = [e.split(';q=') for e in a] - a = [(lambda x: len(x)==1 and (1, x[0]) or - (float(x[1]), x[0])) (e) for e in a] - a.sort() - a.reverse() - a = [x[1] for x in a] - # now a is an ordered list of preferred languages - - # -- Choose the appropriate translation dictionary (default is english) - lang = "en" - for l in a: - if translations.has_key(l): - lang = l - break - dico = copy.copy(translations[lang]) - - # -- Set message and picture - if message: - dico["message"] = ('
%s
' % - message) - else: - dico["message"] = "" - - if picture != None: - dico["divpicture"] = self.divpicture - else: - dico["divpicture"] = "" - - # -- Possibly provide download links - links = "" - names = self.published_files() - if names: - for name in names: - links += '%s' % ( - urllib.quote(name.encode('utf-8')), - name) - links = '
' + links + '
' - dico["files"] = links - - # -- Add a link to discover the url - if self.client_address[0] == "127.0.0.1": - dico["port"] = self.server.server_port - dico["ssl"] = int(certfile is not None) - dico["linkurl"] = linkurltmpl % dico - else: - dico["linkurl"] = "" - - if (userdirs == True): - dico["userdiropts"] = userdirform % dico - else: - dico["userdiropts"] = '' - - dico["problem"] = "" - if (errormsg != ""): - if dico[errormsg]: - dico["problem"]=dico[errormsg] - - return templates[page] % dico - - def check_auth(method): - def decorated(self, *args): - if auth and self.headers.getheader('Authorization') != \ - 'Basic ' + base64.b64encode(auth): - self.send_response(401) - self.send_header('WWW-Authenticate', 'Basic realm=\"Droopy\"') - self.send_header('Content-type', 'text/html') - self.end_headers() - else: - method(self, *args) - return decorated - - @check_auth - def do_GET(self): - name = self.path.lstrip('/') - name = urllib.unquote(name) - name = name.decode('utf-8') - - if picture != None and self.path == '/__droopy/picture': - # send the picture - self.send_file(picture) - - elif name in self.published_files(): - localpath = os.path.join(directory, name) - self.send_file(localpath) - - else: - self.send_html(self.html("main")) - - - @check_auth - def do_POST(self): - # Do some browsers /really/ use multipart ? maybe Opera ? - try: - self.log_message("Started file transfer") - - # -- Set up environment for cgi.FieldStorage - env = {} - env['REQUEST_METHOD'] = self.command - if self.headers.typeheader is None: - env['CONTENT_TYPE'] = self.headers.type - else: - env['CONTENT_TYPE'] = self.headers.typeheader - - # -- Save file (numbered to avoid overwriting, ex: foo-3.png) - form = DroopyFieldStorage(fp = self.rfile, environ = env); - file_items = form[self.form_field] - - #-- Handle multiple file upload - if not isinstance(file_items, list): - file_items = [file_items] - - for item in file_items: - filename = self.basename(item.filename).decode('utf-8') - if filename == "": - continue - - - if filename.lower() == "index.html" or filename.lower() == "index.htm": - self.send_response(303) - self.send_header('Location', '/') - self.end_headers() - continue - - - localpath ='' - if (userdirs == True ): - subdir = form['subdir'].value - passwd = form['secret'].value - success,userdir=self._login(subdir, passwd ) - if success == False: - self.send_html(self.html("error","subdirerror")) - #os.unlink(fileitem.tmpfilename) - return - else: - if (userdir == anondir or userdir == ''): - if ( useAnondir == 0): - localpath = None - else: - localpath=self._mkuserpath(anondir,filename) - else: - localpath=self._mkuserpath(userdir,filename) - - - localpath = os.path.join(directory, filename).encode('utf-8') - root, ext = os.path.splitext(localpath) - i = 1 - - # race condition, but hey... - while (os.path.exists(localpath)): - localpath = "%s-%d%s" % (root, i, ext) - i = i + 1 - if hasattr(item, 'tmpfile'): - # DroopyFieldStorage.make_file() has been called - item.tmpfile.close() - shutil.move(item.tmpfilename, localpath) - else: - # no temporary file, self.file is a StringIO() - # see cgi.FieldStorage.read_lines() - fout = file(localpath, 'wb') - shutil.copyfileobj(item.file, fout) - fout.close() - - if file_mode is not None: - os.chmod(localpath, file_mode) - self.log_message("Received: %s", os.path.basename(localpath)) - - # -- Reply - if publish_files: - # The file list gives a feedback for the upload - # success - self.send_response(301) - self.send_header("Location", "/") - self.end_headers() - else: - self.send_html(self.html("success")) - - except Exception, e: - self.log_message(repr(e)) - self.send_html(self.html("error")) - - - def send_html(self, htmlstr): - self.send_response(200) - self.send_header('Content-type','text/html; charset=utf-8') - self.end_headers() - self.wfile.write(htmlstr.encode('utf-8')) - - def send_file(self, localpath): - f = open(localpath, 'rb') - self.send_response(200) - self.send_header('Content-type', - mimetypes.guess_type(localpath)[0]) - self.send_header('Content-length', os.fstat(f.fileno())[6]) - self.end_headers() - shutil.copyfileobj(f, self.wfile) - - def basename(self, path): - """Extract the file base name (some browsers send the full file path). - """ - for mod in posixpath, macpath, ntpath: - path = mod.basename(path) - return path - - def published_files(self): - """Returns the list of files that should appear as download links. - - The returned filenames are unicode strings. - """ - if publish_files: - # os.listdir() returns a list of unicode strings when the - # directory is passed as an unicode string itself. - names = [name for name in os.listdir(unicode(directory)) - if os.path.isfile(os.path.join(directory, name)) - and not name.startswith(DroopyFieldStorage.TMPPREFIX)] - names.sort(key=lambda s: s.lower()) - else: - names = [] - return names - - def handle(self): - try: - BaseHTTPServer.BaseHTTPRequestHandler.handle(self) - except socket.error, e: - self.log_message(str(e)) - raise Abort() - - -class Abort(Exception): pass - - -class ThreadedHTTPServer(SocketServer.ThreadingMixIn, - BaseHTTPServer.HTTPServer): - - def handle_error(self, request, client_address): - # Override SocketServer.handle_error - exctype = sys.exc_info()[0] - if not exctype is Abort: - BaseHTTPServer.HTTPServer.handle_error(self,request,client_address) - - -# -- Options - -def fullpath(path): - return os.path.abspath(os.path.expanduser(path)) - -def configfile(): - appname = 'droopy' - # os.name is 'posix', 'nt', 'os2', 'mac', 'ce' or 'riscos' - if os.name == 'posix': - getenv = CDLL("libc.so.6").getenv - getenv.restype = c_char_p - filename = "%s/.%s" % (getenv("HOME"), appname) - - elif os.name == 'mac': - filename = ("%s/Library/Application Support/%s" % - (os.environ["HOME"], appname)) - - elif os.name == 'nt': - filename = ("%s\%s" % (os.environ["APPDATA"], appname)) - - else: - filename = None - - return filename - - -def save_options(): - opt = [] - if message: - opt.append('--message=%s' % message.replace('\n', '\\n')) - if picture: - opt.append('--picture=%s' % picture) - if directory: - opt.append('--directory=%s' % directory) - if auth: - opt.append('--auth=%s' % auth) - if certfile: - opt.append('--ssl=%s' % certfile) - if file_mode: - opt.append('--chmod=%s' % file_mode) - if publish_files: - opt.append('--dl') - if port: - opt.append('%d' % port) - f = open(configfile(), 'w') - f.write('\n'.join(opt).encode('utf8')) - f.close() - - -def load_options(): - try: - f = open(configfile()) - cmd = [line.strip().decode('utf8').replace('\\n', '\n') - for line in f.readlines()] - parse_args(cmd) - f.close() - return True - except IOError, e: - return False - - -def parse_args(cmd=None): - """Parse command-line arguments. - - Parse sys.argv[1:] if no argument is passed. - """ - global picture, message, port, directory, must_save_options, publish_files - global auth, certfile, file_mode - global userdirs - - if cmd == None: - cmd = sys.argv[1:] - lang, encoding = locale.getdefaultlocale() - if encoding != None: - cmd = [a.decode(encoding) for a in cmd] - - opts, args = None, None - try: - opts, args = getopt.gnu_getopt(cmd, "p:m:d:a:u:h", - ["picture=","message=", "directory=", - "auth=", "ssl=", "chmod=", "help", "userdirs", - "save-config", "delete-config", "dl"]) - except Exception, e: - print e - sys.exit(1) - - for o, a in opts: - if o in ["-p", "--picture"]: - if os.path.exists(a): - picture = fullpath(a) - else: - print "Picture not found: '%s'" % a - - elif o in ["-m", "--message"]: - message = a - - elif o in ['-d', '--directory']: - directory = fullpath(a) - - elif o in ["-u", "--userdirs" ] : - userdirs = True - print "userdirs are %s" %userdirs - - elif o in ['--save-config']: - must_save_options = True - - elif o in ['--delete-config']: - try: - filename = configfile() - os.remove(filename) - print 'Deleted ' + filename - except Exception, e: - print e - sys.exit(0) - - elif o in ['--dl']: - publish_files = True - - elif o in ['-a', '--auth']: - if ':' not in a: - print "Error: authentication credentials must be " \ - "specified as USER:PASSWORD" - sys.exit(1) - auth = a - - elif o in ['--ssl']: - if not os.path.isfile(a): - print "PEM file not found: '%s'" % a - sys.exit(1) - certfile = fullpath(a) - - elif o in ['--chmod']: - try: - file_mode = int(a, 8) - except ValueError: - print "Invalid octal value passed to chmod option: '%s'" % a - sys.exit(1) - - - elif o in ['-h', '--help']: - print USAGE - sys.exit(0) - - # port number - try: - if args[0:]: - port = int(args[0]) - except ValueError: - print args[0], "is not a valid port number" - sys.exit(1) - - -# -- - -def run(): - """Run the webserver.""" - socket.setdefaulttimeout(3*60) - server_address = ('', port) - httpd = ThreadedHTTPServer(server_address, HTTPUploadHandler) - if certfile: - try: - import ssl - except: - print "Error: Could not import module 'ssl', exiting." - sys.exit(2) - httpd.socket = ssl.wrap_socket(httpd.socket, certfile=certfile, - server_side=True) - httpd.serve_forever() - - -if __name__ == '__main__': - print LOGO - - config_found = load_options() - parse_args() - - if config_found: - print 'Configuration found in %s' % configfile() - else: - print "No configuration file found." - - if must_save_options: - save_options() - print "Options saved in %s" % configfile() - - proto = 'https' if certfile else 'http' - print "Files will be uploaded to %s" % directory - print - print ("HTTP server running... Check it out at %s://localhost:%d" - % (proto, port)) - try: - run() - except KeyboardInterrupt: - print '^C received, shutting down server' - # some threads may run until they terminate diff --git a/piratebox_origin/piratebox/piratebox/bin/exchange_www.sh b/piratebox_origin/piratebox/piratebox/bin/exchange_www.sh deleted file mode 100755 index 94df486..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/exchange_www.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -# Matthias Strubel , 2013-2015 (c) GPL-3 -# matthias.strubel@aod-rpg.de - - -## This is an obsolete feature. -## we exit that stuff only and skip processing it. -## In 99% this breaks stuff, over helping you. -## Will be removed with the next full release. - -echo "exchange_www.sh - was deactivated and does nothing now." -echo " Will be removed with the next full release." -exit 0 - - -# Move www folder to given destination - -# Load configfile - -if [ -z $1 ] || [ -z $2 ]; then - echo "Usage change_www my_config - i.e. # exchange_www.sh /opt/piratebox/conf/piratebox.conf /mnt/usb/PirateBox/www_alt " - exit 1 -fi - - -if [ ! -f $1 ] ; then - echo "Config-File $1 not found..." - exit 1 -fi - -#Load config -. $1 - - echo "----------------------------------------------------" - echo "#### $2 ####" - echo "#### switching directories ####" - echo "----------------------------------------------------" - - mv $WWW_FOLDER $PIRATEBOX_FOLDER/www_old - ln -sf $2 $WWW_FOLDER - echo " Copy over >>fake internet detection-stuff<<" - cp -v $PIRATEBOX_FOLDER/www_old/ncsi.txt $WWW_FOLDER - cp -rv $PIRATEBOX_FOLDER/www_old/library $WWW_FOLDER - echo " Copy over >>redirect.html<< for automatic redirect on wrong entered page<<" - cp -v $PIRATEBOX_FOLDER/www_old/redirect.html $WWW_FOLDER - echo " Done. Now, you are on your own! " diff --git a/piratebox_origin/piratebox/piratebox/bin/flush_dnsmasq.sh b/piratebox_origin/piratebox/piratebox/bin/flush_dnsmasq.sh deleted file mode 100755 index 09f939b..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/flush_dnsmasq.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# by Matthias Strubel , 2012 -# -# Sends a SIGHUB to dnsmasq to reread its hosts files -# Needed for mesh feature. Will enable easy dns-service for this. - -PIDFILE_DNSMASQ=/var/run/piratebox_dnsmasq.pid - -kill -1 `cat $PIDFILE_DNSMASQ` - diff --git a/piratebox_origin/piratebox/piratebox/bin/generate_config_files.sh b/piratebox_origin/piratebox/piratebox/bin/generate_config_files.sh deleted file mode 100755 index 85829c3..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/generate_config_files.sh +++ /dev/null @@ -1,217 +0,0 @@ -#!/bin/sh - -# Generate severall configuration files out of piratebox.conf -# conf/hosts_generated -# conf/dnsmasq_generated.conf -# conf/radvd_generated.conf -# conf/lighttpd/env -# -# There are files for default configuration or adding custom stuff: -# conf/hosts -# conf/dnsmasq_default.conf -# -# it is using the following VARS out of piratebox.conf: -# NET = The network of your box i.e. 192.168.1 -# IP_SHORT = The ip of the piratebox i.e. 1 results 192.168.1.1 -# START_LEASE = Range of dhcp leases start 10 -# END_LEASE = end 250 -# LEASE_DURATION = lease time 30min -# HOSTNAME = piratebox.lan - o'rly? Maybe generate some additional stuff here -# - -# GLOBAL_CHAT = Enable Broadcasts -# GLOBAL_DEST = Broadcast IP destinations -# PYTHONPATH = Path of PirateBox python libs -# 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 - -CONFIG_PATH="conf" -DNSMASQ_CONFIG="" -HOSTS_CONFIG="" -DEFAULT_HOSTS="" -LEASE_FILE="" -RADVD_CONFIG="" -LIGHTTPD_ENV_CONFIG="" -AVAHI_SRC="" -AVAHI_CONFIG="" - -set_pathnames() { - CONFIG_PATH=$1/conf - DNSMASQ_CONFIG=$CONFIG_PATH/dnsmasq_generated.conf - HOSTS_CONFIG=$CONFIG_PATH/hosts_generated - HOSTS_MESH=$CONFIG_PATH/hosts_mesh - DEFAULT_HOSTS=$CONFIG_PATH/hosts - DEFAULT_DNSMASQ=$CONFIG_PATH/dnsmasq_default.conf - 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() { - set_hostname=$1 - set_ipv4=$2 - set_ipv6=$3 - echo "Generating hosts file .... " - cat $DEFAULT_HOSTS > $HOSTS_CONFIG - echo "$set_ipv4 $set_hostname " >> $HOSTS_CONFIG - echo "$set_ipv6 $set_hostname " >> $HOSTS_CONFIG - -} - -generate_dnsmasq() { - net=$1 - lease_start=$3 - lease_end=$4 - lease_time=$5 - ip_pb=$2 - dnsmasq_interface=$6 - echo "Generating dnsmasq.conf ....." - cat $DEFAULT_DNSMASQ > $DNSMASQ_CONFIG - - #Add interface line if filled - [ -n $dnsmasq_interface ] && echo "interface=$dnsmasq_interface" >> $DNSMASQ_CONFIG - - lease_line="$net.$lease_start,$net.$lease_end,$lease_time" - echo "dhcp-range=$lease_line" >> $DNSMASQ_CONFIG - #redirect every dns - dns_redirect="/#/$net.$ip_pb" - echo "address=$dns_redirect" >> $DNSMASQ_CONFIG - echo "dhcp-leasefile=$LEASE_FILE" >> $DNSMASQ_CONFIG - - echo "addn-hosts=$HOSTS_CONFIG" >>$DNSMASQ_CONFIG - - #Mesh hosts - echo "addn-hosts=$HOSTS_MESH" >> $DNSMASQ_CONFIG - - if [ "$IPV6_ENABLE" = "yes" ] && [ "$IPV6_ADVERT" = "dnsmasq" ] ; then - echo "Do additional v6 stuff in dnsmasq.conf" - echo "#----- V6 Stuff" >> $DNSMASQ_CONFIG - echo "dchp-range=$ipv6_call::, ra-stateless" >> $DNSMASQ_CONFIG - fi - -} - -generate_radvd(){ - prefix=$1 - mask=$2 - interface=$3 - - echo "Generating config for radvd.." - echo "#---- generated file ---" > $RADVD_CONFIG - echo " - interface $interface { - AdvSendAdvert on; - MinRtrAdvInterval 3; - MaxRtrAdvInterval 10; - prefix $prefix::/$mask { - AdvOnLink on; - AdvAutonomous on; - AdvRouterAddr on; - }; - }; - " >> $RADVD_CONFIG - -} - -#------------ lighttpd env config - Start --------------------- - -generate_lighttpd_env() { - local GLOBAL_CHAT=$1 - local GLOBAL_DEST="$2" - local PYTHONPATH=$3 - local SHOUTBOX_GEN_HTMLFILE=$4 - local PIRATEBOX=$5 - local SHOUTBOX_CHATFILE=$6 - - echo "Generating Environment-config for lighttpd ....." - - LIGHTTPD_ENV_BR_LINE="" - if [ "$GLOBAL_CHAT" = "yes" ] ; then - LIGHTTPD_ENV_BR_LINE=" \"SHOUTBOX_BROADCAST_DESTINATIONS\" => \"$GLOBAL_DEST\" , " - fi - - LIGHTTPD_ENV="setenv.add-environment = ( - \"PYTHONPATH\" => \"$PYTHONPATH:$PIRATEBOX/python_lib\", - \"SHOUTBOX_GEN_HTMLFILE\" => \"$SHOUTBOX_GEN_HTMLFILE\" , - \"SHOUTBOX_CHATFILE\" => \"$SHOUTBOX_CHATFILE\" , - $LIGHTTPD_ENV_BR_LINE - - )" - - echo $LIGHTTPD_ENV > $LIGHTTPD_ENV_CONFIG -} - -#------------ lighttpd env config - End --------------------- - - - -if [ -z $1 ] ; then - echo "Usage is - generate_config_files.sh /opt/piratebox/conf/piratebox.conf - " - exit 255 -fi - -if [ ! -f $1 ] ; then - echo "Config-File $1 not found..." - exit 255 -fi - -. $1 - -. $NODE_CONFIG -. $PIRATEBOX_FOLDER/lib/node_name_generation.sh - -IPV6="#" - -set_pathnames $PIRATEBOX_FOLDER - -ipv6_call='' -if [ "$IPV6_ENABLE" = "yes" ] ; then - ipv6_call=$IPV6_PREFIX - 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 - -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_origin/piratebox/piratebox/bin/hooks/hook_piratebox_start.sh b/piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_start.sh deleted file mode 100755 index 6d110e6..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_start.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# ---- TEMPLATE ---- - -# Runs on every Startup -# get config file - -if [ ! -f $1 ] ; then - echo "Config-File $1 not found..." - exit 255 -fi - -#Load config -. $1 - -# You can uncommend this line to see when hook is starting: -# echo "------------------ Running $0 ------------------" - diff --git a/piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_start_done.sh b/piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_start_done.sh deleted file mode 100755 index 01bf40d..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_start_done.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# ---- TEMPLATE ---- - -# Runs on every Startup after the normal init-steps are done -# get config file - -if [ ! -f $1 ] ; then - echo "Config-File $1 not found..." - exit 255 -fi - -#Load config -. $1 - -# You can uncommend this line to see when hook is starting: -# echo "------------------ Running $0 ------------------" - diff --git a/piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_stop.sh b/piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_stop.sh deleted file mode 100755 index 1c09a82..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_stop.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# ---- TEMPLATE ---- - -# Runs on every Stop before anything is stopped -# get config file - -if [ ! -f $1 ] ; then - echo "Config-File $1 not found..." - exit 255 -fi - -#Load config -. $1 - -# You can uncommend this line to see when hook is starting: -# echo "------------------ Running $0 ------------------" - diff --git a/piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_stop_done.sh b/piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_stop_done.sh deleted file mode 100755 index a315e97..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/hooks/hook_piratebox_stop_done.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# ---- TEMPLATE ---- - -# Rund after every stop command is processed -# get config file - -if [ ! -f $1 ] ; then - echo "Config-File $1 not found..." - exit 255 -fi - -#Load config -. $1 - -# You can uncommend this line to see when hook is starting: -# echo "------------------ Running $0 ------------------" - diff --git a/piratebox_origin/piratebox/piratebox/bin/hooks/hook_post_init.sh b/piratebox_origin/piratebox/piratebox/bin/hooks/hook_post_init.sh deleted file mode 100755 index 0b11eb5..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/hooks/hook_post_init.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# ---- TEMPLATE ---- - -# Hook for modifcation stuff right after -# piratebox/bin/install ... part2 -# is run. - -if [ ! -f $1 ] ; then - echo "Config-File $1 not found..." - exit 255 -fi - -#Load config -. $1 - -# You can uncommend this line to see when hook is starting: -# echo "------------------ Running $0 ------------------" - diff --git a/piratebox_origin/piratebox/piratebox/bin/hooks/hook_pre_init.sh b/piratebox_origin/piratebox/piratebox/bin/hooks/hook_pre_init.sh deleted file mode 100755 index 06ad2b7..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/hooks/hook_pre_init.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# ---- TEMPLATE ---- - -# Hook for modifcation stuff before -# piratebox/bin/install ... part2 -# is run. - -if [ ! -f $1 ] ; then - echo "Config-File $1 not found..." - exit 255 -fi - -#Load config -. $1 - -# You can uncommend this line to see when hook is starting: -# echo "------------------ Running $0 ------------------" - diff --git a/piratebox_origin/piratebox/piratebox/bin/hooks/hook_pre_openwrt_init.sh b/piratebox_origin/piratebox/piratebox/bin/hooks/hook_pre_openwrt_init.sh deleted file mode 100755 index a40fe6f..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/hooks/hook_pre_openwrt_init.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# ---- TEMPLATE ---- - -# Hook for modifcation stuff before -# piratebox/bin/install ... openwrt -# is started - - -if [ ! -f $1 ] ; then - echo "Config-File $1 not found..." - exit 255 -fi - -#Load config -. $1 - -#Load openwrt-common config and procedures file! -. /etc/piratebox.config - - -# You can uncommend this line to see when hook is starting: -# echo "------------------ Running $0 ------------------" diff --git a/piratebox_origin/piratebox/piratebox/bin/install_piratebox.sh b/piratebox_origin/piratebox/piratebox/bin/install_piratebox.sh deleted file mode 100755 index 4972ac5..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/install_piratebox.sh +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/sh -## PirateBox installer script v.01 -## created by Matthias Strubel 2011-08-04 -## - -## 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 - echo "Usage install_piratebox my_config " - echo " Parts: " - echo " part2 : sets Permissions and links correctly" - echo " imageboard : configures kareha imageboard with Basic configuration" - echo " should be installed in /share/board" - echo " pyForum : Simple PythonForum" - echo " station_cnt : Adds Statio counter to your Box - crontab entry" - echo " flush_dns_reg : Installs crontask to flush dnsmasq regulary" - echo " hostname 'name' : Exchanges the Hostname displayed in browser" - exit 1 -fi - - -if [ ! -f $1 ] ; then - echo "Config-File $1 not found..." - exit 1 -fi - -#Load config -PIRATEBOX_CONFIG=$1 -. $1 - -if [ $2 = 'pyForum' ] ; then - cp -v $PIRATEBOX_FOLDER/src/forest.py $WWW_FOLDER/cgi-bin - cp -v $PIRATEBOX_FOLDER/src/forest.css $WWW_FOLDER/ - mkdir -p $PIRATEBOX_FOLDER/forumspace - chmod a+rw -R $PIRATEBOX_FOLDER/forumspace - chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $WWW_FOLDER/cgi-bin/forest.py - chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $WWW_FOLDER/forest.css - echo "Copied the files. Recheck your PirateBox now. " -fi - - - -if [ $2 = 'part2' ] ; then - echo "Starting initialize PirateBox Part2.." -#Create directories -# mkdir -p $PIRATEBOX_FOLDER/share/Shared - mkdir -p $UPLOADFOLDER - mkdir -p $PIRATEBOX_FOLDER/share/board - mkdir -p $PIRATEBOX_FOLDER/share/tmp - mkdir -p $PIRATEBOX_FOLDER/tmp - - #Set permissions - chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $PIRATEBOX_FOLDER/share -R - chmod u+rw $PIRATEBOX_FOLDER/share - chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $PIRATEBOX_FOLDER/www -R - chmod u+x $PIRATEBOX_FOLDER/www/cgi-bin/* - chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $PIRATEBOX_FOLDER/tmp - chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $PIRATEBOX_FOLDER/tmp -R - - -#Install a small script, that the link on the main page still works - if [ ! -f $PIRATEBOX_FOLDER/share/board/kareha.pl ] ; then - cp $PIRATEBOX_FOLDER/src/kareha.pl $PIRATEBOX_FOLDER/share/board - fi - - # Generate Redirect.html once - sed "s|#####HOST#####|$HOST|g" $PIRATEBOX_FOLDER/src/redirect.html.schema > $WWW_FOLDER/redirect.html - [ ! -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 -if [ $2 = 'imageboard' ] ; then - - if [ -e $PIRATEBOX_FOLDER/share/board/init_done ] ; then - echo "$PIRATEBOX_FOLDER/share/board/init_done file Found in Kareha folder. Won't reinstall board." - exit 0; - fi - - - cd $PIRATEBOX_FOLDER/tmp - KAREHA_RELEASE=kareha_3.1.4.zip - 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 - echo "Kareha Zip found..." - else - echo "No Zip found, abort " - exit 255 - fi - - unzip $KAREHA_RELEASE - mv kareha/* $PIRATEBOX_FOLDER/share/board - rm -rf $PIRATEBOX_FOLDER/tmp/kareha* - - cd $PIRATEBOX_FOLDER/share/board - cp -R mode_image/* ./ - cp $PIRATEBOX_FOLDER/src/kareha_img_config.pl $PIRATEBOX_FOLDER/share/board/config.pl - cp $PIRATEBOX_FOLDER/src/no_forum.html $PIRATEBOX_FOLDER/share/board/index.htm - chown -R $LIGHTTPD_USER:$LIGHTTPD_GROUP $PIRATEBOX_FOLDER/share/board - #Install filetype thumbnails - mv $PIRATEBOX_FOLDER/share/board/extras/icons $PIRATEBOX_FOLDER/share/board/ - - echo "Errors in chown occurs if you are using vfat on the USB stick" - echo " . don't Panic!" - echo "Generating index page" - cd /tmp - wget -q http://127.0.0.1/board/kareha.pl - echo "finished!" - echo "Now Edit your kareha settings file to change your ADMIN_PASS and SECRET : " - echo " # vi $PIRATEBOX_FOLDER/www/board/config.pl " - - touch $PIRATEBOX_FOLDER/share/board/init_done -fi - -if [ $2 = "station_cnt" ] ; then - #we want to append the crontab, not overwrite - crontab -l > $PIRATEBOX_FOLDER/tmp/crontab 2> /dev/null - echo "#--- Crontab for PirateBox-Station-Cnt" >> $PIRATEBOX_FOLDER/tmp/crontab - echo " */2 * * * * $PIRATEBOX_FOLDER/bin/station_cnt.sh > $WWW_FOLDER/station_cnt.txt " >> $PIRATEBOX_FOLDER/tmp/crontab - crontab $PIRATEBOX_FOLDER/tmp/crontab - [ "$?" != "0" ] && echo "an error occured" && exit 254 - $PIRATEBOX_FOLDER/bin/station_cnt.sh > $WWW_FOLDER/station_cnt.txt - echo "installed, now every 2 minutes your station count is refreshed" -fi - -if [ $2 = "flush_dns_reg" ] ; then - crontab -l > $PIRATEBOX_FOLDER/tmp/crontab 2> /dev/null - echo "#--- Crontab for dnsmasq flush" >> $PIRATEBOX_FOLDER/tmp/crontab - echo " */2 * * * * $PIRATEBOX_FOLDER/bin/flush_dnsmasq.sh > $PIRATEBOX_FOLDER/tmp/dnsmasq_flush.log " >> $PIRATEBOX_FOLDER/tmp/crontab - crontab $PIRATEBOX_FOLDER/tmp/crontab - [ "$?" != "0" ] && echo "an error occured" && exit 254 - echo "Installed crontab for flushing dnsmasq requlary" -fi - -set_hostname() { - local name=$1 ; shift; - - sed "s|#####HOST#####|$name|g" $PIRATEBOX_FOLDER/src/redirect.html.schema > $WWW_FOLDER/redirect.html - sed "s|HOST=\"$HOST\"|HOST=\"$name\"|" -i $PIRATEBOX_CONFIG -} - -if [ $2 = "hostname" ] ; then - echo "Switching hostname to $3" - set_hostname "$3" - echo "..done" -fi - diff --git a/piratebox_origin/piratebox/piratebox/bin/piratebox_setup_wlan.sh b/piratebox_origin/piratebox/piratebox/bin/piratebox_setup_wlan.sh deleted file mode 100755 index ae715af..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/piratebox_setup_wlan.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash - -# Author: Matthias Strubel / Feb. 2011 -# Script for setting up the wlan interface -# Parameter 1 i used for the config file providing the parameters - -# IP-Adress -# Netmask -# Interface - -probe() { - if [ "$PROBE_INTERFACE" = "yes" ] ; then - echo -n "Probing interface $INTERFACE" - ifconfig "$INTERFACE" >> /dev/null 2>&1 - TEST_OK=$? - CNT=$PROBE_TIME - while [[ "$TEST_OK" != "0" && "$CNT" != "0" ]] - do - echo -n "." - sleep 1 - CNT=$(( $CNT - 1 )) - if [ "$CNT" = 0 ] ; then - exit 99 - fi - ifconfig "$INTERFACE" >> /dev/null 2>&1 - TEST_OK=$? - done - fi -} - - - -# Load configfile - -if [ -z $1 ] || [ -z $2 ]; then - echo "Usage piratebox_setup_wlan.sh my_config " - exit 1 -fi - - -if [ ! -f $1 ] ; then - echo "Config-File $1 not found..." - exit 1 -fi - -#Load config -. $1 - - -### Check config -if [ -z $INTERFACE ]; then - echo "Please define i.e. " - echo " INTERFACE=wlan0 " - exit 1 -fi - -if [ -z $IP ] ; then - echo "Please define i.e. " - echo " IP=192.268.46.2 " - exit 1 -fi - -if [ -z $NETMASK ] ; then - echo "Please define i.e. " - echo " NETMASK=255.255.255.0 " - exit 1 -fi - - - -### Do the stuff - -if [ $2 = "start" ] ; then - - echo "Bringing up wifi interface $INTERFACE " - ifconfig $INTERFACE up - - if [ $? -ne 0 ] ; then - echo "..failed "; - exit 1 - fi - - echo "Setting up $INTERFACE" - ifconfig $INTERFACE $IP netmask $NETMASK - - if [ $? -ne 0 ] ; then - echo "..failed "; - exit 1 - fi - - if [ $IPV6_ENABLE = "yes" ] ; then - echo "Setting up IPv6 stuff" - 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 - - 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 -fi - - - diff --git a/piratebox_origin/piratebox/piratebox/bin/shoutbox_daemon.sh b/piratebox_origin/piratebox/piratebox/bin/shoutbox_daemon.sh deleted file mode 100755 index a6fb83d..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/shoutbox_daemon.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# Starts deamon for global shoutbox service -# requires piratebox.conf as first parameter -# -# Matthias Strubel - 2012 -# Licenced with GPL - -. $1 - -cd $PIRATEBOX_FOLDER -cd python_lib - -export SHOUTBOX_CHATFILE=$CHATFILE -export SHOUTBOX_GEN_HTMLFILE=$GEN_CHATFILE - - -if [ "$GLOBAL_CHAT" = "yes" ] ; then - export SHOUTBOX_BROADCAST_DESTINATIONS="$GLOBAL_DEST" -fi - -exec python discover.py diff --git a/piratebox_origin/piratebox/piratebox/bin/shoutbox_stuff.sh b/piratebox_origin/piratebox/piratebox/bin/shoutbox_stuff.sh deleted file mode 100755 index a7301d5..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/shoutbox_stuff.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -# Matthias Strubel - 2012-09-15 -# -# Only calls generate-Routing in piratebox-folder -# gets Piratebox-Folder into www - - -# $1 www folder -# $2 pirtatebox config file - - -. $2 - - -cd $PIRATEBOX_FOLDER -cd python_lib - -export SHOUTBOX_CHATFILE=$CHATFILE -export SHOUTBOX_GEN_HTMLFILE=$GEN_CHATFILE - - -#Writing init-message and reset chat.. -if [ "$RESET_CHAT" = "yes" ] ; then - echo $CHATMSG > $CHATFILE -fi - -#Generate content file -python psogen.py generate - -$( sleep 20 && touch $GEN_CHATFILE ) & - -#Set correct permissions -chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $SHOUTBOX_CHATFILE -chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $SHOUTBOX_GEN_HTMLFILE -chmod ug+rw $SHOUTBOX_CHATFILE -chmod ug+rw $SHOUTBOX_GEN_HTMLFILE - - diff --git a/piratebox_origin/piratebox/piratebox/bin/station_cnt.sh b/piratebox_origin/piratebox/piratebox/bin/station_cnt.sh deleted file mode 100755 index 3135df2..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/station_cnt.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -CNT=`iw wlan0 station dump | grep Station | wc -l` -#DATE=`date` -#echo $DATE - $CNT -echo "Currently there are $CNT connected clients" diff --git a/piratebox_origin/piratebox/piratebox/bin/timesave.sh b/piratebox_origin/piratebox/piratebox/bin/timesave.sh deleted file mode 100755 index 73f9356..0000000 --- a/piratebox_origin/piratebox/piratebox/bin/timesave.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/sh - -# This script enables a sort of timerescue System -# for Systems without a Realtime Clock -# like TP-Link MR3020 , RaspberryPI -# -# It does not reflect the real time, but -# gives a sort of stability to complete standalone -# systems. -# -# Licenced under GPL-2 @ 2012,2015 -# Matthias Strubel matthias.strubel@aod-rgp.de - -##function for similar saving & getting time -get_datetime() { - # Get format from piratebox.conf - date $TIMESAVE_FORMAT -} - - -# Load configfile - -if [ -z $1 ] || [ -z $2 ] ; then - echo "Set up a crontab entry for regulary saving the time" - echo "Usage $0 " - echo " Valid steps are:" - echo " install - installs the needed parts into crontab" - echo " save - saves time into file" - echo " recover - recovers the time from a file" - - exit 1 -fi - -. $1 - - -if [ "$2" = "install" ] ; then - crontab -l > $PIRATEBOX_FOLDER/tmp/crontab 2> /dev/null - echo "#--- Crontab for PirateBox-Timesave" >> $PIRATEBOX_FOLDER/tmp/crontab - 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 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... - get_datetime > $TIMESAVE - exit 0 -fi - -if [ "$2" = "recover" ] ; then - if [ `get_datetime` -lt `cat $TIMESAVE` ] ; then - date -s `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_origin/piratebox/piratebox/conf/avahi/avahi-daemon.conf.schema b/piratebox_origin/piratebox/piratebox/conf/avahi/avahi-daemon.conf.schema deleted file mode 100644 index a8ba2a4..0000000 --- a/piratebox_origin/piratebox/piratebox/conf/avahi/avahi-daemon.conf.schema +++ /dev/null @@ -1,30 +0,0 @@ -[server] -host-name=#####MASKED_HOSTNAME##### -use-ipv4=no -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_origin/piratebox/piratebox/conf/avahi/services/http.service b/piratebox_origin/piratebox/piratebox/conf/avahi/services/http.service deleted file mode 100644 index 7e9be2d..0000000 --- a/piratebox_origin/piratebox/piratebox/conf/avahi/services/http.service +++ /dev/null @@ -1,10 +0,0 @@ - - - - Web Server on %h - - _http._tcp - 80 - path=/ - - diff --git a/piratebox_origin/piratebox/piratebox/conf/avahi/services/ssh.service b/piratebox_origin/piratebox/piratebox/conf/avahi/services/ssh.service deleted file mode 100644 index c66e0c1..0000000 --- a/piratebox_origin/piratebox/piratebox/conf/avahi/services/ssh.service +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - %h - - - _ssh._tcp - 22 - - - diff --git a/piratebox_origin/piratebox/piratebox/conf/dnsmasq_default.conf b/piratebox_origin/piratebox/piratebox/conf/dnsmasq_default.conf deleted file mode 100644 index e7315cf..0000000 --- a/piratebox_origin/piratebox/piratebox/conf/dnsmasq_default.conf +++ /dev/null @@ -1,15 +0,0 @@ -#dont use resolv.conf -no-resolv -#dont recheck resolv.conf for changes -no-poll - -#overwrite dns.. -#dhcp-authoritative - -# If you don't want dnsmasq to read /etc/hosts, uncomment the -# following line. -no-hosts -# or if you want it to read another file, as well as /etc/hosts, use -# this. -#addn-hosts=/etc/banner_add_hosts -## ^^^^^^ <- generated diff --git a/piratebox_origin/piratebox/piratebox/conf/hook_custom.conf b/piratebox_origin/piratebox/piratebox/conf/hook_custom.conf deleted file mode 100644 index ca3fe53..0000000 --- a/piratebox_origin/piratebox/piratebox/conf/hook_custom.conf +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Place your custom variables down here. -# Will be loaded into piratebox.conf via runtime - -#VAR1="CONTENT" diff --git a/piratebox_origin/piratebox/piratebox/conf/hostapd.conf b/piratebox_origin/piratebox/piratebox/conf/hostapd.conf deleted file mode 100644 index 3f65ac4..0000000 --- a/piratebox_origin/piratebox/piratebox/conf/hostapd.conf +++ /dev/null @@ -1,7 +0,0 @@ -interface=wlan0 -driver=nl80211 -ssid=PirateBox - Share Freely -hw_mode=g -channel=1 -#auth_algs=1 -#ieee80211n=1 diff --git a/piratebox_origin/piratebox/piratebox/conf/hosts b/piratebox_origin/piratebox/piratebox/conf/hosts deleted file mode 100644 index 115a88f..0000000 --- a/piratebox_origin/piratebox/piratebox/conf/hosts +++ /dev/null @@ -1,9 +0,0 @@ -#------ Static - -# Entry for tricking windows -### commented because this will cause the default redirect. -### left here for documentary the stuff -### dns.msftncsi.com 131.107.255.255 -#------- Static end ... Generated stuff now - - diff --git a/piratebox_origin/piratebox/piratebox/conf/hosts_mesh b/piratebox_origin/piratebox/piratebox/conf/hosts_mesh deleted file mode 100644 index bf12fc5..0000000 --- a/piratebox_origin/piratebox/piratebox/conf/hosts_mesh +++ /dev/null @@ -1,3 +0,0 @@ -#-------------------- -# Spacer for generated hostsfile from mesh detection -#-------------------- diff --git a/piratebox_origin/piratebox/piratebox/conf/ipv6.conf b/piratebox_origin/piratebox/piratebox/conf/ipv6.conf deleted file mode 100644 index e175ae5..0000000 --- a/piratebox_origin/piratebox/piratebox/conf/ipv6.conf +++ /dev/null @@ -1,19 +0,0 @@ -####-------------- -# Config file will be filled up partly on init-step -####-------------- - -#Enable IPv6 Setup (yes|no) on you interface -IPV6_ENABLE="no" - -# Which kind of router-adverticement should be used ( radvd | dnsmasq | none ) -# -IPV6_ADVERT="radvd" - -#absolute Node-Adress -IPV6_IP="fdc0:ffea::1" - -#Netmask without / -IPV6_MASK="64" - -# Prefix to piratebox ipv6 adress -IPV6_PREFIX="fdc0:ffea" diff --git a/piratebox_origin/piratebox/piratebox/conf/lighttpd/env b/piratebox_origin/piratebox/piratebox/conf/lighttpd/env deleted file mode 100644 index e69de29..0000000 diff --git a/piratebox_origin/piratebox/piratebox/conf/lighttpd/lighttpd.conf b/piratebox_origin/piratebox/piratebox/conf/lighttpd/lighttpd.conf deleted file mode 100644 index a9a7312..0000000 --- a/piratebox_origin/piratebox/piratebox/conf/lighttpd/lighttpd.conf +++ /dev/null @@ -1,96 +0,0 @@ -## Configuration for Piratebox - -server.modules = ( -# "mod_access", not needed! -# "mod_alias", -# "mod_compress", Disabled, fixing reload Problem?? - "mod_redirect", -# "mod_rewrite", - "mod_setenv", -) - -server.document-root = "/opt/piratebox/www" -server.upload-dirs = ( "/opt/piratebox/share/tmp" ) -server.errorlog = "/opt/piratebox/tmp/error.log" -server.breakagelog = "/opt/piratebox/tmp/break.log" -server.pid-file = "/opt/piratebox/tmp/lighttpd.pid" - - server.username = "nobody" - server.groupname = "nogroup" - - - -index-file.names = ( "index.php", "index.html", - "index.htm", "default.htm", - " index.lighttpd.html" ) - -url.access-deny = ( "~", ".inc" ) - -# added .cgi .py -static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" , ".cgi" , ".py" ) - - -# Enable lighttpd on ipv6 -$SERVER["socket"] == "[::]:80" { } - -dir-listing.encoding = "utf-8" -server.dir-listing = "enable" -dir-listing.hide-dotfiles = "enable" - - -# 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" ) - -#n.a. on router include_shell "/usr/share/lighttpd/create-mime.assign.pl" -include "/opt/piratebox/conf/lighttpd/mime.types" - -#----------- ShoutBox-Env -------------- -include "/opt/piratebox/conf/lighttpd/env" - -#----------- cgi.conf -------------- -server.modules += ( "mod_cgi" ) - -$HTTP["url"] =~ "^/cgi-bin/" { -# cgi.assign = ( "" => "" ) - cgi.assign = ( ".py" => "/usr/bin/python" ) -} - -$HTTP["url"] =~ "^/generate_204" { - cgi.assign = ( "generate_204" => "/usr/bin/python" ) -} - -## Warning this represents a security risk, as it allow to execute any file -## with a .pl/.py even outside of /usr/lib/cgi-bin. -# -#cgi.assign = ( -# ".pl" => "/usr/bin/perl", -# ".py" => "/usr/bin/python", -#) - -$HTTP["url"] =~ "^/board/" { - cgi.assign = ( ".pl" => "/usr/bin/perl" , ) -} -#------------------------------------- - - - -# 404 Error Page with redirect -# -server.error-handler-404 = "/redirect.html" - -## for better debugging -#server.modules += ( "mod_accesslog" ) -#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" -} - diff --git a/piratebox_origin/piratebox/piratebox/conf/lighttpd/mime.types b/piratebox_origin/piratebox/piratebox/conf/lighttpd/mime.types deleted file mode 100644 index ea8b09a..0000000 --- a/piratebox_origin/piratebox/piratebox/conf/lighttpd/mime.types +++ /dev/null @@ -1,89 +0,0 @@ -## MimeType handling -## ------------------- -## -## Use the "Content-Type" extended attribute to obtain mime type if -## possible -## -mimetype.use-xattr = "disable" - -## -## mimetype mapping -## -mimetype.assign = ( - ".pdf" => "application/pdf", - ".sig" => "application/pgp-signature", - ".spl" => "application/futuresplash", - ".class" => "application/octet-stream", - ".ps" => "application/postscript", - ".torrent" => "application/x-bittorrent", - ".dvi" => "application/x-dvi", - ".gz" => "application/x-gzip", - ".pac" => "application/x-ns-proxy-autoconfig", - ".swf" => "application/x-shockwave-flash", - ".tar.gz" => "application/x-tgz", - ".tgz" => "application/x-tgz", - ".tar" => "application/x-tar", - ".zip" => "application/zip", - ".mp3" => "audio/mpeg", - ".m3u" => "audio/x-mpegurl", - ".wma" => "audio/x-ms-wma", - ".wax" => "audio/x-ms-wax", - ".ogg" => "application/ogg", - ".wav" => "audio/x-wav", - ".gif" => "image/gif", - ".jpg" => "image/jpeg", - ".jpeg" => "image/jpeg", - ".png" => "image/png", - ".xbm" => "image/x-xbitmap", - ".xpm" => "image/x-xpixmap", - ".xwd" => "image/x-xwindowdump", - ".css" => "text/css", - ".html" => "text/html", - ".htm" => "text/html", - ".js" => "text/javascript", - ".asc" => "text/plain", - ".c" => "text/plain", - ".cpp" => "text/plain", - ".log" => "text/plain", - ".conf" => "text/plain", - ".text" => "text/plain", - ".txt" => "text/plain", - ".spec" => "text/plain", - ".dtd" => "text/xml", - ".xml" => "text/xml", - ".mpeg" => "video/mpeg", - ".mpg" => "video/mpeg", - ".mov" => "video/quicktime", - ".qt" => "video/quicktime", - ".avi" => "video/x-msvideo", - ".asf" => "video/x-ms-asf", - ".asx" => "video/x-ms-asf", - ".wmv" => "video/x-ms-wmv", - ".mp4" => "video/mp4", - ".bz2" => "application/x-bzip", - ".tbz" => "application/x-bzip-compressed-tar", - ".tar.bz2" => "application/x-bzip-compressed-tar", - ".odt" => "application/vnd.oasis.opendocument.text", - ".ods" => "application/vnd.oasis.opendocument.spreadsheet", - ".odp" => "application/vnd.oasis.opendocument.presentation", - ".odg" => "application/vnd.oasis.opendocument.graphics", - ".odc" => "application/vnd.oasis.opendocument.chart", - ".odf" => "application/vnd.oasis.opendocument.formula", - ".odi" => "application/vnd.oasis.opendocument.image", - ".odm" => "application/vnd.oasis.opendocument.text-master", - ".ott" => "application/vnd.oasis.opendocument.text-template", - ".ots" => "application/vnd.oasis.opendocument.spreadsheet-template", - ".otp" => "application/vnd.oasis.opendocument.presentation-template", - ".otg" => "application/vnd.oasis.opendocument.graphics-template", - ".otc" => "application/vnd.oasis.opendocument.chart-template", - ".otf" => "application/vnd.oasis.opendocument.formula-template", - ".oti" => "application/vnd.oasis.opendocument.image-template", - ".oth" => "application/vnd.oasis.opendocument.text-web", - - ".json" => "application/json", - ".epub" => "application/epub+zip", - ".fb2" => "text/xml", - -# make the default mime type application/octet-stream. - "" => "application/octet-stream", -) diff --git a/piratebox_origin/piratebox/piratebox/conf/node.conf b/piratebox_origin/piratebox/piratebox/conf/node.conf deleted file mode 100644 index 5971d0a..0000000 --- a/piratebox_origin/piratebox/piratebox/conf/node.conf +++ /dev/null @@ -1,27 +0,0 @@ -# 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 -# 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 -# 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_origin/piratebox/piratebox/conf/piratebox.conf b/piratebox_origin/piratebox/piratebox/conf/piratebox.conf deleted file mode 100644 index b27d599..0000000 --- a/piratebox_origin/piratebox/piratebox/conf/piratebox.conf +++ /dev/null @@ -1,176 +0,0 @@ -######### -## 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 -## -## 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 -## 2013-10-07 Added Link to node.conf and comment about hostname -## Cleanup -## -######## - -####### -## Configuration help -## If you plan to use one laptop as the piratebox: -## Set DO_IFCONFIG , USE_APN, USE_DNSMASQ to yes -## If you plan to run a two component setup (one router and one providing the storage+website) -## connected with ethernet: -## 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 -## -## You may deactivated severall option as needed. It's flexible. - - -#----------------- Folder Configuration -------------------# - -PIRATEBOX_FOLDER="/opt/piratebox" -WWW_FOLDER="/opt/piratebox/www" - -#Do not change untill really needed. -PIRATEBOX_PYTHONPATH="$PIRATEBOX_FOLDER/python_lib" - - -#Datafolder , where is you usb-stick // drive mounted -SHARE_FOLDER="$PIRATEBOX_FOLDER/share" - -#Upload Folder -# Change this if you want to user uploaded data in a subfolder -# Make sure the folder exists -# UPLOADFOLDER="$SHARE_FOLDER/Upload" -UPLOADFOLDER="$SHARE_FOLDER/Shared" - -#----------------- Startup Configuration -------------------# -# Which Steps has to be done - -#Do network config -DO_IFCONFIG="yes" - -#Do IW config - setting up a wlan0 interface with iw -# for some wifi-cards required -DO_IW="no" -#Iw physical interface -PHY_IF="phy0" - -# Check if interface exists -# should be set to yes if you use a USB wifi card -PROBE_INTERFACE="no" -# wait how many seconds until throw an error -PROBE_TIME=10 - -#Start services... -# act like a apn / -# please have a look @ hostapd.conf ; you may need to change some options, regarding wifi-card -USE_APN="yes" -# act like dns&dhcp (dnsmasq) -USE_DNSMASQ="yes" - -#HOSTNAME ... if you really want to change it, plz change: -# www/index.html -# -# That is the Domain-Specifi part, where you reach always the local box -HOST="piratebox.lan" - -#----------------- Configuration for DNSMASQ & IF-Setup -------------------# -# Name of the wlan interface -INTERFACE="wlan0" -# On which interface DNSMASQ should listen. -i is the parameter for dnsmasq -# Make it empty to disable -DNSMASQ_INTERFACE="wlan0" - -#Brdige add interfacce (setr yes to enable bridging) -DO_BRIDGE="no" -BRIDGE="br-lan" - -#Network -NET=192.168.77 - -#IP-SHORT (is stringed together) -# Which IP is your Box?? i.e. 1 => 192.168.77.1 -IP_SHORT=1 - -#DHCP LEASE Start -START_LEASE=10 -#DHCP LEASE End Range -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 - -#SET IP for ifconfig stuff - DON'T CHANGE -IP=$NET.$IP_SHORT - -#Load Config about ipv6 stuff - DON'T CHANGE - . $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 - -## Timesave file for non RTC devices -TIMESAVE="$PIRATEBOX_FOLDER/share/timesave_file" - -#On non OpenWRT you can use the default output format -# as an input format. For OpenWrt you need to specify +%C%g%m%d%H%M -# The content is exchanged during makefile processing and image build -TIMESAVE_FORMAT="" - -#Start droopy? - Enable upload? -DROOPY_ENABLED="yes" -#Image-SRC -IMAGENAME="piratebox-logo-small.png" -IMAGE="$PIRATEBOX_FOLDER/src/$IMAGENAME" -DROOPY_TXT="" -DROOPY_PORT="8080" -# Set correct permissions for an uploaded file -DROOPY_CHMOD="755" -DROOPY_USERDIR="" -# Uncomment line below for adding directory feature -#DROOPY_USERDIR=" -u True " - -#Use UserId from lighttpd for droopy (use on ext-filesystems) -DROOPY_USE_USER="yes" - -#Configuration for chat (If you decide to move the chat folder, you have to change /opt/piratebox/chat/cgi-bin/py* files ) -CHATFILE="$WWW_FOLDER/cgi-bin/data.pso" - -#Generated File -GEN_CHATFILE="$WWW_FOLDER/chat_content.html" - -# Reset Shoutbox on Startup? -RESET_CHAT="yes" - -#Inititiation Chat-Message -CHATMSG="
00:00:00 PirateBox: Chat and share files anonymously!
" - -#Activate Global chat -# Still experimentall! -GLOBAL_CHAT="no" - -#On which broadcast address should it send -# Take care on the syntax!! -GLOBAL_DEST="[ #255.255.255.255# , #10.255.255.255# , #$NET.255# ]" - -#------------------------ Additional configuration for lighttpd -LIGHTTPD_USER=nobody -LIGHTTPD_GROUP=nogroup - - -#------------------------ Hook in user-config -. $PIRATEBOX_FOLDER/conf/hook_custom.conf diff --git a/piratebox_origin/piratebox/piratebox/init.d/piratebox b/piratebox_origin/piratebox/piratebox/init.d/piratebox deleted file mode 100755 index 23d77df..0000000 --- a/piratebox_origin/piratebox/piratebox/init.d/piratebox +++ /dev/null @@ -1,245 +0,0 @@ -#! /bin/sh -# /etc/init.d/piratebox - -### BEGIN INIT INFO -# Provides: piratebox -# Required-Start: $all -# Required-Stop: $network $local_fs -# 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 -### END INIT INFO - -### -# Default start-stop script for piratebox services on a laptop -# written by Matthias Strubel (matthias.strubel@aod-rpg.de) 2011-02-22 -# licenced by gpl, feel free to improve and send me comments - -. /lib/lsb/init-functions - - -[ -f /etc/default/rcS ] && . /etc/default/rcS - -# PATH for /opt piratebox folder -PATH=$PATH:/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 -PIDFILE_RADVD=/opt/piratebox/tmp/radvd.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_RADVD=$PIRATEBOX/conf/radvd_generated.conf - -CONF_LIGHTTPD=$PIRATEBOX/conf/lighttpd/lighttpd.conf - -export PYTHONPATH=:$PYTHONPATH:$PIRATEBOX_PYTHONPATH - - -# Some things that run always -touch /var/lock/piratebox - -if [ -f $CONF ] ; then - . $CONF -else - log_failure_msg "Configuration file not found" - 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 " - -# Carry out specific functions when asked to by the system -case "$1" in - start) - log_daemon_msg "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 - log_daemon_msg " Setting up Interface (iw) " - iw $PHY_IF interface add $INTERFACE type managed - fi - - if [ "$PROBE_INTERFACE" = yes ] ; then - log_daemon_msg " Probing wlan" - #Setting up WLAN Interface - piratebox_setup_wlan.sh $CONF probe - fi - if [ $? -ne 0 ] ; then - log_failure_msg "failed probe Interface" - else - - # Only activate - if [ "$USE_APN" = "yes" ] ; then - log_daemon_msg "Starting hostap... " - start-stop-daemon -m --start --background --pidfile $PIDFILE_HOSTAPN --exec /usr/sbin/hostapd -- $CONF_APN - log_end_msg $? - fi - - if [ "$DO_IFCONFIG" = yes ] ; then - log_daemon_msg " Setting up wlan" - #Setting up WLAN Interface - piratebox_setup_wlan.sh $CONF start - if [ $? -ne 0 ] ; then - log_failure_msg "failed setting up Interface" - exit 99 - fi - fi - - #BRIDGE - if [ "$DO_BRIDGE" = "yes" ] ; then - log_daemon_msg "Adding $INTERFACE to bridge $BRIDGE // brctl addif $BRIDGE $INTERFACE " - sleep 1 - BR_CMD="brctl addif $BRIDGE $INTERFACE" - ( $BR_CMD ; ) - log_end_msg $? - fi - - if [ "$USE_DNSMASQ" = "yes" ] ; then - log_daemon_msg "Starting dnsmasq... " - # pidfile is written by dnsmasq - start-stop-daemon --start --quiet --exec /usr/sbin/dnsmasq -- $CMD_DNSMASQ - 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. - #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 - 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 - - #Do shoutbox stuff - $PIRATEBOX/bin/shoutbox_stuff.sh $WWW_FOLDER $CONF - - - #Start here the lighttpd i.e. - log_daemon_msg "Starting lighttpd..." - start-stop-daemon --start --quiet --pidfile $PIDFILE_LIGHTTPD --exec /usr/sbin/lighttpd -- -f $CONF_LIGHTTPD - log_end_msg $? - - #Start Global Chat daemon if needed. - if [ "$GLOBAL_CHAT" = "yes" ] ; then - log_daemon_msg "Starting global chat service..." - start-stop-daemon -m --start --background --pidfile $PIDFILE_SHOUTBOX --startas $PIRATEBOX/bin/shoutbox_daemon.sh -- $CONF - log_end_msg $? - fi - fi - - $PIRATEBOX/bin/hooks/hook_piratebox_start_done.sh "$CONF" - - ;; - stop) - log_daemon_msg "Stopping script piratebox" - echo "" - - $PIRATEBOX/bin/hooks/hook_piratebox_stop.sh "$CONF" - - if [ "$USE_APN" = "yes" ] ; then - log_daemon_msg "Stopping hostap... " - start-stop-daemon --stop --quiet --pidfile $PIDFILE_HOSTAPN --oknodo --startas "hostapd" - log_end_msg $? - fi - if [ "$USE_DNSMASQ" = "yes" ] ; then - log_daemon_msg "Stopping dnsmasq..." - start-stop-daemon --stop --quiet --pidfile $PIDFILE_DNSMASQ - 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..." - start-stop-daemon --stop --quiet --pidfile $PIDFILE_SHOUTBOX - log_end_msg $? - fi - - log_daemon_msg "Stopping lighttpd..." - start-stop-daemon --stop --retry 30 --quiet --pidfile $PIDFILE_LIGHTTPD - log_end_msg $? - - if [ "$DROOPY_ENABLED" = "yes" ] ; then - #Kill Droopy - log_daemon_msg "Stopping droopy... " - start-stop-daemon --stop --quiet --pidfile $PIDFILE_DROOPY --oknodo --startas "python /opt/piratebox/bin/droopy" - log_end_msg $? - 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 - log_daemon_msg "Remove Bridge..." - BR_CMD="brctl delif $BRIDGE $INTERFACE" - ( $BR_CMD ; ) - log_end_msg $? - fi - - $PIRATEBOX/bin/hooks/hook_piratebox_stop_done.sh "$CONF" - - - ;; - *) - echo "Usage: /etc/init.d/piratebox {start|stop}" - exit 1 - ;; -esac - -exit 0 diff --git a/piratebox_origin/piratebox/piratebox/init.d/piratebox_alt b/piratebox_origin/piratebox/piratebox/init.d/piratebox_alt deleted file mode 100755 index 1e43fef..0000000 --- a/piratebox_origin/piratebox/piratebox/init.d/piratebox_alt +++ /dev/null @@ -1,245 +0,0 @@ -#!/bin/sh -# /etc/init.d/piratebox - -### BEGIN INIT INFO -# Provides: piratebox -# Required-Start: $all -# Required-Stop: $network $local_fs -# 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 -### END INIT INFO - -### -# Default start-stop script for piratebox services on a laptop -# written by Matthias Strubel (matthias.strubel@aod-rpg.de) 2011-02-22 -# licenced by gpl, feel free to improve and send me comments - - -[ -f /etc/default/rcS ] && . /etc/default/rcS - -# PATH for /opt piratebox folder -PATH=$PATH:/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 -PIDFILE_RADVD=/opt/piratebox/tmp/radvd.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_RADVD=$PIRATEBOX/conf/radvd_generated.conf - -CONF_LIGHTTPD=$PIRATEBOX/conf/lighttpd/lighttpd.conf - -export PYTHONPATH=:$PYTHONPATH:$PIRATEBOX_PYTHONPATH - -if [ -f $CONF ] ; then - . $CONF -else - echo "Configuration file not found" - exit 1 -fi - -#If you can't find this file -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 " - - # 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 - log_daemon_msg " Setting up Interface (iw) " - iw $PHY_IF interface add $INTERFACE type managed - fi - - if [ "$PROBE_INTERFACE" = yes ] ; then - echo " Probe wlan" - #Setting up WLAN Interface - piratebox_setup_wlan.sh $CONF probe - fi - if [ $? -ne 0 ] ; then - echo "failed probing Interface" - else - - # Only activate - if [ "$USE_APN" = "yes" ] ; then - echo "Starting hostap... " - start-stop-daemon -m -S -b -p $PIDFILE_HOSTAPN -x /usr/sbin/hostapd -- $CONF_APN - echo $? - fi - - if [ "$DO_IFCONFIG" = yes ] ; then - echo " Setting up wlan" - #Setting up WLAN Interface - piratebox_setup_wlan.sh $CONF start - if [ $? -ne 0 ] ; then - echo "failed setting up Interface" - exit 255 - 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 "failed :( " - fi - fi - - if [ "$USE_DNSMASQ" = "yes" ] ; then - echo "Starting dnsmasq... " - # pidfile is written by dnsmasq - start-stop-daemon -S -q -x /usr/sbin/dnsmasq -- $CMD_DNSMASQ - 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..." - find $UPLOADFOLDER/ -iname tmp\* -exec rm {} \; - #Delete 0 Byte Files - delete_empty.sh $UPLOADFOLDER - - DROOPY_USER="" - 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 - echo $? - fi - - #Do shoutbox stuff - $PIRATEBOX/bin/shoutbox_stuff.sh $WWW_FOLDER $CONF - - - #Start here the lighttpd i.e. - echo "Starting lighttpd..." - start-stop-daemon -S -q -p $PIDFILE_LIGHTTPD -x /usr/sbin/lighttpd -- -f $CONF_LIGHTTPD - echo $? - - #Start Global Chat daemon if needed. - if [ "$GLOBAL_CHAT" = "yes" ] ; then - echo "Starting global chat service..." - start-stop-daemon -S -m -b -p $PIDFILE_SHOUTBOX -x $PIRATEBOX/bin/shoutbox_daemon.sh -- $CONF - echo $? - fi - fi - - $PIRATEBOX/bin/hooks/hook_piratebox_start_done.sh "$CONF" - - ;; - stop) - echo "Stopping script piratebox" - - $PIRATEBOX/bin/hooks/hook_piratebox_stop.sh "$CONF" - - if [ "$USE_APN" = "yes" ] ; then - echo "Stopping hostap... " - start-stop-daemon -K -q -p $PIDFILE_HOSTAPN - echo $? - fi - if [ "$USE_DNSMASQ" = "yes" ] ; then - 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... " - start-stop-daemon -s 9 -K -q -p $PIDFILE_DROOPY - echo $? - fi - - #Start Global Chat daemon if needed. - if [ "$GLOBAL_CHAT" = "yes" ] ; then - echo "Stopping global chat service..." - start-stop-daemon -K -q -p $PIDFILE_SHOUTBOX - echo $? - fi - - - - echo "Stopping lighttpd..." - start-stop-daemon -K -q -p $PIDFILE_LIGHTTPD - echo $? - - - if [ "$DO_IFCONFIG" = yes ] ; then - piratebox_setup_wlan.sh $CONF stop - fi - - if [ "$DO_IW" = "yes" ] ; then - iw dev $INTERFACE del - fi - - #BRIDGE - if [ "$DO_BRIDGE" = "yes" ] ; then - echo "Remove $INTERFACE to bridge $BRIDGE // brctl addif -$BRIDGE $INTERFACE " - sleep 1 - BR_CMD="brctl delif $BRIDGE $INTERFACE" - ( $BR_CMD ; ) - if [ $? -ne 0 ] ; then - echo "failed :( " - fi - fi - - $PIRATEBOX/bin/hooks/hook_piratebox_stop_done.sh "$CONF" - ;; - *) - echo "Usage: /etc/init.d/piratebox {start|stop}" - exit 1 - ;; -esac - -exit 0 diff --git a/piratebox_origin/piratebox/piratebox/lib/node_name_generation.sh b/piratebox_origin/piratebox/piratebox/lib/node_name_generation.sh deleted file mode 100644 index a8050f3..0000000 --- a/piratebox_origin/piratebox/piratebox/lib/node_name_generation.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/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=$complete_node_name - return 0 - else - echo "Error: No valid node-name found" - return 1 - fi -} diff --git a/piratebox_origin/piratebox/piratebox/lib/node_name_resolution.sh b/piratebox_origin/piratebox/piratebox/lib/node_name_resolution.sh deleted file mode 100644 index 25ee43e..0000000 --- a/piratebox_origin/piratebox/piratebox/lib/node_name_resolution.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/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 -6 $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 - - -} diff --git a/piratebox_origin/piratebox/piratebox/python_lib/.keep b/piratebox_origin/piratebox/piratebox/python_lib/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/piratebox_origin/piratebox/piratebox/python_lib/broadcast.py b/piratebox_origin/piratebox/piratebox/python_lib/broadcast.py deleted file mode 100644 index 70107bf..0000000 --- a/piratebox_origin/piratebox/piratebox/python_lib/broadcast.py +++ /dev/null @@ -1,121 +0,0 @@ -# PirateBox send Message lib -# modified by Matthias Strubel -# -# Original Version by -# -# Forban - a simple link-local opportunistic p2p free software -# -# For more information : http://www.foo.be/forban/ -# -# Copyright (C) 2009-2010 Alexandre Dulaunoy - http://www.foo.be/ -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - - -import socket -import string -import time -import datetime -try: - from hashlib import sha1 -except ImportError: - from sha import sha as sha1 -import re -import sys - - -flogger = None - - -debug = 0 - -class broadcast: - - def __init__(self,name="notset", uuid=None, port="12556", timestamp=None, - auth=None, destination=["ff02::1","255.255.255.255", ]): - self.name = name - self.uuid = uuid - self.port = port - self.count = 0 - self.destination = destination - self.ipv6_disabled = 0 - - def disableIpv6(self): - self.ipv6_disabled = 1 - self.destination = ["255.255.255.255", ] - - def setDestination(self, destination=["ff02::1","255.255.255.255", ] ): - self.destination = destination - - def set (self, content ): - self.payload = content - - def get (self): - return self.payload - - def __debugMessage (self, msg ): - if flogger != None: - flogger.debug ( msg ) - elif debug == 1: - print msg - - def __errorMessage (self, msg): - if flogger != None: - flogger.error ( msg ) - elif debug == 1: - print msg - - - def send(self): - for destination in self.destination: - if socket.has_ipv6 and re.search(":", destination) and not self.ipv6_disabled == 1: - - self.__debugMessage( "working in ipv6 part on destination " + destination ) - - # Even if Python is compiled with IPv6, it doesn't mean that the os - # is supporting IPv6. (like the Nokia N900) - try: - sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM, socket.IPPROTO_UDP) - # Required on some version of MacOS X while sending IPv6 UDP - # datagram - sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 1) - except: - sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) - - else: - self.__debugMessage ( "open ipv4 socket on destination " + destination ) - sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) - sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) - - try: - sock.sendto(self.payload, (destination, int(self.port))) - except socket.error, msg: - self.__errorMessage ( "Error sending to "+ destination + " : " + msg.strerror ) - continue - sock.close() - - - - - - -def managetest(): - msg = broadcast() - msg.set("Test") - print msg.get() - msg.send() - -if __name__ == "__main__": - managetest() - diff --git a/piratebox_origin/piratebox/piratebox/python_lib/discover.py b/piratebox_origin/piratebox/piratebox/python_lib/discover.py deleted file mode 100644 index 9ab4f6d..0000000 --- a/piratebox_origin/piratebox/piratebox/python_lib/discover.py +++ /dev/null @@ -1,83 +0,0 @@ -import SocketServer -import socket -import sys -import os - -import messages -from psogen import writeToDisk, generate_html_from_file - -global lastmsg -lastmsg = "" - -class MyUDPHandler(SocketServer.BaseRequestHandler): - - def handle(self): - global lastmsg - data = self.request[0].strip() - socket = self.request[1] - if data[:9] == "piratebox": - if data[10:12] == "sb": - if data != lastmsg : - msg = messages.shoutbox_message() - msg.set_message(data) - content = msg.get() - writeToDisk(content) - generate_html_from_file() - lastmsg = data - else: - print data[11:12] - print data - else: - print "debug : not a piratebox message" - -class UDPServer(SocketServer.UDPServer): - - def setIPv6 (self, ipv6 = 1 ): - if ipv6 == 0 : - self.disable_ipv6 = 1 - else: - self.disable_ipv6 = 0 - - def useIPv6 (self ): - return True - - if self.disable_ipv6 == 1 : - return False - else: - return True - - - if socket.has_ipv6 : - try: - socktest = socket.socket(socket.AF_INET6) - socktest.close() - address_family = socket.AF_INET6 - except: - address_family = socket.AF_INET - - def server_bind(self): - - if self.useIPv6(): - - self.v6success = True - try: - socktest = socket.socket(socket.AF_INET6) - socktest.close() - except: - self.v6success = False - - if socket.has_ipv6 and self.v6success: - address_family = socket.AF_INET6 - - #allowing to work in dual-stack when IPv6 is used - if socket.has_ipv6 and self.v6success: - self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0) - - self.socket.bind(self.server_address) - -if __name__ == "__main__": - HOST, PORT = ("::",12556) - server = UDPServer((HOST, PORT), MyUDPHandler) - server.setIPv6(0) - server.serve_forever() - diff --git a/piratebox_origin/piratebox/piratebox/python_lib/messages.py b/piratebox_origin/piratebox/piratebox/python_lib/messages.py deleted file mode 100644 index 1884efb..0000000 --- a/piratebox_origin/piratebox/piratebox/python_lib/messages.py +++ /dev/null @@ -1,48 +0,0 @@ - -import string -import socket - -import base64 -import sys - -class message: - def __init__(self, name="generate" ): - if name == "generate": - self.name=socket.gethostname() - else: - self.name=name - - self.type="gc" - self.decoded="" - - def set ( self, content=" " ): - base64content = base64.b64encode ( content ) - self.decoded="piratebox;"+ self.type + ";01;" + self.name + ";" + base64content - - def get ( self ): - # TODO Split decoded part - message_parts = string.split ( self.decoded , ";" ) - - if message_parts[0] != "piratebox": - return None - - b64_content_part = message_parts[4] - - content = base64.b64decode ( b64_content_part ) - return content - - def get_sendername (self): - return self.name - - def get_message ( self ): - return self.decoded - - def set_message ( self , decoded): - self.decoded = decoded - - -class shoutbox_message(message): - def __init__(self, name="generate" ): - message.__init__( self , name) - self.type="sb" - diff --git a/piratebox_origin/piratebox/piratebox/python_lib/psogen.py b/piratebox_origin/piratebox/piratebox/python_lib/psogen.py deleted file mode 100755 index 00a28b7..0000000 --- a/piratebox_origin/piratebox/piratebox/python_lib/psogen.py +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/python - -# Modificated ShoutBox Library -# enables further modifications for the ShoutBox -# Run without to generate htmlfile -# Run the following to enter a new line from command line -# psogen.py input Anonymous default "Text" - -import os, datetime, re - -import messages, broadcast - -datafilename = os.environ["SHOUTBOX_CHATFILE"] -htmlfilename = os.environ["SHOUTBOX_GEN_HTMLFILE"] - -try: - raw_dest = os.environ["SHOUTBOX_BROADCAST_DESTINATIONS"] - finished_dest = re.sub ( '#' , '"' , raw_dest ) - broadcast_destination = eval ( finished_dest ) -except KeyError: - broadcast_destination = False - - -def html_escape(text): - """Remove HTML chars from the given text and replace them with HTML -entities. """ - html_escape_table = { - '"': """, "'": "'", ">": ">", - "<": "<"} - return "".join(html_escape_table.get(c,c) for c in text) - -#-------------- -# Generates Shoutbox-HTML-Frame ... -# Imports: -# content - String containing preformatted data -#-------------- -def generate_html(content): - htmlstring = "Shout-Out Data" - htmlstring += content - htmlstring += "" - return htmlstring - -#-------------- -# Generates HTML Data based on given content and write it to static html file -# Imports: -# content - String containing preformatted data -#-------------- -def generate_html_into_file(content): - htmlstring = generate_html ( content ) - - htmlfile = open( htmlfilename , 'w' ) - htmlfile.write( htmlstring ) - htmlfile.close() - -#-------------- -# Generates HTML Data based on datafilename 's content -#-------------- -def generate_html_from_file(): - old = read_data_file() - generate_html_into_file( old ) - -#-------------- -# Generates and Displays generated HTML -#-------------- -def generate_html_to_display_from_file(): - old = read_data_file() - htmlstring = generate_html ( old ) - print htmlstring - -#-------------- -# Reads Data file from datafilename given name -#-------------- -def read_data_file(): - datafile = open(datafilename, 'r') - old = datafile.read() - datafile.close() - return old - -#-------------- -# 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 ) - - if broadcast_destination == False: - generate_html_into_file ( content ) - - -#-------------- -# Acutally Saves SB-Content to datafile -#-------------- -def save_input( name , indata , color ): - - content = prepare_line ( name, indata, color ) - - if broadcast_destination != False: - return writeToNetwork( content , broadcast_destination ) - else: - return writeToDisk ( content ) - -def writeToNetwork ( content , broadcast_destination ): - message = messages.shoutbox_message() - message.set(content) - casting = broadcast.broadcast( ) - casting.setDestination(broadcast_destination) - casting.set( message.get_message() ) - casting.send() - return None - -def writeToDisk ( content ): - old = read_data_file() - finalcontent = content + old - datafile = open(datafilename, 'r+') - datafile.write(finalcontent) - #datafile.truncate(0) - datafile.close() - return finalcontent - -def prepare_line (name, indata, color): - name = html_escape(name) - data = html_escape(indata) - color = html_escape(color) - curdate = datetime.datetime.now() - # 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" - return content - -#-------------- -# Testing or Generating static HTML File -#-------------- -if __name__ == "__main__": - import sys - if sys.argv.count("input") >= 1 : - save_input( sys.argv[2] , sys.argv[3] , sys.argv[4] ) - generate_html_to_display_from_file() - print "Entered Text." - - generate_html_from_file () - print "Generated HTML-Shoutbox File." diff --git a/piratebox_origin/piratebox/piratebox/python_lib/style.css b/piratebox_origin/piratebox/piratebox/python_lib/style.css deleted file mode 100755 index 0b49a2f..0000000 --- a/piratebox_origin/piratebox/piratebox/python_lib/style.css +++ /dev/null @@ -1,8 +0,0 @@ -date { font-size: 10pt; color: #666666; font-family:Tahoma } -name { font-weight: bold; font-family:Tahoma } -data { font-family: Tahoma } -data.def { color: #000000 } -data.blue { color: #0000FF } -data.green { color: #008000 } -data.orange { color: #FF8040 } -data.red { color: #FF0000 } \ No newline at end of file diff --git a/piratebox_origin/piratebox/piratebox/share/.keep b/piratebox_origin/piratebox/piratebox/share/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/piratebox_origin/piratebox/piratebox/src/HEADER.txt b/piratebox_origin/piratebox/piratebox/src/HEADER.txt deleted file mode 100644 index a82fc2b..0000000 --- a/piratebox_origin/piratebox/piratebox/src/HEADER.txt +++ /dev/null @@ -1,28 +0,0 @@ - - PirateBox - Share Freely! - - - - - -
-
diff --git a/piratebox_origin/piratebox/piratebox/src/README.txt b/piratebox_origin/piratebox/piratebox/src/README.txt deleted file mode 100644 index 3bf6304..0000000 --- a/piratebox_origin/piratebox/piratebox/src/README.txt +++ /dev/null @@ -1,12 +0,0 @@ - -
-
-
-
-

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_origin/piratebox/piratebox/src/forest.css b/piratebox_origin/piratebox/piratebox/src/forest.css deleted file mode 100644 index 926bb68..0000000 --- a/piratebox_origin/piratebox/piratebox/src/forest.css +++ /dev/null @@ -1,72 +0,0 @@ -body { - font-family: Arial, sans-serif; - font-size: 10pt; -} - -a { - font-weight: bold; - text-decoration: none; - color: #009900; -} - -a:hover { - color: #00EE00; -} - -form { - background-color: #EEEEEE; -} - -.threads_table { - font-size: 10pt; -} - -.threads_header { - background-color: #009900; - color: white; -} - -.thread_header { - background-color: #009900; - color: white; - font-weight: bold; - font-size: 110%; -} - -.thread_row { - background-color: #dddddd; -} -.thread_row_alt { - background-color: #eeeeee; -} - -.submit_button { - border: solid 1px black; - background: #00AA00; - color: white; - font-weight: bold; -} - -.error { - color: red; -} - -.copy { - font-size: 8pt; - text-align: center; -} - -#hidden_form { - display: none; -} - -.board_description { - -moz-border-radius: 8px; - padding: 5px; - background-color: #eeeeee; - border: 2px solid #dddddd; -} - -.date { - font-size: 85%; -} diff --git a/piratebox_origin/piratebox/piratebox/src/forest.py b/piratebox_origin/piratebox/piratebox/src/forest.py deleted file mode 100755 index e91db3c..0000000 --- a/piratebox_origin/piratebox/piratebox/src/forest.py +++ /dev/null @@ -1,552 +0,0 @@ -#!/usr/bin/python -""" -Script: Forest, a simple Python forum script. -Author: Andrew Nelis (andrew.nelis@gmail.com) -OnTheWeb: http://www.triv.org.uk/~nelis/forest -Date: Jun 2010 -Version: 1.0.3 - -A Python CGI script for a basic flat-file based forum. - -Getting Started: - -* Set up your web server/place forest.py so that it is executed as a CGI script. - You'll probably have to change the python path at the top of this script and - chmod this script as appropriate if you're not on Windows. -* Put the stylesheet forest.css somewhere where it will be served by the - webserver. -* Edit some of the variables below to taste. Most important of all: - o DATA_PATH - Should point to a writable folder where the posts will be - stored. - o CSS_PATH - Specify where the stylesheet forest.css is. - (There are other settings within this file, mostly self explanatory.) -* Go to the appropriate URL and post away! - -LICENCE: - -Copyright (c) 2010 Andrew Nelis - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. -""" - - -import md5 -import os -import time - -# Show any errors on the page. You might want to take this out on a live server -# and look in the servers error log instead. -# Removed for compatibility issues -#import cgitb -#cgitb.enable() - -# ============================================================================ -# Configuration -# ============================================================================ - -# Where the threads are stored. This folder must exist. -DATA_PATH = '/opt/piratebox/forumspace/' -#Where the forest CGI is located (as a URL). -CGI_URL='/cgi-bin/forest.py' -# Where the main stylesheet is kept (as a URL). -CSS_PATH = '/forest.css' -# What is the title of the board? -BOARD_TITLE = 'PirateBox Board' -# Simple Description of the board, appears at the top of each page -BOARD_DESCRIPTION = """PirateBox Board. Put media reviews or questions here.
-Click here to go back to the main site """ -# How dates are stored (see python time module for details) -DATE_FORMAT = '%d %b %Y %H:%M:%S' -# If no author name is given, then this is the default. -ANON_AUTHOR = 'Anonymous Coward' - -# How many entries to show on the index? -INDEX_PAGE_SIZE = 20 -# How many entries to show on the thread page? -THREAD_PAGE_SIZE = 20 - -# Maximum lengths for names, subjects and message bodies. -# (currently we chop them off without warning) -MAX_AUTHOR_LEN = 20 -MAX_SUBJECT_LEN = 100 -MAX_BODY_LEN = 10000 - -# ============================================================================ -# HTML Elements. -# ============================================================================ -HTML_TOP = ''' - - - - - %s - - - - -

%s

-

%s

-''' % (BOARD_TITLE, CSS_PATH, BOARD_TITLE, BOARD_DESCRIPTION) - -HTML_BOTTOM = ''' -

Powered by the Forest Python Board -''' -HTML_THREADS_TOP = ''' - - - -''' -HTML_THREADS_ROW = ''' - - - -''' -HTML_NEW_THREAD = ''' -

Start a new thread

-
-
-

Name:

-

Subject:

-

-

- -
-''' % (MAX_AUTHOR_LEN, MAX_SUBJECT_LEN) - -HTML_NEW_REPLY = ''' -

Reply to this thread

-
-
-

Name:

-

-

- -
-''' % (MAX_AUTHOR_LEN,) - -HTML_THREADS_BOTTOM = '
SubjectAuthorDateRepliesLast Reply
%s%s%s%s%s
' -HTML_THREAD_TOP = ''' - - - - - -''' -HTML_THREAD_ROW = ''' - - - - -''' -HTML_THREAD_BOTTOM = ''' -
<< Main
%s
%s
%s
%s
-''' - -# ============================================================================ -# Error messages -# ============================================================================ - -ERR_INVALID_THREAD = '

Invalid Thread Specified

' -ERR_NO_SUBJECT = '

No Subject Given

' -ERR_NO_BODY = '

No body text!

' - -# ============================================================================ -# Misc. globals -# ============================================================================ - -# No need to fiddle with these though. -ROW_STYLES = {0: 'thread_row', 1: 'thread_row_alt'} -INDEX_FILE = os.path.join(DATA_PATH, 'index.txt') -THREAD_PATH = DATA_PATH - -# ============================================================================ -# Function definitions -# ============================================================================ - -html_escape_table = { - "&": "&", '"': """, "'": "'", ">": ">", - "<": "<", ';': ";", "/": "/", '=': "=", - ":": ":", '?': "?", '!': "!", '(': "(", - "{": "y", "[": "[", "-": "-", - } - -def strip_html( text ): - """Remove HTML chars from the given text and replace them with HTML - entities. """ - return "".join(html_escape_table.get(c,c) for c in text ) - - -def process_body(body): - """Process the message body e.g. for escaping smilies, HTML etc. - ready for storing. We should then just be able to print the body out""" - import re - # Maximum body length. - new_body = strip_html( body[:MAX_BODY_LEN] ) - new_body = new_body.replace('\n', '
\n') - # Turn (obvious) URLs into links. -# new_body = url_re.sub(r'\1', new_body) -# url_re = re.compile('(http://[\S\.]+)') - return new_body.encode('string_escape') - - -def process_author(author): - """Clean the author tag""" - # Remove tabs and ensure a maximum length. - new_author = strip_html( author[:MAX_AUTHOR_LEN] ) - return new_author.replace('\t', ' ') - - -def process_subject(subject): - """Clean the subject line""" - if ( subject is not None): - return subject[:MAX_SUBJECT_LEN] - else: - return "No Subject" - - -def get_query_params(): - """Return the URL parameters as a dictionary. - - Writing our own simple version means we don't have to import the cgi module - for every page (which noticeably slows down page viewing). - """ - param_string = os.getenv('QUERY_STRING', '') - params = param_string.split('&') - param_dict = {} - for param in params: - if '=' in param: - key, value = param.split('=', 1) - param_dict[key] = value - else: - param_dict[param] = None - return param_dict - - -def is_valid_hash(hash_string): - """Ensure that is a proper hash representing an existing - thread""" - # Should be a string comprising of hex digits - if not hash_string.isalnum(): - return False - if not os.path.exists(os.path.join(THREAD_PATH, hash_string)): - return False - return True - - -def get_offset(args): - """Get the page offset, validating or returning 0 if None or invalid.""" - offset = args.get('offset', '0') - if offset.isdigit(): - return int(offset) - else: - return 0 - - -def update_thread(author, subject=None, key=None): - """Update the thread, creating a new thread if key is None. Returns the - key (hash). - - author - String, the name of the author. - subject - String, the title of the thread. - key - String, the key to an existing thread to update. - - If is given, then it's assumed that we're starting a new thread - and if is given, then we should be updating an existing thread. - """ - now = time.strftime(DATE_FORMAT) - author = process_author(author) - - if key: - row_hash = key - else: - row_hash = md5.new('%s%s%s' % (now, author, subject)).hexdigest() - - # Read the index of threads in. - try: - threads = file(INDEX_FILE, 'r').readlines() - except IOError: - # The file gets (re)created later on so there's no problem. - threads = [] - - new_threads = [] - - # Index format: - # hash, date, num_replies, last_reply, author, subject - if not key: - # A new thread, put at the top. - new_threads.append('\t'.join( - (row_hash, now, '0', '-', author, subject))) - - for thread in threads: - if thread.startswith(row_hash): - # insert the updated thread at the beginning. - # (_ ignore last reply - we're setting it to now) - _, date, num_replies, _, author, subject = \ - thread.strip().split('\t') - num_replies = str(int(num_replies) + 1) - new_threads.insert(0, '\t'.join( - (row_hash, date, num_replies, now, author, subject))) - else: - new_threads.append(thread.strip()) - - # Overwrite the existing index with the updated index. - threads = file(INDEX_FILE, 'w') - threads.write('\n'.join(new_threads)) - threads.close() - - return row_hash - - -def new_subject(field_storage): - """Add a new subject to the list of threads. - - field_storage - cgi.FieldStorage instance. - - On success: - returns - On error: - raises ValueError with error as message. - """ - author = field_storage.getfirst( 'author', ANON_AUTHOR ) - subject = field_storage.getfirst( 'subject' ) - body = field_storage.getfirst( 'body' ) - if not subject: - raise ValueError( ERR_NO_SUBJECT ) - elif not body: - raise ValueError( ERR_NO_BODY ) - subject = strip_html(subject.replace('\t', ' ')) - row_hash = update_thread( author, subject ) - new_post( author, subject, body, row_hash ) - return row_hash - - -def new_post(author, subject, body, key): - """Create a new post, either by creating or appending to a post file. - - author, subject, body, key - Strings - """ - author = process_author(author) - subject = process_subject(subject) - body = process_body(body) - - date = time.strftime(DATE_FORMAT) - post_filename = os.path.join(THREAD_PATH, key) - if not os.path.exists(post_filename): - post_file = file(post_filename, 'w') - print >> post_file, '%s\t%s' % (key, subject) - else: - post_file = file(post_filename, 'a') - print >> post_file, '%s\t%s\t%s' % (date, author, body) - - -def reply(field_storage, key): - """Reply to an existing post. - - field_storage - A cgi.FieldStorage containing post data for the post - key - String, the id of the thread we're replying to. - - On success: - return - On failure: - raise ValueError with error message as error value. - """ - # Check that the thread id is valid. - if not (key and is_valid_hash(key)): - raise ValueError( ERR_INVALID_THREAD ) - author = field_storage.getfirst( 'author', ANON_AUTHOR ) - body = field_storage.getfirst( 'body' ) - if not body: - raise ValueError( ERR_NO_BODY ) - author = author.replace('\t', ' ') - update_thread(author, key=key) - new_post(author, None, body, key) - return key - - -def display_paging_links( current_offset, num_items, page_length, thread=None ): - """Display a list of links to go to a given page number""" - pages = num_items / page_length - # Any left over pages? - if (num_items % page_length): - pages += 1 - - if pages < 2: - # Only one page. Don't bother showing links. - return - - links = [] - if thread: - url = '?thread=%s&offset=%%d' % thread - else: - url = '?offset=%d' - for page_number in range(pages): - offset = page_number * page_length - if offset != current_offset: - links.append( '%s' % \ - (url % offset, page_number + 1) ) - else: - links.append( str( page_number + 1 ) ) - - print ' | '.join(links) - - -def list_threads(offset=0): - """List the existing threads.""" - if os.path.exists(INDEX_FILE): - thread_file = file(INDEX_FILE, 'r') - threads = thread_file.read().strip().split('\n') - thread_file.close() - else: - threads = [] - - num_threads = len(threads) - - display_paging_links(offset, num_threads, INDEX_PAGE_SIZE) - - print HTML_THREADS_TOP - - thread_index = -1 - - for thread in threads[offset:offset + INDEX_PAGE_SIZE]: - thread_index += 1 - - thread_items = thread.split('\t') - if len(thread_items) != 6: - continue - - thread_hash, date, num_replies, last_reply, author, subject = \ - thread_items - - link = '%s' % (thread_hash, subject) - - # Date Author Subject Replies Last Reply - print HTML_THREADS_ROW % (ROW_STYLES[thread_index % 2], link, author, - date, num_replies, last_reply) - - print HTML_THREADS_BOTTOM - print HTML_NEW_THREAD - - -def list_single_thread(thread_hash, offset=0): - """Output the HTMl for a given thread id""" - if not is_valid_hash(thread_hash): - print ERR_INVALID_THREAD - return - - thread_file = file(os.path.join(THREAD_PATH, thread_hash), 'r') - threads = thread_file.read().split('\n') - thread_file.close() - - # The first item in the file is actually the hash and the subject. But we - # don't need it really. - _, subject = threads.pop(0).split('\t') - num_posts = len(threads) - - display_paging_links(offset, num_posts, THREAD_PAGE_SIZE, thread_hash) - print HTML_THREAD_TOP % subject.strip() - - row_index = -1 - for line in threads[offset : offset + THREAD_PAGE_SIZE]: - row_index += 1 - split_line = line.split('\t') - if len(split_line) != 3: - continue - - date, author, body = split_line - print HTML_THREAD_ROW % (ROW_STYLES[row_index % 2], author, date, - body.decode('string_escape')) - - print HTML_THREAD_BOTTOM - print HTML_NEW_REPLY % thread_hash - - -def redirect( threadid, offset=None ): - """Redirect the browser""" - #new_location = os.environ.get('REQUEST_URI', '') - new_location = CGI_URL - new_location += '?thread=%s' % threadid - if offset: - new_location += '&offset=%s' % offset - -## can't use standard redirect on CGIHTTPServer -# print 'Status: 303 See Other' -# print 'Location: %s' % new_location -# print -# print 'Nothing to see here, move along!' - - print 'Content-Type: text/html; charset=utf-8' - print - print '' % new_location - print "" - -def handle(): - """Main entry point for our code. Handles the web request.""" - - query_params = get_query_params() - post_error = None - - if query_params.has_key('new'): - # We only want the whole cgi module when we need to parse POST data. - import cgi - form_data = cgi.FieldStorage() - what = query_params['new'] - if what == 'thread': - try: - thread_hash = new_subject(form_data) - redirect( thread_hash ) - return - except ValueError, error: - post_error = str( error ) - elif what == 'reply': - try: - thread_hash = reply(form_data, query_params.get('thread')) - # QQQ -> Get offset. - redirect( thread_hash ) - return - except ValueError, error: - post_error = str( error ) - - print 'Content-Type: text/html; charset=utf-8' - print - print HTML_TOP - - if post_error: - print post_error - - # paging. - offset = get_offset( query_params ) - - if query_params.has_key( 'thread' ): - list_single_thread( query_params['thread'], offset ) - else: - list_threads( offset ) - - print HTML_BOTTOM - - -if __name__ == '__main__': - handle() diff --git a/piratebox_origin/piratebox/piratebox/src/kareha.pl b/piratebox_origin/piratebox/piratebox/src/kareha.pl deleted file mode 100644 index 1ac763e..0000000 --- a/piratebox_origin/piratebox/piratebox/src/kareha.pl +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/perl -wT - -use strict; -use CGI; -use CGI::Carp qw ( fatalsToBrowser ); -use File::Basename; - -my $query = new CGI; - -print $query->header ( ); -print "Sorry, no Board is installed"; - -1; diff --git a/piratebox_origin/piratebox/piratebox/src/kareha_img_config.pl b/piratebox_origin/piratebox/piratebox/src/kareha_img_config.pl deleted file mode 100644 index 80e28ee..0000000 --- a/piratebox_origin/piratebox/piratebox/src/kareha_img_config.pl +++ /dev/null @@ -1,173 +0,0 @@ -# -# Example config file. -# -# Uncomment and edit the options you want to specifically change from the -# default values. You must specify ADMIN_PASS and SECRET. -# - -# System config -#use constant ADMIN_PASS => 'xyzPASSWORDzyx'; # Admin password. For fucks's sake, change this. -#use constant SECRET => 'xyzSECRETCODEzyx'; # Cryptographic secret. CHANGE THIS to something totally random, and long. -#use constant CAPPED_TRIPS => ('!!example1'=>' capcode','!!example2'=>' cap'); # Admin tripcode hash, for startng threads when locked down, and similar. Format is '!trip'=>'capcode', where 'capcode' is what is shown instead of the trip. This can contain HTML, but keep it valid XHTML! - -# Page look -use constant TITLE => 'PirateBox board'; # Name of this image board -use constant SHOWTITLETXT => 1; # Show TITLE at top (1: yes 0: no) -use constant SHOWTITLEIMG => 1; # Show image at top (0: no, 1: single, 2: rotating) -use constant TITLEIMG => '/piratebox-logo-small.png'; # Title image (point to a script file if rotating) -#use constant THREADS_DISPLAYED => 10; # Number of threads on the front page -#use constant THREADS_LISTED => 40; # Number of threads in the thread list -#use constant REPLIES_PER_THREAD => 10; # Replies shown -#use constant S_ANONAME => 'Anonymous'; # Defines what to print if there is no text entered in the name field -#use constant DEFAULT_STYLE => 'Futaba'; # Default CSS style title -use constant FAVICON => '/favicon.ico'; # Path to the favicon for the board - -# Limitations -use constant ALLOW_TEXT_THREADS => 1; # Allow users to create text threads -use constant ALLOW_TEXT_REPLIES => 1; # Allow users to make text replies -#use constant AUTOCLOSE_POSTS => 0; # Maximum number of posts before a thread closes. 0 to disable. -#use constant AUTOCLOSE_DAYS => 0; # Maximum number of days with no activity before a thread closes. 0 to disable. -#use constant AUTOCLOSE_SIZE => 0; # Maximum size of the thread HTML file in kilobytes before a thread closes. 0 to disable. -#use constant MAX_RES => 20; # Maximum topic bumps -#use constant MAX_THREADS => 0; # Maximum number of threads - set to 0 to disable -#use constant MAX_POSTS => 500; # Maximum number of posts - set to 0 to disable -#use constant MAX_MEGABYTES => 0; # Maximum size to use for all images in megabytes - set to 0 to disable -#use constant MAX_FIELD_LENGTH => 100; # Maximum number of characters in subject, name, and email -#use constant MAX_COMMENT_LENGTH => 8192; # Maximum number of characters in a comment -#use constant MAX_LINES_SHOWN => 15; # Max lines of a comment shown on the main page (0 = no limit) -#use constant ALLOW_ADMIN_EDIT => 0; # Allow editing of include files and spam.txt from admin.pl. - # Warning! This is a security risk, since include templates can run code! Only enable if you completely trust your moderators! - -# Image posts -#use constant ALLOW_IMAGE_THREADS => 1; # Allow users to create image threads -#use constant ALLOW_IMAGE_REPLIES => 1; # Allow users to make image replies -#use constant IMAGE_REPLIES_PER_THREAD => 0; # Number of image replies per thread to show, set to 0 for no limit. -use constant MAX_KB => 10000; # Maximum upload size in KB -#use constant MAX_W => 200; # Images exceeding this width will be thumbnailed -#use constant MAX_H => 200; # Images exceeding this height will be thumbnailed -#use constant THUMBNAIL_SMALL => 1; # Thumbnail small images (1: yes, 0: no) -#use constant THUMBNAIL_QUALITY => 70; # Thumbnail JPEG quality - use constant ALLOW_UNKNOWN => 0; # Allow unknown filetypes (1: yes, 0: no) - use constant MUNGE_UNKNOWN => '.unknown'; # Munge unknown file type extensions with this. If you remove this, make sure your web server is locked down properly. - use constant FORBIDDEN_EXTENSIONS => ('php','php3','php4','phtml','shtml','cgi','pl','pm','py','r','exe','dll','scr','pif','asp','cfm','jsp','vbs'); # file extensions which are forbidden - use constant STUPID_THUMBNAILING => 1; # Bypass thumbnailing code and just use HTML to resize the image. STUPID, wastes bandwidth. (1: enable, 0: disable) -#use constant MAX_IMAGE_WIDTH => 16384; # Maximum width of image before rejecting -#use constant MAX_IMAGE_HEIGHT => 16384; # Maximum height of image before rejecting -#use constant MAX_IMAGE_PIXELS => 50000000; # Maximum width*height of image before rejecting -#use constant CONVERT_COMMAND => 'convert'; # location of the ImageMagick convert command (usually just 'convert', but sometime a full path is needed) - -# Captcha -#use constant ENABLE_CAPTCHA => 0; # Enable verification codes (0: disabled, 1: enabled) -#use constant CAPTCHA_HEIGHT => 18; # Approximate height of captcha image -#use constant CAPTCHA_SCRIBBLE => 0.2; # Scribbling factor -#use constant CAPTCHA_SCALING => 0.15; # Randomized scaling factor -#use constant CAPTCHA_ROTATION => 0.3; # Randomized rotation factor -#use constant CAPTCHA_SPACING => 2.5; # Letter spacing - -# Tweaks -#use constant CHARSET => 'utf-8'; # Character set to use, typically "utf-8" or "shift_jis". Remember to set Apache to use the same character set for .html files! (AddCharset shift_jis html) -#use constant PROXY_CHECK => (); # Ports to scan for proxies - NOT IMPLEMENTED. -#use constant TRIM_METHOD => 0; # Which threads to trim (0: oldest - like futaba 1: least active - furthest back) -#use constant REQUIRE_THREAD_TITLE => 0; # Require a title for threads (0: no, 1: yes) -#use constant DATE_STYLE => 'futaba'; # Date style ('2ch', 'futaba', 'localtime, 'http') - use constant DISPLAY_ID => 'day'; # How to display user IDs (0 or '': don't display, - # 'day', 'thread', 'board' in any combination: make IDs change for each day, thread or board, - # 'mask': display masked IP address (similar IPs look similar, but are still encrypted) - # 'sage': don't display ID when user sages, 'link': don't display ID when the user fills out the link field, - # 'ip': display user's IP, 'host': display user's host) -#use constant EMAIL_ID => 'Heaven'; # Replace the ID with this string when the user uses an email. Set to '' to disable. -#use constant SILLY_ANONYMOUS => ''; # Make up silly names for anonymous people (same syntax as DISPLAY_ID) -#use constant FORCED_ANON => 0; # Force anonymous posting (0: no, 1: yes) -#use constant TRIPKEY => '!'; # This character is displayed before tripcodes -#use constant ALTERNATE_REDIRECT => 0; # Use alternate redirect method. (Javascript/meta-refresh instead of HTTP forwards.) -#use constant APPROX_LINE_LENGTH => 150; # Approximate line length used by reply abbreviation code to guess at the length of a reply. -#use constant COOKIE_PATH => 'root'; # Path argument for cookies ('root': cookies apply to all boards on the site, 'current': cookies apply only to this board, 'parent': cookies apply to all boards in the parent directory) - does NOT apply to the style cookie! -#use constant STYLE_COOKIE => 'wakabastyle'; # Cookie name for the style selector. -#use constant ENABLE_DELETION => 1; # Enable user deletion of posts. (0: no, 1: yes) -#use constant PAGE_GENERATION => 'paged'; # Page generation method ('single': just one page, 'paged': split into several pages like futaba, 'monthly': separate pages for each month) -#use constant DELETE_FIRST => 'remove'; # What to do when the first post is deleted ('keep': keep the thread, 'single': delete the thread if there is only one post, 'remove': delete the whole thread) -#use constant DEFAULT_MARKUP => 'waka'; # Default markup format ('none', 'waka', 'html', 'aa') -#use constant FUDGE_BLOCKQUOTES => 1; # Modify formatting for old stylesheets -#use constant USE_XHTML => 1; # Send pages as application/xhtml+xml to browsers that support this (0:no, 1:yes) -#use constant KEEP_MAINPAGE_NEWLINES => 0; # Don't strip whitespace from main page (needed for Google ads to work, 0:no, 1:yes) -#use constant SPAM_TRAP => 1; # Enable the spam trap (empty, hidden form fields that spam bots usually fill out) (0:no, 1:yes) - -# Internal paths and files - might as well leave this alone. -#use constant RES_DIR => 'res/'; # Reply cache directory (needs to be writeable by the script) -#use constant CSS_DIR => 'css/'; # CSS file directory -#use constant IMG_DIR => 'src/'; # Image directory (needs to be writeable by the script) -#use constant THUMB_DIR => 'thumb/'; # Thumbnail directory (needs to be writeable by the script) -#use constant INCLUDE_DIR => 'include/'; # Include file directory -#use constant LOG_FILE => 'log.txt'; # Log file (stores delete passwords and IP addresses in encrypted form) -#use constant PAGE_EXT => '.html'; # Extension used for board pages after first -#use constant HTML_SELF => 'index.html'; # Name of main html file -#use constant HTML_BACKLOG => ''; # Name of backlog html file -#use constant RSS_FILE => ''; # RSS file. Set to '' to disable RSS support. -#use constant JS_FILE => 'kareha.js'; # Location of the js file -#use constant SPAM_FILES => ('spam.txt'); # Spam definition files, as a Perl list. - # Hints: * Set all boards to use the same file for easy updating. - # * Set up two files, one being the official list from - # http://wakaba.c3.cx/antispam/spam.txt, and one your own additions. - -# Admin script options -#use constant ADMIN_SHOWN_LINES => 5; # Number of post lines the admin script shows. -#use constant ADMIN_SHOWN_POSTS => 10; # Number of posts per thread the admin script shows. -#use constant ADMIN_MASK_IPS => 0; # Mask poster IP addresses in the admin script (0: no, 1: yes) -#use constant ADMIN_EDITABLE_FILES => (SPAM_FILES); # A Perl list of all files that can be edited from the admin script. - # Hints: * If you don't trust your moderators, don't let them edit templates! - # Templates can execute code on your server! - # * If you still want to allow editing of templates, use - # (SPAM_FILES,glob("include/*")) as a convenient shorthand. -#use constant ADMIN_BAN_FILE => '.htaccess'; # Name of the file to write bans to -#use constant ADMIN_BAN_TEMPLATE => "\n# Banned at ()\nDeny from \n"; - # Format of the ban entries, using the template syntax. - - -# Icons for filetypes - file extensions specified here will not be renamed, and will get icons -# (except for the built-in image formats). These example icons can be found in the extras/ directory. - use constant FILETYPES => ( -# # Audio files - mp3 => 'icons/audio-mp3.png', - ogg => 'icons/audio-ogg.png', - aac => 'icons/audio-aac.png', - m4a => 'icons/audio-aac.png', - mpc => 'icons/audio-mpc.png', - mpp => 'icons/audio-mpp.png', - mod => 'icons/audio-mod.png', - it => 'icons/audio-it.png', - xm => 'icons/audio-xm.png', - fla => 'icons/audio-flac.png', - flac => 'icons/audio-flac.png', - sid => 'icons/audio-sid.png', - mo3 => 'icons/audio-mo3.png', - spc => 'icons/audio-spc.png', - nsf => 'icons/audio-nsf.png', - # Archive files - zip => 'icons/archive-zip.png', - rar => 'icons/archive-rar.png', - lzh => 'icons/archive-lzh.png', - lha => 'icons/archive-lzh.png', - gz => 'icons/archive-gz.png', - bz2 => 'icons/archive-bz2.png', - '7z' => 'icons/archive-7z.png', - # Other files - swf => 'icons/flash.png', - torrent => 'icons/torrent.png', - # To stop Wakaba from renaming image files, put their names in here like this: -# gif => '.', -# jpg => '.', -# png => '.', -); - -# Allowed HTML tags and attributes. Sort of undocumented for now, but feel free to -# learn by example. -#use constant ALLOWED_HTML => ( -# 'a'=>{args=>{'href'=>'url'},forced=>{'rel'=>'nofollow'}}, -# 'b'=>{},'i'=>{},'u'=>{},'sub'=>{},'sup'=>{}, -# 'em'=>{},'strong'=>{}, -# 'ul'=>{},'ol'=>{},'li'=>{},'dl'=>{},'dt'=>{},'dd'=>{}, -# 'p'=>{},'br'=>{empty=>1},'blockquote'=>{}, -#); - - -1; diff --git a/piratebox_origin/piratebox/piratebox/src/linux.example.minidlna.conf b/piratebox_origin/piratebox/piratebox/src/linux.example.minidlna.conf deleted file mode 100644 index a88bb63..0000000 --- a/piratebox_origin/piratebox/piratebox/src/linux.example.minidlna.conf +++ /dev/null @@ -1,17 +0,0 @@ -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_origin/piratebox/piratebox/src/no_forum.html b/piratebox_origin/piratebox/piratebox/src/no_forum.html deleted file mode 100644 index 6582521..0000000 --- a/piratebox_origin/piratebox/piratebox/src/no_forum.html +++ /dev/null @@ -1,10 +0,0 @@ - - -The kareha imageboard is not fully configured.
-
-Visit the following Link to do the initial configuration. -
-
-Or go back to PirateBox start page. - - diff --git a/piratebox_origin/piratebox/piratebox/src/no_link.html b/piratebox_origin/piratebox/piratebox/src/no_link.html deleted file mode 100644 index e69de29..0000000 diff --git a/piratebox_origin/piratebox/piratebox/src/openwrt.example.minidlna b/piratebox_origin/piratebox/piratebox/src/openwrt.example.minidlna deleted file mode 100644 index d8f25a4..0000000 --- a/piratebox_origin/piratebox/piratebox/src/openwrt.example.minidlna +++ /dev/null @@ -1,17 +0,0 @@ -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' diff --git a/piratebox_origin/piratebox/piratebox/src/redirect.html.schema b/piratebox_origin/piratebox/piratebox/src/redirect.html.schema deleted file mode 100644 index eeb2d67..0000000 --- a/piratebox_origin/piratebox/piratebox/src/redirect.html.schema +++ /dev/null @@ -1,13 +0,0 @@ - - Redirect... - - - - - - - Redirect - - - - diff --git a/piratebox_origin/piratebox/piratebox/tmp/.keep b/piratebox_origin/piratebox/piratebox/tmp/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/piratebox_origin/piratebox/piratebox/www/.READ.ME.htm b/piratebox_origin/piratebox/piratebox/www/.READ.ME.htm deleted file mode 100755 index 5bb7970..0000000 --- a/piratebox_origin/piratebox/piratebox/www/.READ.ME.htm +++ /dev/null @@ -1,44 +0,0 @@ - - - -READ ME - - - - - - -

- - - -

- - - - - - - -

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_origin/piratebox/piratebox/www/cgi-bin/data.pso b/piratebox_origin/piratebox/piratebox/www/cgi-bin/data.pso deleted file mode 100644 index e69de29..0000000 diff --git a/piratebox_origin/piratebox/piratebox/www/cgi-bin/psoread.py b/piratebox_origin/piratebox/piratebox/www/cgi-bin/psoread.py deleted file mode 100755 index 2fe74f0..0000000 --- a/piratebox_origin/piratebox/piratebox/www/cgi-bin/psoread.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/python - -# PyShoutOut by Joey C. (http://www.joeyjwc.x3fusion.com) -# Read the data from a shout-out file. - - -# Changed by Matthias Strubel / 2011-02-27 for piratebox-path - -from psogen import generate_html_to_display_from_file - -print "Content-type:text/html\r\n\r\n" - -generate_html_to_display_from_file() - diff --git a/piratebox_origin/piratebox/piratebox/www/cgi-bin/psowrte.py b/piratebox_origin/piratebox/piratebox/www/cgi-bin/psowrte.py deleted file mode 100755 index 363d51c..0000000 --- a/piratebox_origin/piratebox/piratebox/www/cgi-bin/psowrte.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python - -# PyShoutOut by Joey C. (http://www.joeyjwc.x3fusion.com) -# Writes the recieved information to the data file. - - -import cgi, datetime -from psogen import process_form - - -print "Content-type:text/html\r\n\r\n" - -values = cgi.FieldStorage() -if values.has_key("name"): - rawname = values["name"].value -else: - rawname = " " -if values.has_key("data"): - rawdata = values["data"].value -else: - rawdata = " " - -color = values["color"].value -curdate = datetime.datetime.now() - -process_form(rawname, rawdata, color) - -print """ok""" - diff --git a/piratebox_origin/piratebox/piratebox/www/cgi-bin/style.css b/piratebox_origin/piratebox/piratebox/www/cgi-bin/style.css deleted file mode 100755 index 0b49a2f..0000000 --- a/piratebox_origin/piratebox/piratebox/www/cgi-bin/style.css +++ /dev/null @@ -1,8 +0,0 @@ -date { font-size: 10pt; color: #666666; font-family:Tahoma } -name { font-weight: bold; font-family:Tahoma } -data { font-family: Tahoma } -data.def { color: #000000 } -data.blue { color: #0000FF } -data.green { color: #008000 } -data.orange { color: #FF8040 } -data.red { color: #FF0000 } \ No newline at end of file diff --git a/piratebox_origin/piratebox/piratebox/www/favicon.ico b/piratebox_origin/piratebox/piratebox/www/favicon.ico deleted file mode 100755 index d18db961f50856a4597031c729cd3f2d031fdb78..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1406 zcmeHGJ8PO@6nUZT-YV;l7|aS%ihRB-6vAVwE;5FETA zPKru!6-5GqQ^1UZAddb3Cnp^gRPfTzN+E0LRLJvk&U4Pg;k@v?yuciNSS-+a0l%2Q zDu8V|XbBuTrurYu&FFGnC=`&*W|7HckW3~Ki^UL)MiGfb5DteC3;W2n_?jK^cBR4NRILnssq^!t6t<#NbmGIYCLkR%DQ zSPYR!gjTBsKA#URmy2eziAJM=dcBTXt%ho~igLM(i;D}KpP!>xEaL3!4EcN>xm*tE zbQ-6pr%0tzNF)-7$KwcvLI?x`@Or)Qcsy{qTyQuXu-omh*=(>{t*}@uFqup+7!1&A zwa{oZm`o-ZjYd!^l^6^L==FM#N~P#@I*>>tXt&!C3WX2|1mN*_s8lK_l}eY)ye_XD z_&*(>|KpXQI8xB_U-p;x88pAz;S(#2t!Eod%s)O*f9DYIBuYZXdvfdj0wp8}@ja5< ze6zStO!45x^VwB*S3a?by_<(0=yvn%NB+hU`GUPhewN(d#aD`2UT3Z{sF!PdOHV24 vwP;s - - - - 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_origin/piratebox/piratebox/www/jquery.min.js b/piratebox_origin/piratebox/piratebox/www/jquery.min.js deleted file mode 100755 index 16ad06c..0000000 --- a/piratebox_origin/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_origin/piratebox/piratebox/www/library/test/success.html b/piratebox_origin/piratebox/piratebox/www/library/test/success.html deleted file mode 100644 index 67d95ea..0000000 --- a/piratebox_origin/piratebox/piratebox/www/library/test/success.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - Success - - -Success - - diff --git a/piratebox_origin/piratebox/piratebox/www/menu.png b/piratebox_origin/piratebox/piratebox/www/menu.png deleted file mode 100644 index 63396253889f7f86d7e0272ee17395e19a567d22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2992 zcmV;h3s3ZkP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&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N002ovPDHLkV1jWucp(4) diff --git a/piratebox_origin/piratebox/piratebox/www/piratebox-logo-small.png b/piratebox_origin/piratebox/piratebox/www/piratebox-logo-small.png deleted file mode 100755 index 667a5d8ddf26a14f98083f91850482bceeaae56a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12637 zcmXw9Wmr^Q7rjFcJ#=>t-HLPxj3BLmba#jnQbRXLNq0#j2+|A~)# zrUcYaGW5`piTg%FOBHt+gA|vM zi`agt2>@6C4HZQLzoo+<|2#9pjH54?a=R-5E}DkC8g|b|BRE*`AXpJNkw;Ix6#lp) zTA7Jgmwxyt-xT!VsA7F0?ff&h-aPB0#DM;#DCRp6?^npM0u7s$dWw_;hs0{Nbbj;Y zyO4vo)js)o0X5dV@2{L6f*)mcygjD9Fb}Bn2y%Ihq4p=H1YEGoh+-m5^tS+m*kIBT z$inU0=O@0^L~Pa9m!)rGO3lFdkr;vNBdu=Bjc@+wUH1H(t9$heeHuDAR5C{uudlB+ z#0`~DV<{s23&@mM2$e;LV_vt{o?QpxDMe@{CN5nDt^WK;(c01yNp0>|OsbTSQXv#_ zJ>GWEG+u$Van6(h!!~irp0JPgZCYycvaugYVoX$4R!+PQ3^wub@bE6y$&!mHE_|}_D%UeM<;~ckvsp?I zal;aS#<~Y!DaF763ovVW`UxnKmCc6mK{-XFf=pHSV+)hy@LvMfj@XaUF&+KFE6|9A zrRnKULBk2O*8#`fj}nB+y1Nd1FTJb6-aFrB11^tb!();RVH2k^ z9yxl|eP=S-u&Q)DJt#JmQv=Eh^nc7@ZV$l#t0>W9+7P~>h*fv_p&KDgIPkih%<$_k z>vp{{YJ$i~rQ$}}xDvI0|Ncq-y}Z1nj#p)5<^y9G@Mb_2vko@=nM!!*bca0N&E%Rq za$P`Gg!c6jV6I!FjQ{F#mE;R&iJ>;*fwD$Il)zwxP<7CIGL$7D7RzcbH#`B718jAD z2944vo4CZ4#PDX|Q{rRuQs7UcP>oQk_<$0g4zbMfyRMd&mVNZ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=tK`yT$wOOkNqg&lhyu#0dHapkc!1+ta&|`@U^hL`9WE9}m2bRE@NY zlHduA72m1nWFi_@`k9&v#_=&e;3KQ#1iRZjC)E++D z<^>5hg?BJWX505RFWV8p8Je@}8V$eMsVSTRJr9H^WFW%P1z!Py_oJyts>!)4#dk;_ zgC~fJ=3m0wyAK4GjOczOmJ_xgj`2nnCW-*VecVXjtEo|;Ed?&kfszIB*nm#-KzW*o z^;NLxi9F~ZLz=i+*gRyW#;H|?C?P}N59>1MWek(GAdBrG3b%3WbI!z|^1+UqjX+Zd zc4>c(RVaJj$w>|8x8dTI_puGMx6U?y3+*0ez(xFU9gK4_BWNgRYJe0Nxdd*zYYq&V zH<8<%0gm(#jTlt^h$kdjLZRk6l=W?s_ihzflOGT=crrrp22)H3^FArwia@A4UY-cn z?H~E)sSwSlwTh><%u}h|p=RCAHc$8`mcA*Vw-Egt`o=BE#Q(e#LYg^(9><>~rNoB~dLoM7n$cebdCjRx1n!ZRNM^beRt1c%$| z%vlX^LyS>aQ8XNvIftWGn3lqukAFiXQTLsIqN6Rne7u_{!?=f?)elXsL(RtMcw?{+ zidgo;N#8hhHvls?S#E(Nk!FB@<0Ut-${L2GK(G@V1>?F62vOi5KqAbDsHSi&rgfAX z>NoWZ{JU@_X`I)rVkDq6jFUWx^k4SOcAmqb0N{WjL4Y?Q$E>S6o9eInu~mHAaxqbNVckr#*df%$^!{%i4P zLYLB0K9`)eL6PO?*1r757Z*9mj{G-{){R(&?Tts~Mo7gel*9)gKTlq+kIL~{W0tK7&GCkat8iAQR!a?LC&rr-EiZ3+0~C1IpSTyFtrooj~w}#MW=7$teIFPB2h8?|G`7U@B?PE%G-g` SMg1TEeQ2mYSE*OB4ErDSeE~=S diff --git a/piratebox_origin/piratebox/piratebox/www/redirect.html b/piratebox_origin/piratebox/piratebox/www/redirect.html deleted file mode 100755 index 500a68b..0000000 --- a/piratebox_origin/piratebox/piratebox/www/redirect.html +++ /dev/null @@ -1,11 +0,0 @@ - -Redirect... - - - - - - -Redirect - - diff --git a/piratebox_origin/piratebox/piratebox/www/scripts.js b/piratebox_origin/piratebox/piratebox/www/scripts.js deleted file mode 100755 index 92e1216..0000000 --- a/piratebox_origin/piratebox/piratebox/www/scripts.js +++ /dev/null @@ -1,122 +0,0 @@ -$(document).ready(function() { - $.get('station_cnt.txt', function(data) { - $('div#station').html(data); - }); - - $('div#shoutbox').ajaxError(function() { - $(this).text( "Triggered ajaxError handler on shoutbox" ); - }); - - $("#sb_form").submit(function(event) { - /* stop form from submitting normally */ - event.preventDefault(); - post_shoutbox(); - }); - - 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 () { - $.get('chat_content.html', function(data) { - $('div#shoutbox').html(data); - }); -} - -function refresh_time_sb () { - // Refresh rate in milli seconds - mytime=setTimeout('display_shoutbox()', 10000); -} - -function post_shoutbox () { - $.post("/cgi-bin/psowrte.py" , $("#sb_form").serialize()) - .success(function() { - refresh_shoutbox(); - }); - $('#shoutbox-input .message').val(''); -} - -function display_shoutbox() { - refresh_shoutbox(); - refresh_time_sb(); -} - -function fnGetDomain(url) { - return url.match(/:\/\/(.[^/]+)/)[1]; -} diff --git a/piratebox_origin/piratebox/piratebox/www/station_cnt.txt b/piratebox_origin/piratebox/piratebox/www/station_cnt.txt deleted file mode 100644 index e69de29..0000000 diff --git a/piratebox_origin/piratebox/piratebox/www/style.css b/piratebox_origin/piratebox/piratebox/www/style.css deleted file mode 100644 index cef92ac..0000000 --- a/piratebox_origin/piratebox/piratebox/www/style.css +++ /dev/null @@ -1,354 +0,0 @@ -* { - overflow: auto; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - margin: 0; - padding: 0; -} - -html, body, div, object, iframe, fieldset { - border: 0; -} - -ol, ul { - list-style: none; -} - -table { - border-spacing: 0; - border-collapse: collapse; -} - -header, footer, footer, nav, section, article, hgroup, figure { - display: block; -} - -legend { - display: none; -} - -body { - color: #1b1d1e; - font-family: sans-serif; - font-size: 100%; -} - -h1 { - font-size: 1em; - font-weight: bold; - line-height: auto; - margin: 0; -} - -h2 { - font-size: 1.3em; - font-weight: bold; - line-height: auto; - margin: 0 0 0.25em; -} - -h3 { - font-size: 1em; - font-weight: bold; - line-height: auto; - margin: 0 0 0.25em; -} - -p { - font-size: 1em; - font-weight: normal; - line-height: 1.5em; - margin: 0 0 1em; -} - -a { - color: #ad000b; - 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; -} - -.green { - color: green; -} - -.blue { - color: blue; -} - -.orange { - color: #ff8040; -} - -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 { - clear: both; - display: none; - padding: 1em 0 0 0; -} - -#thanks { - float: right; -} - -#upload iframe { - border: 1px solid #979ea1; - border-radius: 3px; - margin: 0 0 1em; -} - -#shoutbox { - height: 350px; - overflow: auto; - width: 100%; - border: 1px solid #979ea1; - border-radius: 3px; - margin: 0 0 1em; - padding: 0.5em; -} -#shoutbox .message { - margin: 0 0 .25em 0; -} - -#shoutbox-input { - margin: 0 0 1em 0; -} -#shoutbox-input .nickname, -#shoutbox-input .message, -#shoutbox-input .button { - width: 100%; -} - -#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 { - height: 3em; - border: 1px solid #979ea1; - border-radius: 3px; - margin: 0 0 1em; - padding: 0 0.5em; -} - -input[type=radio] { - height: 1.3em; - margin: 0 .5em 0 0; -} - -.button { - background: #979ea1; - border: 0; - color: white; - margin: 0; -} - -.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 { - margin: 0 2em 0 0; - } - - #menu-icon { - display: none; - } - - #top-nav { - clear: none; - display: table-cell; - padding: 0; - vertical-align: middle; - } - #top-nav ul li { - float: left; - } - #top-nav ul li a { - margin: 0 1em 0 0; - padding: 0; - } - - #sidebar { - float: right; - width: 40%; - } - - #main { - float: left; - padding: 0 1em 0 0; - width: 60%; - } - - #shoutbox-input .nickname { - float: left; - margin: 0 1em 0 0; - width: 20%; - } - #shoutbox-input .message { - float: left; - margin: 0 1em 0 0; - width: 60%; - } - #shoutbox-input .button { - float: right; - margin: 0; - width: 15%; - } - - .to-top { - display: none; - } - - .container { - margin: 0 auto; - max-width: 1280px; - width: 90%; - } - - .list table .m, - .list table .s, - .list table .t { - display: table-cell; - } -} diff --git a/piratebox_origin/piratebox/readme.txt b/piratebox_origin/piratebox/readme.txt deleted file mode 100755 index 06b1a73..0000000 --- a/piratebox_origin/piratebox/readme.txt +++ /dev/null @@ -1,77 +0,0 @@ -## 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 -## - - -####### 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 9672b3fceac336e9ac3523d2367ae64085962dcc Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 14 May 2017 11:17:25 +0200 Subject: [PATCH 03/21] Squashed 'piratebox_origin/' content from commit 150ba18 git-subtree-dir: piratebox_origin git-subtree-split: 150ba186da3aea740b5be56fcc5d7d559ac323f2 --- .gitignore | 11 + AUTHORS | 38 + CHANGELOG | 170 +++ CHECKLIST.md | 84 ++ LICENSE | 674 ++++++++++ Makefile | 110 ++ README.md | 60 + development/lighttpd_extra.conf | 99 ++ development/lighttpd_inside.conf | 100 ++ image_stuff/OpenWRT_ext4_100MB.img.gz | Bin 0 -> 107404 bytes image_stuff/OpenWRT_ext4_50MB.img.gz | Bin 0 -> 54561 bytes piratebox/install.sh | 123 ++ piratebox/piratebox/bin/avahi_to_sdns.sh | 27 + piratebox/piratebox/bin/board-autoconf.sh | 23 + piratebox/piratebox/bin/delete_empty.sh | 26 + .../bin/distribute_file_into_directory.sh | 31 + piratebox/piratebox/bin/distribute_files.sh | 51 + piratebox/piratebox/bin/droopy | 1157 +++++++++++++++++ piratebox/piratebox/bin/firewall.sh | 70 + piratebox/piratebox/bin/flush_dnsmasq.sh | 10 + .../piratebox/bin/generate_config_files.sh | 228 ++++ .../bin/hooks/hook_piratebox_start.sh | 18 + .../bin/hooks/hook_piratebox_start_done.sh | 18 + .../bin/hooks/hook_piratebox_stop.sh | 18 + .../bin/hooks/hook_piratebox_stop_done.sh | 18 + .../piratebox/bin/hooks/hook_post_init.sh | 19 + .../piratebox/bin/hooks/hook_pre_init.sh | 19 + .../bin/hooks/hook_pre_openwrt_init.sh | 23 + piratebox/piratebox/bin/install_piratebox.sh | 176 +++ piratebox/piratebox/bin/json_generation.sh | 46 + .../piratebox/bin/piratebox_setup_wlan.sh | 121 ++ piratebox/piratebox/bin/rpi_hwclock.sh | 7 + piratebox/piratebox/bin/shoutbox_daemon.sh | 22 + piratebox/piratebox/bin/shoutbox_stuff.sh | 53 + piratebox/piratebox/bin/station_cnt.sh | 8 + piratebox/piratebox/bin/timesave.sh | 85 ++ .../conf/avahi/avahi-daemon.conf.schema | 30 + .../conf/avahi/services/http.service | 10 + .../piratebox/conf/avahi/services/ssh.service | 34 + piratebox/piratebox/conf/chat_init.txt | 1 + piratebox/piratebox/conf/dnsmasq_default.conf | 15 + piratebox/piratebox/conf/firewall.conf | 12 + piratebox/piratebox/conf/hook_custom.conf | 6 + piratebox/piratebox/conf/hostapd.conf | 23 + piratebox/piratebox/conf/hosts | 9 + piratebox/piratebox/conf/hosts_mesh | 3 + piratebox/piratebox/conf/ipv6.conf | 19 + piratebox/piratebox/conf/irc.conf | 13 + piratebox/piratebox/conf/irc/motd.txt | 7 + piratebox/piratebox/conf/json.conf | 9 + piratebox/piratebox/conf/lighttpd/env | 0 .../lighttpd/fastcgi-php-generate203.conf | 16 + .../piratebox/conf/lighttpd/fastcgi-php.conf | 11 + .../piratebox/conf/lighttpd/lighttpd.conf | 124 ++ piratebox/piratebox/conf/lighttpd/mime.types | 93 ++ piratebox/piratebox/conf/node.conf | 27 + piratebox/piratebox/conf/piratebox.conf | 197 +++ piratebox/piratebox/init.d/piratebox | 295 +++++ piratebox/piratebox/init.d/piratebox_alt | 292 +++++ piratebox/piratebox/lib/json_func.sh | 12 + .../piratebox/lib/node_name_generation.sh | 32 + .../piratebox/lib/node_name_resolution.sh | 30 + piratebox/piratebox/python_lib/.keep | 0 piratebox/piratebox/python_lib/broadcast.py | 120 ++ piratebox/piratebox/python_lib/discover.py | 82 ++ piratebox/piratebox/python_lib/diskusage.py | 106 ++ piratebox/piratebox/python_lib/messages.py | 50 + piratebox/piratebox/python_lib/psogen.py | 167 +++ piratebox/piratebox/python_lib/psutil.py | 45 + piratebox/piratebox/python_lib/style.css | 8 + .../piratebox/rpi/bin/do_switch_client.sh | 14 + piratebox/piratebox/rpi/bin/run_client.sh | 27 + piratebox/piratebox/rpi/bin/sdcard_share.sh | 103 ++ piratebox/piratebox/rpi/bin/starter.sh | 18 + .../piratebox/rpi/bin/switch_to_client.sh | 6 + piratebox/piratebox/rpi/bin/usb_share.sh | 46 + piratebox/piratebox/rpi/bin/wifi_detect.sh | 82 ++ piratebox/piratebox/rpi/motd.txt | 35 + .../piratebox/rpi/services/piratebox.service | 14 + .../rpi/services/rpi_hwclock.service | 10 + .../piratebox/rpi/services/timesave.service | 10 + piratebox/piratebox/rpi/udev/99-wifi.rules | 1 + piratebox/piratebox/share/.keep | 0 piratebox/piratebox/src/HEADER.txt | 28 + piratebox/piratebox/src/README.txt | 12 + piratebox/piratebox/src/forest.css | 72 + piratebox/piratebox/src/forest.py | 552 ++++++++ piratebox/piratebox/src/kareha.pl | 13 + piratebox/piratebox/src/kareha_img_config.pl | 173 +++ .../piratebox/src/linux.example.minidlna.conf | 17 + piratebox/piratebox/src/no_forum.html | 10 + piratebox/piratebox/src/no_link.html | 0 .../piratebox/src/openwrt.example.minidlna | 17 + piratebox/piratebox/src/redirect.html.schema | 13 + piratebox/piratebox/tmp/.keep | 0 piratebox/piratebox/www/.READ.ME.htm | 44 + piratebox/piratebox/www/cgi-bin/data.pso | 3 + piratebox/piratebox/www/cgi-bin/diskwrite.py | 14 + piratebox/piratebox/www/cgi-bin/psoread.py | 13 + piratebox/piratebox/www/cgi-bin/psowrte.py | 27 + piratebox/piratebox/www/cgi-bin/style.css | 8 + piratebox/piratebox/www/generate_204 | 5 + piratebox/piratebox/www/index.html | 11 + .../piratebox/www/library/test/success.html | 9 + piratebox/piratebox/www/ncsi.txt | 1 + piratebox/piratebox/www/redirect.html | 11 + piratebox/piratebox/www/station_cnt.txt | 0 .../www/upload_handler/files/.gitignore | 3 + .../www_content/css/jquery-ui.min.css | 7 + .../piratebox/www_content/css/page_style.css | 388 ++++++ piratebox/piratebox/www_content/favicon.ico | Bin 0 -> 1406 bytes piratebox/piratebox/www_content/img/menu.png | Bin 0 -> 2992 bytes .../img/piratebox-logo-horizontal-white.png | Bin 0 -> 6607 bytes .../www_content/img/piratebox-logo-small.png | Bin 0 -> 12637 bytes piratebox/piratebox/www_content/index.html | 110 ++ .../piratebox/www_content/js/jquery-ui.min.js | 6 + .../piratebox/www_content/js/jquery.min.js | 4 + piratebox/piratebox/www_content/js/l10n.js | 1157 +++++++++++++++++ piratebox/piratebox/www_content/js/scripts.js | 171 +++ .../www_content/locales/data.de.properties | 39 + .../www_content/locales/data.en.properties | 39 + .../www_content/locales/data.fr.properties | 39 + .../www_content/locales/data.pt-br.properties | 48 + .../piratebox/www_content/locales/locales.ini | 11 + piratebox/readme.txt | 4 + 125 files changed, 9086 insertions(+) create mode 100644 .gitignore create mode 100644 AUTHORS create mode 100644 CHANGELOG create mode 100644 CHECKLIST.md create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README.md create mode 100644 development/lighttpd_extra.conf create mode 100644 development/lighttpd_inside.conf create mode 100644 image_stuff/OpenWRT_ext4_100MB.img.gz create mode 100644 image_stuff/OpenWRT_ext4_50MB.img.gz create mode 100755 piratebox/install.sh create mode 100755 piratebox/piratebox/bin/avahi_to_sdns.sh create mode 100755 piratebox/piratebox/bin/board-autoconf.sh create mode 100755 piratebox/piratebox/bin/delete_empty.sh create mode 100755 piratebox/piratebox/bin/distribute_file_into_directory.sh create mode 100755 piratebox/piratebox/bin/distribute_files.sh create mode 100755 piratebox/piratebox/bin/droopy create mode 100755 piratebox/piratebox/bin/firewall.sh create mode 100755 piratebox/piratebox/bin/flush_dnsmasq.sh create mode 100755 piratebox/piratebox/bin/generate_config_files.sh create mode 100755 piratebox/piratebox/bin/hooks/hook_piratebox_start.sh create mode 100755 piratebox/piratebox/bin/hooks/hook_piratebox_start_done.sh create mode 100755 piratebox/piratebox/bin/hooks/hook_piratebox_stop.sh create mode 100755 piratebox/piratebox/bin/hooks/hook_piratebox_stop_done.sh create mode 100755 piratebox/piratebox/bin/hooks/hook_post_init.sh create mode 100755 piratebox/piratebox/bin/hooks/hook_pre_init.sh create mode 100755 piratebox/piratebox/bin/hooks/hook_pre_openwrt_init.sh create mode 100755 piratebox/piratebox/bin/install_piratebox.sh create mode 100755 piratebox/piratebox/bin/json_generation.sh create mode 100755 piratebox/piratebox/bin/piratebox_setup_wlan.sh create mode 100755 piratebox/piratebox/bin/rpi_hwclock.sh create mode 100755 piratebox/piratebox/bin/shoutbox_daemon.sh create mode 100755 piratebox/piratebox/bin/shoutbox_stuff.sh create mode 100755 piratebox/piratebox/bin/station_cnt.sh create mode 100755 piratebox/piratebox/bin/timesave.sh 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 create mode 100644 piratebox/piratebox/conf/chat_init.txt create mode 100644 piratebox/piratebox/conf/dnsmasq_default.conf create mode 100644 piratebox/piratebox/conf/firewall.conf create mode 100644 piratebox/piratebox/conf/hook_custom.conf create mode 100644 piratebox/piratebox/conf/hostapd.conf create mode 100644 piratebox/piratebox/conf/hosts create mode 100644 piratebox/piratebox/conf/hosts_mesh create mode 100644 piratebox/piratebox/conf/ipv6.conf create mode 100644 piratebox/piratebox/conf/irc.conf create mode 100644 piratebox/piratebox/conf/irc/motd.txt create mode 100644 piratebox/piratebox/conf/json.conf create mode 100644 piratebox/piratebox/conf/lighttpd/env create mode 100644 piratebox/piratebox/conf/lighttpd/fastcgi-php-generate203.conf create mode 100644 piratebox/piratebox/conf/lighttpd/fastcgi-php.conf create mode 100644 piratebox/piratebox/conf/lighttpd/lighttpd.conf create mode 100644 piratebox/piratebox/conf/lighttpd/mime.types create mode 100644 piratebox/piratebox/conf/node.conf create mode 100644 piratebox/piratebox/conf/piratebox.conf create mode 100755 piratebox/piratebox/init.d/piratebox create mode 100755 piratebox/piratebox/init.d/piratebox_alt create mode 100755 piratebox/piratebox/lib/json_func.sh create mode 100644 piratebox/piratebox/lib/node_name_generation.sh create mode 100644 piratebox/piratebox/lib/node_name_resolution.sh create mode 100644 piratebox/piratebox/python_lib/.keep create mode 100644 piratebox/piratebox/python_lib/broadcast.py create mode 100644 piratebox/piratebox/python_lib/discover.py create mode 100644 piratebox/piratebox/python_lib/diskusage.py create mode 100644 piratebox/piratebox/python_lib/messages.py create mode 100755 piratebox/piratebox/python_lib/psogen.py create mode 100644 piratebox/piratebox/python_lib/psutil.py create mode 100755 piratebox/piratebox/python_lib/style.css create mode 100755 piratebox/piratebox/rpi/bin/do_switch_client.sh create mode 100755 piratebox/piratebox/rpi/bin/run_client.sh create mode 100755 piratebox/piratebox/rpi/bin/sdcard_share.sh create mode 100755 piratebox/piratebox/rpi/bin/starter.sh create mode 100755 piratebox/piratebox/rpi/bin/switch_to_client.sh create mode 100755 piratebox/piratebox/rpi/bin/usb_share.sh create mode 100755 piratebox/piratebox/rpi/bin/wifi_detect.sh create mode 100644 piratebox/piratebox/rpi/motd.txt create mode 100644 piratebox/piratebox/rpi/services/piratebox.service create mode 100644 piratebox/piratebox/rpi/services/rpi_hwclock.service create mode 100644 piratebox/piratebox/rpi/services/timesave.service create mode 100644 piratebox/piratebox/rpi/udev/99-wifi.rules create mode 100644 piratebox/piratebox/share/.keep create mode 100644 piratebox/piratebox/src/HEADER.txt create mode 100644 piratebox/piratebox/src/README.txt create mode 100644 piratebox/piratebox/src/forest.css create mode 100755 piratebox/piratebox/src/forest.py create mode 100644 piratebox/piratebox/src/kareha.pl create mode 100644 piratebox/piratebox/src/kareha_img_config.pl create mode 100644 piratebox/piratebox/src/linux.example.minidlna.conf create mode 100644 piratebox/piratebox/src/no_forum.html create mode 100644 piratebox/piratebox/src/no_link.html create mode 100644 piratebox/piratebox/src/openwrt.example.minidlna create mode 100644 piratebox/piratebox/src/redirect.html.schema create mode 100644 piratebox/piratebox/tmp/.keep create mode 100755 piratebox/piratebox/www/.READ.ME.htm create mode 100644 piratebox/piratebox/www/cgi-bin/data.pso create mode 100755 piratebox/piratebox/www/cgi-bin/diskwrite.py create mode 100755 piratebox/piratebox/www/cgi-bin/psoread.py create mode 100755 piratebox/piratebox/www/cgi-bin/psowrte.py create mode 100755 piratebox/piratebox/www/cgi-bin/style.css create mode 100644 piratebox/piratebox/www/generate_204 create mode 100755 piratebox/piratebox/www/index.html create mode 100644 piratebox/piratebox/www/library/test/success.html create mode 100644 piratebox/piratebox/www/ncsi.txt create mode 100755 piratebox/piratebox/www/redirect.html create mode 100644 piratebox/piratebox/www/station_cnt.txt create mode 100644 piratebox/piratebox/www/upload_handler/files/.gitignore create mode 100644 piratebox/piratebox/www_content/css/jquery-ui.min.css create mode 100644 piratebox/piratebox/www_content/css/page_style.css create mode 100755 piratebox/piratebox/www_content/favicon.ico create mode 100644 piratebox/piratebox/www_content/img/menu.png create mode 100644 piratebox/piratebox/www_content/img/piratebox-logo-horizontal-white.png create mode 100755 piratebox/piratebox/www_content/img/piratebox-logo-small.png create mode 100644 piratebox/piratebox/www_content/index.html create mode 100644 piratebox/piratebox/www_content/js/jquery-ui.min.js create mode 100644 piratebox/piratebox/www_content/js/jquery.min.js create mode 100644 piratebox/piratebox/www_content/js/l10n.js create mode 100755 piratebox/piratebox/www_content/js/scripts.js create mode 100644 piratebox/piratebox/www_content/locales/data.de.properties create mode 100644 piratebox/piratebox/www_content/locales/data.en.properties create mode 100644 piratebox/piratebox/www_content/locales/data.fr.properties create mode 100644 piratebox/piratebox/www_content/locales/data.pt-br.properties create mode 100644 piratebox/piratebox/www_content/locales/locales.ini create mode 100755 piratebox/readme.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57eb33e --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +*.pyc +*.swp +piratebox/piratebox/version +piratebox/piratebox/www/chat_content.html +image_stuff/* +piratebox_ws_* +piratebox-ws_* +tmp/* +piratebox/piratebox/bin/miniircd.py +piratebox/piratebox/www/Shared +piratebox/piratebox/www/cgi-bin/data.pso diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..a077c0e --- /dev/null +++ b/AUTHORS @@ -0,0 +1,38 @@ +Based on idea of David Darts: http://daviddarts.com + +Script collection by: + Matthias Strubel http://piratebox.aod-rpg.de + +Live CD & Installer by: + TerrorByte ~ Cale Blac k + +Contributors for modifications: + # stylesuxx - Makefile and development support + # FriedZombie - OpenWRT and scripting support + # someguy - Droopy Directory support + # Reventlov - Modification for better iOS Support + # someguy - Modifications for running on OpenWRT + # ToM'aSs - Languag-Support + # Liblor - Fixes + # Loris Reiff + # iamarf + # denis-d + # taffy-nay + # risca + # herr-gabriel + # Jess Stubenbord + # Mike Weaver + # bartschat - RTC RPi feature + # casdr + # jdieg0 + # a-ira + # ... and all others I might have forgotten. + + +Design: + * David Brooks + +Based on Software: + * Droopy - http://stackp.online.fr/?p=28 + * forest.py - http://www.triv.org.uk/~nelis/forest/ + * kareha - http://wakaba.c3.cx/s/web/wakaba_kareha diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..087b728 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,170 @@ +CHANGELOG + +=== 1.1.3 === +* [New] Translation bt-pr +* [New] [RPi] Helper scripts to jump to wifi client mode +* [New] [RPi] Helper script to use SDCard without reboot +* [New] [RPi] Image adjustments to save SDCard for to many writes +* [Fix] Some shell incompatibilities +* [Fix] forest.py : Cleanup used folders +* [Fix] Fixed localization ID for placeholder message +* [Fix] Correct/translate German localisation strings +* [Fix] Adjust hostapd.conf with comments & addtional parameter for n-mode wifi +* [Fix] Some help about setting up WPA2 mode for AP in hostapd.conf +* [Fix] Reduce browser cache to a minimum, which solves issues with shoutbox and diskusage +* [Fix] Trigger async disk usage refresh during page load + +=== 1.1.2 === +* [Fix] Upgrade 1.1.x - 1.1.x does not create content symlink + +=== 1.1.1 === +* [Fix] Translation en,fr LibraryBox -> PirateBox +* [Fix] Spellings in translation +* [Fix] IRC startup command failed. +* [Removed] exchange_www.sh + +=== 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] 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] Website is now available under /content and /opt/piratebox/share +* [New] [RPi] Service files for using a RTC at PiratBox +* [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 +* [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 +* [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. +* [New] Display disk space usage on front page. +* [New] Add webm mime-type to lighttpd +* [RPi] [New] RPi2 and Zero support +* [RPi] [New] USB activation scripts. +* [RPi] [New] udev rules for piratebox activation +* [RPi] [New] Script for activating the correct hostap for Realtek chipsets +* [RPI] [New] wpa_supplicant fallback if no AP enabled WiFi device was found +* [Fix] Send a proper HTTP Reason code back +* [Fix] Fix version number in RPi MOTD. +* [Fix] Insert mime-type for .svg +* [Fix] Improve Shoutbox update speed after sending a message. +* [Fix] Do not cleanup the rootfs if Shared folder does not exist. +* [Fix] Improved comparison of timestamps on RPi. +* [Fix] Improved MOTD for RPi. +* [Fix] Improved initialization of the board. + +=== 1.0.6 === +* [Fix] Styling of the upload box iframe was quite ugly. + +=== 1.0.5 === +* [New] Improved styling for droopy iframe. +* [New] Timesave script service file to run set the time during startup. +* [Fix] Droopy call in init.d/piratebox failed to use the correct port. +* [Fix] Timesave script behaviour fixed on full Linux systems. +* OpenWrt's date format is now customized during build & piratebox.conf . + +=== 1.0.4 === +* [New] New feature: /opt/piratebox/bin/board-autoconf.sh for setting up the imageboard +* [New] Droopy update: Multiple upload +* [New] Droopy update: In general user/password setting (non configurable via + PirateBox) +* [New] imageboard: inital dummy page for a not installed board. +* [New] Send HTTP-Code 204 for Android devices, avoids captive Portal and leaving devices. + +* [Fix] Some script cleanups +* [Fix] Improved Cachehandling +* [Fix] Modified index HTML structure for increased stylability +* [Fix] Droopy update: Language encoding +* [Fix] Droopy update: Uploaded filepermission can be configured. + PirateBox default: 755 +* [Fix] Fix not refreshing shoutbox after bootup +* [Fix] Show station count again, after it is enabled + +* [Removed] Droopy update: Include hostname to templates (not needed anymore) +* [Removed] Droopy update: Field including iframe for shoutbox (not needed anymore) +* [Removed] Droopy update: iOS fake answer code, which was included in lighttpd since + Piratebox 0.5.x +* [Removed] exchange_www.sh : This feature is not available anymore, because it breaks + more then it helps. +* [Removed] Unnessecary AJAX calls & files from pre 1.0 + +=== 1.0.3 === + + (skipped) + +=== 1.0.2 === +* [Fix] Settings for correct permission of shoutbox files +* [Fix] Broken probe function in some shells +* [Fix] Issues with Python scripts on some plattforms +* [Fix] Fixes in installation script +* [Fix] Distribute files did not work with folder containing whitespaces +* [Fix] Fixed CSS issue with the shoutbox + +=== 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] [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 +* [Fix] Board Link out of nested Shared folder +* [Fix] Russian Translation in Droopy +* [Fix] ReDistribute DirectoryListing files upon initialization on first Startup +* [Fix] [OpenWRT] Fixing customization of lease-file location for OpenWRT +* [Fix] [OpenWRT] Fixes issues when extendRoot couldn't get initilized correctly +* [New] [OpenWRT] Optimized handling of mount options in extendRoot +* [Fix] [RPi] Bootup issue with some USB-wifi sticks. +* [Fix] Prevent XSS in forest.py + +=== 1.0.0 === +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 + * [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 +* [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 +* [Fix] Enable unescaped blanks in Upload-Folder +* [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 +* [New] Image file is ext4 and 50MB +* [Fix] Fixed captive Portal detection for iOS7 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) +* [ ] 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/Makefile b/Makefile new file mode 100644 index 0000000..6282dcb --- /dev/null +++ b/Makefile @@ -0,0 +1,110 @@ +NAME = piratebox-ws +VERSION = 1.1.3 +ARCH = all +PB_FOLDER=piratebox +PB_SRC_FOLDER=$(PB_FOLDER)/$(PB_FOLDER) + +PACKAGE_NAME=$(NAME)_$(VERSION) +PACKAGE=$(PACKAGE_NAME).tar.gz +VERSION_FILE=$(PB_FOLDER)/$(PB_FOLDER)/version + +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 +OPENWRT_FOLDER=image_stuff/openwrt +OPENWRT_CONFIG_FOLDER=$(OPENWRT_FOLDER)/conf +OPENWRT_BIN_FOLDER=$(OPENWRT_FOLDER)/bin + +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) + echo `git status -sb --porcelain` >> $(VERSION_FILE) + echo ` git log -1 --oneline` >> $(VERSION_FILE) + +$(PACKAGE): $(IRC_TARGET_SERVER) $(VERSION) + tar czf $@ $(PB_FOLDER) + + +$(IMAGE_FILE): $(IRC_TARGET_SERVER) $(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) + echo "#### Copy content to image file" + sudo cp -vr $(PB_SRC_FOLDER)/* $(MOUNT_POINT) + echo "#### Copy customizatiosns to image file" + sudo cp -rv $(OPENWRT_FOLDER)/* $(MOUNT_POINT)/ + echo "#### Umount Image file" + sudo umount $(MOUNT_POINT) + gzip -rc $(SRC_IMAGE_UNPACKED) > $(IMAGE_FILE) + + +$(OPENWRT_CONFIG_FOLDER): + mkdir -p $@ + 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 $@/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 + 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 + sed 's:FIREWALL_FETCH_HTTP="yes":FIREWALL_FETCH_HTTP="no":' -i $@/firewall.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) + + +$(SRC_IMAGE_UNPACKED): + gunzip -dc $(SRC_IMAGE) > $(SRC_IMAGE_UNPACKED) + + +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) + +cleanimage: + - rm -f $(TGZ_IMAGE_FILE) + - 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) + + + +.PHONY: all clean package shortimage diff --git a/README.md b/README.md new file mode 100644 index 0000000..d6041f8 --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +# PirateBoxScripts with Modifications for running in a Webserver + +[![Join the chat at https://gitter.im/PirateBox-Dev/PirateBoxScripts_Webserver](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/PirateBox-Dev/PirateBoxScripts_Webserver?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +© 2012-2014 [Matthias Strubel](mailto:matthias.strubel@aod-rpg.de) licenced under GPL-3 + +## Maintainers +* [Matthias Strubel](matthias.strubel@aod-rpg.de) + + +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/ + +----- Info ----- +Packages contains only scripts based PirateBox scripts with running lighttpd webserver. + +PirateBox scripts can: + * Setup WLAN Interface via iw + * Setup hotspot functionality (hostapd) + * Setup IP Adresses of wlan interface + * Proping until USB-WLAN is available + * Can add wlan interface to an existing bridge + * Sets Up a DHCP Server with redirect to wlan-interface IP + * Upload landing page (via iframe droopy) + * Browse Uploaded files + * Announce "Internet yes" for iOS + * Announce "Internet yes" for MS devices + * ShoutBox + * Optional small python Forum + * Optional imageboard + * Optional Station counter + * 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 + +More information can be found ont http://piratebox.aod-rpg.de +Installation-HowTo und current Download-Link: http://piratebox.aod-rpg.de/dokuwiki/doku.php/piratebox_lighttpd + +Is supported by mkPirateBox > v0.5 for OpenWRT Systems https://github.com/MaStr/mkPirateBox +and by PirateBox Manager https://github.com/TerrorByte/PirateBox-Manager + +----- Installation ----- +PirateBox should be in most common repositories soon, but in the mean time you can use this method: + + +##### For alpha testing + +Download the package: +https://github.com/MaStr/PirateBoxScripts_Webserver/archive/development.zip + +Unzip the package: +$unzip development.zip + +Run the installer in the unzipped folder: +$ cd PirateBoxScripts_Webserver/piratebox +$ sudo ./install.sh default #Default can be substituted with 'board' if you want an image board on your PB + + + diff --git a/development/lighttpd_extra.conf b/development/lighttpd_extra.conf new file mode 100644 index 0000000..3a0741b --- /dev/null +++ b/development/lighttpd_extra.conf @@ -0,0 +1,99 @@ +## Configuration for Piratebox + +server.modules = ( +# "mod_access", not needed! + "mod_alias", +# "mod_compress", Disabled, fixing reload Problem?? + "mod_redirect", +# "mod_rewrite", + "mod_setenv", +) + +var.basedir=env.HOME + /tmp + +server.document-root = basedir + "/www" + + +## Locate the tmp storage into tmp. It is in most cases the ram +## Limit the uploads to 4MB to save - especially on small devices +## the device from dieing because OUT-OF-RAM exceptions +## in KB => 4MB +server.upload-dirs = ( "/tmp" ) +server.max-request-size = 4048 + +server.errorlog = "/tmp/error.log" +server.breakagelog = "/tmp/break.log" +server.pid-file = "/tmp/lighttpd.pid" + + +index-file.names = ( "index.php", "index.html", + "index.htm", "default.htm", + " index.lighttpd.html" ) + +url.access-deny = ( "~", ".inc" ) + +# added .cgi .py +static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" , ".cgi" , ".py" ) + + +# Enable lighttpd on ipv6 +$SERVER["socket"] == "[::]:8001" { } +server.port = 8001 + +dir-listing.encoding = "utf-8" +server.dir-listing = "enable" + +# Grabs main css +dir-listing.external-css = "/css/page_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 = " " + +## custom MIME-Type support +include "piratebox/piratebox/conf/lighttpd/mime.types" + +#----------- cgi.conf -------------- +server.modules += ( "mod_cgi" ) + +$HTTP["url"] =~ "^/cgi-bin/" { + cgi.assign = ( ".py" => "/usr/bin/python2" ) +} + +$HTTP["url"] =~ "^/board/" { + cgi.assign = ( ".pl" => "/usr/bin/perl" , ) +} +#------------------------------------- + + + +# 404 Error Page with redirect +# +#server.error-handler-404 = "/redirect.html" + +## for better debugging +#server.modules += ( "mod_accesslog" ) +#accesslog.filename = "/tmp/access.log" + + + +include "piratebox/piratebox/conf/lighttpd/fastcgi.conf" + + +setenv.add-environment = ( + "SHOUTBOX_GEN_HTMLFILE" => basedir "/chat_content.html" , + "SHOUTBOX_CHATFILE" => basedir + "/cgi-bin/data.pso" , + "SHOUTBOX_CLIENT_TIMESTAMP" => "yes" +) diff --git a/development/lighttpd_inside.conf b/development/lighttpd_inside.conf new file mode 100644 index 0000000..2e0ce8f --- /dev/null +++ b/development/lighttpd_inside.conf @@ -0,0 +1,100 @@ +## Configuration for Piratebox + +server.modules = ( +# "mod_access", not needed! + "mod_alias", +# "mod_compress", Disabled, fixing reload Problem?? + "mod_redirect", +# "mod_rewrite", + "mod_setenv", +) + +var.basedir=env.PWD + +server.document-root = basedir + "/piratebox/piratebox/www" + + +## Locate the tmp storage into tmp. It is in most cases the ram +## Limit the uploads to 4MB to save - especially on small devices +## the device from dieing because OUT-OF-RAM exceptions +## in KB => 4MB +server.upload-dirs = ( "/tmp" ) +server.max-request-size = 4048 + +server.errorlog = "/tmp/error.log" +server.breakagelog = "/tmp/break.log" +server.pid-file = "/tmp/lighttpd.pid" + + +index-file.names = ( "index.php", "index.html", + "index.htm", "default.htm", + " index.lighttpd.html" ) + +url.access-deny = ( "~", ".inc" ) + +# added .cgi .py +static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" , ".cgi" , ".py" ) + + +# Enable lighttpd on ipv6 +$SERVER["socket"] == "[::]:8001" { } +server.port = 8001 + +dir-listing.encoding = "utf-8" +server.dir-listing = "enable" + +# Grabs main css +dir-listing.external-css = "/css/page_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 = " " + +## custom MIME-Type support +include basedir + "/piratebox/piratebox/conf/lighttpd/mime.types" + +#----------- cgi.conf -------------- +server.modules += ( "mod_cgi" ) + +$HTTP["url"] =~ "^/cgi-bin/" { + cgi.assign = ( ".py" => "/usr/bin/python2" ) +} + +$HTTP["url"] =~ "^/board/" { + cgi.assign = ( ".pl" => "/usr/bin/perl" , ) +} +#------------------------------------- + + + +# 404 Error Page with redirect +# +#server.error-handler-404 = "/redirect.html" + +## for better debugging +#server.modules += ( "mod_accesslog" ) +#accesslog.filename = "/tmp/access.log" + + + +include basedir + "/piratebox/piratebox/conf/lighttpd/fastcgi.conf" + + +setenv.add-environment = ( + "PYTHONPATH" => basedir + "/piratebox/piratebox/python_lib" , + "SHOUTBOX_GEN_HTMLFILE" => basedir + "/piratebox/piratebox/www/chat_content.html" , + "SHOUTBOX_CHATFILE" => basedir + "/piratebox/piratebox/www/cgi-bin/data.pso" , + "SHOUTBOX_CLIENT_TIMESTAMP" => "yes" +) 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>;! z7thhz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;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 zcmeI)c~Dc=9>8%dBKE0JtJP5!TX09At|%cy+p-8kR8%SyqD4Sumq262#OG|NlYOZf&`L>_MG?E`=ft2W8e65250#C%f07*&Po1q zGADlG#9?~-77a~$kXL}qmaPo01I(4Cd;NVhBm&lPsaJGuUs2NjshbKt*H`_xd3xb4 zmjc#w$v`2iz~zSmMW@))tUXdjy?ctCa%ZmhJ=*fK%e?Q6c&d&^nLZrf^ZL#*ONJLC z|ExkaD0xyTDx!#^7@IFDY%sb?T$UHejG}wApcp;|c0>wNz-B5np zQ%&*rccMtk(*09aF|-HL6`cdWb2`jYQ}WUSDm;tA?emgoL_wfbPG00hE6sFSBTt_sl1U} zHw#0X=kyP0r}Qj!D-X|i=LFyPVBb%lQ9z^T5oTD$n8d zY4_VK4z#g;QAfWpgr>xF~RNcH2C{(|6RxNI0+XuFLvgW9}J+D^ z0|ht4s#G7Y`Zz=NbsKwwZoBW;KPT{1j(Iev(r1xHYyCxIFHUES7*|^cC6w4^p70h= zK7T7M(dJyk_pv>LS5`LprH)(KUfyI^6h5)wS);viL+>{=`;}W~?_I4s?li?^>=p7a zcHWFOIkqx6PNPohviH&x%ke)3sL`Y-Z|o9=pDkgf;cyLwb?Bw?ZRlET6egjIm+!;@ zO_T?r5RY$PfYxP=ZttFp!d)CPP*{&1$#lnG3w+as*0T-$ethirPJ^0=q<7E!Zovc& zIVe2A;VKGm(Iw)x|Mdjr-=X!Hpg_UPNnHFFkNZuuoabmcd0Wu!52I_jV4fQ|4Tl``l9M=OqTr0fH587Z-AKbbdI_zE zhZ**xTsw)!32lv zC|t#Xi-Io>B`An-s6s&xhe8yRalj|b4F`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C8!X009sH0T2KI5C8!X009sH0T2KI5cpID^h>ql r-hVB^ud3?7L!W=D4Dj3_00JNY0w4eaAn +# REQUIREMENTS: --- +# BUGS: Link from install +# NOTES: --- +# AUTHOR: Cale 'TerrorByte' Black, cablack@rams.colostate.edu +# 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 +scriptfile="$(readlink -f $0)" +CURRENT_DIR="$(dirname ${scriptfile})" + +#Must be root +if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root" #1>&2 + exit 0 +fi + +if [[ $1 ]]; then + echo "Installing..." +else + echo "Useage: /bin/bash install.sh " + exit 0 +fi + +if [[ -f "$CURRENT_DIR"/$CURRENT_CONF ]]; then + . $CURRENT_CONF 2> /dev/null +else + echo "PirateBox config is not in its normal directory" + exit 0 +fi + +#begin setting up piratebox's home dir +if [[ ! -d /opt ]]; then + mkdir -p /opt +fi + +cp -rv "$CURRENT_DIR"/piratebox /opt &> /dev/null +echo "Finished copying files..." +echo "$NET.$IP_SHORT piratebox.lan">>/etc/hosts +echo "$NET.$IP_SHORT piratebox">>/etc/hosts + +if [[ -d /etc/init.d/ ]]; then + ln -s /opt/piratebox/init.d/piratebox /etc/init.d/piratebox + echo "To make PirateBox start at boot run: update-rc.d piratebox defaults" +# systemctl enable piratebox #This enables PirateBox at start up... could be useful for Live +else + #link between opt and etc/pb + ln -s /opt/piratebox/init.d/piratebox.service /etc/systemd/system/piratebox.service + echo "To make PirateBox start at boot run: systemctl enable piratebox" +fi + +#install dependencies +#TODO missing anything in $DEPENDENCIES? +# Modified Script by martedì at http://www.mirkopagliai.it/bash-scripting-check-for-and-install-missing-dependencies/ +PKGSTOINSTALL="hostapd lighttpd dnsmasq" + +# If some dependencies are missing, asks if user wants to install +if [ "$PKGSTOINSTALL" != "" ]; then + echo -n "Some dependencies may missing. Would you like to install them? (Y/n): " + read SURE + # If user want to install missing dependencies + if [[ $SURE = "Y" || $SURE = "y" || $SURE = "" ]]; then + # Debian, Ubuntu and derivatives (with apt-get) + if which apt-get &> /dev/null; then + apt-get install $PKGSTOINSTALL + # OpenSuse (with zypper) + #elif which zypper &> /dev/null; then + # zypper in $PKGSTOINSTALL + # Mandriva (with urpmi) + elif which urpmi &> /dev/null; then + urpmi $PKGSTOINSTALL + # Fedora and CentOS (with yum) + elif which yum &> /dev/null; then + yum install $PKGSTOINSTALL + # ArchLinux (with pacman) + elif which pacman &> /dev/null; then + pacman -Sy $PKGSTOINSTALL + # Else, if no package manager has been found + else + # Set $NOPKGMANAGER + NOPKGMANAGER=TRUE + echo "ERROR: No package manager found. Please, manually install: $PKGSTOINSTALL." + fi + fi +fi + +#install piratebox with the given option +case "$1" in + default) + /opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf part2 + ;; + board) + /opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf imageboard + echo "############################################################################" + echo "#Edit /opt/piratebox/share/board/config.pl and change ADMIN_PASS and SECRET#" + echo "############################################################################" + ;; + *) + echo "$1 is not an option. Useage: /bin/bash install.sh " + exit 0 + ;; +esac + +echo "##############################" +echo "#PirateBox has been installed#" +echo "##############################" +echo "" +echo "Use: sudo service piratebox " +echo "or for systemd systems Use: sudo systemctl piratebox" +exit 0 diff --git a/piratebox/piratebox/bin/avahi_to_sdns.sh b/piratebox/piratebox/bin/avahi_to_sdns.sh new file mode 100755 index 0000000..6e47a43 --- /dev/null +++ b/piratebox/piratebox/bin/avahi_to_sdns.sh @@ -0,0 +1,27 @@ +PIRATEBOX_HOSTS_MESH=/opt/piratebox/conf/hosts_mesh +AVAHI_CACHE_FILE=/tmp/avahi.browse +AVAHI_GEN_OUTPUT="${AVAHI_CACHE_FILE}".hosts + +DNSMASQ_PID=/var/run/piratebox_dnsmasq.pid + +SLEEPTIME=$((60 * 5 )) # Sleep for 5 Minutes before doing a refresh + +PROTOCOLL="_http._tcp" + +while true; do + + ## Browse Avahi discover results and format them into a hosts file + avahi-browse -p -r -t -f $PROTOCOLL | grep -e "=" > $AVAHI_CACHE_FILE + grep \= $AVAHI_CACHE_FILE | \ + sed -e 's|\.local||g' \ + -e 's|_|\.|g' | \ + awk 'BEGIN { FS=";" } { print $8 " " $7; }' > $AVAHI_GEN_OUTPUT + + + echo "# Updated " `date` >> $AVAHI_GEN_OUTPUT + cp $AVAHI_GEN_OUTPUT $PIRATEBOX_HOSTS_MESH + + # Send SIGHUP to dnsmasq for refreshing its cache + kill -1 `cat $DNSMASQ_PID` + sleep $SLEEPTIME +done diff --git a/piratebox/piratebox/bin/board-autoconf.sh b/piratebox/piratebox/bin/board-autoconf.sh new file mode 100755 index 0000000..7bfdc91 --- /dev/null +++ b/piratebox/piratebox/bin/board-autoconf.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +if [[ ! -d /opt/piratebox/share/board ]]; then + echo "You have to install the imageboard first!" + echo "Run (as root):" + echo "\t/opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf imageboard" +else + echo -n "Imageboard admin password: " + read -s BOARDPASSWORD + echo + sed -i "s|xyzPASSWORDzyx|$BOARDPASSWORD|g" /opt/piratebox/share/board/config.pl + + TEMPRAND=$(< /dev/urandom tr -dc A-Za-z0-9_ | head -c128) + sed -i "s|xyzSECRETCODEzyx|$TEMPRAND|g" /opt/piratebox/share/board/config.pl + + sed -i "s|#use constant ADMIN_PASS|use constant ADMIN_PASS|" /opt/piratebox/share/board/config.pl + sed -i "s|#use constant SECRET|use constant SECRET|" /opt/piratebox/share/board/config.pl + + # Remove temporary index page and then try to initialize the board + test -e /opt/piratebox/share/board/index.htm && rm /opt/piratebox/share/board/index.htm + #wget -q -s -O - http://127.0.0.1/board/kareha.pl 2>/dev/null + wget -qO- http://127.0.0.1/board/kareha.pl &> /dev/null +fi diff --git a/piratebox/piratebox/bin/delete_empty.sh b/piratebox/piratebox/bin/delete_empty.sh new file mode 100755 index 0000000..c5c02ed --- /dev/null +++ b/piratebox/piratebox/bin/delete_empty.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Matthias Strubel (c) 2014,2016 - GPL3 +# matthias.strubel@aod-rpg.de +# +# This script deletes 0 Byte files +# This script is needed for Piratebox on OpenWrt. +# The find utility there has only a limited feature set. + +IFS=' +' + + +# Change directory, if not exist exit to not cleanup the +# OS filesystem. +cd $1 || exit 1 + +ls_list=$( find ./ -type f ) + +for filename in $ls_list +do + if [ ! -s $filename ] ; then + echo "Deleting 0 Byte file $filename" + rm $filename + fi +done 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..c063926 --- /dev/null +++ b/piratebox/piratebox/bin/distribute_file_into_directory.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# 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 +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..d347f08 --- /dev/null +++ b/piratebox/piratebox/bin/distribute_files.sh @@ -0,0 +1,51 @@ +#!/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 +PIRATEBOX_FOLDER=$4 +PIRATEBOX_FOLDER=${PIRATEBOX_FOLDER:=/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/bin/droopy b/piratebox/piratebox/bin/droopy new file mode 100755 index 0000000..503ca77 --- /dev/null +++ b/piratebox/piratebox/bin/droopy @@ -0,0 +1,1157 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Droopy (http://stackp.online.fr/droopy) +# Copyright 2008-2013 (c) Pierre Duquesne +# 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 +# * Add option to change uploaded file permissions +# * Add support for HTML5 multiple file upload +# 20120108 * Taiwanese translation by Li-cheng Hsu. +# 20110928 * Correctly save message with --save-config. Fix by Sven Radde. +# 20110708 * Polish translation by Jacek Politowski. +# 20110625 * Fix bug regarding filesystem name encoding. +# * Save the --dl option when --save-config is passed. +# 20110501 * Add the --dl option to let clients download files. +# * CSS speech bubble. +# 20101130 * CSS and HTML update. Switch to the new BSD License. +# 20100523 * Simplified Chinese translation by Ye Wei. +# 20100521 * Hungarian translation by Csaba Szigetvári. +# * Russian translation by muromec. +# * Use %APPDATA% Windows environment variable -- fix by Maik. +# 20091229 * Brazilian Portuguese translation by +# Carlos Eduardo Moreira dos Santos and Toony Poony. +# * IE layout fix by Carlos Eduardo Moreira dos Santos. +# * Galician translation by Miguel Anxo Bouzada. +# 20090721 * Indonesian translation by Kemas. +# 20090205 * Japanese translation by Satoru Matsumoto. +# * Slovak translation by CyberBoBaK. +# 20090203 * Norwegian translation by Preben Olav Pedersen. +# 20090202 * Korean translation by xissy. +# * Fix for unicode filenames by xissy. +# * Relies on 127.0.0.1 instead of "localhost" hostname. +# 20090129 * Serbian translation by kotnik. +# 20090125 * Danish translation by jan. +# 20081210 * Greek translation by n2j3. +# 20081128 * Slovene translation by david. +# * Romanian translation by Licaon. +# 20081022 * Swedish translation by David Eurenius. +# 20081001 * Droopy gets pretty (css and html rework). +# * Finnish translation by ipppe. +# 20080926 * Configuration saving and loading. +# 20080906 * Extract the file base name (some browsers send the full path). +# 20080905 * File is uploaded directly into the specified directory. +# 20080904 * Arabic translation by Djalel Chefrour. +# * Italian translation by fabius and d1s4st3r. +# * Dutch translation by Tonio Voerman. +# * Portuguese translation by Pedro Palma. +# * Turkish translation by Heartsmagic. +# 20080727 * Spanish translation by Federico Kereki. +# 20080624 * Option -d or --directory to specify the upload directory. +# 20080622 * File numbering to avoid overwriting. +# 20080620 * Czech translation by Jiří. +# * German translation by Michael. +# 20080408 * First release. + +import BaseHTTPServer +import SocketServer +import cgi +import os +import posixpath +import macpath +import ntpath +import sys +import getopt +import mimetypes +import copy +import shutil +import tempfile +import socket +import locale +import urllib +import base64 +import string +from pickle import load,dump +from ctypes import CDLL, c_char_p + +LOGO = '''\ + _____ +| \.----.-----.-----.-----.--.--. +| -- | _| _ | _ | _ | | | +|_____/|__| |_____|_____| __|___ | + |__| |_____| +''' + +USAGE='''\ +Usage: droopy [options] [PORT] + +Options: + -h, --help show this help message and exit + -d DIRECTORY, --directory DIRECTORY set the directory to upload files to + -m MESSAGE, --message MESSAGE set the message + -p PICTURE, --picture PICTURE set the picture + --dl provide download links + -a USER:PASS, --auth USER:PASS set the authentication credentials + --ssl PEMFILE set up https using the certificate file + --chmod MODE set the file permissions (octal value) + --save-config save options in a configuration file + --delete-config delete the configuration file and exit + +Example: + droopy -m "Hi, this is Bob. You can send me a file." -p avatar.png +''' + +picture = None +message = "" +port = 8000 +directory = os.curdir +must_save_options = False +publish_files = False +auth = None +certfile = None +file_mode = None + +## User supplied subdirectory stuff +userdirs= False # disabled by default, overridden by command line +# where to store the password file for users +#password_file='/opt/piratebox/passwd' +password_file='/tmp/passwd' +# What name will be used if subdir isn't specified +# must be lower case +anondir="anonymous" +# If no subdir is specified, put in root (0), or anondir(1)? +useAnondir=1 + +userdirform=''' +
%(advanced)s +
+ +
+''' + +# -- HTML templates + +style = ''' + +''' + +userinfo = ''' +
+ %(message)s + %(divpicture)s +
+''' + +maintmpl = ''' + + + +%(maintitle)s +''' + style + ''' + + +%(linkurl)s +
+
+
+
+ + + %(userdiropts)s + +
+ +
+
+ + +
+ +
+
%(sending)s
+ + +''' + userinfo + ''' +%(files)s + + + +''' + +successtmpl = ''' + + + %(successtitle)s +''' + style + ''' + + +
+
+
+ %(received)s + %(another)s +
+
+''' + userinfo + ''' +
+ + +''' + +errortmpl = ''' + + + %(errortitle)s +''' + style + ''' + + +
+
+
+ %(problem)s + %(retry)s +
+
+''' + userinfo + ''' +
+ + +''' + +linkurltmpl = '''''' + + +templates = {"main": maintmpl, "success": successtmpl, "error": errortmpl} + +# -- Translations + +ar = {"maintitle": u"إرسال ملف", + "submit": u"إرسال", + "sending": u"الملف قيد الإرسال", + "successtitle": u"تم استقبال الملف", + "received": u"تم استقبال الملف !", + "another": u"إرسال ملف آخر", + "errortitle": u"مشكلة", + "problem": u"حدثت مشكلة !", + "retry": u"إعادة المحاولة", + "discover": u"اكتشاف عنوان هذه الصفحة"} + +cs = {"maintitle": u"Poslat soubor", + "submit": u"Poslat", + "sending": u"Posílám", + "successtitle": u"Soubor doručen", + "received": u"Soubor doručen !", + "another": u"Poslat další soubor", + "errortitle": u"Chyba", + "problem": u"Stala se chyba !", + "retry": u"Zkusit znova.", + "discover": u"Zjistit adresu stránky"} + +da = {"maintitle": u"Send en fil", + "submit": u"Send", + "sending": u"Sender", + "successtitle": u"Fil modtaget", + "received": u"Fil modtaget!", + "another": u"Send en fil til.", + "errortitle": u"Problem", + "problem": u"Det er opstået en fejl!", + "retry": u"Forsøg igen.", + "discover": u"Find adressen til denne side"} + +de = {"maintitle": "Datei senden", + "submit": "Senden", + "sending": "Sendet", + "successtitle": "Datei empfangen", + "received": "Datei empfangen!", + "another": "Weitere Datei senden", + "errortitle": "Fehler", + "problem": "Ein Fehler ist aufgetreten!", + "retry": "Wiederholen", + "discover": "Internet-Adresse dieser Seite feststellen"} + +el = {"maintitle": u"Στείλε ένα αρχείο", + "submit": u"Αποστολή", + "sending": u"Αποστέλλεται...", + "successtitle": u"Επιτυχής λήψη αρχείου ", + "received": u"Λήψη αρχείου ολοκληρώθηκε", + "another": u"Στείλε άλλο ένα αρχείο", + "errortitle": u"Σφάλμα", + "problem": u"Παρουσιάστηκε σφάλμα", + "retry": u"Επανάληψη", + "discover": u"Βρες την διεύθυνση της σελίδας"} + +en = {"maintitle": "Send a file", + "submit": "Send", + "sending": "Sending", + "successtitle": "File received", + "received": "File received!", + "another": "Send another file.", + "errortitle": "Problem", + "problem": "There has been a problem!", + "retry": "Retry.", + "discover": "Discover the address of this page", + "subdirerror": "There is a problem uploading to that subdirectory.
Check if that subdirectory already exits.
If it does not, make sure you are only using characters a-zA-Z0-9 for the username and password.
If the directory exists and the characters are valid, you probably are using the wrong password

", + "advanced": "advanced options", + "userdirname": "Name of directory to place files in ", + "userdirpassword": "Password for saving files to that directory (optional)" + } + +es = {"maintitle": u"Enviar un archivo", + "submit": u"Enviar", + "sending": u"Enviando", + "successtitle": u"Archivo recibido", + "received": u"¡Archivo recibido!", + "another": u"Enviar otro archivo.", + "errortitle": u"Error", + "problem": u"¡Hubo un problema!", + "retry": u"Reintentar", + "discover": u"Descubrir la dirección de esta página"} + +fi = {"maintitle": u"Lähetä tiedosto", + "submit": u"Lähetä", + "sending": u"Lähettää", + "successtitle": u"Tiedosto vastaanotettu", + "received": u"Tiedosto vastaanotettu!", + "another": u"Lähetä toinen tiedosto.", + "errortitle": u"Virhe", + "problem": u"Virhe lahetettäessä tiedostoa!", + "retry": u"Uudelleen.", + "discover": u"Näytä tämän sivun osoite"} + +fr = {"maintitle": u"Envoyer un fichier", + "submit": u"Envoyer", + "sending": u"Envoi en cours", + "successtitle": u"Fichier reçu", + "received": u"Fichier reçu !", + "another": u"Envoyer un autre fichier.", + "errortitle": u"Problème", + "problem": u"Il y a eu un problème !", + "retry": u"Réessayer.", + "discover": u"Découvrir l'adresse de cette page"} + +gl = {"maintitle": u"Enviar un ficheiro", + "submit": u"Enviar", + "sending": u"Enviando", + "successtitle": u"Ficheiro recibido", + "received": u"Ficheiro recibido!", + "another": u"Enviar outro ficheiro.", + "errortitle": u"Erro", + "problem": u"Xurdíu un problema!", + "retry": u"Reintentar", + "discover": u"Descubrir o enderezo desta páxina"} + +hu = {"maintitle": u"Állomány küldése", + "submit": u"Küldés", + "sending": u"Küldés folyamatban", + "successtitle": u"Az állomány beérkezett", + "received": u"Az állomány beérkezett!", + "another": u"További állományok küldése", + "errortitle": u"Hiba", + "problem": u"Egy hiba lépett fel!", + "retry": u"Megismételni", + "discover": u"Az oldal Internet-címének megállapítása"} + +id = {"maintitle": "Kirim sebuah berkas", + "submit": "Kirim", + "sending": "Mengirim", + "successtitle": "Berkas diterima", + "received": "Berkas diterima!", + "another": "Kirim berkas yang lain.", + "errortitle": "Permasalahan", + "problem": "Telah ditemukan sebuah kesalahan!", + "retry": "Coba kembali.", + "discover": "Kenali alamat IP dari halaman ini"} + +it = {"maintitle": u"Invia un file", + "submit": u"Invia", + "sending": u"Invio in corso", + "successtitle": u"File ricevuto", + "received": u"File ricevuto!", + "another": u"Invia un altro file.", + "errortitle": u"Errore", + "problem": u"Si è verificato un errore!", + "retry": u"Riprova.", + "discover": u"Scopri l’indirizzo di questa pagina"} + +ja = {"maintitle": u"ファイル送信", + "submit": u"送信", + "sending": u"送信中", + "successtitle": u"受信完了", + "received": u"ファイルを受信しました!", + "another": u"他のファイルを送信する", + "errortitle": u"問題発生", + "problem": u"問題が発生しました!", + "retry": u"リトライ", + "discover": u"このページのアドレスを確認する"} + +ko = {"maintitle": u"파일 보내기", + "submit": u"보내기", + "sending": u"보내는 중", + "successtitle": u"파일이 받아졌습니다", + "received": u"파일이 받아졌습니다!", + "another": u"다른 파일 보내기", + "errortitle": u"문제가 발생했습니다", + "problem": u"문제가 발생했습니다!", + "retry": u"다시 시도", + "discover": u"이 페이지 주소 알아보기"} + +nl = {"maintitle": "Verstuur een bestand", + "submit": "Verstuur", + "sending": "Bezig met versturen", + "successtitle": "Bestand ontvangen", + "received": "Bestand ontvangen!", + "another": "Verstuur nog een bestand.", + "errortitle": "Fout", + "problem": "Er is een fout opgetreden!", + "retry": "Nog eens.", + "discover": "Vind het adres van deze pagina"} + +no = {"maintitle": u"Send en fil", + "submit": u"Send", + "sending": u"Sender", + "successtitle": u"Fil mottatt", + "received": u"Fil mottatt !", + "another": u"Send en ny fil.", + "errortitle": u"Feil", + "problem": u"Det har skjedd en feil !", + "retry": u"Send på nytt.", + "discover": u"Finn addressen til denne siden"} + +pl = {"maintitle": u"Wyślij plik", + "submit": u"Wyślij", + "sending": u"Wysyłanie", + "successtitle": u"Plik wysłany", + "received": u"Plik wysłany!", + "another": u"Wyślij kolejny plik.", + "errortitle": u"Problem", + "problem": u"Wystąpił błąd!", + "retry": u"Spróbuj ponownie.", + "discover": u"Znajdź adres tej strony"} + +pt = {"maintitle": u"Enviar um ficheiro", + "submit": u"Enviar", + "sending": u"A enviar", + "successtitle": u"Ficheiro recebido", + "received": u"Ficheiro recebido !", + "another": u"Enviar outro ficheiro.", + "errortitle": u"Erro", + "problem": u"Ocorreu um erro !", + "retry": u"Tentar novamente.", + "discover": u"Descobrir o endereço desta página"} + +pt_br = { + "maintitle": u"Enviar um arquivo", + "submit": u"Enviar", + "sending": u"Enviando", + "successtitle": u"Arquivo recebido", + "received": u"Arquivo recebido!", + "another": u"Enviar outro arquivo.", + "errortitle": u"Erro", + "problem": u"Ocorreu um erro!", + "retry": u"Tentar novamente.", + "discover": u"Descobrir o endereço desta página"} + +ro = {"maintitle": u"Trimite un fişier", + "submit": u"Trimite", + "sending": u"Se trimite", + "successtitle": u"Fişier recepţionat", + "received": u"Fişier recepţionat !", + "another": u"Trimite un alt fişier.", + "errortitle": u"Problemă", + "problem": u"A intervenit o problemă !", + "retry": u"Reîncearcă.", + "discover": u"Descoperă adresa acestei pagini"} + +ru = {"maintitle": u"Отправить файл", + "submit": u"Отправить", + "sending": u"Отправляю", + "successtitle": u"Файл получен", + "received": u"Файл получен !", + "another": u"Отправить другой файл.", + "errortitle": u"Ошибка", + "problem": u"Произошла ошибка !", + "retry": u"Повторить.", + "discover": u"Посмотреть адрес этой страницы"} + +sk = {"maintitle": u"Pošli súbor", + "submit": u"Pošli", + "sending": u"Posielam", + "successtitle": u"Súbor prijatý", + "received": u"Súbor prijatý !", + "another": u"Poslať ďalší súbor.", + "errortitle": u"Chyba", + "problem": u"Vyskytla sa chyba!", + "retry": u"Skúsiť znova.", + "discover": u"Zisti adresu tejto stránky"} + +sl = {"maintitle": u"Pošlji datoteko", + "submit": u"Pošlji", + "sending": u"Pošiljam", + "successtitle": u"Datoteka prejeta", + "received": u"Datoteka prejeta !", + "another": u"Pošlji novo datoteko.", + "errortitle": u"Napaka", + "problem": u"Prišlo je do napake !", + "retry": u"Poizkusi ponovno.", + "discover": u"Poišči naslov na tej strani"} + +sr = {"maintitle": u"Pošalji fajl", + "submit": u"Pošalji", + "sending": u"Šaljem", + "successtitle": u"Fajl primljen", + "received": u"Fajl primljen !", + "another": u"Pošalji još jedan fajl.", + "errortitle": u"Problem", + "problem": u"Desio se problem !", + "retry": u"Pokušaj ponovo.", + "discover": u"Otkrij adresu ove stranice"} + +sv = {"maintitle": u"Skicka en fil", + "submit": u"Skicka", + "sending": u"Skickar...", + "successtitle": u"Fil mottagen", + "received": u"Fil mottagen !", + "another": u"Skicka en fil till.", + "errortitle": u"Fel", + "problem": u"Det har uppstått ett fel !", + "retry": u"Försök igen.", + "discover": u"Ta reda på adressen till denna sida"} + +tr = {"maintitle": u"Dosya gönder", + "submit": u"Gönder", + "sending": u"Gönderiliyor...", + "successtitle": u"Gönderildi", + "received": u"Gönderildi", + "another": u"Başka bir dosya gönder.", + "errortitle": u"Problem.", + "problem": u"Bir problem oldu !", + "retry": u"Yeniden dene.", + "discover": u"Bu sayfanın adresini bul"} + +zh_cn = { + "maintitle": u"发送文件", + "submit": u"发送", + "sending": u"发送中", + "successtitle": u"文件已收到", + "received": u"文件已收到!", + "another": u"发送另一个文件。", + "errortitle": u"问题", + "problem": u"出现问题!", + "retry": u"重试。", + "discover": u"查看本页面的地址"} + +zh_tw = { + "maintitle": u"上傳檔案", + "submit": u"上傳", + "sending": u"傳送中...", + "successtitle": u"已收到檔案", + "received": u"已收到檔案!", + "another": u"上傳另一個檔案。", + "errortitle": u"錯誤", + "problem": u"出現錯誤!", + "retry": u"重試。", + "discover": u"查閱本網頁的網址"} + +translations = {"ar": ar, "cs": cs, "da": da, "de": de, "el": el, "en": en, + "es": es, "fi": fi, "fr": fr, "gl": gl, "hu": hu, "id": id, + "it": it, "ja": ja, "ko": ko, "nl": nl, "no": no, "pl": pl, + "pt": pt, "pt-br": pt_br, "ro": ro, "ru": ru, "sk": sk, + "sl": sl, "sr": sr, "sv": sv, "tr": tr, "zh-cn": zh_cn, + "zh-tw": zh_tw} + + +class DroopyFieldStorage(cgi.FieldStorage): + """The file is created in the destination directory and its name is + stored in the tmpfilename attribute. + """ + + TMPPREFIX = 'tmpdroopy' + + def make_file(self, binary=None): + fd, name = tempfile.mkstemp(dir=directory, prefix=self.TMPPREFIX) + self.tmpfile = os.fdopen(fd, 'w+b') + self.tmpfilename = name + return self.tmpfile + + +class HTTPUploadHandler(BaseHTTPServer.BaseHTTPRequestHandler): + + protocol_version = 'HTTP/1.0' + form_field = 'upfile' + divpicture = '

' + + + def _safername(self,name): + """ Checking whether we can make a directory-name out of this name + Thanks to stackoverflow, Vinko Vrsalovic + """ + valid_chars = frozenset("-_() %s%s" % (string.letters, string.digits)) + name2 = ''.join(c for c in name if c in valid_chars) + if len(name) == 0: + return anondir + if name2 == name: + return name.encode('utf8') + else: + print('WARNING: name too complex; try %s'%name2) + return False + + + def _mkuserpath(self,userdir,filename): + mydir = directory + "/" + userdir + if (os.path.exists(mydir)): + localpath = os.path.join(mydir, filename).encode('utf-8') + else: + try: + os.mkdir(mydir) + except IOError: + print ("can't make directory") + else: + localpath = os.path.join(mydir, filename).encode('utf-8') + return localpath + + def _login(self,subdir, passwd ): + """ Allow user to provide subdirectory & write access password. + This offers little security, but helps organization + returns success,NAME + """ + name = self._safername( subdir.lower() ) + password = passwd #safename( passwd ) + + if (name == "" or name == anondir) : + return (True, anondir ) # don't let people set password on anon + try: + pairs = load(open(password_file)) + except IOError: + print('WARNING: No password file found. Starting from scratch.') + pairs = {} + if name in pairs: + if pairs[name] == password: + return True,name + else: + print('ERROR: wrong password') + return False,"BadPassword" + else: + print('INFO: Adding subdir %s to the system'%name) + pairs[name] = password + dump(pairs, open(password_file, 'w')) + return True,name + + + + def html(self, page, errormsg=""): + """ + page can be "main", "success", or "error" + returns an html page (in the appropriate language) as a string + """ + + # -- Parse accept-language header + if not self.headers.has_key("accept-language"): + a = [] + else: + a = self.headers["accept-language"] + a = a.split(',') + a = [e.split(';q=') for e in a] + a = [(lambda x: len(x)==1 and (1, x[0]) or + (float(x[1]), x[0])) (e) for e in a] + a.sort() + a.reverse() + a = [x[1] for x in a] + # now a is an ordered list of preferred languages + + # -- Choose the appropriate translation dictionary (default is english) + lang = "en" + for l in a: + if translations.has_key(l): + lang = l + break + dico = copy.copy(translations[lang]) + + # -- Set message and picture + if message: + dico["message"] = ('
%s
' % + message) + else: + dico["message"] = "" + + if picture != None: + dico["divpicture"] = self.divpicture + else: + dico["divpicture"] = "" + + # -- Possibly provide download links + links = "" + names = self.published_files() + if names: + for name in names: + links += '%s' % ( + urllib.quote(name.encode('utf-8')), + name) + links = '
' + links + '
' + dico["files"] = links + + # -- Add a link to discover the url + if self.client_address[0] == "127.0.0.1": + dico["port"] = self.server.server_port + dico["ssl"] = int(certfile is not None) + dico["linkurl"] = linkurltmpl % dico + else: + dico["linkurl"] = "" + + if (userdirs == True): + dico["userdiropts"] = userdirform % dico + else: + dico["userdiropts"] = '' + + dico["problem"] = "" + if (errormsg != ""): + if dico[errormsg]: + dico["problem"]=dico[errormsg] + + return templates[page] % dico + + def check_auth(method): + def decorated(self, *args): + if auth and self.headers.getheader('Authorization') != \ + 'Basic ' + base64.b64encode(auth): + self.send_response(401) + self.send_header('WWW-Authenticate', 'Basic realm=\"Droopy\"') + self.send_header('Content-type', 'text/html') + self.end_headers() + else: + method(self, *args) + return decorated + + @check_auth + def do_GET(self): + name = self.path.lstrip('/') + name = urllib.unquote(name) + name = name.decode('utf-8') + + if picture != None and self.path == '/__droopy/picture': + # send the picture + self.send_file(picture) + + elif name in self.published_files(): + localpath = os.path.join(directory, name) + self.send_file(localpath) + + else: + self.send_html(self.html("main")) + + + @check_auth + def do_POST(self): + # Do some browsers /really/ use multipart ? maybe Opera ? + try: + self.log_message("Started file transfer") + + # -- Set up environment for cgi.FieldStorage + env = {} + env['REQUEST_METHOD'] = self.command + if self.headers.typeheader is None: + env['CONTENT_TYPE'] = self.headers.type + else: + env['CONTENT_TYPE'] = self.headers.typeheader + + # -- Save file (numbered to avoid overwriting, ex: foo-3.png) + form = DroopyFieldStorage(fp = self.rfile, environ = env); + file_items = form[self.form_field] + + #-- Handle multiple file upload + if not isinstance(file_items, list): + file_items = [file_items] + + for item in file_items: + filename = self.basename(item.filename).decode('utf-8') + if filename == "": + continue + + + 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() + continue + + + localpath ='' + if (userdirs == True ): + subdir = form['subdir'].value + passwd = form['secret'].value + success,userdir=self._login(subdir, passwd ) + if success == False: + self.send_html(self.html("error","subdirerror")) + #os.unlink(fileitem.tmpfilename) + return + else: + if (userdir == anondir or userdir == ''): + if ( useAnondir == 0): + localpath = None + else: + localpath=self._mkuserpath(anondir,filename) + else: + localpath=self._mkuserpath(userdir,filename) + + + localpath = os.path.join(directory, filename).encode('utf-8') + root, ext = os.path.splitext(localpath) + i = 1 + + # race condition, but hey... + while (os.path.exists(localpath)): + localpath = "%s-%d%s" % (root, i, ext) + i = i + 1 + if hasattr(item, 'tmpfile'): + # DroopyFieldStorage.make_file() has been called + item.tmpfile.close() + shutil.move(item.tmpfilename, localpath) + else: + # no temporary file, self.file is a StringIO() + # see cgi.FieldStorage.read_lines() + fout = file(localpath, 'wb') + shutil.copyfileobj(item.file, fout) + fout.close() + + if file_mode is not None: + os.chmod(localpath, file_mode) + self.log_message("Received: %s", os.path.basename(localpath)) + + # -- Reply + if publish_files: + # The file list gives a feedback for the upload + # success + self.send_response(301) + self.send_header("Location", "/") + self.end_headers() + else: + self.send_html(self.html("success")) + + except Exception, e: + self.log_message(repr(e)) + self.send_html(self.html("error")) + + + def send_html(self, htmlstr): + self.send_response(200) + self.send_header('Content-type','text/html; charset=utf-8') + self.end_headers() + self.wfile.write(htmlstr.encode('utf-8')) + + def send_file(self, localpath): + f = open(localpath, 'rb') + self.send_response(200) + self.send_header('Content-type', + mimetypes.guess_type(localpath)[0]) + self.send_header('Content-length', os.fstat(f.fileno())[6]) + self.end_headers() + shutil.copyfileobj(f, self.wfile) + + def basename(self, path): + """Extract the file base name (some browsers send the full file path). + """ + for mod in posixpath, macpath, ntpath: + path = mod.basename(path) + return path + + def published_files(self): + """Returns the list of files that should appear as download links. + + The returned filenames are unicode strings. + """ + if publish_files: + # os.listdir() returns a list of unicode strings when the + # directory is passed as an unicode string itself. + names = [name for name in os.listdir(unicode(directory)) + if os.path.isfile(os.path.join(directory, name)) + and not name.startswith(DroopyFieldStorage.TMPPREFIX)] + names.sort(key=lambda s: s.lower()) + else: + names = [] + return names + + def handle(self): + try: + BaseHTTPServer.BaseHTTPRequestHandler.handle(self) + except socket.error, e: + self.log_message(str(e)) + raise Abort() + + +class Abort(Exception): pass + + +class ThreadedHTTPServer(SocketServer.ThreadingMixIn, + BaseHTTPServer.HTTPServer): + + def handle_error(self, request, client_address): + # Override SocketServer.handle_error + exctype = sys.exc_info()[0] + if not exctype is Abort: + BaseHTTPServer.HTTPServer.handle_error(self,request,client_address) + + +# -- Options + +def fullpath(path): + return os.path.abspath(os.path.expanduser(path)) + +def configfile(): + appname = 'droopy' + # os.name is 'posix', 'nt', 'os2', 'mac', 'ce' or 'riscos' + if os.name == 'posix': + getenv = CDLL("libc.so.6").getenv + getenv.restype = c_char_p + filename = "%s/.%s" % (getenv("HOME"), appname) + + elif os.name == 'mac': + filename = ("%s/Library/Application Support/%s" % + (os.environ["HOME"], appname)) + + elif os.name == 'nt': + filename = ("%s\%s" % (os.environ["APPDATA"], appname)) + + else: + filename = None + + return filename + + +def save_options(): + opt = [] + if message: + opt.append('--message=%s' % message.replace('\n', '\\n')) + if picture: + opt.append('--picture=%s' % picture) + if directory: + opt.append('--directory=%s' % directory) + if auth: + opt.append('--auth=%s' % auth) + if certfile: + opt.append('--ssl=%s' % certfile) + if file_mode: + opt.append('--chmod=%s' % file_mode) + if publish_files: + opt.append('--dl') + if port: + opt.append('%d' % port) + f = open(configfile(), 'w') + f.write('\n'.join(opt).encode('utf8')) + f.close() + + +def load_options(): + try: + f = open(configfile()) + cmd = [line.strip().decode('utf8').replace('\\n', '\n') + for line in f.readlines()] + parse_args(cmd) + f.close() + return True + except IOError, e: + return False + + +def parse_args(cmd=None): + """Parse command-line arguments. + + Parse sys.argv[1:] if no argument is passed. + """ + global picture, message, port, directory, must_save_options, publish_files + global auth, certfile, file_mode + global userdirs + + if cmd == None: + cmd = sys.argv[1:] + lang, encoding = locale.getdefaultlocale() + if encoding != None: + cmd = [a.decode(encoding) for a in cmd] + + opts, args = None, None + try: + opts, args = getopt.gnu_getopt(cmd, "p:m:d:a:u:h", + ["picture=","message=", "directory=", + "auth=", "ssl=", "chmod=", "help", "userdirs", + "save-config", "delete-config", "dl"]) + except Exception, e: + print e + sys.exit(1) + + for o, a in opts: + if o in ["-p", "--picture"]: + if os.path.exists(a): + picture = fullpath(a) + else: + print "Picture not found: '%s'" % a + + elif o in ["-m", "--message"]: + message = a + + elif o in ['-d', '--directory']: + directory = fullpath(a) + + elif o in ["-u", "--userdirs" ] : + userdirs = True + print "userdirs are %s" %userdirs + + elif o in ['--save-config']: + must_save_options = True + + elif o in ['--delete-config']: + try: + filename = configfile() + os.remove(filename) + print 'Deleted ' + filename + except Exception, e: + print e + sys.exit(0) + + elif o in ['--dl']: + publish_files = True + + elif o in ['-a', '--auth']: + if ':' not in a: + print "Error: authentication credentials must be " \ + "specified as USER:PASSWORD" + sys.exit(1) + auth = a + + elif o in ['--ssl']: + if not os.path.isfile(a): + print "PEM file not found: '%s'" % a + sys.exit(1) + certfile = fullpath(a) + + elif o in ['--chmod']: + try: + file_mode = int(a, 8) + except ValueError: + print "Invalid octal value passed to chmod option: '%s'" % a + sys.exit(1) + + + elif o in ['-h', '--help']: + print USAGE + sys.exit(0) + + # port number + try: + if args[0:]: + port = int(args[0]) + except ValueError: + print args[0], "is not a valid port number" + sys.exit(1) + + +# -- + +def run(): + """Run the webserver.""" + socket.setdefaulttimeout(3*60) + server_address = ('', port) + httpd = ThreadedHTTPServer(server_address, HTTPUploadHandler) + if certfile: + try: + import ssl + except: + print "Error: Could not import module 'ssl', exiting." + sys.exit(2) + httpd.socket = ssl.wrap_socket(httpd.socket, certfile=certfile, + server_side=True) + httpd.serve_forever() + + +if __name__ == '__main__': + print LOGO + + config_found = load_options() + parse_args() + + if config_found: + print 'Configuration found in %s' % configfile() + else: + print "No configuration file found." + + if must_save_options: + save_options() + print "Options saved in %s" % configfile() + + proto = 'https' if certfile else 'http' + print "Files will be uploaded to %s" % directory + print + print ("HTTP server running... Check it out at %s://localhost:%d" + % (proto, port)) + try: + run() + except KeyboardInterrupt: + print '^C received, shutting down server' + # some threads may run until they terminate diff --git a/piratebox/piratebox/bin/firewall.sh b/piratebox/piratebox/bin/firewall.sh new file mode 100755 index 0000000..606892e --- /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/bin/flush_dnsmasq.sh b/piratebox/piratebox/bin/flush_dnsmasq.sh new file mode 100755 index 0000000..09f939b --- /dev/null +++ b/piratebox/piratebox/bin/flush_dnsmasq.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# by Matthias Strubel , 2012 +# +# Sends a SIGHUB to dnsmasq to reread its hosts files +# Needed for mesh feature. Will enable easy dns-service for this. + +PIDFILE_DNSMASQ=/var/run/piratebox_dnsmasq.pid + +kill -1 `cat $PIDFILE_DNSMASQ` + diff --git a/piratebox/piratebox/bin/generate_config_files.sh b/piratebox/piratebox/bin/generate_config_files.sh new file mode 100755 index 0000000..3d063a2 --- /dev/null +++ b/piratebox/piratebox/bin/generate_config_files.sh @@ -0,0 +1,228 @@ +#!/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 +# conf/dnsmasq_default.conf +# +# it is using the following VARS out of piratebox.conf: +# NET = The network of your box i.e. 192.168.1 +# IP_SHORT = The ip of the piratebox i.e. 1 results 192.168.1.1 +# START_LEASE = Range of dhcp leases start 10 +# END_LEASE = end 250 +# LEASE_DURATION = lease time 30min +# HOSTNAME = piratebox.lan - o'rly? Maybe generate some additional stuff here +# - +# GLOBAL_CHAT = Enable Broadcasts +# GLOBAL_DEST = Broadcast IP destinations +# PYTHONPATH = Path of PirateBox python libs +# 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 + +CONFIG_PATH="conf" +DNSMASQ_CONFIG="" +HOSTS_CONFIG="" +DEFAULT_HOSTS="" +LEASE_FILE="" +RADVD_CONFIG="" +LIGHTTPD_ENV_CONFIG="" +AVAHI_SRC="" +AVAHI_CONFIG="" + +set_pathnames() { + CONFIG_PATH=$1/conf + DNSMASQ_CONFIG=$CONFIG_PATH/dnsmasq_generated.conf + HOSTS_CONFIG=$CONFIG_PATH/hosts_generated + HOSTS_MESH=$CONFIG_PATH/hosts_mesh + DEFAULT_HOSTS=$CONFIG_PATH/hosts + DEFAULT_DNSMASQ=$CONFIG_PATH/dnsmasq_default.conf + 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() { + set_hostname=$1 + set_ipv4=$2 + set_ipv6=$3 + echo "Generating hosts file .... " + cat $DEFAULT_HOSTS > $HOSTS_CONFIG + echo "$set_ipv4 $set_hostname " >> $HOSTS_CONFIG + echo "$set_ipv6 $set_hostname " >> $HOSTS_CONFIG + +} + +generate_dnsmasq() { + net=$1 + lease_start=$3 + lease_end=$4 + lease_time=$5 + ip_pb=$2 + dnsmasq_interface=$6 + echo "Generating dnsmasq.conf ....." + cat $DEFAULT_DNSMASQ > $DNSMASQ_CONFIG + + #Add interface line if filled + [ -n $dnsmasq_interface ] && echo "interface=$dnsmasq_interface" >> $DNSMASQ_CONFIG + + lease_line="$net.$lease_start,$net.$lease_end,$lease_time" + echo "dhcp-range=$lease_line" >> $DNSMASQ_CONFIG + #redirect every dns + dns_redirect="/#/$net.$ip_pb" + echo "address=$dns_redirect" >> $DNSMASQ_CONFIG + echo "dhcp-leasefile=$LEASE_FILE" >> $DNSMASQ_CONFIG + + echo "addn-hosts=$HOSTS_CONFIG" >>$DNSMASQ_CONFIG + + #Mesh hosts + echo "addn-hosts=$HOSTS_MESH" >> $DNSMASQ_CONFIG + + if [ "$IPV6_ENABLE" = "yes" ] && [ "$IPV6_ADVERT" = "dnsmasq" ] ; then + echo "Do additional v6 stuff in dnsmasq.conf" + echo "#----- V6 Stuff" >> $DNSMASQ_CONFIG + echo "dchp-range=$ipv6_call::, ra-stateless" >> $DNSMASQ_CONFIG + fi + +} + +generate_radvd(){ + prefix=$1 + mask=$2 + interface=$3 + + echo "Generating config for radvd.." + echo "#---- generated file ---" > $RADVD_CONFIG + echo " + interface $interface { + AdvSendAdvert on; + MinRtrAdvInterval 3; + MaxRtrAdvInterval 10; + prefix $prefix::/$mask { + AdvOnLink on; + AdvAutonomous on; + AdvRouterAddr on; + }; + }; + " >> $RADVD_CONFIG + +} + +#------------ lighttpd env config - Start --------------------- + +generate_lighttpd_env() { + local GLOBAL_CHAT=$1 + local GLOBAL_DEST="$2" + local PYTHONPATH=$3 + local SHOUTBOX_GEN_HTMLFILE=$4 + local PIRATEBOX=$5 + local SHOUTBOX_CHATFILE=$6 + local SHOUTBOX_CLIENT_TIMESTAMP=$7 + local IN_UPLOAD_PATH=$8 + local DISK_GEN_HTMLFILE=$9 + + echo "Generating Environment-config for lighttpd ....." + + LIGHTTPD_ENV_BR_LINE="" + if [ "$GLOBAL_CHAT" = "yes" ] ; then + LIGHTTPD_ENV_BR_LINE=" \"SHOUTBOX_BROADCAST_DESTINATIONS\" => \"$GLOBAL_DEST\" , " + fi + + LIGHTTPD_ENV="setenv.add-environment = ( + \"PYTHONPATH\" => \"$PYTHONPATH:$PIRATEBOX/python_lib\", + \"SHOUTBOX_GEN_HTMLFILE\" => \"$SHOUTBOX_GEN_HTMLFILE\" , + \"SHOUTBOX_CHATFILE\" => \"$SHOUTBOX_CHATFILE\" , + \"SHOUTBOX_CLIENT_TIMESTAMP\" => \"$SHOUTBOX_CLIENT_TIMESTAMP\" , + \"UPLOAD_PATH\" => \"$IN_UPLOAD_PATH\" , + \"DISK_GEN_HTMLFILE\" => \"$DISK_GEN_HTMLFILE\" , + $LIGHTTPD_ENV_BR_LINE + + )" + + echo $LIGHTTPD_ENV > $LIGHTTPD_ENV_CONFIG +} + +#------------ lighttpd env config - End --------------------- + + + +if [ -z $1 ] ; then + echo "Usage is + generate_config_files.sh /opt/piratebox/conf/piratebox.conf + " + exit 255 +fi + +if [ ! -f $1 ] ; then + echo "Config-File $1 not found..." + exit 255 +fi + +. $1 + +. $NODE_CONFIG +. $PIRATEBOX_FOLDER/lib/node_name_generation.sh + +IPV6="#" + +set_pathnames $PIRATEBOX_FOLDER + +ipv6_call='' +if [ "$IPV6_ENABLE" = "yes" ] ; then + ipv6_call=$IPV6_PREFIX + 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 $SHOUTBOX_CLIENT_TIMESTAMP $UPLOADFOLDER $GEN_DISKFILE + +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/bin/hooks/hook_piratebox_start.sh b/piratebox/piratebox/bin/hooks/hook_piratebox_start.sh new file mode 100755 index 0000000..6d110e6 --- /dev/null +++ b/piratebox/piratebox/bin/hooks/hook_piratebox_start.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# ---- TEMPLATE ---- + +# Runs on every Startup +# get config file + +if [ ! -f $1 ] ; then + echo "Config-File $1 not found..." + exit 255 +fi + +#Load config +. $1 + +# You can uncommend this line to see when hook is starting: +# echo "------------------ Running $0 ------------------" + diff --git a/piratebox/piratebox/bin/hooks/hook_piratebox_start_done.sh b/piratebox/piratebox/bin/hooks/hook_piratebox_start_done.sh new file mode 100755 index 0000000..01bf40d --- /dev/null +++ b/piratebox/piratebox/bin/hooks/hook_piratebox_start_done.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# ---- TEMPLATE ---- + +# Runs on every Startup after the normal init-steps are done +# get config file + +if [ ! -f $1 ] ; then + echo "Config-File $1 not found..." + exit 255 +fi + +#Load config +. $1 + +# You can uncommend this line to see when hook is starting: +# echo "------------------ Running $0 ------------------" + diff --git a/piratebox/piratebox/bin/hooks/hook_piratebox_stop.sh b/piratebox/piratebox/bin/hooks/hook_piratebox_stop.sh new file mode 100755 index 0000000..1c09a82 --- /dev/null +++ b/piratebox/piratebox/bin/hooks/hook_piratebox_stop.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# ---- TEMPLATE ---- + +# Runs on every Stop before anything is stopped +# get config file + +if [ ! -f $1 ] ; then + echo "Config-File $1 not found..." + exit 255 +fi + +#Load config +. $1 + +# You can uncommend this line to see when hook is starting: +# echo "------------------ Running $0 ------------------" + diff --git a/piratebox/piratebox/bin/hooks/hook_piratebox_stop_done.sh b/piratebox/piratebox/bin/hooks/hook_piratebox_stop_done.sh new file mode 100755 index 0000000..a315e97 --- /dev/null +++ b/piratebox/piratebox/bin/hooks/hook_piratebox_stop_done.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# ---- TEMPLATE ---- + +# Rund after every stop command is processed +# get config file + +if [ ! -f $1 ] ; then + echo "Config-File $1 not found..." + exit 255 +fi + +#Load config +. $1 + +# You can uncommend this line to see when hook is starting: +# echo "------------------ Running $0 ------------------" + diff --git a/piratebox/piratebox/bin/hooks/hook_post_init.sh b/piratebox/piratebox/bin/hooks/hook_post_init.sh new file mode 100755 index 0000000..0b11eb5 --- /dev/null +++ b/piratebox/piratebox/bin/hooks/hook_post_init.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# ---- TEMPLATE ---- + +# Hook for modifcation stuff right after +# piratebox/bin/install ... part2 +# is run. + +if [ ! -f $1 ] ; then + echo "Config-File $1 not found..." + exit 255 +fi + +#Load config +. $1 + +# You can uncommend this line to see when hook is starting: +# echo "------------------ Running $0 ------------------" + diff --git a/piratebox/piratebox/bin/hooks/hook_pre_init.sh b/piratebox/piratebox/bin/hooks/hook_pre_init.sh new file mode 100755 index 0000000..06ad2b7 --- /dev/null +++ b/piratebox/piratebox/bin/hooks/hook_pre_init.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# ---- TEMPLATE ---- + +# Hook for modifcation stuff before +# piratebox/bin/install ... part2 +# is run. + +if [ ! -f $1 ] ; then + echo "Config-File $1 not found..." + exit 255 +fi + +#Load config +. $1 + +# You can uncommend this line to see when hook is starting: +# echo "------------------ Running $0 ------------------" + diff --git a/piratebox/piratebox/bin/hooks/hook_pre_openwrt_init.sh b/piratebox/piratebox/bin/hooks/hook_pre_openwrt_init.sh new file mode 100755 index 0000000..a40fe6f --- /dev/null +++ b/piratebox/piratebox/bin/hooks/hook_pre_openwrt_init.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# ---- TEMPLATE ---- + +# Hook for modifcation stuff before +# piratebox/bin/install ... openwrt +# is started + + +if [ ! -f $1 ] ; then + echo "Config-File $1 not found..." + exit 255 +fi + +#Load config +. $1 + +#Load openwrt-common config and procedures file! +. /etc/piratebox.config + + +# You can uncommend this line to see when hook is starting: +# echo "------------------ Running $0 ------------------" diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh new file mode 100755 index 0000000..7a6e932 --- /dev/null +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -0,0 +1,176 @@ +#!/bin/sh +## PirateBox installer script +## 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 + echo "Usage install_piratebox my_config " + echo " Parts: " + echo " part2 : sets Permissions and links correctly" + echo " imageboard : configures kareha imageboard with Basic configuration" + echo " should be installed in /share/board" + echo " pyForum : Simple PythonForum" + echo " station_cnt : Adds Statio counter to your Box - crontab entry" + echo " flush_dns_reg : Installs crontask to flush dnsmasq regulary" + echo " hostname 'name' : Exchanges the Hostname displayed in browser" + exit 1 +fi + + +if [ ! -f $1 ] ; then + echo "Config-File $1 not found..." + exit 1 +fi + +#Load config +PIRATEBOX_CONFIG=$1 +. $1 + +if [ $2 = 'pyForum' ] ; then + cp -v $PIRATEBOX_FOLDER/src/forest.py $WWW_FOLDER/cgi-bin + cp -v $PIRATEBOX_FOLDER/src/forest.css $WWW_FOLDER/content/css + mkdir -p $PIRATEBOX_FOLDER/forumspace + chmod a+rw -R $PIRATEBOX_FOLDER/forumspace 2> /dev/null + chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $WWW_FOLDER/cgi-bin/forest.py + chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $WWW_FOLDER/content/forest.css 2> /dev/null + echo "Copied the files. Recheck your PirateBox now. " +fi + + + +if [ $2 = 'part2' ] ; then + echo "Starting initialize PirateBox Part2.." +#Create directories +# mkdir -p $PIRATEBOX_FOLDER/share/Shared + mkdir -p $UPLOADFOLDER + mkdir -p $PIRATEBOX_FOLDER/share/board + mkdir -p $PIRATEBOX_FOLDER/share/tmp + mkdir -p $PIRATEBOX_FOLDER/tmp + + #Distribute the Directory Listing files + $PIRATEBOX_FOLDER/bin/distribute_files.sh $SHARE_FOLDER/Shared true + #Set permissions + chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $PIRATEBOX_FOLDER/share -R + chmod u+rw $PIRATEBOX_FOLDER/share + chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $PIRATEBOX_FOLDER/www -R + chmod u+x $PIRATEBOX_FOLDER/www/cgi-bin/* + chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $PIRATEBOX_FOLDER/tmp + chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $PIRATEBOX_FOLDER/tmp -R + + +#Install a small script, that the link on the main page still works + if [ ! -f $PIRATEBOX_FOLDER/share/board/kareha.pl ] ; then + cp $PIRATEBOX_FOLDER/src/kareha.pl $PIRATEBOX_FOLDER/share/board + fi + + [ ! -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 + [ ! -L $PIRATEBOX_FOLDER/www/content ] && \ + ln -s $WWW_CONTENT $WWW_FOLDER/content + +fi + +#Install the image-board +if [ $2 = 'imageboard' ] ; then + + if [ -e $PIRATEBOX_FOLDER/share/board/init_done ] ; then + echo "$PIRATEBOX_FOLDER/share/board/init_done file Found in Kareha folder. Won't reinstall board." + exit 0; + fi + + + cd $PIRATEBOX_FOLDER/tmp + KAREHA_RELEASE=kareha_3.1.4.zip + 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 + echo "Kareha Zip found..." + else + echo "No Zip found, abort " + exit 255 + fi + + unzip $KAREHA_RELEASE + mv kareha/* $PIRATEBOX_FOLDER/share/board + rm -rf $PIRATEBOX_FOLDER/tmp/kareha* + + cd $PIRATEBOX_FOLDER/share/board + cp -R mode_image/* ./ + cp $PIRATEBOX_FOLDER/src/kareha_img_config.pl $PIRATEBOX_FOLDER/share/board/config.pl + cp $PIRATEBOX_FOLDER/src/no_forum.html $PIRATEBOX_FOLDER/share/board/index.htm + chown -R $LIGHTTPD_USER:$LIGHTTPD_GROUP $PIRATEBOX_FOLDER/share/board + #Install filetype thumbnails + mv $PIRATEBOX_FOLDER/share/board/extras/icons $PIRATEBOX_FOLDER/share/board/ + + echo "Errors in chown occurs if you are using vfat on the USB stick" + echo " . don't Panic!" + echo "Generating index page" + cd /tmp + wget -q http://127.0.0.1/board/kareha.pl + echo "finished!" + echo "Now Edit your kareha settings file to change your ADMIN_PASS and SECRET : " + echo " # vi $PIRATEBOX_FOLDER/www/board/config.pl " + + touch $PIRATEBOX_FOLDER/share/board/init_done +fi + +if [ $2 = "station_cnt" ] ; then + #we want to append the crontab, not overwrite + crontab -l > $PIRATEBOX_FOLDER/tmp/crontab 2> /dev/null + echo "#--- Crontab for PirateBox-Station-Cnt" >> $PIRATEBOX_FOLDER/tmp/crontab + echo " */2 * * * * $PIRATEBOX_FOLDER/bin/station_cnt.sh > $WWW_FOLDER/station_cnt.txt " >> $PIRATEBOX_FOLDER/tmp/crontab + crontab $PIRATEBOX_FOLDER/tmp/crontab + [ "$?" != "0" ] && echo "an error occured" && exit 254 + $PIRATEBOX_FOLDER/bin/station_cnt.sh > $WWW_FOLDER/station_cnt.txt + echo "installed, now every 2 minutes your station count is refreshed" +fi + +if [ $2 = "flush_dns_reg" ] ; then + crontab -l > $PIRATEBOX_FOLDER/tmp/crontab 2> /dev/null + echo "#--- Crontab for dnsmasq flush" >> $PIRATEBOX_FOLDER/tmp/crontab + echo " */2 * * * * $PIRATEBOX_FOLDER/bin/flush_dnsmasq.sh > $PIRATEBOX_FOLDER/tmp/dnsmasq_flush.log " >> $PIRATEBOX_FOLDER/tmp/crontab + crontab $PIRATEBOX_FOLDER/tmp/crontab + [ "$?" != "0" ] && echo "an error occured" && exit 254 + echo "Installed crontab for flushing dnsmasq requlary" +fi + +set_hostname() { + local name=$1 ; shift; + + sed "s|#####HOST#####|$name|g" $PIRATEBOX_FOLDER/src/redirect.html.schema > $WWW_FOLDER/redirect.html + sed "s|HOST=\"$HOST\"|HOST=\"$name\"|" -i $PIRATEBOX_CONFIG +} + +if [ $2 = "hostname" ] ; then + echo "Switching hostname to $3" + set_hostname "$3" + echo "..done" +fi + +if [ $2 = "content" ] ; then + create_content_folder +fi diff --git a/piratebox/piratebox/bin/json_generation.sh b/piratebox/piratebox/bin/json_generation.sh new file mode 100755 index 0000000..869466e --- /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/bin/piratebox_setup_wlan.sh b/piratebox/piratebox/bin/piratebox_setup_wlan.sh new file mode 100755 index 0000000..e6f2da4 --- /dev/null +++ b/piratebox/piratebox/bin/piratebox_setup_wlan.sh @@ -0,0 +1,121 @@ +#!/bin/bash + +# 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 IPv4 + IPv6 +# Netmask +# Interface + +probe() { + if [ "$PROBE_INTERFACE" = "yes" ] ; then + echo -n "Probing interface $INTERFACE" + ifconfig "$INTERFACE" >> /dev/null 2>&1 + TEST_OK=$? + CNT=$PROBE_TIME + while [[ "$TEST_OK" != "0" && "$CNT" != "0" ]] + do + echo -n "." + sleep 1 + CNT=$(( $CNT - 1 )) + if [ "$CNT" = 0 ] ; then + exit 99 + fi + ifconfig "$INTERFACE" >> /dev/null 2>&1 + TEST_OK=$? + done + fi +} + + + +# Load configfile + +if [ -z $1 ] || [ -z $2 ]; then + echo "Usage piratebox_setup_wlan.sh my_config " + exit 1 +fi + + +if [ ! -f $1 ] ; then + echo "Config-File $1 not found..." + exit 1 +fi + +#Load config +. $1 + + +### Check config +if [ -z $INTERFACE ]; then + echo "Please define i.e. " + echo " INTERFACE=wlan0 " + exit 1 +fi + +if [ -z $IP ] ; then + echo "Please define i.e. " + echo " IP=192.268.46.2 " + exit 1 +fi + +if [ -z $NETMASK ] ; then + echo "Please define i.e. " + echo " NETMASK=255.255.255.0 " + exit 1 +fi + + + +### Do the stuff + +if [ $2 = "start" ] ; then + + echo "Bringing up wifi interface $INTERFACE " + ifconfig $INTERFACE up + + if [ $? -ne 0 ] ; then + echo "..failed "; + exit 1 + fi + + echo "Setting up $INTERFACE" + ifconfig $INTERFACE $IP netmask $NETMASK + + if [ $? -ne 0 ] ; then + echo "..failed "; + exit 1 + fi + + if [ $IPV6_ENABLE = "yes" ] ; then + echo "Setting up IPv6 stuff" + 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 + + 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 [ $2 = "probe" ] ; then + # simply check if the interface is available + probe +fi + + + diff --git a/piratebox/piratebox/bin/rpi_hwclock.sh b/piratebox/piratebox/bin/rpi_hwclock.sh new file mode 100755 index 0000000..22bb9d6 --- /dev/null +++ b/piratebox/piratebox/bin/rpi_hwclock.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# This small shell script initializes the I2C bus on a Raspberry Pi +# and activates an installed real time clock module. +# Afterwards the system time is synced to the hardware clock. + +echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device +hwclock -s diff --git a/piratebox/piratebox/bin/shoutbox_daemon.sh b/piratebox/piratebox/bin/shoutbox_daemon.sh new file mode 100755 index 0000000..68b758e --- /dev/null +++ b/piratebox/piratebox/bin/shoutbox_daemon.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +# Starts deamon for global shoutbox service +# requires piratebox.conf as first parameter +# +# Matthias Strubel - 2012-2014 +# Licenced with GPL-3 + +. $1 + +cd $PIRATEBOX_FOLDER +cd python_lib + +export SHOUTBOX_CHATFILE=$CHATFILE +export SHOUTBOX_GEN_HTMLFILE=$GEN_CHATFILE + + +if [ "$GLOBAL_CHAT" = "yes" ] ; then + export SHOUTBOX_BROADCAST_DESTINATIONS="$GLOBAL_DEST" +fi + +exec python discover.py diff --git a/piratebox/piratebox/bin/shoutbox_stuff.sh b/piratebox/piratebox/bin/shoutbox_stuff.sh new file mode 100755 index 0000000..6f6423a --- /dev/null +++ b/piratebox/piratebox/bin/shoutbox_stuff.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +# Matthias Strubel - (c)2012-2014 with GPL-3 +# +# Only calls generate-Routing in piratebox-folder +# gets Piratebox-Folder into www + + +# $1 www folder +# $2 pirtatebox config file + + +. $2 + + +cd $PIRATEBOX_FOLDER +cd python_lib + +export SHOUTBOX_CHATFILE=$CHATFILE +export SHOUTBOX_GEN_HTMLFILE=$GEN_CHATFILE +export SHOUTBOX_CLIENT_TIMESTAMP=$SHOUTBOX_CLIENT_TIMESTAMP + +export DISK_GEN_HTMLFILE=$GEN_DISKFILE + +#Writing init-message and reset chat.. +if [ "$RESET_CHAT" = "yes" ] ; then + cat $PIRATEBOX_FOLDER/conf/chat_init.txt > $CHATFILE +fi + +#Generate content file for Shoutbox +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 + +#Generate content file for DiskUsage +python diskusage.py generate + +$( sleep 20 && touch $GEN_CHATFILE ) & + +#Set correct permissions +chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $SHOUTBOX_CHATFILE +chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $SHOUTBOX_GEN_HTMLFILE +chmod ug+rw $SHOUTBOX_CHATFILE +chmod ug+rw $SHOUTBOX_GEN_HTMLFILE + +#DiskUsage correct permissions +chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $DISK_GEN_HTMLFILE +chmod ug+rw $DISK_GEN_HTMLFILE diff --git a/piratebox/piratebox/bin/station_cnt.sh b/piratebox/piratebox/bin/station_cnt.sh new file mode 100755 index 0000000..652714b --- /dev/null +++ b/piratebox/piratebox/bin/station_cnt.sh @@ -0,0 +1,8 @@ +#!/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 +echo "Currently there are $CNT connected clients" diff --git a/piratebox/piratebox/bin/timesave.sh b/piratebox/piratebox/bin/timesave.sh new file mode 100755 index 0000000..a5e691e --- /dev/null +++ b/piratebox/piratebox/bin/timesave.sh @@ -0,0 +1,85 @@ +#!/bin/sh + +# This script enables a sort of timerescue System +# for Systems without a Realtime Clock +# like TP-Link MR3020 , RaspberryPI +# +# It does not reflect the real time, but +# gives a sort of stability to complete standalone +# systems. +# +# Licenced under GPL-3 @ 2012,2015 +# Matthias Strubel matthias.strubel@aod-rgp.de + +##function for similar saving & getting time +get_datetime() { + # Get format from piratebox.conf + date "${TIMESAVE_FORMAT}" +} + +# Strip spaces from datetime +sanitize_datetime() { + echo $1 | sed s/" "/""/g +} + +# Print usage if parameters are not provided +if [ -z $1 ] || [ -z $2 ] ; then + echo "Set up a crontab entry for regulary saving the time" + echo "Usage $0 " + echo " Valid steps are:" + echo " install - installs the needed parts into crontab" + echo " save - saves time into file" + echo " recover - recovers the time from a file" + + exit 1 +fi + +# Load configfile +. $1 + +if [ "$2" = "install" ] ; then + crontab -l > $PIRATEBOX_FOLDER/tmp/crontab 2> /dev/null + echo "#--- Crontab for PirateBox-Timesave" >> $PIRATEBOX_FOLDER/tmp/crontab + 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 MAY have to cron active..." + echo " on OpenWrt run: /etc/init.d/piratebox enable" + + exit 0 +fi + +# Save current date-time in a recoverable format +if [ "$2" = "save" ] ; then + if [ -e $TIMESAVE ] ; then + if [ $(sanitize_datetime "$(get_datetime)") -lt $(sanitize_datetime "$(cat $TIMESAVE)") ] ; then + logger -s "$0: Current date-time is lower then saved one. Not saving!" + exit 1 + fi + fi + + get_datetime > $TIMESAVE + exit 0 +fi + +# Recover date-time from a previous state +if [ "$2" = "recover" ] ; then + if [ $(sanitize_datetime "$(get_datetime)") -lt $(sanitize_datetime "$(cat $TIMESAVE)") ] ; then + date -s "$(cat $TIMESAVE)" > /dev/null + if [ "$?" != "0" ] ; then + logger -s "$0: Could not recover date-time." + exit 1 + else + logger -s "$0: Sucessfully recovered date-time." + exit 0 + fi + else + logger -s "$0: Time can not be changed to the past." + exit 1 + fi +fi 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..a8ba2a4 --- /dev/null +++ b/piratebox/piratebox/conf/avahi/avahi-daemon.conf.schema @@ -0,0 +1,30 @@ +[server] +host-name=#####MASKED_HOSTNAME##### +use-ipv4=no +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 + + + 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/dnsmasq_default.conf b/piratebox/piratebox/conf/dnsmasq_default.conf new file mode 100644 index 0000000..e7315cf --- /dev/null +++ b/piratebox/piratebox/conf/dnsmasq_default.conf @@ -0,0 +1,15 @@ +#dont use resolv.conf +no-resolv +#dont recheck resolv.conf for changes +no-poll + +#overwrite dns.. +#dhcp-authoritative + +# If you don't want dnsmasq to read /etc/hosts, uncomment the +# following line. +no-hosts +# or if you want it to read another file, as well as /etc/hosts, use +# this. +#addn-hosts=/etc/banner_add_hosts +## ^^^^^^ <- generated 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/conf/hook_custom.conf b/piratebox/piratebox/conf/hook_custom.conf new file mode 100644 index 0000000..ca3fe53 --- /dev/null +++ b/piratebox/piratebox/conf/hook_custom.conf @@ -0,0 +1,6 @@ +#!/bin/sh + +# Place your custom variables down here. +# Will be loaded into piratebox.conf via runtime + +#VAR1="CONTENT" diff --git a/piratebox/piratebox/conf/hostapd.conf b/piratebox/piratebox/conf/hostapd.conf new file mode 100644 index 0000000..b6d8f9d --- /dev/null +++ b/piratebox/piratebox/conf/hostapd.conf @@ -0,0 +1,23 @@ +interface=wlan0 +driver=nl80211 +ssid=PirateBox - Share Freely + +channel=1 +#auth_algs=1 + +# Remove # to enable n wifi mode +#ieee80211n=1 +#wmm_enabled=1 +#ht_capab=[HT40+][SHORT-GI-40][DSSS_CCK-40] +hw_mode=g + +# Put a # in front of the following line to allow +# direct client 2 client communication +ap_isolate=1 + +# Uncomment the following lines to enable WPA +#wpa=2 +#wpa_key_mgmt=WPA-PSK +#wpa_pairwise=TKIP CCMP +#rsn_pairwise=CCMP +#wpa_passphrase=Somepassphrase diff --git a/piratebox/piratebox/conf/hosts b/piratebox/piratebox/conf/hosts new file mode 100644 index 0000000..115a88f --- /dev/null +++ b/piratebox/piratebox/conf/hosts @@ -0,0 +1,9 @@ +#------ Static + +# Entry for tricking windows +### commented because this will cause the default redirect. +### left here for documentary the stuff +### dns.msftncsi.com 131.107.255.255 +#------- Static end ... Generated stuff now + + diff --git a/piratebox/piratebox/conf/hosts_mesh b/piratebox/piratebox/conf/hosts_mesh new file mode 100644 index 0000000..bf12fc5 --- /dev/null +++ b/piratebox/piratebox/conf/hosts_mesh @@ -0,0 +1,3 @@ +#-------------------- +# Spacer for generated hostsfile from mesh detection +#-------------------- diff --git a/piratebox/piratebox/conf/ipv6.conf b/piratebox/piratebox/conf/ipv6.conf new file mode 100644 index 0000000..e175ae5 --- /dev/null +++ b/piratebox/piratebox/conf/ipv6.conf @@ -0,0 +1,19 @@ +####-------------- +# Config file will be filled up partly on init-step +####-------------- + +#Enable IPv6 Setup (yes|no) on you interface +IPV6_ENABLE="no" + +# Which kind of router-adverticement should be used ( radvd | dnsmasq | none ) +# +IPV6_ADVERT="radvd" + +#absolute Node-Adress +IPV6_IP="fdc0:ffea::1" + +#Netmask without / +IPV6_MASK="64" + +# Prefix to piratebox ipv6 adress +IPV6_PREFIX="fdc0:ffea" 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..1cd5a64 --- /dev/null +++ b/piratebox/piratebox/conf/irc/motd.txt @@ -0,0 +1,7 @@ +Welcome to PirateBox IRC! + +Inspired by pirate radio and the free culture movement, PirateBox is a DIY anonymous offline file-sharing and communications system. PirateBox creates offline wireless networks designed for anonymous file sharing, chatting, message boarding, and media streaming. You can think of it as your very own portable offline Internet in a box! + +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 the Lead Developer is Matthias Strubel. The project is licensed under the GPLv3. To learn more about the project or to find out how to build your own PirateBox, please visit http://piratebox.cc 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/lighttpd/env b/piratebox/piratebox/conf/lighttpd/env new file mode 100644 index 0000000..e69de29 diff --git a/piratebox/piratebox/conf/lighttpd/fastcgi-php-generate203.conf b/piratebox/piratebox/conf/lighttpd/fastcgi-php-generate203.conf new file mode 100644 index 0000000..4f1d6e5 --- /dev/null +++ b/piratebox/piratebox/conf/lighttpd/fastcgi-php-generate203.conf @@ -0,0 +1,16 @@ +#-------------------- FAST CGI stuff + +# 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/fastcgi-php.conf b/piratebox/piratebox/conf/lighttpd/fastcgi-php.conf new file mode 100644 index 0000000..810cf0b --- /dev/null +++ b/piratebox/piratebox/conf/lighttpd/fastcgi-php.conf @@ -0,0 +1,11 @@ +#-------------------- FAST CGI stuff + +$HTTP["url"] =~ "^/content/" { + 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 new file mode 100644 index 0000000..dfac75b --- /dev/null +++ b/piratebox/piratebox/conf/lighttpd/lighttpd.conf @@ -0,0 +1,124 @@ +## Configuration for Piratebox + +server.modules = ( +# "mod_access", not needed! + "mod_alias", +# "mod_compress", Disabled, fixing reload Problem?? + "mod_redirect", +# "mod_rewrite", + "mod_setenv", + "mod_fastcgi" +) + +server.document-root = "/opt/piratebox/www" + +## Locate the tmp storage into tmp. It is in most cases the ram +## Limit the uploads to 5MB to save - especially on small devices +## the device from dieing because OUT-OF-RAM exceptions +## in KB => 5MB +server.upload-dirs = ( "/tmp" ) +server.max-request-size = 5120 + +server.errorlog = "/opt/piratebox/tmp/error.log" +server.breakagelog = "/opt/piratebox/tmp/break.log" +server.pid-file = "/opt/piratebox/tmp/lighttpd.pid" + + server.username = "nobody" + server.groupname = "nogroup" + + + +index-file.names = ( "index.php", "index.html", + "index.htm", "default.htm", + " index.lighttpd.html" ) + +url.access-deny = ( "~", ".inc" ) + +# added .cgi .py +static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" , ".cgi" , ".py" ) + + +# Enable lighttpd on ipv6 +$SERVER["socket"] == "[::]:80" { } + +dir-listing.encoding = "utf-8" +server.dir-listing = "enable" + +# Grabs main css +dir-listing.external-css = "/content/css/page_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" ) + +#n.a. on router include_shell "/usr/share/lighttpd/create-mime.assign.pl" +include "/opt/piratebox/conf/lighttpd/mime.types" + +#----------- ShoutBox-Env -------------- +include "/opt/piratebox/conf/lighttpd/env" + +#----------- cgi.conf -------------- +server.modules += ( "mod_cgi" ) + +$HTTP["url"] =~ "^/cgi-bin/" { +# cgi.assign = ( "" => "" ) + cgi.assign = ( ".py" => "/usr/bin/python" ) +} + +## Warning this represents a security risk, as it allow to execute any file +## with a .pl/.py even outside of /usr/lib/cgi-bin. +# +#cgi.assign = ( +# ".pl" => "/usr/bin/perl", +# ".py" => "/usr/bin/python", +#) + +$HTTP["url"] =~ "^/board/" { + cgi.assign = ( ".pl" => "/usr/bin/perl" , ) +} +#------------------------------------- + + +setenv.add-response-header += ( "Cache-Control" => "max-age=60, must-revalidate, no-store, no-cache, public" ) + +# 404 Error Page with redirect +# +server.error-handler-404 = "/redirect.html" + +## for better debugging +#server.modules += ( "mod_accesslog" ) +#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" +} + + +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" diff --git a/piratebox/piratebox/conf/lighttpd/mime.types b/piratebox/piratebox/conf/lighttpd/mime.types new file mode 100644 index 0000000..1218720 --- /dev/null +++ b/piratebox/piratebox/conf/lighttpd/mime.types @@ -0,0 +1,93 @@ +## MimeType handling +## ------------------- +## +## Use the "Content-Type" extended attribute to obtain mime type if +## possible +## +mimetype.use-xattr = "disable" + +## +## mimetype mapping +## +mimetype.assign = ( + ".pdf" => "application/pdf", + ".sig" => "application/pgp-signature", + ".spl" => "application/futuresplash", + ".class" => "application/octet-stream", + ".ps" => "application/postscript", + ".torrent" => "application/x-bittorrent", + ".dvi" => "application/x-dvi", + ".gz" => "application/x-gzip", + ".pac" => "application/x-ns-proxy-autoconfig", + ".swf" => "application/x-shockwave-flash", + ".tar.gz" => "application/x-tgz", + ".tgz" => "application/x-tgz", + ".tar" => "application/x-tar", + ".zip" => "application/zip", + ".mp3" => "audio/mpeg", + ".m3u" => "audio/x-mpegurl", + ".wma" => "audio/x-ms-wma", + ".wax" => "audio/x-ms-wax", + ".ogg" => "application/ogg", + ".wav" => "audio/x-wav", + ".gif" => "image/gif", + ".jpg" => "image/jpeg", + ".jpeg" => "image/jpeg", + ".png" => "image/png", + ".xbm" => "image/x-xbitmap", + ".xpm" => "image/x-xpixmap", + ".xwd" => "image/x-xwindowdump", + ".css" => "text/css", + ".xhtml" => "application/xhtml+xml", + ".html" => "text/html", + ".htm" => "text/html", + ".js" => "text/javascript", + ".asc" => "text/plain", + ".c" => "text/plain", + ".cpp" => "text/plain", + ".log" => "text/plain", + ".conf" => "text/plain", + ".text" => "text/plain", + ".txt" => "text/plain", + ".spec" => "text/plain", + ".dtd" => "text/xml", + ".xml" => "text/xml", + ".mpeg" => "video/mpeg", + ".mpg" => "video/mpeg", + ".mov" => "video/quicktime", + ".qt" => "video/quicktime", + ".avi" => "video/x-msvideo", + ".asf" => "video/x-ms-asf", + ".asx" => "video/x-ms-asf", + ".wmv" => "video/x-ms-wmv", + ".mp4" => "video/mp4", + ".bz2" => "application/x-bzip", + ".tbz" => "application/x-bzip-compressed-tar", + ".tar.bz2" => "application/x-bzip-compressed-tar", + ".odt" => "application/vnd.oasis.opendocument.text", + ".ods" => "application/vnd.oasis.opendocument.spreadsheet", + ".odp" => "application/vnd.oasis.opendocument.presentation", + ".odg" => "application/vnd.oasis.opendocument.graphics", + ".odc" => "application/vnd.oasis.opendocument.chart", + ".odf" => "application/vnd.oasis.opendocument.formula", + ".odi" => "application/vnd.oasis.opendocument.image", + ".odm" => "application/vnd.oasis.opendocument.text-master", + ".ott" => "application/vnd.oasis.opendocument.text-template", + ".ots" => "application/vnd.oasis.opendocument.spreadsheet-template", + ".otp" => "application/vnd.oasis.opendocument.presentation-template", + ".otg" => "application/vnd.oasis.opendocument.graphics-template", + ".otc" => "application/vnd.oasis.opendocument.chart-template", + ".otf" => "application/vnd.oasis.opendocument.formula-template", + ".oti" => "application/vnd.oasis.opendocument.image-template", + ".oth" => "application/vnd.oasis.opendocument.text-web", + + ".webm" => "video/webm", + + ".json" => "application/json", + ".epub" => "application/epub+zip", + ".fb2" => "text/xml", + ".svg" => "image/svg+xml", + +# make the default mime type application/octet-stream. + "" => "application/octet-stream", +) diff --git a/piratebox/piratebox/conf/node.conf b/piratebox/piratebox/conf/node.conf new file mode 100644 index 0000000..5971d0a --- /dev/null +++ b/piratebox/piratebox/conf/node.conf @@ -0,0 +1,27 @@ +# 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 +# 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 +# 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 new file mode 100644 index 0000000..aa61cc4 --- /dev/null +++ b/piratebox/piratebox/conf/piratebox.conf @@ -0,0 +1,197 @@ +######### +## Config for pirate-box WWW Release +## written by Matthias Strubel (matthias.strubel@aod-rpg.de) (c)2011-2014 +## licenced under the GPL-3 ; feel free to improve or send me feedback +######## +## Configuration help +## If you plan to use one laptop as the piratebox: +## Set DO_IFCONFIG , USE_APN, USE_DNSMASQ to yes +## If you plan to run a two component setup (one router and one providing the storage+website) +## connected with ethernet: +## 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://www.piratebox.cc for futher instructions +## +## You may deactivated severall option as needed. It's flexible. + + +#----------------- Folder Configuration -------------------# + +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" + + +#Datafolder , where is you usb-stick // drive mounted +SHARE_FOLDER="$PIRATEBOX_FOLDER/share" + +#Upload Folder +# Change this if you want to user uploaded data in a subfolder +# Make sure the folder exists +# UPLOADFOLDER="$SHARE_FOLDER/Upload" +UPLOADFOLDER="$SHARE_FOLDER/Shared" + +#----------------- Startup Configuration -------------------# +# Which Steps has to be done + +#Do network config +DO_IFCONFIG="yes" + +#Do IW config - setting up a wlan0 interface with iw +# for some wifi-cards required +DO_IW="no" +#Iw physical interface +PHY_IF="phy0" + +# Check if interface exists +# should be set to yes if you use a USB wifi card +PROBE_INTERFACE="no" +# wait how many seconds until throw an error +PROBE_TIME=10 + +#Start services... +# act like a apn / +# please have a look @ hostapd.conf ; you may need to change some options, regarding wifi-card +USE_APN="yes" +# act like dns&dhcp (dnsmasq) +USE_DNSMASQ="yes" + +#HOSTNAME ... if you really want to change it, plz change: +# www/index.html +# +# That is the Domain-Specifi part, where you reach always the local box +HOST="piratebox.lan" + +#----------------- Configuration for DNSMASQ & IF-Setup -------------------# +# Name of the wlan interface +INTERFACE="wlan0" +# On which interface DNSMASQ should listen. -i is the parameter for dnsmasq +# Make it empty to disable +DNSMASQ_INTERFACE="wlan0" + +#Brdige add interface (setr yes to enable bridging) +DO_BRIDGE="no" +BRIDGE="br-lan" + +#Network +NET=192.168.77 + +#IP-SHORT (is stringed together) +# What IP does your Box have?? i.e. 1 => 192.168.77.1 +IP_SHORT=1 + +#DHCP LEASE Start +START_LEASE=10 +#DHCP LEASE End Range +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 + +#SET IP for ifconfig stuff - DON'T CHANGE +IP=$NET.$IP_SHORT + +#Load Config about ipv6 stuff - DON'T CHANGE + . $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 + +## Timesave file for non-RTC devices +TIMESAVE="$PIRATEBOX_FOLDER/share/timesave_file" + +#On non OpenWRT you can use the default output format +# as an input format. For OpenWrt you need to specify +%C%g%m%d%H%M +# The content is exchanged during makefile processing and image build +TIMESAVE_FORMAT="" + +#Start droopy? - Enable upload? +DROOPY_ENABLED="yes" +#Image-SRC +IMAGENAME="piratebox-logo-small.png" +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 " + +#Use UserId from lighttpd for droopy (use on ext-filesystems) +DROOPY_USE_USER="yes" + +#Configuration for chat (If you decide to move the chat folder, you have to change /opt/piratebox/chat/cgi-bin/py* files ) +CHATFILE="$WWW_FOLDER/cgi-bin/data.pso" + +#Generated File +GEN_CHATFILE="$WWW_FOLDER/chat_content.html" + +#Generated File for DiskUsage +GEN_DISKFILE="$WWW_FOLDER/diskusage.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" + +SHOUTBOX_CLIENT_TIMESTAMP="no" + +#Inititiation Chat-Message +### 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" + +#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" + +#On which broadcast address should it send +# Take care on the syntax!! +GLOBAL_DEST="[ #255.255.255.255# , #10.255.255.255# , #$NET.255# ]" + +#------------------------ Additional configuration for lighttpd +LIGHTTPD_USER=nobody +LIGHTTPD_GROUP=nogroup + + +#------------------------ IRC Configuration + +#Switch to yes if you want to enable the IRC-Server +ENABLE_IRC_SERVER="no" +IRC_USER="$LIGHTTPD_USER" + +## If you want to save rooms and so on, create the folder +# /opt/piratebox/share/IRC_STATE and make sure it is writeable +# for IRC_USER (nobody per default) +#IRC_STATE_DIR="$SHARE_FOLDER/IRC_STATE" + +#------------------------ Hook in user-config +. $PIRATEBOX_FOLDER/conf/hook_custom.conf diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox new file mode 100755 index 0000000..b4862db --- /dev/null +++ b/piratebox/piratebox/init.d/piratebox @@ -0,0 +1,295 @@ +#! /bin/sh +# /etc/init.d/piratebox + +### BEGIN INIT INFO +# Provides: piratebox +# Required-Start: $all +# Required-Stop: $network $local_fs +# 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 several services +### END INIT INFO + +### +# Default start-stop script for piratebox services on a laptop +# written by Matthias Strubel (matthias.strubel@aod-rpg.de) 2011-02-22 +# licenced by gpl, feel free to improve and send me comments + +. /lib/lsb/init-functions + + +[ -f /etc/default/rcS ] && . /etc/default/rcS + +# PATH for /opt piratebox folder +PATH=$PATH:/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 +PIDFILE_RADVD=/opt/piratebox/tmp/radvd.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 + +#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 + + +# Some things that run always +touch /var/lock/piratebox + +if [ -f $CONF ] ; then + . $CONF +else + log_failure_msg "Configuration file not found" + 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 + + +# 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 " + +# Carry out specific functions when asked to by the system +case "$1" in + start) + log_daemon_msg "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 [ "$CUSTOM_DIRLIST_COPY" = "yes" ]; then + echo "Copy over directory design files" + $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 + fi + + if [ "$PROBE_INTERFACE" = yes ] ; then + log_daemon_msg " Probing wlan" + #Setting up WLAN Interface + piratebox_setup_wlan.sh $CONF probe + fi + if [ $? -ne 0 ] ; then + log_failure_msg "failed probe Interface" + else + + # Only activate + if [ "$USE_APN" = "yes" ] ; then + log_daemon_msg "Starting hostap... " + start-stop-daemon -m --start --background --pidfile $PIDFILE_HOSTAPN --exec /usr/sbin/hostapd -- $CONF_APN + log_end_msg $? + fi + + if [ "$DO_IFCONFIG" = yes ] ; then + log_daemon_msg " Setting up wlan" + #Setting up WLAN Interface + piratebox_setup_wlan.sh $CONF start + if [ $? -ne 0 ] ; then + log_failure_msg "failed setting up Interface" + exit 99 + fi + fi + + #BRIDGE + if [ "$DO_BRIDGE" = "yes" ] ; then + log_daemon_msg "Adding $INTERFACE to bridge $BRIDGE // brctl addif $BRIDGE $INTERFACE " + sleep 1 + BR_CMD="brctl addif $BRIDGE $INTERFACE" + ( $BR_CMD ; ) + log_end_msg $? + fi + + if [ "$USE_DNSMASQ" = "yes" ] ; then + log_daemon_msg "Starting dnsmasq... " + # pidfile is written by dnsmasq + start-stop-daemon --start --quiet --exec /usr/sbin/dnsmasq -- $CMD_DNSMASQ + 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 + log_end_msg $? + fi + + + 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 {} \; + + DROOPY_USER="" + if [ "$DROOPY_USE_USER" = "yes" ] ; then + DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP " + fi + 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 + + #Do shoutbox stuff + $PIRATEBOX/bin/shoutbox_stuff.sh $WWW_FOLDER $CONF + + + #Start here the lighttpd i.e. + log_daemon_msg "Starting lighttpd..." + start-stop-daemon --start --quiet --pidfile $PIDFILE_LIGHTTPD --exec /usr/sbin/lighttpd -- -f $CONF_LIGHTTPD + log_end_msg $? + + #Start Global Chat daemon if needed. + if [ "$GLOBAL_CHAT" = "yes" ] ; then + log_daemon_msg "Starting global chat service..." + 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="--setuid $IRC_USER --daemon --motd '$IRC_MOTD' " + + if [ ! -z "$IRC_STATEDIR" ] ; then + IRC_PARMS=" $IRCPARMS --statedir '$IRC_STATEDIR' " + fi + + log_daemon_msg "Starting Miniircd..." + start-stop-daemon $DROOPY_USER -m -S -p $PIDFILE_IRC -x $PIRATEBOX/bin/miniircd.py -- $IRC_PARMS + log_end_msg $? + fi + fi + + $PIRATEBOX/bin/hooks/hook_piratebox_start_done.sh "$CONF" + + ;; + stop) + log_daemon_msg "Stopping script piratebox" + echo "" + + $PIRATEBOX/bin/hooks/hook_piratebox_stop.sh "$CONF" + + if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then + log_daemon_msg "Stopping IRC..." + start-stop-daemon -K -q -p $PIDFILE_IRC + 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" + log_end_msg $? + fi + if [ "$USE_DNSMASQ" = "yes" ] ; then + log_daemon_msg "Stopping dnsmasq..." + start-stop-daemon --stop --quiet --pidfile $PIDFILE_DNSMASQ + 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..." + start-stop-daemon --stop --quiet --pidfile $PIDFILE_SHOUTBOX + log_end_msg $? + fi + + log_daemon_msg "Stopping lighttpd..." + start-stop-daemon --stop --retry 30 --quiet --pidfile $PIDFILE_LIGHTTPD + log_end_msg $? + + if [ "$DROOPY_ENABLED" = "yes" ] ; then + #Kill Droopy + log_daemon_msg "Stopping droopy... " + start-stop-daemon --stop --quiet --pidfile $PIDFILE_DROOPY --oknodo --startas "python /opt/piratebox/bin/droopy" + log_end_msg $? + 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 + log_daemon_msg "Remove Bridge..." + BR_CMD="brctl delif $BRIDGE $INTERFACE" + ( $BR_CMD ; ) + log_end_msg $? + fi + + $PIRATEBOX/bin/hooks/hook_piratebox_stop_done.sh "$CONF" + + + ;; + *) + echo "Usage: /etc/init.d/piratebox {start|stop}" + exit 1 + ;; +esac + +exit 0 diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt new file mode 100755 index 0000000..e2c27b5 --- /dev/null +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -0,0 +1,292 @@ +#!/bin/sh +# /etc/init.d/piratebox + +### BEGIN INIT INFO +# Provides: piratebox +# Required-Start: $all +# Required-Stop: $network $local_fs +# 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 +### END INIT INFO + +### +# Default start-stop script for piratebox services on a laptop +# written by Matthias Strubel (matthias.strubel@aod-rpg.de) 2011-02-22 +# licenced by gpl, feel free to improve and send me comments + + +[ -f /etc/default/rcS ] && . /etc/default/rcS + +# PATH for /opt piratebox folder +PATH=$PATH:/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 +PIDFILE_RADVD=/opt/piratebox/tmp/radvd.pid +PIDFILE_IRC=/opt/piratebox/tmp/irc.pid + +PIRATEBOX=/opt/piratebox +CONF=$PIRATEBOX/conf/piratebox.conf +CONF_IRC=$PIRATEBOX/conf/irc.conf +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 + +if [ -f $CONF ] ; then + . $CONF +else + echo "Configuration file not found" + exit 1 +fi + +#If you can't find this file +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 + + +# 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 " + +# Carry out specific functions when asked to by the system +case "$1" in + start) + echo "Starting script piratebox " + + # 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 [ "$CUSTOM_DIRLIST_COPY" = "yes" ]; then + echo "Copy over directory design files" + $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 + fi + + if [ "$PROBE_INTERFACE" = "yes" ] ; then + echo " Probe wlan" + #Setting up WLAN Interface + piratebox_setup_wlan.sh $CONF probe + fi + if [ $? -ne 0 ] ; then + echo "failed probing Interface" + else + + # Only activate + if [ "$USE_APN" = "yes" ] ; then + echo "Starting hostap... " + start-stop-daemon -m -S -b -p $PIDFILE_HOSTAPN -x /usr/sbin/hostapd -- $CONF_APN + echo $? + fi + + if [ "$DO_IFCONFIG" = "yes" ] ; then + echo " Setting up wlan" + #Setting up WLAN Interface + piratebox_setup_wlan.sh $CONF start + if [ $? -ne 0 ] ; then + echo "failed setting up Interface" + exit 255 + 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 "failed :( " + fi + fi + + if [ "$USE_DNSMASQ" = "yes" ] ; then + echo "Starting dnsmasq... " + # pidfile is written by dnsmasq + start-stop-daemon -S -q -x /usr/sbin/dnsmasq -- $CMD_DNSMASQ + 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 + echo $? + fi + + + + if [ "$DROOPY_ENABLED" = "yes" ] ; then + #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 + + DROOPY_USER="" + if [ "$DROOPY_USE_USER" = "yes" ] ; then + DROOPY_USER=" -c $LIGHTTPD_USER:$LIGHTTPD_GROUP " + fi + 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 + + #Do shoutbox stuff + $PIRATEBOX/bin/shoutbox_stuff.sh $WWW_FOLDER $CONF + + + #Start here the lighttpd i.e. + echo "Starting lighttpd..." + start-stop-daemon -S -q -p $PIDFILE_LIGHTTPD -x /usr/sbin/lighttpd -- -f $CONF_LIGHTTPD + echo $? + + #Start Global Chat daemon if needed. + if [ "$GLOBAL_CHAT" = "yes" ] ; then + echo "Starting global chat service..." + 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="--setuid $IRC_USER --daemon --motd '$IRC_MOTD' " + + if [ ! -z "$IRC_STATEDIR" ] ; then + IRC_PARMS=" $IRCPARMS --statedir '$IRC_STATEDIR' " + fi + echo "Starting Miniircd..." + start-stop-daemon $DROOPY_USER -m -S -p $PIDFILE_IRC -x $PIRATEBOX/bin/miniircd.py -- $IRC_PARMS + echo $? + fi + fi + + $PIRATEBOX/bin/hooks/hook_piratebox_start_done.sh "$CONF" + + ;; + stop) + echo "Stopping script piratebox" + + $PIRATEBOX/bin/hooks/hook_piratebox_stop.sh "$CONF" + + if [ "$USE_APN" = "yes" ] ; then + echo "Stopping hostap... " + start-stop-daemon -K -q -p $PIDFILE_HOSTAPN + echo $? + fi + if [ "$USE_DNSMASQ" = "yes" ] ; then + echo "Stopping dnsmasq..." + start-stop-daemon -K -q -p $PIDFILE_DNSMASQ + 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 + echo $? + fi + + + if [ "$DROOPY_ENABLED" = "yes" ] ; then + #Kill Droopy + echo "Stopping droopy... " + start-stop-daemon -s 9 -K -q -p $PIDFILE_DROOPY + echo $? + fi + + #Start Global Chat daemon if needed. + if [ "$GLOBAL_CHAT" = "yes" ] ; then + echo "Stopping global chat service..." + start-stop-daemon -K -q -p $PIDFILE_SHOUTBOX + echo $? + fi + + if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then + echo "Stopping IRC..." + start-stop-daemon -K -q -p $PIDFILE_IRC + echo $? + fi + + + + echo "Stopping lighttpd..." + start-stop-daemon -K -q -p $PIDFILE_LIGHTTPD + echo $? + + + if [ "$DO_IFCONFIG" = "yes" ] ; then + piratebox_setup_wlan.sh $CONF stop + fi + + if [ "$DO_IW" = "yes" ] ; then + iw dev $INTERFACE del + fi + + #BRIDGE + if [ "$DO_BRIDGE" = "yes" ] ; then + echo "Remove $INTERFACE to bridge $BRIDGE // brctl addif +$BRIDGE $INTERFACE " + sleep 1 + BR_CMD="brctl delif $BRIDGE $INTERFACE" + ( $BR_CMD ; ) + if [ $? -ne 0 ] ; then + echo "failed :( " + fi + fi + + $PIRATEBOX/bin/hooks/hook_piratebox_stop_done.sh "$CONF" + ;; + *) + echo "Usage: /etc/init.d/piratebox {start|stop}" + exit 1 + ;; +esac + +exit 0 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 +} diff --git a/piratebox/piratebox/lib/node_name_generation.sh b/piratebox/piratebox/lib/node_name_generation.sh new file mode 100644 index 0000000..a8050f3 --- /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=$complete_node_name + return 0 + else + echo "Error: No valid node-name found" + return 1 + fi +} diff --git a/piratebox/piratebox/lib/node_name_resolution.sh b/piratebox/piratebox/lib/node_name_resolution.sh new file mode 100644 index 0000000..25ee43e --- /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 -6 $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 + + +} diff --git a/piratebox/piratebox/python_lib/.keep b/piratebox/piratebox/python_lib/.keep new file mode 100644 index 0000000..e69de29 diff --git a/piratebox/piratebox/python_lib/broadcast.py b/piratebox/piratebox/python_lib/broadcast.py new file mode 100644 index 0000000..27d77e0 --- /dev/null +++ b/piratebox/piratebox/python_lib/broadcast.py @@ -0,0 +1,120 @@ +# PirateBox send Message lib (C)2012-2014 +# modified by Matthias Strubel +# +# Original Version by +# +# Forban - a simple link-local opportunistic p2p free software +# +# For more information : http://www.foo.be/forban/ +# +# Copyright (C) 2009-2010 Alexandre Dulaunoy - http://www.foo.be/ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +import socket +import string +import time +import datetime +try: + from hashlib import sha1 +except ImportError: + from sha import sha as sha1 +import re +import sys + + +flogger = None +debug = 0 + + +class broadcast: + def __init__(self, name="notset", uuid=None, port="12556", timestamp=None, + auth=None, destination=["ff02::1", "255.255.255.255", ]): + self.name = name + self.uuid = uuid + self.port = port + self.count = 0 + self.destination = destination + self.ipv6_disabled = 0 + + def disableIpv6(self): + self.ipv6_disabled = 1 + self.destination = ["255.255.255.255", ] + + def setDestination(self, destination=["ff02::1", "255.255.255.255", ]): + self.destination = destination + + def set(self, content): + self.payload = content + + def get(self): + return self.payload + + def __debugMessage(self, msg): + if flogger is not None: + flogger.debug(msg) + elif debug == 1: + print msg + + def __errorMessage(self, msg): + if flogger is not None: + flogger.error(msg) + elif debug == 1: + print msg + + def send(self): + for destination in self.destination: + if socket.has_ipv6 and re.search(":", destination) and not \ + self.ipv6_disabled == 1: + + self.__debugMessage("working in ipv6 part on destination " + + destination) + + # Even if Python is compiled with IPv6, it doesn't mean that + # the os is supporting IPv6. (like the Nokia N900) + try: + sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM, + socket.IPPROTO_UDP) + # Required on some version of MacOS X while sending IPv6 + # UDP datagram + sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 1) + except: + sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, + socket.IPPROTO_UDP) + + else: + self.__debugMessage("open ipv4 socket on destination " + + destination) + sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, + socket.IPPROTO_UDP) + sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) + + try: + sock.sendto(self.payload, (destination, int(self.port))) + except socket.error, msg: + self.__errorMessage("Error sending to " + destination + " : " + + msg.strerror) + continue + sock.close() + + +def managetest(): + msg = broadcast() + msg.set("Test") + print msg.get() + msg.send() + +if __name__ == "__main__": + managetest() diff --git a/piratebox/piratebox/python_lib/discover.py b/piratebox/piratebox/python_lib/discover.py new file mode 100644 index 0000000..9cebd4a --- /dev/null +++ b/piratebox/piratebox/python_lib/discover.py @@ -0,0 +1,82 @@ +# PirateBox Message broadcasting lib (C)2012-2014 +# Matthias Strubel + +import SocketServer +import socket +import sys +import os + +import messages +from psogen import writeToDisk, generate_html_from_file + + +lastmsg = "" + + +class MyUDPHandler(SocketServer.BaseRequestHandler): + def handle(self): + global lastmsg + data = self.request[0].strip() + socket = self.request[1] + if data[:9] == "piratebox": + if data[10:12] == "sb": + if data != lastmsg: + msg = messages.shoutbox_message() + msg.set_message(data) + content = msg.get() + writeToDisk(content) + generate_html_from_file() + lastmsg = data + else: + print data[11:12] + print data + else: + print "debug : not a piratebox message" + + +class UDPServer(SocketServer.UDPServer): + def setIPv6(self, ipv6=1): + if ipv6 == 0: + self.disable_ipv6 = 1 + else: + self.disable_ipv6 = 0 + + def useIPv6(self): + return True + + if self.disable_ipv6 == 1: + return False + else: + return True + + if socket.has_ipv6: + try: + socktest = socket.socket(socket.AF_INET6) + socktest.close() + address_family = socket.AF_INET6 + except: + address_family = socket.AF_INET + + def server_bind(self): + if self.useIPv6(): + self.v6success = True + try: + socktest = socket.socket(socket.AF_INET6) + socktest.close() + except: + self.v6success = False + + if socket.has_ipv6 and self.v6success: + address_family = socket.AF_INET6 + + #allowing to work in dual-stack when IPv6 is used + if socket.has_ipv6 and self.v6success: + self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, + 0) + self.socket.bind(self.server_address) + +if __name__ == "__main__": + HOST, PORT = ("::", 12556) + server = UDPServer((HOST, PORT), MyUDPHandler) + server.setIPv6(0) + server.serve_forever() diff --git a/piratebox/piratebox/python_lib/diskusage.py b/piratebox/piratebox/python_lib/diskusage.py new file mode 100644 index 0000000..0862550 --- /dev/null +++ b/piratebox/piratebox/python_lib/diskusage.py @@ -0,0 +1,106 @@ +#!/usr/bin/python + +# Library to write the current disk usage + +# Heavily Modified version the ShoutBox Library (psogen.py) + +import os, re, datetime +from psutil import disk_usage + +htmlfilename = os.environ["DISK_GEN_HTMLFILE"] +delay = 60*5 #In seconds + +#-------------- +# Generates Shoutbox-HTML-Frame ... +# Imports: +# content - String containing preformatted data +#-------------- +def generate_html(content): + htmlstring = "DiskUsage Data" + htmlstring += content + htmlstring += "" + return htmlstring + +def modification_date(filename): + moddate = os.path.getmtime(filename) + return datetime.datetime.fromtimestamp(moddate) + +#-------------- +# Generates HTML Data based on given content and write it to static html file +# Imports: +# content - String containing preformatted data +#-------------- +def generate_html_into_file(content): + open(htmlfilename, 'w').close() + htmlstring = generate_html ( content ) + htmlfile = open( htmlfilename , 'w' ) + htmlfile.truncate() + htmlfile.write( htmlstring ) + htmlfile.close() + +#-------------- +# Function for saving the disk usage to a file. Called by HTML-Form +#-------------- +def get_usage(drive): + + try: + file_mod_time = modification_date(htmlfilename) + except OSError: + content = prepare_line(drive) + generate_html_into_file(content) + file_mod_time = modification_date(htmlfilename) + + now = datetime.datetime.today() + max_delay = datetime.timedelta(0,delay) + age = now - file_mod_time + + #Add delay. + if age < max_delay: + print "CRITICAL: {} modified {} minutes ago. Threshold set to {} minutes. Cannot update.".format(drive, age.seconds/60, max_delay.seconds/60) + else: + print "OK. File last modified {} minutes ago. Updating now...".format(age.seconds/60) + content = prepare_line(drive) + generate_html_into_file(content) + +#-------------- +# Function for returning the amount of free space as an Integer +#-------------- +def FreeSpace(drive): + """ Return the FreeSape of a shared drive in bytes""" + try: + usage = disk_usage(drive) + floatpercent = float(usage.used) / float(usage.total) + percent = int(100*floatpercent) + return percent + except: + return 0 + + +#-------------- +# Function which formats the about of freespace into a nice readable format +#-------------- +def prepare_line (drive): + data = str(FreeSpace(drive)) + # Trying to make it look like this: + #
+ #
+ # 15% Full + #
+ #
+ content = "
" + data + "% Full
" + return content + +#-------------- +# Generating static HTML File +#-------------- +if __name__ == "__main__": + + disk = "/opt/piratebox/share/Shared" + + if os.path.exists(htmlfilename) != True: + content = prepare_line(disk) + generate_html_into_file(content) + else: + get_usage(disk) + + print "Generated HTML-DiskUsage File." \ No newline at end of file diff --git a/piratebox/piratebox/python_lib/messages.py b/piratebox/piratebox/python_lib/messages.py new file mode 100644 index 0000000..8b31082 --- /dev/null +++ b/piratebox/piratebox/python_lib/messages.py @@ -0,0 +1,50 @@ +# PirateBox Message lib (C)2012-2014 +# Matthias Strubel + +import string +import socket +import base64 +import sys + + +class message: + def __init__(self, name="generate"): + if name == "generate": + self.name = socket.gethostname() + else: + self.name = name + + self.type = "gc" + self.decoded = "" + + def set(self, content=" "): + base64content = base64.b64encode(content) + self.decoded = "piratebox;" + self.type + ";01;" + self.name + ";" + \ + base64content + + def get(self): + # TODO Split decoded part + message_parts = string.split(self.decoded, ";") + + if message_parts[0] != "piratebox": + return None + + b64_content_part = message_parts[4] + + content = base64.b64decode(b64_content_part) + return content + + def get_sendername(self): + return self.name + + def get_message(self): + return self.decoded + + def set_message(self, decoded): + self.decoded = decoded + + +class shoutbox_message(message): + def __init__(self, name="generate"): + message.__init__(self, name) + self.type = "sb" diff --git a/piratebox/piratebox/python_lib/psogen.py b/piratebox/piratebox/python_lib/psogen.py new file mode 100755 index 0000000..2fcdf30 --- /dev/null +++ b/piratebox/piratebox/python_lib/psogen.py @@ -0,0 +1,167 @@ +#!/usr/bin/python + +# 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 +# psogen.py input Anonymous default "Text" + +import os +import datetime +import re +import messages +import 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"] + finished_dest = re.sub('#', '"', raw_dest) + broadcast_destination = eval(finished_dest) +except KeyError: + broadcast_destination = False + + +def html_escape(text): + """ + Removes HTML chars from the given text and replace them with HTML entities. + """ + html_escape_table = { + '"': """, "'": "'", ">": ">", + "<": "<"} + return "".join(html_escape_table.get(c, c) for c in text) + + +def generate_html(content): + """ + Generates Shoutbox-HTML-Frame... + + Args: + content: String containing preformatted data + """ + htmlstring = "" \ + "Shout-Out Data" + htmlstring += content + htmlstring += "" + return htmlstring + + +def generate_html_into_file(content): + """ + Generates HTML Data based on given content and write it to static html + file. + + Args: + content: String containing preformatted data + """ + htmlstring = generate_html(content) + htmlfile = open(htmlfilename, 'w') + htmlfile.write(htmlstring) + htmlfile.close() + + +def generate_html_from_file(): + """ + Generates HTML Data based on datafilename's content + """ + old = read_data_file() + generate_html_into_file(old) + + +def generate_html_to_display_from_file(): + """ + Generates and Displays generated HTML + """ + old = read_data_file() + htmlstring = generate_html(old) + print htmlstring + + +def read_data_file(): + """ + Reads Data file from datafilename given name + """ + datafile = open(datafilename, 'r') + old = datafile.read() + datafile.close() + return old + + +def process_form(name, indata, color, timestamp): + """ + Function for saving new Shoubox-Content & Regenerate static + HTML file. + -> usually called by HTML-Form + """ + content = save_input(name, indata, color, timestamp) + + if not broadcast_destination: + generate_html_into_file(content) + + +def save_input(name, indata, color, timestamp): + """ + Acutally saves SB-Content to datafile + """ + content = prepare_line(name, indata, color, timestamp) + + if broadcast_destination: + return writeToNetwork(content, broadcast_destination) + else: + return writeToDisk(content) + + +def writeToNetwork(content, broadcast_destination): + message = messages.shoutbox_message() + message.set(content) + casting = broadcast.broadcast() + casting.setDestination(broadcast_destination) + casting.set(message.get_message()) + casting.send() + + +def writeToDisk(content): + old = read_data_file() + finalcontent = content + old + datafile = open(datafilename, 'r+') + datafile.write(finalcontent) + #datafile.truncate(0) + datafile.close() + return finalcontent + + +def prepare_line(name, indata, color, timestamp): + name = html_escape(name) + data = html_escape(indata) + color = html_escape(color) + 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 + #
+ # + content = "
%s %s: " \ + "%s
\n" \ + % (curdate.strftime("%H:%M:%S"), name, color, data) + return content + +#-------------- +# Testing or Generating static HTML File +#-------------- +if __name__ == "__main__": + import sys + if sys.argv.count("input") >= 1: + save_input(sys.argv[2], sys.argv[3], sys.argv[4]) + generate_html_to_display_from_file() + print "Entered Text." + + generate_html_from_file() + print "Generated HTML-Shoutbox File." diff --git a/piratebox/piratebox/python_lib/psutil.py b/piratebox/piratebox/python_lib/psutil.py new file mode 100644 index 0000000..17dc3e2 --- /dev/null +++ b/piratebox/piratebox/python_lib/psutil.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python + +""" +Return disk usage statistics about the given path as a (total, used, free) +namedtuple. Values are expressed in bytes. +""" +# Author: Giampaolo Rodola' +# License: MIT + +import os +import collections + +_ntuple_diskusage = collections.namedtuple('usage', 'total used free') + +if hasattr(os, 'statvfs'): # POSIX + def disk_usage(path): + st = os.statvfs(path) + free = st.f_bavail * st.f_frsize + total = st.f_blocks * st.f_frsize + used = (st.f_blocks - st.f_bfree) * st.f_frsize + return _ntuple_diskusage(total, used, free) + +elif os.name == 'nt': # Windows + import ctypes + import sys + + def disk_usage(path): + _, total, free = ctypes.c_ulonglong(), ctypes.c_ulonglong(), \ + ctypes.c_ulonglong() + if sys.version_info >= (3,) or isinstance(path, unicode): + fun = ctypes.windll.kernel32.GetDiskFreeSpaceExW + else: + fun = ctypes.windll.kernel32.GetDiskFreeSpaceExA + ret = fun(path, ctypes.byref(_), ctypes.byref(total), ctypes.byref(free)) + if ret == 0: + raise ctypes.WinError() + used = total.value - free.value + return _ntuple_diskusage(total.value, used, free.value) +else: + raise NotImplementedError("platform not supported") + +disk_usage.__doc__ = __doc__ + +if __name__ == '__main__': + print disk_usage(os.getcwd()) \ No newline at end of file diff --git a/piratebox/piratebox/python_lib/style.css b/piratebox/piratebox/python_lib/style.css new file mode 100755 index 0000000..0b49a2f --- /dev/null +++ b/piratebox/piratebox/python_lib/style.css @@ -0,0 +1,8 @@ +date { font-size: 10pt; color: #666666; font-family:Tahoma } +name { font-weight: bold; font-family:Tahoma } +data { font-family: Tahoma } +data.def { color: #000000 } +data.blue { color: #0000FF } +data.green { color: #008000 } +data.orange { color: #FF8040 } +data.red { color: #FF0000 } \ No newline at end of file diff --git a/piratebox/piratebox/rpi/bin/do_switch_client.sh b/piratebox/piratebox/rpi/bin/do_switch_client.sh new file mode 100755 index 0000000..9234778 --- /dev/null +++ b/piratebox/piratebox/rpi/bin/do_switch_client.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# Wrapper script for the steps to enable wifi client + +systemctl stop piratebox +if /opt/piratebox/rpi/run_client.sh ; then + echo "Started Wifi client sucessfully!" + exit 0 +else + echo "Error while starting wifi client, restarting piratebox" + systemctl start piratebox + exit 1 +fi +exit 1 diff --git a/piratebox/piratebox/rpi/bin/run_client.sh b/piratebox/piratebox/rpi/bin/run_client.sh new file mode 100755 index 0000000..11e69ab --- /dev/null +++ b/piratebox/piratebox/rpi/bin/run_client.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Runs with wpa_supplicant & wifi device from boot folder. + +## Default +WIFI_DEVICE="wlan0" + +WIFI_CONFIG_PATH="/boot/wifi_card.conf" +WPA_SUPPLICANT="/boot/wpa_supplicant.conf" + +# Try to get wifi device +if test -e "${WIFI_CONFIG_PATH}" ; then + echo "Found wifi card config" + WIFI_DEVICE=$( head -n 1 "${WIFI_CONFIG_PATH}" | tr -d '\n' ) +fi + +# Try to connect to Wifi if wpa_supplicant.conf is available. +if [ -f "${WPA_SUPPLICANT}" ]; then + echo "Found wpa_supplicant conf, trying to connect..." + wpa_supplicant -i"${WIFI_DEVICE}" -c "${WPA_SUPPLICANT}" -B -D wext + dhcpcd "${WIFI_DEVICE}" + exit 0 +else + echo "Wifi configuration not found" + exit 1 +fi +exit 1 diff --git a/piratebox/piratebox/rpi/bin/sdcard_share.sh b/piratebox/piratebox/rpi/bin/sdcard_share.sh new file mode 100755 index 0000000..92d1874 --- /dev/null +++ b/piratebox/piratebox/rpi/bin/sdcard_share.sh @@ -0,0 +1,103 @@ +#/bin/bash + +# This script enables the SDCard as ext4 to be used as storage +# it also activates some spare for swap + +MOUNTPOINT="/mnt/sdshare" +FS="ext4" + + +SDCARD="/dev/mmcblk0" + +if test -e "$SDCARD"p3 ; then + echo "ERROR: SWAP already exists" + exit 1 +fi + +if test -e "$SDCARD"p4 ; then + echo "ERROR: Data partition already exists" + exit 1 +fi + +echo "Creating partitions.." +fdisk "$SDCARD" <> /etc/fstab + +echo "Creating data partition" +mkfs.ext4 -F "$SDCARD"p4 +if [ $? -ne 0 ] ; then + echo "Error formating data" + exit 1 +fi + +DATA_UUID=$( blkid | grep "${SDCARD}p4.*TYPE=\"ext4\"" | egrep -o " UUID=\"([a-zA-Z0-9-])*\"" | sed 's/ //g' ) +if grep -q "${DATA_UUID}" /etc/fstab ; then + echo "Error: data is already configured in fstab" + exit 1 +fi + +echo "${DATA_UUID} ${MOUNTPOINT} ext4 defaults,noatime,nodiratime,data=writeback 0 0 ">> /etc/fstab + +mkdir -p "${MOUNTPOINT}" +mount "${MOUNTPOINT}" + +if [ $? -ne 0 ] ; then + echo "ERROR mounting data partion" + exit 1 +fi + +echo "## Moving files..." +mv /opt/piratebox/share "${MOUNTPOINT}/share" > /dev/null 2>&1 +ln -s "${MOUNTPOINT}/share" /opt/piratebox/share > /dev/null + + +# Force update diskwirte +touch -t 197001010101 /opt/piratebox/www/diskusage.html +wget http://127.0.0.1/cgi-bin/diskwrite.py -q -O - + +exit 0 + diff --git a/piratebox/piratebox/rpi/bin/starter.sh b/piratebox/piratebox/rpi/bin/starter.sh new file mode 100755 index 0000000..1eb5b5d --- /dev/null +++ b/piratebox/piratebox/rpi/bin/starter.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# Try to setup WiFi and if it succeeds, start the PirateBox + +## Default +WIFI_DEVICE="wlan0" + +WIFI_CONFIG_PATH="/boot/wifi_card.conf" + +if test -e "${WIFI_CONFIG_PATH}" ; then + echo "Found wifi card config" + WIFI_DEVICE=$( head -n 1 "${WIFI_CONFIG_PATH}" | tr -d '\n' ) +fi + + +if [ "${INTERFACE}" = "${WIFI_DEVICE}" ] ; then + /bin/sh -c /opt/piratebox/rpi/bin/wifi_detect.sh && /usr/bin/systemctl start piratebox +fi +exit 0 diff --git a/piratebox/piratebox/rpi/bin/switch_to_client.sh b/piratebox/piratebox/rpi/bin/switch_to_client.sh new file mode 100755 index 0000000..a2bee92 --- /dev/null +++ b/piratebox/piratebox/rpi/bin/switch_to_client.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# User friendly way to switch to client +# Adds "nohup" option... + +nohup /opt/piratebox/rpi/bin/do_switch_client.sh diff --git a/piratebox/piratebox/rpi/bin/usb_share.sh b/piratebox/piratebox/rpi/bin/usb_share.sh new file mode 100755 index 0000000..bdcf524 --- /dev/null +++ b/piratebox/piratebox/rpi/bin/usb_share.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# Find a vfat partition and configure it as an external share +MOUNTPOINT="/mnt/usbshare" +FS="vfat" +UUIDS=$(blkid | grep "/dev/sd*.*TYPE=\"${FS}\"" | egrep -o " UUID=\"([a-zA-Z0-9-])*\"" | sed 's/ //g') + +if [ $(echo "${UUIDS}" | wc -l) -gt 1 ]; then + echo "You seem to have more than one valid ${FS} partition for a USB share:" + echo "${UUIDS}\n" + echo "Please make sure you have a USB thumb drive attached with a single ${FS} partition." + exit 1 +fi + +if [ $(echo "${UUIDS}" | wc -l) -lt 1 ] || [[ $UUIDS == "" ]]; then + echo "You seem to have no valid ${FS} partition for a USB share." + echo "Please make sure you have a USB thumb drive attached with a single ${FS} partition." + exit 1 +fi + +UUID=$(echo "${UUIDS}" | cut -f2 -d" " | sed s/"\""/""/g) +grep "${UUID}" /etc/fstab > /dev/null +if [ $? -eq 0 ]; then + echo "Error: This disk is already configured as an USB share..." + exit 1 +fi + +echo "## Adding USB share..." +mkdir -p "${MOUNTPOINT}" > /dev/null +echo "${UUID} ${MOUNTPOINT} vfat umask=0,noatime,rw,user,uid=nobody,gid=nogroup 0 0" >> /etc/fstab +mount "${MOUNTPOINT}" > /dev/null + +if [ $? == 0 ]; then + echo "## Moving files..." + mv /opt/piratebox/share "${MOUNTPOINT}/share" > /dev/null 2>&1 + ln -s "${MOUNTPOINT}/share" /opt/piratebox/share > /dev/null +else + echo "Error: Mounting file system failed, will not move files..." + cat "/etc/fstab" +fi + +# Force update diskwirte +touch -t 197001010101 /opt/piratebox/www/diskusage.html +wget http://127.0.0.1/cgi-bin/diskwrite.py -q -O - + +exit 0 diff --git a/piratebox/piratebox/rpi/bin/wifi_detect.sh b/piratebox/piratebox/rpi/bin/wifi_detect.sh new file mode 100755 index 0000000..68e3c5a --- /dev/null +++ b/piratebox/piratebox/rpi/bin/wifi_detect.sh @@ -0,0 +1,82 @@ +#!/bin/sh + +# Install the proper hostapd package and adjust the hostapd configuration +# accordingly. + +## Default +WIFI_DEVICE="wlan0" + +WIFI_CONFIG_PATH="/boot/wifi_card.conf" + +PACKAGE_PATH="/prebuild/hostapd" +CONFIG_PATH="/opt/piratebox/conf/hostapd.conf" +PIRATEBOX_CONFIG_PATH="/opt/piratebox/conf/piratebox.conf" + +## Only use if it is set +if test -e "${WIFI_CONFIG_PATH}" ; then + echo "Found wifi card config" + WIFI_DEVICE=$( head -n 1 "${WIFI_CONFIG_PATH}" | tr -d '\n' ) +fi + +hostap_interface=$( grep -e '^interface' "${CONFIG_PATH}" | sed -e 's|interface=||' ) +piratebox_interface=$( grep -e '^INTERFACE' "${PIRATEBOX_CONFIG_PATH}" | \ + sed -e 's|INTERFACE=||' -e 's|"||g' ) +dnsmasq_interface=$( grep -e '^DNSMASQ_INTERFACE' "${PIRATEBOX_CONFIG_PATH}" | \ + sed -e 's|DNSMASQ_INTERFACE=||' -e 's|"||g' ) + +sed -i -e "s|interface=$hostap_interface|interface=$WIFI_DEVICE|" "${CONFIG_PATH}" + +#Only change piratebox interface if it is a wifi interface +if echo "$piratebox_interface" | grep -q "wlan" ; then + sed -i -e "s|INTERFACE=\"$piratebox_interface\"|INTERFACE=\"$WIFI_DEVICE\"|" \ + "${PIRATEBOX_CONFIG_PATH}" +fi +if echo "$dnsmasq_interface" | grep -q "wlan" ; then + sed -i -e "s|DNSMASQ_INTERFACE=\"$dnsmasq_interface\"|DNSMASQ_INTERFACE=\"$WIFI_DEVICE\"|" \ + "${PIRATEBOX_CONFIG_PATH}" +fi + + + +## Get pyhX device node +CARD_ID=$( cat /sys/class/net/"${WIFI_DEVICE}"/phy80211/index ) + + +# Check if we have an nl80211 enabled device with AP mode, then we are done +if iw phy phy"${CARD_ID}" info | grep -q "* AP$"; then + echo "Found nl80211 device capable of AP mode..." + pacman --noconfirm -U --needed "${PACKAGE_PATH}/hostapd-2"* > /dev/null + sed -i 's/^#driver=nl80211/driver=nl80211/' "${CONFIG_PATH}" + exit 0 +fi + +#Get driver name +DRIVER_NAME=$( ls -1 /sys/class/net/"${WIFI_DEVICE}"/device/driver/module/drivers/ ) + +# Check for r8188eu enabled device +if echo "$DRIVER_NAME" | grep -q "r8188eu:"; then + echo "Found r8188eu enabled device..." + pacman --noconfirm -U --needed "${PACKAGE_PATH}/hostapd-8188eu-"* > /dev/null + sed -i 's/^driver=nl80211/#driver=nl80211/' "${CONFIG_PATH}" + exit 0 +fi + + +# Check for rtl8192cu enabled device +if echo "$DRIVER_NAME" | grep -q "rtl8192cu"; then + echo "Found rtl8192cu enabled device..." + pacman --noconfirm -U --needed "${PACKAGE_PATH}/hostapd-8192cu-"* > /dev/null + sed -i 's/^driver=nl80211/#driver=nl80211/' "${CONFIG_PATH}" + exit 0 +fi + +echo "Could not find an AP enabled WiFi card..." + +# Try to connect to Wifi if wpa_supplicant.conf is available. +if [ -f /boot/wpa_supplicant.conf ]; then + /opt/piratebox/rpi/bin/run_client.sh + exit 1 + # Exit =! 0 will result in not starting piratebox service +fi + +exit 1 diff --git a/piratebox/piratebox/rpi/motd.txt b/piratebox/piratebox/rpi/motd.txt new file mode 100644 index 0000000..626df55 --- /dev/null +++ b/piratebox/piratebox/rpi/motd.txt @@ -0,0 +1,35 @@ +____________________.__ __ __________ +\______ \______ \__|___________ _/ |_ ____\______ \ _______ ___ + | _/| ___/ \_ __ \__ \\ __\/ __ \| | _// _ \ \/ / + | | \| | | || | \// __ \| | \ ___/| | ( <_> > < + |____|_ /|____| |__||__| (____ /__| \___ >______ /\____/__/\_ \ + \/ \/ \/ \/ \/ + +Website: http://piratebox.cc PirateBox Version: 1.1.3 +Forum: http://forum.piratebox.cc RPi Image Version: 1.1.3-1 +IRC: #piratebox irc.freenode.net Be open -- Share freely! + +First Steps After Flashing +1. Change password of alarm user + > passwd +2. Enable Fake-Timeservice + 2.1 Set date and time + # Disable network time sync + > sudo timedatectl set-ntp false + # Set time to "Mon May 23 17:42:00" (Format: CCYYMMDD hhmm) + > sudo date -s "20170523 1742" + > cd /opt/piratebox && sudo ./bin/timesave.sh ./conf/piratebox.conf install + 2.2 Enable on startup + > sudo systemctl enable timesave +3. Enable the Kareha Image and Discussion Board + > sudo /opt/piratebox/bin/board-autoconf.sh +4. Enable USB thumb drive share OR extend SDCard + USB: > sudo /opt/piratebox/rpi/bin/usb_share.sh + SDCard: > sudo /opt/piratebox/rpi/bin/sdcard_share.sh +5. Enable UPnP Media Server + > sudo cp /etc/minidlna.conf /etc/minidlna.conf.bkp + > sudo cp /opt/piratebox/src/linux.example.minidlna.conf /etc/minidlna.conf + > sudo systemctl start minidlna + > sudo systemctl enable minidlna +6. Enable RealTimeClock timekeeping (needs DS3231 or 1307 RTC module!) + > sudo systemctl enable rpi_hwclock diff --git a/piratebox/piratebox/rpi/services/piratebox.service b/piratebox/piratebox/rpi/services/piratebox.service new file mode 100644 index 0000000..ac7a1a9 --- /dev/null +++ b/piratebox/piratebox/rpi/services/piratebox.service @@ -0,0 +1,14 @@ +[Unit] +Description=PirateBox Service + +[Service] +Type=idle +RemainAfterExit=yes +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 + diff --git a/piratebox/piratebox/rpi/services/rpi_hwclock.service b/piratebox/piratebox/rpi/services/rpi_hwclock.service new file mode 100644 index 0000000..4cb72f9 --- /dev/null +++ b/piratebox/piratebox/rpi/services/rpi_hwclock.service @@ -0,0 +1,10 @@ +[Unit] +Description=rpi_hwclock initialization and sync +After=multi-user.target + +[Service] +Type=idle +ExecStart=/opt/piratebox/bin/rpi_hwclock.sh + +[Install] +WantedBy=multi-user.target diff --git a/piratebox/piratebox/rpi/services/timesave.service b/piratebox/piratebox/rpi/services/timesave.service new file mode 100644 index 0000000..26a4c13 --- /dev/null +++ b/piratebox/piratebox/rpi/services/timesave.service @@ -0,0 +1,10 @@ +[Unit] +Description=PirateBox timesave service + +[Service] +Type=oneshot +ExecStart=/opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf recover +TimeoutSec=20 + +[Install] +WantedBy=multi-user.target diff --git a/piratebox/piratebox/rpi/udev/99-wifi.rules b/piratebox/piratebox/rpi/udev/99-wifi.rules new file mode 100644 index 0000000..b39d287 --- /dev/null +++ b/piratebox/piratebox/rpi/udev/99-wifi.rules @@ -0,0 +1 @@ +KERNEL=="wlan*", RUN+="/bin/sh -c /opt/piratebox/rpi/bin/starter.sh" diff --git a/piratebox/piratebox/share/.keep b/piratebox/piratebox/share/.keep new file mode 100644 index 0000000..e69de29 diff --git a/piratebox/piratebox/src/HEADER.txt b/piratebox/piratebox/src/HEADER.txt new file mode 100644 index 0000000..6eac57b --- /dev/null +++ b/piratebox/piratebox/src/HEADER.txt @@ -0,0 +1,28 @@ + + PirateBox - Share Freely! + + + + + +
+
diff --git a/piratebox/piratebox/src/README.txt b/piratebox/piratebox/src/README.txt new file mode 100644 index 0000000..3bf6304 --- /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 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/src/forest.css b/piratebox/piratebox/src/forest.css new file mode 100644 index 0000000..926bb68 --- /dev/null +++ b/piratebox/piratebox/src/forest.css @@ -0,0 +1,72 @@ +body { + font-family: Arial, sans-serif; + font-size: 10pt; +} + +a { + font-weight: bold; + text-decoration: none; + color: #009900; +} + +a:hover { + color: #00EE00; +} + +form { + background-color: #EEEEEE; +} + +.threads_table { + font-size: 10pt; +} + +.threads_header { + background-color: #009900; + color: white; +} + +.thread_header { + background-color: #009900; + color: white; + font-weight: bold; + font-size: 110%; +} + +.thread_row { + background-color: #dddddd; +} +.thread_row_alt { + background-color: #eeeeee; +} + +.submit_button { + border: solid 1px black; + background: #00AA00; + color: white; + font-weight: bold; +} + +.error { + color: red; +} + +.copy { + font-size: 8pt; + text-align: center; +} + +#hidden_form { + display: none; +} + +.board_description { + -moz-border-radius: 8px; + padding: 5px; + background-color: #eeeeee; + border: 2px solid #dddddd; +} + +.date { + font-size: 85%; +} diff --git a/piratebox/piratebox/src/forest.py b/piratebox/piratebox/src/forest.py new file mode 100755 index 0000000..d2c23bf --- /dev/null +++ b/piratebox/piratebox/src/forest.py @@ -0,0 +1,552 @@ +#!/usr/bin/python +""" +Script: Forest, a simple Python forum script. +Author: Andrew Nelis (andrew.nelis@gmail.com) +OnTheWeb: http://www.triv.org.uk/~nelis/forest +Date: Jun 2010 +Version: 1.0.3 + +A Python CGI script for a basic flat-file based forum. + +Getting Started: + +* Set up your web server/place forest.py so that it is executed as a CGI script. + You'll probably have to change the python path at the top of this script and + chmod this script as appropriate if you're not on Windows. +* Put the stylesheet forest.css somewhere where it will be served by the + webserver. +* Edit some of the variables below to taste. Most important of all: + o DATA_PATH - Should point to a writable folder where the posts will be + stored. + o CSS_PATH - Specify where the stylesheet forest.css is. + (There are other settings within this file, mostly self explanatory.) +* Go to the appropriate URL and post away! + +LICENCE: + +Copyright (c) 2010 Andrew Nelis + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. +""" + + +import md5 +import os +import time + +# Show any errors on the page. You might want to take this out on a live server +# and look in the servers error log instead. +# Removed for compatibility issues +#import cgitb +#cgitb.enable() + +# ============================================================================ +# Configuration +# ============================================================================ + +# Where the threads are stored. This folder must exist. +DATA_PATH = '/opt/piratebox/share/forumspace/' +#Where the forest CGI is located (as a URL). +CGI_URL='/cgi-bin/forest.py' +# Where the main stylesheet is kept (as a URL). +CSS_PATH = '/content/css/forest.css' +# What is the title of the board? +BOARD_TITLE = 'PirateBox Board' +# Simple Description of the board, appears at the top of each page +BOARD_DESCRIPTION = """PirateBox Board. Put media reviews or questions here.
+Click here to go back to the main site """ +# How dates are stored (see python time module for details) +DATE_FORMAT = '%d %b %Y %H:%M:%S' +# If no author name is given, then this is the default. +ANON_AUTHOR = 'Anonymous Coward' + +# How many entries to show on the index? +INDEX_PAGE_SIZE = 20 +# How many entries to show on the thread page? +THREAD_PAGE_SIZE = 20 + +# Maximum lengths for names, subjects and message bodies. +# (currently we chop them off without warning) +MAX_AUTHOR_LEN = 20 +MAX_SUBJECT_LEN = 100 +MAX_BODY_LEN = 10000 + +# ============================================================================ +# HTML Elements. +# ============================================================================ +HTML_TOP = ''' + + + + + %s + + + + +

%s

+

%s

+''' % (BOARD_TITLE, CSS_PATH, BOARD_TITLE, BOARD_DESCRIPTION) + +HTML_BOTTOM = ''' +

Powered by the Forest Python Board +''' +HTML_THREADS_TOP = ''' + + + +''' +HTML_THREADS_ROW = ''' + + + +''' +HTML_NEW_THREAD = ''' +

Start a new thread

+
+
+

Name:

+

Subject:

+

+

+ +
+''' % (MAX_AUTHOR_LEN, MAX_SUBJECT_LEN) + +HTML_NEW_REPLY = ''' +

Reply to this thread

+
+
+

Name:

+

+

+ +
+''' % (MAX_AUTHOR_LEN,) + +HTML_THREADS_BOTTOM = '
SubjectAuthorDateRepliesLast Reply
%s%s%s%s%s
' +HTML_THREAD_TOP = ''' + + + + + +''' +HTML_THREAD_ROW = ''' + + + + +''' +HTML_THREAD_BOTTOM = ''' +
<< Main
%s
%s
%s
%s
+''' + +# ============================================================================ +# Error messages +# ============================================================================ + +ERR_INVALID_THREAD = '

Invalid Thread Specified

' +ERR_NO_SUBJECT = '

No Subject Given

' +ERR_NO_BODY = '

No body text!

' + +# ============================================================================ +# Misc. globals +# ============================================================================ + +# No need to fiddle with these though. +ROW_STYLES = {0: 'thread_row', 1: 'thread_row_alt'} +INDEX_FILE = os.path.join(DATA_PATH, 'index.txt') +THREAD_PATH = DATA_PATH + +# ============================================================================ +# Function definitions +# ============================================================================ + +html_escape_table = { + "&": "&", '"': """, "'": "'", ">": ">", + "<": "<", ';': ";", "/": "/", '=': "=", + ":": ":", '?': "?", '!': "!", '(': "(", + "{": "y", "[": "[", "-": "-", + } + +def strip_html( text ): + """Remove HTML chars from the given text and replace them with HTML + entities. """ + return "".join(html_escape_table.get(c,c) for c in text ) + + +def process_body(body): + """Process the message body e.g. for escaping smilies, HTML etc. + ready for storing. We should then just be able to print the body out""" + import re + # Maximum body length. + new_body = strip_html( body[:MAX_BODY_LEN] ) + new_body = new_body.replace('\n', '
\n') + # Turn (obvious) URLs into links. +# new_body = url_re.sub(r'\1', new_body) +# url_re = re.compile('(http://[\S\.]+)') + return new_body.encode('string_escape') + + +def process_author(author): + """Clean the author tag""" + # Remove tabs and ensure a maximum length. + new_author = strip_html( author[:MAX_AUTHOR_LEN] ) + return new_author.replace('\t', ' ') + + +def process_subject(subject): + """Clean the subject line""" + if ( subject is not None): + return subject[:MAX_SUBJECT_LEN] + else: + return "No Subject" + + +def get_query_params(): + """Return the URL parameters as a dictionary. + + Writing our own simple version means we don't have to import the cgi module + for every page (which noticeably slows down page viewing). + """ + param_string = os.getenv('QUERY_STRING', '') + params = param_string.split('&') + param_dict = {} + for param in params: + if '=' in param: + key, value = param.split('=', 1) + param_dict[key] = value + else: + param_dict[param] = None + return param_dict + + +def is_valid_hash(hash_string): + """Ensure that is a proper hash representing an existing + thread""" + # Should be a string comprising of hex digits + if not hash_string.isalnum(): + return False + if not os.path.exists(os.path.join(THREAD_PATH, hash_string)): + return False + return True + + +def get_offset(args): + """Get the page offset, validating or returning 0 if None or invalid.""" + offset = args.get('offset', '0') + if offset.isdigit(): + return int(offset) + else: + return 0 + + +def update_thread(author, subject=None, key=None): + """Update the thread, creating a new thread if key is None. Returns the + key (hash). + + author - String, the name of the author. + subject - String, the title of the thread. + key - String, the key to an existing thread to update. + + If is given, then it's assumed that we're starting a new thread + and if is given, then we should be updating an existing thread. + """ + now = time.strftime(DATE_FORMAT) + author = process_author(author) + + if key: + row_hash = key + else: + row_hash = md5.new('%s%s%s' % (now, author, subject)).hexdigest() + + # Read the index of threads in. + try: + threads = file(INDEX_FILE, 'r').readlines() + except IOError: + # The file gets (re)created later on so there's no problem. + threads = [] + + new_threads = [] + + # Index format: + # hash, date, num_replies, last_reply, author, subject + if not key: + # A new thread, put at the top. + new_threads.append('\t'.join( + (row_hash, now, '0', '-', author, subject))) + + for thread in threads: + if thread.startswith(row_hash): + # insert the updated thread at the beginning. + # (_ ignore last reply - we're setting it to now) + _, date, num_replies, _, author, subject = \ + thread.strip().split('\t') + num_replies = str(int(num_replies) + 1) + new_threads.insert(0, '\t'.join( + (row_hash, date, num_replies, now, author, subject))) + else: + new_threads.append(thread.strip()) + + # Overwrite the existing index with the updated index. + threads = file(INDEX_FILE, 'w') + threads.write('\n'.join(new_threads)) + threads.close() + + return row_hash + + +def new_subject(field_storage): + """Add a new subject to the list of threads. + + field_storage - cgi.FieldStorage instance. + + On success: + returns + On error: + raises ValueError with error as message. + """ + author = field_storage.getfirst( 'author', ANON_AUTHOR ) + subject = field_storage.getfirst( 'subject' ) + body = field_storage.getfirst( 'body' ) + if not subject: + raise ValueError( ERR_NO_SUBJECT ) + elif not body: + raise ValueError( ERR_NO_BODY ) + subject = strip_html(subject.replace('\t', ' ')) + row_hash = update_thread( author, subject ) + new_post( author, subject, body, row_hash ) + return row_hash + + +def new_post(author, subject, body, key): + """Create a new post, either by creating or appending to a post file. + + author, subject, body, key - Strings + """ + author = process_author(author) + subject = process_subject(subject) + body = process_body(body) + + date = time.strftime(DATE_FORMAT) + post_filename = os.path.join(THREAD_PATH, key) + if not os.path.exists(post_filename): + post_file = file(post_filename, 'w') + print >> post_file, '%s\t%s' % (key, subject) + else: + post_file = file(post_filename, 'a') + print >> post_file, '%s\t%s\t%s' % (date, author, body) + + +def reply(field_storage, key): + """Reply to an existing post. + + field_storage - A cgi.FieldStorage containing post data for the post + key - String, the id of the thread we're replying to. + + On success: + return + On failure: + raise ValueError with error message as error value. + """ + # Check that the thread id is valid. + if not (key and is_valid_hash(key)): + raise ValueError( ERR_INVALID_THREAD ) + author = field_storage.getfirst( 'author', ANON_AUTHOR ) + body = field_storage.getfirst( 'body' ) + if not body: + raise ValueError( ERR_NO_BODY ) + author = author.replace('\t', ' ') + update_thread(author, key=key) + new_post(author, None, body, key) + return key + + +def display_paging_links( current_offset, num_items, page_length, thread=None ): + """Display a list of links to go to a given page number""" + pages = num_items / page_length + # Any left over pages? + if (num_items % page_length): + pages += 1 + + if pages < 2: + # Only one page. Don't bother showing links. + return + + links = [] + if thread: + url = '?thread=%s&offset=%%d' % thread + else: + url = '?offset=%d' + for page_number in range(pages): + offset = page_number * page_length + if offset != current_offset: + links.append( '%s' % \ + (url % offset, page_number + 1) ) + else: + links.append( str( page_number + 1 ) ) + + print ' | '.join(links) + + +def list_threads(offset=0): + """List the existing threads.""" + if os.path.exists(INDEX_FILE): + thread_file = file(INDEX_FILE, 'r') + threads = thread_file.read().strip().split('\n') + thread_file.close() + else: + threads = [] + + num_threads = len(threads) + + display_paging_links(offset, num_threads, INDEX_PAGE_SIZE) + + print HTML_THREADS_TOP + + thread_index = -1 + + for thread in threads[offset:offset + INDEX_PAGE_SIZE]: + thread_index += 1 + + thread_items = thread.split('\t') + if len(thread_items) != 6: + continue + + thread_hash, date, num_replies, last_reply, author, subject = \ + thread_items + + link = '%s' % (thread_hash, subject) + + # Date Author Subject Replies Last Reply + print HTML_THREADS_ROW % (ROW_STYLES[thread_index % 2], link, author, + date, num_replies, last_reply) + + print HTML_THREADS_BOTTOM + print HTML_NEW_THREAD + + +def list_single_thread(thread_hash, offset=0): + """Output the HTMl for a given thread id""" + if not is_valid_hash(thread_hash): + print ERR_INVALID_THREAD + return + + thread_file = file(os.path.join(THREAD_PATH, thread_hash), 'r') + threads = thread_file.read().split('\n') + thread_file.close() + + # The first item in the file is actually the hash and the subject. But we + # don't need it really. + _, subject = threads.pop(0).split('\t') + num_posts = len(threads) + + display_paging_links(offset, num_posts, THREAD_PAGE_SIZE, thread_hash) + print HTML_THREAD_TOP % subject.strip() + + row_index = -1 + for line in threads[offset : offset + THREAD_PAGE_SIZE]: + row_index += 1 + split_line = line.split('\t') + if len(split_line) != 3: + continue + + date, author, body = split_line + print HTML_THREAD_ROW % (ROW_STYLES[row_index % 2], author, date, + body.decode('string_escape')) + + print HTML_THREAD_BOTTOM + print HTML_NEW_REPLY % thread_hash + + +def redirect( threadid, offset=None ): + """Redirect the browser""" + #new_location = os.environ.get('REQUEST_URI', '') + new_location = CGI_URL + new_location += '?thread=%s' % threadid + if offset: + new_location += '&offset=%s' % offset + +## can't use standard redirect on CGIHTTPServer +# print 'Status: 303 See Other' +# print 'Location: %s' % new_location +# print +# print 'Nothing to see here, move along!' + + print 'Content-Type: text/html; charset=utf-8' + print + print '' % new_location + print "" + +def handle(): + """Main entry point for our code. Handles the web request.""" + + query_params = get_query_params() + post_error = None + + if query_params.has_key('new'): + # We only want the whole cgi module when we need to parse POST data. + import cgi + form_data = cgi.FieldStorage() + what = query_params['new'] + if what == 'thread': + try: + thread_hash = new_subject(form_data) + redirect( thread_hash ) + return + except ValueError, error: + post_error = str( error ) + elif what == 'reply': + try: + thread_hash = reply(form_data, query_params.get('thread')) + # QQQ -> Get offset. + redirect( thread_hash ) + return + except ValueError, error: + post_error = str( error ) + + print 'Content-Type: text/html; charset=utf-8' + print + print HTML_TOP + + if post_error: + print post_error + + # paging. + offset = get_offset( query_params ) + + if query_params.has_key( 'thread' ): + list_single_thread( query_params['thread'], offset ) + else: + list_threads( offset ) + + print HTML_BOTTOM + + +if __name__ == '__main__': + handle() diff --git a/piratebox/piratebox/src/kareha.pl b/piratebox/piratebox/src/kareha.pl new file mode 100644 index 0000000..1ac763e --- /dev/null +++ b/piratebox/piratebox/src/kareha.pl @@ -0,0 +1,13 @@ +#!/usr/bin/perl -wT + +use strict; +use CGI; +use CGI::Carp qw ( fatalsToBrowser ); +use File::Basename; + +my $query = new CGI; + +print $query->header ( ); +print "Sorry, no Board is installed"; + +1; diff --git a/piratebox/piratebox/src/kareha_img_config.pl b/piratebox/piratebox/src/kareha_img_config.pl new file mode 100644 index 0000000..a37529f --- /dev/null +++ b/piratebox/piratebox/src/kareha_img_config.pl @@ -0,0 +1,173 @@ +# +# Example config file. +# +# Uncomment and edit the options you want to specifically change from the +# default values. You must specify ADMIN_PASS and SECRET. +# + +# System config +#use constant ADMIN_PASS => 'xyzPASSWORDzyx'; # Admin password. For fucks's sake, change this. +#use constant SECRET => 'xyzSECRETCODEzyx'; # Cryptographic secret. CHANGE THIS to something totally random, and long. +#use constant CAPPED_TRIPS => ('!!example1'=>' capcode','!!example2'=>' cap'); # Admin tripcode hash, for startng threads when locked down, and similar. Format is '!trip'=>'capcode', where 'capcode' is what is shown instead of the trip. This can contain HTML, but keep it valid XHTML! + +# Page look +use constant TITLE => 'PirateBox board'; # Name of this image board +use constant SHOWTITLETXT => 1; # Show TITLE at top (1: yes 0: no) +use constant SHOWTITLEIMG => 1; # Show image at top (0: no, 1: single, 2: rotating) +use constant TITLEIMG => '/content/img/piratebox-logo-small.png'; # Title image (point to a script file if rotating) +#use constant THREADS_DISPLAYED => 10; # Number of threads on the front page +#use constant THREADS_LISTED => 40; # Number of threads in the thread list +#use constant REPLIES_PER_THREAD => 10; # Replies shown +#use constant S_ANONAME => 'Anonymous'; # Defines what to print if there is no text entered in the name field +#use constant DEFAULT_STYLE => 'Futaba'; # Default CSS style title +use constant FAVICON => '/favicon.ico'; # Path to the favicon for the board + +# Limitations +use constant ALLOW_TEXT_THREADS => 1; # Allow users to create text threads +use constant ALLOW_TEXT_REPLIES => 1; # Allow users to make text replies +#use constant AUTOCLOSE_POSTS => 0; # Maximum number of posts before a thread closes. 0 to disable. +#use constant AUTOCLOSE_DAYS => 0; # Maximum number of days with no activity before a thread closes. 0 to disable. +#use constant AUTOCLOSE_SIZE => 0; # Maximum size of the thread HTML file in kilobytes before a thread closes. 0 to disable. +#use constant MAX_RES => 20; # Maximum topic bumps +#use constant MAX_THREADS => 0; # Maximum number of threads - set to 0 to disable +#use constant MAX_POSTS => 500; # Maximum number of posts - set to 0 to disable +#use constant MAX_MEGABYTES => 0; # Maximum size to use for all images in megabytes - set to 0 to disable +#use constant MAX_FIELD_LENGTH => 100; # Maximum number of characters in subject, name, and email +#use constant MAX_COMMENT_LENGTH => 8192; # Maximum number of characters in a comment +#use constant MAX_LINES_SHOWN => 15; # Max lines of a comment shown on the main page (0 = no limit) +#use constant ALLOW_ADMIN_EDIT => 0; # Allow editing of include files and spam.txt from admin.pl. + # Warning! This is a security risk, since include templates can run code! Only enable if you completely trust your moderators! + +# Image posts +#use constant ALLOW_IMAGE_THREADS => 1; # Allow users to create image threads +#use constant ALLOW_IMAGE_REPLIES => 1; # Allow users to make image replies +#use constant IMAGE_REPLIES_PER_THREAD => 0; # Number of image replies per thread to show, set to 0 for no limit. +use constant MAX_KB => 5000; # Maximum upload size in KB +#use constant MAX_W => 200; # Images exceeding this width will be thumbnailed +#use constant MAX_H => 200; # Images exceeding this height will be thumbnailed +#use constant THUMBNAIL_SMALL => 1; # Thumbnail small images (1: yes, 0: no) +#use constant THUMBNAIL_QUALITY => 70; # Thumbnail JPEG quality + use constant ALLOW_UNKNOWN => 0; # Allow unknown filetypes (1: yes, 0: no) + use constant MUNGE_UNKNOWN => '.unknown'; # Munge unknown file type extensions with this. If you remove this, make sure your web server is locked down properly. + use constant FORBIDDEN_EXTENSIONS => ('php','php3','php4','phtml','shtml','cgi','pl','pm','py','r','exe','dll','scr','pif','asp','cfm','jsp','vbs'); # file extensions which are forbidden + use constant STUPID_THUMBNAILING => 1; # Bypass thumbnailing code and just use HTML to resize the image. STUPID, wastes bandwidth. (1: enable, 0: disable) +#use constant MAX_IMAGE_WIDTH => 16384; # Maximum width of image before rejecting +#use constant MAX_IMAGE_HEIGHT => 16384; # Maximum height of image before rejecting +#use constant MAX_IMAGE_PIXELS => 50000000; # Maximum width*height of image before rejecting +#use constant CONVERT_COMMAND => 'convert'; # location of the ImageMagick convert command (usually just 'convert', but sometime a full path is needed) + +# Captcha +#use constant ENABLE_CAPTCHA => 0; # Enable verification codes (0: disabled, 1: enabled) +#use constant CAPTCHA_HEIGHT => 18; # Approximate height of captcha image +#use constant CAPTCHA_SCRIBBLE => 0.2; # Scribbling factor +#use constant CAPTCHA_SCALING => 0.15; # Randomized scaling factor +#use constant CAPTCHA_ROTATION => 0.3; # Randomized rotation factor +#use constant CAPTCHA_SPACING => 2.5; # Letter spacing + +# Tweaks +#use constant CHARSET => 'utf-8'; # Character set to use, typically "utf-8" or "shift_jis". Remember to set Apache to use the same character set for .html files! (AddCharset shift_jis html) +#use constant PROXY_CHECK => (); # Ports to scan for proxies - NOT IMPLEMENTED. +#use constant TRIM_METHOD => 0; # Which threads to trim (0: oldest - like futaba 1: least active - furthest back) +#use constant REQUIRE_THREAD_TITLE => 0; # Require a title for threads (0: no, 1: yes) +#use constant DATE_STYLE => 'futaba'; # Date style ('2ch', 'futaba', 'localtime, 'http') + use constant DISPLAY_ID => 'day'; # How to display user IDs (0 or '': don't display, + # 'day', 'thread', 'board' in any combination: make IDs change for each day, thread or board, + # 'mask': display masked IP address (similar IPs look similar, but are still encrypted) + # 'sage': don't display ID when user sages, 'link': don't display ID when the user fills out the link field, + # 'ip': display user's IP, 'host': display user's host) +#use constant EMAIL_ID => 'Heaven'; # Replace the ID with this string when the user uses an email. Set to '' to disable. +#use constant SILLY_ANONYMOUS => ''; # Make up silly names for anonymous people (same syntax as DISPLAY_ID) +#use constant FORCED_ANON => 0; # Force anonymous posting (0: no, 1: yes) +#use constant TRIPKEY => '!'; # This character is displayed before tripcodes +#use constant ALTERNATE_REDIRECT => 0; # Use alternate redirect method. (Javascript/meta-refresh instead of HTTP forwards.) +#use constant APPROX_LINE_LENGTH => 150; # Approximate line length used by reply abbreviation code to guess at the length of a reply. +#use constant COOKIE_PATH => 'root'; # Path argument for cookies ('root': cookies apply to all boards on the site, 'current': cookies apply only to this board, 'parent': cookies apply to all boards in the parent directory) - does NOT apply to the style cookie! +#use constant STYLE_COOKIE => 'wakabastyle'; # Cookie name for the style selector. +#use constant ENABLE_DELETION => 1; # Enable user deletion of posts. (0: no, 1: yes) +#use constant PAGE_GENERATION => 'paged'; # Page generation method ('single': just one page, 'paged': split into several pages like futaba, 'monthly': separate pages for each month) +#use constant DELETE_FIRST => 'remove'; # What to do when the first post is deleted ('keep': keep the thread, 'single': delete the thread if there is only one post, 'remove': delete the whole thread) +#use constant DEFAULT_MARKUP => 'waka'; # Default markup format ('none', 'waka', 'html', 'aa') +#use constant FUDGE_BLOCKQUOTES => 1; # Modify formatting for old stylesheets +#use constant USE_XHTML => 1; # Send pages as application/xhtml+xml to browsers that support this (0:no, 1:yes) +#use constant KEEP_MAINPAGE_NEWLINES => 0; # Don't strip whitespace from main page (needed for Google ads to work, 0:no, 1:yes) +#use constant SPAM_TRAP => 1; # Enable the spam trap (empty, hidden form fields that spam bots usually fill out) (0:no, 1:yes) + +# Internal paths and files - might as well leave this alone. +#use constant RES_DIR => 'res/'; # Reply cache directory (needs to be writeable by the script) +#use constant CSS_DIR => 'css/'; # CSS file directory +#use constant IMG_DIR => 'src/'; # Image directory (needs to be writeable by the script) +#use constant THUMB_DIR => 'thumb/'; # Thumbnail directory (needs to be writeable by the script) +#use constant INCLUDE_DIR => 'include/'; # Include file directory +#use constant LOG_FILE => 'log.txt'; # Log file (stores delete passwords and IP addresses in encrypted form) +#use constant PAGE_EXT => '.html'; # Extension used for board pages after first +#use constant HTML_SELF => 'index.html'; # Name of main html file +#use constant HTML_BACKLOG => ''; # Name of backlog html file +#use constant RSS_FILE => ''; # RSS file. Set to '' to disable RSS support. +#use constant JS_FILE => 'kareha.js'; # Location of the js file +#use constant SPAM_FILES => ('spam.txt'); # Spam definition files, as a Perl list. + # Hints: * Set all boards to use the same file for easy updating. + # * Set up two files, one being the official list from + # http://wakaba.c3.cx/antispam/spam.txt, and one your own additions. + +# Admin script options +#use constant ADMIN_SHOWN_LINES => 5; # Number of post lines the admin script shows. +#use constant ADMIN_SHOWN_POSTS => 10; # Number of posts per thread the admin script shows. +#use constant ADMIN_MASK_IPS => 0; # Mask poster IP addresses in the admin script (0: no, 1: yes) +#use constant ADMIN_EDITABLE_FILES => (SPAM_FILES); # A Perl list of all files that can be edited from the admin script. + # Hints: * If you don't trust your moderators, don't let them edit templates! + # Templates can execute code on your server! + # * If you still want to allow editing of templates, use + # (SPAM_FILES,glob("include/*")) as a convenient shorthand. +#use constant ADMIN_BAN_FILE => '.htaccess'; # Name of the file to write bans to +#use constant ADMIN_BAN_TEMPLATE => "\n# Banned at ()\nDeny from \n"; + # Format of the ban entries, using the template syntax. + + +# Icons for filetypes - file extensions specified here will not be renamed, and will get icons +# (except for the built-in image formats). These example icons can be found in the extras/ directory. + use constant FILETYPES => ( +# # Audio files + mp3 => 'icons/audio-mp3.png', + ogg => 'icons/audio-ogg.png', + aac => 'icons/audio-aac.png', + m4a => 'icons/audio-aac.png', + mpc => 'icons/audio-mpc.png', + mpp => 'icons/audio-mpp.png', + mod => 'icons/audio-mod.png', + it => 'icons/audio-it.png', + xm => 'icons/audio-xm.png', + fla => 'icons/audio-flac.png', + flac => 'icons/audio-flac.png', + sid => 'icons/audio-sid.png', + mo3 => 'icons/audio-mo3.png', + spc => 'icons/audio-spc.png', + nsf => 'icons/audio-nsf.png', + # Archive files + zip => 'icons/archive-zip.png', + rar => 'icons/archive-rar.png', + lzh => 'icons/archive-lzh.png', + lha => 'icons/archive-lzh.png', + gz => 'icons/archive-gz.png', + bz2 => 'icons/archive-bz2.png', + '7z' => 'icons/archive-7z.png', + # Other files + swf => 'icons/flash.png', + torrent => 'icons/torrent.png', + # To stop Wakaba from renaming image files, put their names in here like this: +# gif => '.', +# jpg => '.', +# png => '.', +); + +# Allowed HTML tags and attributes. Sort of undocumented for now, but feel free to +# learn by example. +#use constant ALLOWED_HTML => ( +# 'a'=>{args=>{'href'=>'url'},forced=>{'rel'=>'nofollow'}}, +# 'b'=>{},'i'=>{},'u'=>{},'sub'=>{},'sup'=>{}, +# 'em'=>{},'strong'=>{}, +# 'ul'=>{},'ol'=>{},'li'=>{},'dl'=>{},'dt'=>{},'dd'=>{}, +# 'p'=>{},'br'=>{empty=>1},'blockquote'=>{}, +#); + + +1; 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/no_forum.html b/piratebox/piratebox/src/no_forum.html new file mode 100644 index 0000000..6582521 --- /dev/null +++ b/piratebox/piratebox/src/no_forum.html @@ -0,0 +1,10 @@ + + +The kareha imageboard is not fully configured.
+
+Visit the following Link to do the initial configuration. +
+
+Or go back to PirateBox start page. + + diff --git a/piratebox/piratebox/src/no_link.html b/piratebox/piratebox/src/no_link.html new file mode 100644 index 0000000..e69de29 diff --git a/piratebox/piratebox/src/openwrt.example.minidlna b/piratebox/piratebox/src/openwrt.example.minidlna new file mode 100644 index 0000000..87029a3 --- /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 '/opt/piratebox/share/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' diff --git a/piratebox/piratebox/src/redirect.html.schema b/piratebox/piratebox/src/redirect.html.schema new file mode 100644 index 0000000..7dd58cc --- /dev/null +++ b/piratebox/piratebox/src/redirect.html.schema @@ -0,0 +1,13 @@ + + Redirect... + + + + + + + Redirect + + + + diff --git a/piratebox/piratebox/tmp/.keep b/piratebox/piratebox/tmp/.keep new file mode 100644 index 0000000..e69de29 diff --git a/piratebox/piratebox/www/.READ.ME.htm b/piratebox/piratebox/www/.READ.ME.htm new file mode 100755 index 0000000..0337342 --- /dev/null +++ b/piratebox/piratebox/www/.READ.ME.htm @@ -0,0 +1,44 @@ + + + +READ ME + + + + + + +

+ + + +

+ + + + + + + +

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://daviddarts.com/piratebox +


+ + +

+

+ +
+

diff --git a/piratebox/piratebox/www/cgi-bin/data.pso b/piratebox/piratebox/www/cgi-bin/data.pso new file mode 100644 index 0000000..7fe930e --- /dev/null +++ b/piratebox/piratebox/www/cgi-bin/data.pso @@ -0,0 +1,3 @@ +
09:52:54 Anonymous:ttttttttt
+
09:52:25 Anonymous:ttt
+
09:32:38 Anonymous:test
diff --git a/piratebox/piratebox/www/cgi-bin/diskwrite.py b/piratebox/piratebox/www/cgi-bin/diskwrite.py new file mode 100755 index 0000000..b2bd170 --- /dev/null +++ b/piratebox/piratebox/www/cgi-bin/diskwrite.py @@ -0,0 +1,14 @@ +#!/usr/bin/python + +# Disk Write +# Writes the total freespace to an HTML file. + +import cgi, datetime +from diskusage import get_usage + + +print "Content-type:text/html\r\n\r\n" + +get_usage("/opt/piratebox/share/Shared/") + +print """ok""" diff --git a/piratebox/piratebox/www/cgi-bin/psoread.py b/piratebox/piratebox/www/cgi-bin/psoread.py new file mode 100755 index 0000000..3ae7a48 --- /dev/null +++ b/piratebox/piratebox/www/cgi-bin/psoread.py @@ -0,0 +1,13 @@ +#!/usr/bin/python + +# PyShoutOut by Joey C. (http://www.joeyjwc.x3fusion.com) +# Read the data from a shout-out file. + + +# Changed by Matthias Strubel / 2011-02-27 for piratebox-path + +from psogen import generate_html_to_display_from_file + +print "Content-type:text/html\r\n\r\n" + +generate_html_to_display_from_file() diff --git a/piratebox/piratebox/www/cgi-bin/psowrte.py b/piratebox/piratebox/www/cgi-bin/psowrte.py new file mode 100755 index 0000000..ad2eaa3 --- /dev/null +++ b/piratebox/piratebox/www/cgi-bin/psowrte.py @@ -0,0 +1,27 @@ +#!/usr/bin/python + +# PyShoutOut by Joey C. (http://www.joeyjwc.x3fusion.com) +# Writes the recieved information to the data file. +import cgi +from psogen import process_form + + +print "Content-type:text/html\r\n\r\n" + +values = cgi.FieldStorage() +if "name" in values: + rawname = values["name"].value +else: + rawname = " " +if "data" in values: + rawdata = values["data"].value +else: + rawdata = " " + +color = values["color"].value +timestamp = float(values["timestamp"].value) + +process_form(rawname, rawdata, color, timestamp) + +print "Status:200\r\n\r\n" +print """ok""" diff --git a/piratebox/piratebox/www/cgi-bin/style.css b/piratebox/piratebox/www/cgi-bin/style.css new file mode 100755 index 0000000..0b49a2f --- /dev/null +++ b/piratebox/piratebox/www/cgi-bin/style.css @@ -0,0 +1,8 @@ +date { font-size: 10pt; color: #666666; font-family:Tahoma } +name { font-weight: bold; font-family:Tahoma } +data { font-family: Tahoma } +data.def { color: #000000 } +data.blue { color: #0000FF } +data.green { color: #008000 } +data.orange { color: #FF8040 } +data.red { color: #FF0000 } \ No newline at end of file diff --git a/piratebox/piratebox/www/generate_204 b/piratebox/piratebox/www/generate_204 new file mode 100644 index 0000000..8bddb09 --- /dev/null +++ b/piratebox/piratebox/www/generate_204 @@ -0,0 +1,5 @@ + diff --git a/piratebox/piratebox/www/index.html b/piratebox/piratebox/www/index.html new file mode 100755 index 0000000..81848cc --- /dev/null +++ b/piratebox/piratebox/www/index.html @@ -0,0 +1,11 @@ + +Redirect... + + + + + + +Redirect + + diff --git a/piratebox/piratebox/www/library/test/success.html b/piratebox/piratebox/www/library/test/success.html new file mode 100644 index 0000000..67d95ea --- /dev/null +++ b/piratebox/piratebox/www/library/test/success.html @@ -0,0 +1,9 @@ + + + + Success + + +Success + + diff --git a/piratebox/piratebox/www/ncsi.txt b/piratebox/piratebox/www/ncsi.txt new file mode 100644 index 0000000..8ac0217 --- /dev/null +++ b/piratebox/piratebox/www/ncsi.txt @@ -0,0 +1 @@ +Microsoft NCSI diff --git a/piratebox/piratebox/www/redirect.html b/piratebox/piratebox/www/redirect.html new file mode 100755 index 0000000..81848cc --- /dev/null +++ b/piratebox/piratebox/www/redirect.html @@ -0,0 +1,11 @@ + +Redirect... + + + + + + +Redirect + + diff --git a/piratebox/piratebox/www/station_cnt.txt b/piratebox/piratebox/www/station_cnt.txt new file mode 100644 index 0000000..e69de29 diff --git a/piratebox/piratebox/www/upload_handler/files/.gitignore b/piratebox/piratebox/www/upload_handler/files/.gitignore new file mode 100644 index 0000000..e24a60f --- /dev/null +++ b/piratebox/piratebox/www/upload_handler/files/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore +!.htaccess diff --git a/piratebox/piratebox/www_content/css/jquery-ui.min.css b/piratebox/piratebox/www_content/css/jquery-ui.min.css new file mode 100644 index 0000000..5ceebe5 --- /dev/null +++ b/piratebox/piratebox/www_content/css/jquery-ui.min.css @@ -0,0 +1,7 @@ +/*! jQuery UI - v1.11.4 - 2015-09-17 +* http://jqueryui.com +* Includes: core.css, tooltip.css, theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=gloss_wave&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=highlight_soft&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=glass&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=diagonals_thick&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=diagonals_thick&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px +* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #ddd;background:#eee url("images/ui-bg_highlight-soft_100_eeeeee_1x100.png") 50% top repeat-x;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #e78f08;background:#f6a828 url("images/ui-bg_gloss-wave_35_f6a828_500x100.png") 50% 50% repeat-x;color:#fff;font-weight:bold}.ui-widget-header a{color:#fff}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #ccc;background:#f6f6f6 url("images/ui-bg_glass_100_f6f6f6_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#1c94c4}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#1c94c4;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #fbcb09;background:#fdf5ce url("images/ui-bg_glass_100_fdf5ce_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#c77405}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#c77405;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #fbd850;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#eb8f00}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#eb8f00;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fed22f;background:#ffe45c url("images/ui-bg_highlight-soft_75_ffe45c_1x100.png") 50% top repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#b81900 url("images/ui-bg_diagonals-thick_18_b81900_40x40.png") 50% 50% repeat;color:#fff}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#fff}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#fff}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_228ef1_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_ffd27a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#666 url("images/ui-bg_diagonals-thick_20_666666_40x40.png") 50% 50% repeat;opacity:.5;filter:Alpha(Opacity=50)}.ui-widget-shadow{margin:-5px 0 0 -5px;padding:5px;background:#000 url("images/ui-bg_flat_10_000000_40x100.png") 50% 50% repeat-x;opacity:.2;filter:Alpha(Opacity=20);border-radius:5px} \ No newline at end of file diff --git a/piratebox/piratebox/www_content/css/page_style.css b/piratebox/piratebox/www_content/css/page_style.css new file mode 100644 index 0000000..3a8f15b --- /dev/null +++ b/piratebox/piratebox/www_content/css/page_style.css @@ -0,0 +1,388 @@ +* { + overflow: auto; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; +} + +html, body, div, object, iframe, fieldset { + border: 0; +} + +ol, ul { + list-style: none; +} + +table { + border-spacing: 0; + border-collapse: collapse; +} + +header, footer, footer, nav, section, article, hgroup, figure { + display: block; +} + +legend { + display: none; +} + +body { + color: #1b1d1e; + font-family: sans-serif; + font-size: 100%; +} + +h1 { + font-size: 1em; + font-weight: bold; + line-height: auto; + margin: 0; +} + +h2 { + font-size: 1.3em; + font-weight: bold; + line-height: auto; + margin: 0 0 0.25em; +} + +h3 { + font-size: 1em; + font-weight: bold; + line-height: auto; + margin: 0 0 0.25em; +} + +p { + font-size: 1em; + font-weight: normal; + line-height: 1.5em; + margin: 0 0 1em; +} + +a { + color: #ad000b; + 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; +} + +.green { + color: green; +} + +.blue { + color: blue; +} + +.orange { + color: #ff8040; +} + +body { + background: #e7e9ea; +} + +header, footer { + background: #1b1d1e; +} +header img, footer img { + vertical-align: bottom; +} + +#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; + 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 { + clear: both; + display: none; + padding: 1em 0 0 0; +} + +#thanks { + float: right; +} + +#upload iframe { + border: 1px solid #979ea1; + border-radius: 3px; + margin: 0 0 1em; +} + +#shoutbox { + height: 350px; + overflow: auto; + width: 100%; + border: 1px solid #979ea1; + border-radius: 3px; + margin: 0 0 1em; + padding: 0.5em; +} +#shoutbox .message { + margin: 0 0 .25em 0; +} + +#shoutbox-input { + margin: 0 0 1em 0; +} +#shoutbox-input .nickname, +#shoutbox-input .message, +#shoutbox-input .button { + width: 100%; +} + +#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 { + height: 3em; + border: 1px solid #979ea1; + border-radius: 3px; + margin: 0 0 1em; + padding: 0 0.5em; +} + +input[type=radio] { + height: 1.3em; + margin: 0 .5em 0 0; +} + +.button { + background: #979ea1; + border: 0; + color: white; + margin: 0; +} + +.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 { + margin: 0 2em 0 0; + } + + #menu-icon { + display: none; + } + + #top-nav { + clear: none; + display: table-cell; + padding: 0; + vertical-align: middle; + } + #top-nav ul li { + float: left; + } + #top-nav ul li a { + margin: 0 1em 0 0; + padding: 0; + } + + #sidebar { + float: right; + width: 40%; + } + + #main { + float: left; + padding: 0 1em 0 0; + width: 60%; + } + + #shoutbox-input .nickname { + float: left; + margin: 0 1em 0 0; + width: 20%; + } + #shoutbox-input .message { + float: left; + margin: 0 1em 0 0; + width: 60%; + } + #shoutbox-input .button { + float: right; + margin: 0; + width: 15%; + } + + .to-top { + display: none; + } + + .container { + margin: 0 auto; + max-width: 1280px; + width: 90%; + } + + .list table .m, + .list table .s, + .list table .t { + display: table-cell; + } +} + +/* +Progress bar used from the Bootstrap Library: +https://github.com/twbs/bootstrap + +Licensed under the MIT license. +*/ + +.progress { + height: 20px; + margin-bottom: 20px; + overflow: hidden; + background-color: #F5F5F5; + border-radius: 4px; + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1) inset; +} + +.progress-bar { + float: left; + width: 0px; + font-size: 12px; + line-height: 20px; + color: #FFF; + text-align: center; + background-color: #337AB7; + box-shadow: 0px -1px 0px rgba(0, 0, 0, 0.15) inset; + transition: width 0.6s ease 0s; +} diff --git a/piratebox/piratebox/www_content/favicon.ico b/piratebox/piratebox/www_content/favicon.ico new file mode 100755 index 0000000000000000000000000000000000000000..d18db961f50856a4597031c729cd3f2d031fdb78 GIT binary patch literal 1406 zcmeHGJ8PO@6nUZT-YV;l7|aS%ihRB-6vAVwE;5FETA zPKru!6-5GqQ^1UZAddb3Cnp^gRPfTzN+E0LRLJvk&U4Pg;k@v?yuciNSS-+a0l%2Q zDu8V|XbBuTrurYu&FFGnC=`&*W|7HckW3~Ki^UL)MiGfb5DteC3;W2n_?jK^cBR4NRILnssq^!t6t<#NbmGIYCLkR%DQ zSPYR!gjTBsKA#URmy2eziAJM=dcBTXt%ho~igLM(i;D}KpP!>xEaL3!4EcN>xm*tE zbQ-6pr%0tzNF)-7$KwcvLI?x`@Or)Qcsy{qTyQuXu-omh*=(>{t*}@uFqup+7!1&A zwa{oZm`o-ZjYd!^l^6^L==FM#N~P#@I*>>tXt&!C3WX2|1mN*_s8lK_l}eY)ye_XD z_&*(>|KpXQI8xB_U-p;x88pAz;S(#2t!Eod%s)O*f9DYIBuYZXdvfdj0wp8}@ja5< ze6zStO!45x^VwB*S3a?by_<(0=yvn%NB+hU`GUPhewN(d#aD`2UT3Z{sF!PdOHV24 vwP;sKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA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Z2K@z%wUx#>5f80Ur5qk%GFsy+$hT(DOaInyv*Ub@Sa|T0g8SaF~!0| zFxxvmyy<+u3G+gxZ*TA*T7Gt-UUC*!(|IlaLgfoEC0Z_Cre&k}JVkLXA+@b^=|o$g zH;H+OX<}~frKMV+MlLXIr9erc--E!P<*5$Tg!BnqvwS;F`vz>BJ6a)K`{u#gzF_q*OvT7O53d{>@X))hQ`s*<@ zW1}$zyhq_LlANpD&Q;Qo@>ZIlw+8NgFIR}@BPpWA+&|FQ^R#RVH(Q^g6;>|_2>akN z=Ow97w^ZSre%6L_doupArgLIKy);-V<(}{HsOJZ+xlxY6##J#n+m#Vlk(Vnx4MVZM zEq3r*Qo2xS$>U{^4ioXeDZ4}uK3JZyPM_Hr8rBU7*NCxL<%Wi}f&P4zbmVMyzDcVwpN?ahp7zx6WeasxX_EzQui1`Pb1H z_A?6WsukKTQFvIe`s(7cOfd#6`sJ;nr9d0VQqJ>)R#N9CktBsb>cGBXM zyO~<839Ys!v_?WV-3eQ<#74x;VU8dK~n7K^<5yM)L z+uSn;t6V1oFpq>Xq7*W?3x@UXP0P>w%}}^KBjNgOq?n7Xb*ZvAhq#Dh4b5@MTEAv7 z#mjP~QugDw88Unk$Y)cKAw#BI88T$bl_5ihOt~^-$doHXhOZj_GXN;~s{09Nl#>7e N002ovPDHLkV1jWucp(4) literal 0 HcmV?d00001 diff --git a/piratebox/piratebox/www_content/img/piratebox-logo-small.png b/piratebox/piratebox/www_content/img/piratebox-logo-small.png new file mode 100755 index 0000000000000000000000000000000000000000..667a5d8ddf26a14f98083f91850482bceeaae56a GIT binary patch literal 12637 zcmXw9Wmr^Q7rjFcJ#=>t-HLPxj3BLmba#jnQbRXLNq0#j2+|A~)# zrUcYaGW5`piTg%FOBHt+gA|vM zi`agt2>@6C4HZQLzoo+<|2#9pjH54?a=R-5E}DkC8g|b|BRE*`AXpJNkw;Ix6#lp) zTA7Jgmwxyt-xT!VsA7F0?ff&h-aPB0#DM;#DCRp6?^npM0u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0gm(#jTlt^h$kdjLZRk6l=W?s_ihzflOGT=crrrp22)H3^FArwia@A4UY-cn z?H~E)sSwSlwTh><%u}h|p=RCAHc$8`mcA*Vw-Egt`o=BE#Q(e#LYg^(9><>~rNoB~dLoM7n$cebdCjRx1n!ZRNM^beRt1c%$| z%vlX^LyS>aQ8XNvIftWGn3lqukAFiXQTLsIqN6Rne7u_{!?=f?)elXsL(RtMcw?{+ zidgo;N#8hhHvls?S#E(Nk!FB@<0Ut-${L2GK(G@V1>?F62vOi5KqAbDsHSi&rgfAX z>NoWZ{JU@_X`I)rVkDq6jFUWx^k4SOcAmqb0N{WjL4Y?Q$E>S6o9eInu~mHAaxqbNVckr#*df%$^!{%i4P zLYLB0K9`)eL6PO?*1r757Z*9mj{G-{){R(&?Tts~Mo7gel*9)gKTlq+kIL~{W0tK7&GCkat8iAQR!a?LC&rr-EiZ3+0~C1IpSTyFtrooj~w}#MW=7$teIFPB2h8?|G`7U@B?PE%G-g` SMg1TEeQ2mYSE*OB4ErDSeE~=S literal 0 HcmV?d00001 diff --git a/piratebox/piratebox/www_content/index.html b/piratebox/piratebox/www_content/index.html new file mode 100644 index 0000000..1f09279 --- /dev/null +++ b/piratebox/piratebox/www_content/index.html @@ -0,0 +1,110 @@ + + + + + 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_content/js/jquery-ui.min.js b/piratebox/piratebox/www_content/js/jquery-ui.min.js new file mode 100644 index 0000000..98783ec --- /dev/null +++ b/piratebox/piratebox/www_content/js/jquery-ui.min.js @@ -0,0 +1,6 @@ +/*! jQuery UI - v1.11.4 - 2015-09-17 +* http://jqueryui.com +* Includes: core.js, widget.js, position.js, tooltip.js +* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ + +(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var s=0,n=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,a=n.call(arguments,1),o=0,r=a.length;r>o;o++)for(i in a[o])s=a[o][i],a[o].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(a){var o="string"==typeof a,r=n.call(arguments,1),h=this;return o?this.each(function(){var i,n=e.data(this,s);return"instance"===a?(h=n,!1):n?e.isFunction(n[a])&&"_"!==a.charAt(0)?(i=n[a].apply(n,r),i!==n&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+a+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+a+"'")}):(r.length&&(a=e.widget.extend.apply(null,[a].concat(r))),this.each(function(){var t=e.data(this,s);t?(t.option(a||{}),t._init&&t._init()):e.data(this,s,new i(a,this))})),h}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=s++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget,function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("
"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.widthi?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(N,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.tooltip",{version:"1.11.4",options:{content:function(){var t=e(this).attr("title")||"";return e("
").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("
").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t.element)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s.element[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(t,s),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){n._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=a),this._open(t,e,i))})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,o.is(":hidden")||o.position(l)}var a,o,r,h,l=e.extend({},this.options.position);if(s){if(a=this._find(i))return a.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),o=a.tooltip,this._addDescribedBy(i,o.attr("id")),o.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(h=s.clone(),h.removeAttr("id").find("[id]").removeAttr("id")):h=s,e("
").html(h).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):o.position(e.extend({of:i},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){o.is(":visible")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger("open",t,{tooltip:o})}},_registerCloseHandlers:function(t,i){var s={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(s.mouseleave="close"),t&&"focusin"!==t.type||(s.focusout="close"),this._on(!0,i,s)},close:function(t){var i,s=this,n=e(t?t.currentTarget:this.element),a=this._find(n);return a?(i=a.tooltip,a.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),a.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(e(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete s.parents[t]}),a.closing=!0,this._trigger("close",t,{tooltip:i}),a.hiding||(a.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(t){var i=e("
").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("
").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]={element:t,tooltip:i}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur"),a=s.element;n.target=n.currentTarget=a[0],t.close(n,!0),e("#"+i).remove(),a.data("ui-tooltip-title")&&(a.attr("title")||a.attr("title",a.data("ui-tooltip-title")),a.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})}); \ No newline at end of file diff --git a/piratebox/piratebox/www_content/js/jquery.min.js b/piratebox/piratebox/www_content/js/jquery.min.js new file mode 100644 index 0000000..b8c4187 --- /dev/null +++ b/piratebox/piratebox/www_content/js/jquery.min.js @@ -0,0 +1,4 @@ +/*! jQuery v2.2.3 | (c) jQuery Foundation | 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=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.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()},push:g,sort:c.sort,splice:c.splice},n.extend=n.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||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;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,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=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)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(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 oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(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"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.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===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!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 fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.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},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.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=fa.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=fa.selectors={cacheLength:50,createPseudo:ha,match:W,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(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===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]||fa.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]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.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(ba,ca).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("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.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.replace(P," ")+" ").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,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(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),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).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 Y.test(a.nodeName)},input:function(a){return X.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:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(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,k=[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(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(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 ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(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 va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(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?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(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 va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.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(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.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(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(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&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.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=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;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},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c; +}catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.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=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.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 N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length",""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!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&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,la=/\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("