diff --git a/.gitignore b/.gitignore index 57eb33e0..6b14e74c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ tmp/* piratebox/piratebox/bin/miniircd.py piratebox/piratebox/www/Shared piratebox/piratebox/www/cgi-bin/data.pso +piratebox/piratebox/rpi/motd.txt diff --git a/AUTHORS b/AUTHORS index a077c0e9..6c36b8dc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -26,6 +26,7 @@ Contributors for modifications: # casdr # jdieg0 # a-ira + # ponsfrilus # ... and all others I might have forgotten. diff --git a/CHANGELOG b/CHANGELOG index 087b728a..7b3c07d7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,34 @@ CHANGELOG +=== 1.1.4 === +* [New] Removed legacy redirect.html, use /index.html only +* [New] install_piratebox.sh, avoid distribution of index files, if turned off. +* [New] mime.types: Adding gpx mime-type +* [New] [i8n] Spanish and Basque +* [New] [i8n] Russian translation +* [New] [RPi] Add all needed things to create a simple on/off button +* [Changed] [RPi] MotD generation reworked and more dynamically +* [Changed] [RPi] Run timesave-save function during shutdown +* [Changed] [RPi] Work with en_US.UTF-8 per default +* [Fix] diskusage: Fix wrong error message +* [Fix] lang-de ; fix grammar +* [Fix] [RPi] Fix wrong path in wifi client helper script +* [Fix] [RPi] Fix issue with diskusage generation & usb share +* [Fix] [RPi] Enable cronie for startup, which was missing +* [Fix] [RPi] Fixed resolv.conf. A default entry is now available +* [Fix] [RPi] Fixed detection of 8188eu +* [Fix] [RPi] Store the installed hostap package in /prebuild/hostapd +* [Fix] initd: minircd startup fix setuid +* [Fix] initd: minircd fixing start-stop issues +* [Fix] initd: Fix radvd path to an absolute path +* [Fix] initd: Ugly hack for absolute path of radvd on OpenWrt +* [Fix] WWW-Content, fix a syntax error which broke jQuery +* [Fix] Refresh kareha download URL, which changed in year 2015 +* [Fix] diskusage: Adding missing tag +* [Fix] timesave: Shellcheck issues fixed +* [Fix] timesave: Problems with date & time format at RPi fixed + + === 1.1.3 === * [New] Translation bt-pr * [New] [RPi] Helper scripts to jump to wifi client mode @@ -21,11 +50,11 @@ CHANGELOG * [Fix] Translation en,fr LibraryBox -> PirateBox * [Fix] Spellings in translation * [Fix] IRC startup command failed. -* [Removed] exchange_www.sh +* [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] 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 @@ -41,7 +70,7 @@ CHANGELOG * [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] 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 @@ -75,15 +104,15 @@ CHANGELOG * [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. +* [Fix] Timesave script behaviour fixed on full Linux systems. * OpenWrt's date format is now customized during build & piratebox.conf . -=== 1.0.4 === +=== 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] 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 @@ -120,11 +149,11 @@ CHANGELOG * [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] 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 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 @@ -154,9 +183,9 @@ NOTE: This may only be a partial changelog, check github / your package manager * [Removed] [Testing] Executable, we will stick to service based * [Fixed] Overwritten saved timestamp with 1970 one * [New] possibility in install_piratebox.sh to exchange the hostname easily -* [New] Moved DHCP leasefile into memory on OpenWRT system (/tmp is memory) +* [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] 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 diff --git a/Makefile b/Makefile index 6282dcb3..45bd9775 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME = piratebox-ws -VERSION = 1.1.3 +VERSION = 1.1.4 ARCH = all PB_FOLDER=piratebox PB_SRC_FOLDER=$(PB_FOLDER)/$(PB_FOLDER) @@ -7,6 +7,7 @@ PB_SRC_FOLDER=$(PB_FOLDER)/$(PB_FOLDER) PACKAGE_NAME=$(NAME)_$(VERSION) PACKAGE=$(PACKAGE_NAME).tar.gz VERSION_FILE=$(PB_FOLDER)/$(PB_FOLDER)/version +MOTD=$(PB_FOLDER)/$(PB_FOLDER)/rpi/motd.txt IMAGE_FILE=piratebox_ws_1.1_img.gz TGZ_IMAGE_FILE=piratebox_ws_1.1_img.tar.gz @@ -32,16 +33,18 @@ $(IRC_TARGET_SERVER): git clone $(IRC_GITHUB_ULR) $(IRC_WORK_FOLDER) cp $(IRC_SRC_SERVER) $(IRC_TARGET_SERVER) -$(VERSION): +$(MOTD): + sed -e 's|##version##|$(VERSION)|' rpi.motd-template.txt > $@ + +$(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) - +$(PACKAGE): $(IRC_TARGET_SERVER) $(VERSION) $(MOTD) + tar czf $@ $(PB_FOLDER) -$(IMAGE_FILE): $(IRC_TARGET_SERVER) $(VERSION) $(SRC_IMAGE_UNPACKED) $(OPENWRT_CONFIG_FOLDER) $(OPENWRT_BIN_FOLDER) +$(IMAGE_FILE): $(IRC_TARGET_SERVER) $(VERSION) $(SRC_IMAGE_UNPACKED) $(OPENWRT_CONFIG_FOLDER) $(OPENWRT_BIN_FOLDER) $(MOTD) mkdir -p $(MOUNT_POINT) echo "#### Mounting image-file" sudo mount -o loop,rw,sync $(SRC_IMAGE_UNPACKED) $(MOUNT_POINT) @@ -66,7 +69,7 @@ $(OPENWRT_CONFIG_FOLDER): 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:TIMESAVE_FORMAT="+%C%g%m%d %H%M":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 @@ -93,7 +96,7 @@ clean: cleanimage rm -fr $(IRC_WORK_FOLDER) rm -f $(IRC_TARGET_SERVER) rm -f $(PACKAGE) - rm -f $(VERSION_FILE) + rm -f $(VERSION_FILE) $(MOTD) cleanimage: - rm -f $(TGZ_IMAGE_FILE) diff --git a/development/lighttpd_extra.conf b/development_helper/lighttpd_extra.conf similarity index 98% rename from development/lighttpd_extra.conf rename to development_helper/lighttpd_extra.conf index 3a0741b1..f1f7aa82 100644 --- a/development/lighttpd_extra.conf +++ b/development_helper/lighttpd_extra.conf @@ -81,7 +81,7 @@ $HTTP["url"] =~ "^/board/" { # 404 Error Page with redirect # -#server.error-handler-404 = "/redirect.html" +#server.error-handler-404 = "/index.html" ## for better debugging #server.modules += ( "mod_accesslog" ) diff --git a/development/lighttpd_inside.conf b/development_helper/lighttpd_inside.conf similarity index 98% rename from development/lighttpd_inside.conf rename to development_helper/lighttpd_inside.conf index 2e0ce8fb..78006745 100644 --- a/development/lighttpd_inside.conf +++ b/development_helper/lighttpd_inside.conf @@ -81,7 +81,7 @@ $HTTP["url"] =~ "^/board/" { # 404 Error Page with redirect # -#server.error-handler-404 = "/redirect.html" +#server.error-handler-404 = "/index.html" ## for better debugging #server.modules += ( "mod_accesslog" ) diff --git a/piratebox/piratebox/bin/install_piratebox.sh b/piratebox/piratebox/bin/install_piratebox.sh index 7a6e9320..92f5e762 100755 --- a/piratebox/piratebox/bin/install_piratebox.sh +++ b/piratebox/piratebox/bin/install_piratebox.sh @@ -66,7 +66,9 @@ if [ $2 = 'part2' ] ; then mkdir -p $PIRATEBOX_FOLDER/tmp #Distribute the Directory Listing files - $PIRATEBOX_FOLDER/bin/distribute_files.sh $SHARE_FOLDER/Shared true + if [ "$CUSTOM_DIRLIST_COPY" = "yes" ] ; then + $PIRATEBOX_FOLDER/bin/distribute_files.sh $SHARE_FOLDER/Shared true + fi #Set permissions chown $LIGHTTPD_USER:$LIGHTTPD_GROUP $PIRATEBOX_FOLDER/share -R chmod u+rw $PIRATEBOX_FOLDER/share @@ -101,7 +103,7 @@ if [ $2 = 'imageboard' ] ; then 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 + wget http://wakaba.c3.cx/releases/Kareha/$KAREHA_RELEASE if [ "$?" != "0" ] ; then echo "wget kareha failed.. you can place the current file your to $PIRATEBOX_FOLDER/tmp " fi @@ -161,7 +163,7 @@ 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#####|$name|g" $PIRATEBOX_FOLDER/src/redirect.html.schema > $WWW_FOLDER/index.html sed "s|HOST=\"$HOST\"|HOST=\"$name\"|" -i $PIRATEBOX_CONFIG } diff --git a/piratebox/piratebox/bin/timesave.sh b/piratebox/piratebox/bin/timesave.sh index a5e691e3..28134baa 100755 --- a/piratebox/piratebox/bin/timesave.sh +++ b/piratebox/piratebox/bin/timesave.sh @@ -19,11 +19,11 @@ get_datetime() { # Strip spaces from datetime sanitize_datetime() { - echo $1 | sed s/" "/""/g + echo "$1" | sed s/" "/""/g } # Print usage if parameters are not provided -if [ -z $1 ] || [ -z $2 ] ; then +if [ -z "$1" ] || [ -z "$2" ] ; then echo "Set up a crontab entry for regulary saving the time" echo "Usage $0 " echo " Valid steps are:" @@ -35,7 +35,7 @@ if [ -z $1 ] || [ -z $2 ] ; then fi # Load configfile -. $1 +. "$1" if [ "$2" = "install" ] ; then crontab -l > $PIRATEBOX_FOLDER/tmp/crontab 2> /dev/null @@ -44,9 +44,9 @@ if [ "$2" = "install" ] ; then crontab $PIRATEBOX_FOLDER/tmp/crontab echo "initialize timesave file" - touch $TIMESAVE - chmod a+rw $TIMESAVE - get_datetime > $TIMESAVE + 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" @@ -56,14 +56,14 @@ fi # Save current date-time in a recoverable format if [ "$2" = "save" ] ; then - if [ -e $TIMESAVE ] ; 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 + get_datetime > "$TIMESAVE" exit 0 fi diff --git a/piratebox/piratebox/conf/lighttpd/lighttpd.conf b/piratebox/piratebox/conf/lighttpd/lighttpd.conf index dfac75bc..0e23f410 100644 --- a/piratebox/piratebox/conf/lighttpd/lighttpd.conf +++ b/piratebox/piratebox/conf/lighttpd/lighttpd.conf @@ -99,7 +99,7 @@ setenv.add-response-header += ( "Cache-Control" => "max-age=60, must-revalidate, # 404 Error Page with redirect # -server.error-handler-404 = "/redirect.html" +server.error-handler-404 = "/index.html" ## for better debugging #server.modules += ( "mod_accesslog" ) diff --git a/piratebox/piratebox/conf/lighttpd/mime.types b/piratebox/piratebox/conf/lighttpd/mime.types index 12187203..b5119590 100644 --- a/piratebox/piratebox/conf/lighttpd/mime.types +++ b/piratebox/piratebox/conf/lighttpd/mime.types @@ -87,7 +87,7 @@ mimetype.assign = ( ".epub" => "application/epub+zip", ".fb2" => "text/xml", ".svg" => "image/svg+xml", - + ".gpx" => "application/gpx+xml", # make the default mime type application/octet-stream. "" => "application/octet-stream", ) diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index aa61cc41..47cdc122 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -116,10 +116,8 @@ NODE_CONFIG="$PIRATEBOX_FOLDER/conf/node.conf" ## 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="" +## Format for storing & recovering the date&time +TIMESAVE_FORMAT="+%C%g%m%d %H%M" #Start droopy? - Enable upload? DROOPY_ENABLED="yes" diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index b4862dbb..c3a75e15 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -157,7 +157,7 @@ case "$1" in 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 + start-stop-daemon --start --quiet --exec /usr/bin/radvd -- -p $PIDFILE_RADVD -C $CONF_RADVD log_end_msg $? fi @@ -200,14 +200,14 @@ case "$1" in . $CONF_IRC - IRC_PARMS="--setuid $IRC_USER --daemon --motd '$IRC_MOTD' " + IRC_PARMS="--setuid $IRC_USER --daemon --motd $IRC_MOTD --pid-file $PIDFILE_IRC " if [ ! -z "$IRC_STATEDIR" ] ; then - IRC_PARMS=" $IRCPARMS --statedir '$IRC_STATEDIR' " + 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 + start-stop-daemon -S -x $PIRATEBOX/bin/miniircd.py -- $IRC_PARMS log_end_msg $? fi fi @@ -223,7 +223,7 @@ case "$1" in if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then log_daemon_msg "Stopping IRC..." - start-stop-daemon -K -q -p $PIDFILE_IRC + start-stop-daemon -s 9 -K -q -p $PIDFILE_IRC log_end_msg $? fi diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index e2c27b50..ab368317 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -149,8 +149,13 @@ case "$1" in echo $? if [ "$IPV6_ENABLE" = "yes" ] && [ "$IPV6_ADVERT" = "radvd" ] ; then + # Ugly hack on PirateBox 1.1.x only + if test -e "/usr/local/usr/sbin/radvd" && test ! -e "/usr/bin/radvd" ; then + echo "Deploy ugly hack for radvd on PirateBox 1.1" + ln -sf /usr/local/usr/sbin/radvd /usr/bin/radvd + fi echo "Starting radvd..." - start-stop-daemon -S -q -x radvd -- -p $PIDFILE_RADVD -C $CONF_RADVD + start-stop-daemon -S -q -x /usr/bin/radvd -- -p $PIDFILE_RADVD -C $CONF_RADVD echo $? fi @@ -192,13 +197,13 @@ case "$1" in #Start IRC Server if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then . $CONF_IRC - IRC_PARMS="--setuid $IRC_USER --daemon --motd '$IRC_MOTD' " + IRC_PARMS="--setuid $IRC_USER --daemon --motd $IRC_MOTD --pid-file $PIDFILE_IRC " if [ ! -z "$IRC_STATEDIR" ] ; then - IRC_PARMS=" $IRCPARMS --statedir '$IRC_STATEDIR' " + 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 + start-stop-daemon -S -x $PIRATEBOX/bin/miniircd.py -- $IRC_PARMS echo $? fi fi @@ -250,7 +255,7 @@ case "$1" in if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then echo "Stopping IRC..." - start-stop-daemon -K -q -p $PIDFILE_IRC + start-stop-daemon -s 9 -K -q -p $PIDFILE_IRC echo $? fi diff --git a/piratebox/piratebox/python_lib/diskusage.py b/piratebox/piratebox/python_lib/diskusage.py index 08625509..116c598c 100644 --- a/piratebox/piratebox/python_lib/diskusage.py +++ b/piratebox/piratebox/python_lib/diskusage.py @@ -16,7 +16,7 @@ # content - String containing preformatted data #-------------- def generate_html(content): - htmlstring = "DiskUsage Data" + htmlstring = "DiskUsage Data" htmlstring += content htmlstring += "" return htmlstring @@ -56,7 +56,7 @@ def get_usage(drive): #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) + print "CRITICAL: {} modified {} minutes ago. Threshold set to {} minutes. Cannot update.".format(htmlfilename, 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) @@ -103,4 +103,4 @@ def prepare_line (drive): else: get_usage(disk) - print "Generated HTML-DiskUsage File." \ No newline at end of file + print "Generated HTML-DiskUsage File." diff --git a/piratebox/piratebox/rpi/bin/do_switch_client.sh b/piratebox/piratebox/rpi/bin/do_switch_client.sh index 92347787..712f7be0 100755 --- a/piratebox/piratebox/rpi/bin/do_switch_client.sh +++ b/piratebox/piratebox/rpi/bin/do_switch_client.sh @@ -3,7 +3,7 @@ # Wrapper script for the steps to enable wifi client systemctl stop piratebox -if /opt/piratebox/rpi/run_client.sh ; then +if /opt/piratebox/rpi/bin/run_client.sh ; then echo "Started Wifi client sucessfully!" exit 0 else diff --git a/piratebox/piratebox/rpi/bin/usb_share.sh b/piratebox/piratebox/rpi/bin/usb_share.sh index bdcf5244..7911a486 100755 --- a/piratebox/piratebox/rpi/bin/usb_share.sh +++ b/piratebox/piratebox/rpi/bin/usb_share.sh @@ -40,7 +40,7 @@ else fi # Force update diskwirte -touch -t 197001010101 /opt/piratebox/www/diskusage.html +touch -t 201701010101 /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 index 68e3c5a2..7c600607 100755 --- a/piratebox/piratebox/rpi/bin/wifi_detect.sh +++ b/piratebox/piratebox/rpi/bin/wifi_detect.sh @@ -3,8 +3,8 @@ # Install the proper hostapd package and adjust the hostapd configuration # accordingly. -## Default -WIFI_DEVICE="wlan0" +## Default +WIFI_DEVICE="wlan0" WIFI_CONFIG_PATH="/boot/wifi_card.conf" @@ -29,7 +29,7 @@ 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}" + "${PIRATEBOX_CONFIG_PATH}" fi if echo "$dnsmasq_interface" | grep -q "wlan" ; then sed -i -e "s|DNSMASQ_INTERFACE=\"$dnsmasq_interface\"|DNSMASQ_INTERFACE=\"$WIFI_DEVICE\"|" \ @@ -54,7 +54,7 @@ fi 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 +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}" diff --git a/piratebox/piratebox/rpi/services/timesave.service b/piratebox/piratebox/rpi/services/timesave.service index 26a4c134..925dc3ae 100644 --- a/piratebox/piratebox/rpi/services/timesave.service +++ b/piratebox/piratebox/rpi/services/timesave.service @@ -3,7 +3,9 @@ Description=PirateBox timesave service [Service] Type=oneshot +RemainAfterExit=true ExecStart=/opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf recover +ExecStop=/opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf save TimeoutSec=20 [Install] diff --git a/piratebox/piratebox/www/redirect.html b/piratebox/piratebox/www/redirect.html deleted file mode 100755 index 81848ccf..00000000 --- a/piratebox/piratebox/www/redirect.html +++ /dev/null @@ -1,11 +0,0 @@ - -Redirect... - - - - - - -Redirect - - diff --git a/piratebox/piratebox/www_content/js/scripts.js b/piratebox/piratebox/www_content/js/scripts.js index cf2e8290..f70d67df 100755 --- a/piratebox/piratebox/www_content/js/scripts.js +++ b/piratebox/piratebox/www_content/js/scripts.js @@ -68,7 +68,7 @@ $(document).ready(function() { var locationPath = filterPath(location.pathname); var scrollElem = scrollableElement('html', 'body'); - $('a[href*=#]').each(function() { + $('a[href*=\\#]').each(function() { var thisPath = filterPath(this.pathname) || locationPath; if ( locationPath == thisPath && (location.hostname == this.hostname || !this.hostname) diff --git a/piratebox/piratebox/www_content/locales/data.de.properties b/piratebox/piratebox/www_content/locales/data.de.properties index af08f189..cb5b8d06 100644 --- a/piratebox/piratebox/www_content/locales/data.de.properties +++ b/piratebox/piratebox/www_content/locales/data.de.properties @@ -10,7 +10,7 @@ logoIMG.alt = PirateBox logoIMG.title = PirateBox - Share Freely welcomeWelcome = Willkommen -welcomeDescription.innerHTML = Das Wichtigste vorweg: Hier geht nichts Illegales oder Unheimliches vor. Dies ist ein sozialer Platz, wo jeder chatten und Dateien austauschen kann und zwar anonym! Dies ist ein Offline-Netzwerk, speziell zum Filesharing und Chatten entwickelt. Vom Netz getrennt zu sein, ist die Voraussetzung für volle Anonymität. Hab Spaß, chatte mit Menschen und teile Dateien, die du magst. +welcomeDescription.innerHTML = Das Wichtigste vorweg: Hier geht nichts Illegales oder Unheimliches vor. Dies ist ein sozialer Platz, wo jeder chatten und Dateien austauschen kann und zwar anonym! Dies ist ein Offline-Netzwerk, speziell zum Filesharing und Chatten entwickelt. Vom Netz getrennt zu sein ist die Voraussetzung für volle Anonymität. Hab Spaß, chatte mit Menschen und teile Dateien, die du magst. welcomeThanksButton.value = Alles klar! sidebarUpload = Upload -> sidebarIframeNotSupported = Dein Browser unterstützt keine Iframes. Wenn du etwas hochladen möchtest, hier entlang: diff --git a/piratebox/piratebox/www_content/locales/data.es.properties b/piratebox/piratebox/www_content/locales/data.es.properties new file mode 100644 index 00000000..b2203544 --- /dev/null +++ b/piratebox/piratebox/www_content/locales/data.es.properties @@ -0,0 +1,39 @@ +# English strings +# vim: ft=jproperties + +link = enlace +navbarHome = Inicio +navbarForum = Foro +navbarFiles = Ficheros +navbarAbout = Acerca de +logoIMG.alt = PirateBox +logoIMG.title = PirateBox - Compartir Libremente + +welcomeWelcome = Bienvenida +welcomeDescription.innerHTML = Ahora, lo primero de todo, no hay nada ilegal o raro entrando aqui. Este es un sitio social donde puedes charlar y compartir ficheros con gente de alrededor tuyo, anonimamente! Esta es una red desconectada, especialmente diseñada y desarrollada para servicios de comparticion de ficheros y charlas. Estar desconectado es una precaucion para mantener un completo anonimato. Por favor, pasalo bien, charla con gente, y siente libre de compartir los ficheros que tu quieras. +welcomeThanksButton.value = Gracias +sidebarUpload = Subir ficheros -> +sidebarIframeNotSupported = Tu navegador no soporta iframes.. Si quieres subir algo, sigue esto +sidebarBrowseFiles = Ver Ficheros -> + +diskUsage = Uso de disco +refreshButton.value = Actualizar +refreshButton.title = El uso de disco solo puede ser actualizado cada 5 minutos + +mainChatChat = Charlar +mainChatSend.value = Enviar +mainChatName.placeholder = Alias +mainChatName.value = Anonimo +mainChatMessage.placeholder = Mensaje... +mainChatTextColor = Color de texto: +mainShoutboxDefault = Por defecto +mainShoutboxBlue = Azul +mainShoutboxGreen = Verde +mainShoutboxOrange = Naranja +mainShoutboxRed = Rojo + +footerBackToTop = Ir a arriba +footerAbout = Acerca de +footerInspired = Inspirada en las radios piratas y en el movimiento de cultura libre, PirateBox es un dispositivo movil auto-contenido para la colaboracion y comparticion de ficheros. PirateBox utiliza software libre, gratuito y de codigo abierto (FLOSS) para redes wireless moviles de comparticion de ficheros donde los usuarios pueden compartir anonimamente imagenes, videos, audio, documentos, y otros contenidos digitales. +footerFilesTopSafety = PirateBox esta diseñado para ser estable y seguro. No se requiere registro y ningun dato de usuario es registrado. El sistema no esta conectado a internet a proposito para prevenir el seguimiento y preservar la privacidad del usuario. +footerLicenceMain = PirateBox esta licenciado bajo GPLv3. diff --git a/piratebox/piratebox/www_content/locales/data.eu.properties b/piratebox/piratebox/www_content/locales/data.eu.properties new file mode 100644 index 00000000..335c2327 --- /dev/null +++ b/piratebox/piratebox/www_content/locales/data.eu.properties @@ -0,0 +1,40 @@ +# Euskara strings +# by Astur +# vim: ft=jproperties + +link = lotura +navbarHome = Hasiera +navbarForum = Foroa +navbarFiles = Fitxategiak +navbarAbout = Honi buruz +logoIMG.alt = PirateBox +logoIMG.title = PirateBox - Aske Partekatu + +welcomeWelcome = Ongi Etorri +welcomeDescription.innerHTML = Orain, lehenik etra behin, ez dago ezer arrarorik edo legez kanpo hona sartuz. Hau zure inguruko jendearekin hitz egiteko eta fitxategiak partekatzeko gune sozial bat da. Hau konexiorik gabeko sarea da, bereziki fitxategiak partekatzeko eta hitz egiteko diseinaturik. Konexiorik gabe egotea erabateko anonimotasunari eusteko segurtasun neurria da. Mesedez, ondo pasa, jendearekin hitz egin eta aske sentitu nahi dituzun fitxategiak partekatzeko. +welcomeThanksButton.value = Eskerrik asko +sidebarUpload = Fitxategiak igo -> +sidebarIframeNotSupported = Zure nabigatzaileak ez du iframerik onartzen.. Zerbait igotzeko, jarraitu honi +sidebarBrowseFiles = Fitxategiak ikusi -> + +diskUsage = Diskoaren erabilera +refreshButton.value = Eguneratu +refreshButton.title = Diskoaren erabilera 5 minutuan behin baino ezin da eguneratu + +mainChatChat = Hitz egin +mainChatSend.value = Bidali +mainChatName.placeholder = Ezizena +mainChatName.value = Anonimoa +mainChatMessage.placeholder = Mezua.. +mainChatTextColor = Testuaren kolorea: +mainShoutboxDefault = Lehenetsita +mainShoutboxBlue = Urdina +mainShoutboxGreen = Berdea +mainShoutboxOrange = Laranja +mainShoutboxRed = Gorria + +footerBackToTop = Gora itzuli +footerAbout = Honi buruz +footerInspired = Irrati piratetan eta kultura askearen mugimenduan inspiraturik, PirateBox fitxategiak partekatzeko eta auzolanerako tresna bateratu eta eramangarria da. PirateBox-ek fitxategiak partekatzeko wireless sare eramangarrietarako software askea, doakoa eta kode irekikoa (FLOSS) erabiltzen du, non erabiltzaileek anononimoki irudiak, bideoak, audioa, dokumentuak eta bestelako eduki digitalak parteka ditzaketen. +footerFilesTopSafety = PirateBox egonkorra eta segurua izateko diseinaturik dago. Ez da erregistrorik behar, eta ez da erabiltzaileen daturik gordetzen. Sistema nahita deskonektaturik dago internetetik jazarpena saihesteko eta erabiltzailearen pribatutasuna babesteko. +footerLicenceMain = PirateBox GPLv3 lizentziapean dago diff --git a/piratebox/piratebox/www_content/locales/data.ru.properties b/piratebox/piratebox/www_content/locales/data.ru.properties new file mode 100644 index 00000000..9ca646b3 --- /dev/null +++ b/piratebox/piratebox/www_content/locales/data.ru.properties @@ -0,0 +1,39 @@ +# English strings +# vim: ft=jproperties + +link = ссылка +navbarHome = Главная +navbarForum = Форум +navbarFiles = Файлы +navbarAbout = О Проекте +logoIMG.alt = PirateBox +logoIMG.title = PirateBox - Распространяй Свободно + +welcomeWelcome = Добро Пожаловать +welcomeDescription.innerHTML = Во-первых, здесь не происходит ничего незаконного или страшного. Это общественная площадка, где вы можете болтать и делиться файлами с людьми вокруг вас анонимно! Это оффлайн сеть, специально спроектированная и разработанная для обмена файлами и сервисов для общения. Отсутствие подключения к Интернету обеспечивает вашу полную анонимность. Наслаждайтесь, общайтесь с другими пользователями и свободно делитесь своими файлами. +welcomeThanksButton.value = Спасибо +sidebarUpload = Перейти К Загрузке -> +sidebarIframeNotSupported = Ваш браузер не поддерживает IFrame.. Если вы хотите загрузить что-нибудь, пройдите сюда +sidebarBrowseFiles = Просмотр Файлов -> + +diskUsage = Использование Диска +refreshButton.value = Обновить +refreshButton.title = Обновлять данные об использовании диска можно только раз в 5 минут + +mainChatChat = Чат +mainChatSend.value = Отправить +mainChatName.placeholder = Псевдоним +mainChatName.value = Аноним +mainChatMessage.placeholder = Сообщение... +mainChatTextColor = Цвет Текста: +mainShoutboxDefault = По-умолчанию +mainShoutboxBlue = Синий +mainShoutboxGreen = Зелёный +mainShoutboxOrange = Оранжевый +mainShoutboxRed = Красный + +footerBackToTop = Вверх +footerAbout = О проекте +footerInspired = PirateBox это самодостаточное мобильное устройство для общения и файлообмена, созданное под вдохновлением от пиратских радиостанций и движения за свободную культуру. В PirateBox используется свободное программное обеспечение с открытым исходным кодом для создания мобильных беспроводных сетей обмена файлами, в которых пользователи могут анонимно обмениваться картинками, видео, музыкой, документами и другим цифровым контентом. +footerFilesTopSafety = PirateBox спроектирован для полной безопасности. Тут не требуют регистрироваться и не сохраняются никакие данные о пользователях. Система специально отключена от Интернета, чтобы предотвратить слежку и сохранить приватность пользователя. +footerLicenceMain = PirateBox распространяется под лицензией GPLv3. diff --git a/piratebox/piratebox/www_content/locales/locales.ini b/piratebox/piratebox/www_content/locales/locales.ini index c1366d5f..526526c6 100644 --- a/piratebox/piratebox/www_content/locales/locales.ini +++ b/piratebox/piratebox/www_content/locales/locales.ini @@ -9,3 +9,12 @@ [pt-br] @import url(data.pt-br.properties) + +[es] +@import url(data.es.properties) + +[eu] +@import url(data.eu.properties) + +[ru] +@import url(data.ru.properties) diff --git a/piratebox/piratebox/rpi/motd.txt b/rpi.motd-template.txt similarity index 76% rename from piratebox/piratebox/rpi/motd.txt rename to rpi.motd-template.txt index 626df556..fb7893fb 100644 --- a/piratebox/piratebox/rpi/motd.txt +++ b/rpi.motd-template.txt @@ -5,31 +5,33 @@ ____________________.__ __ __________ |____|_ /|____| |__||__| (____ /__| \___ >______ /\____/__/\_ \ \/ \/ \/ \/ \/ -Website: http://piratebox.cc PirateBox Version: 1.1.3 -Forum: http://forum.piratebox.cc RPi Image Version: 1.1.3-1 +Website: http://piratebox.cc PirateBox Version: ##version## +Forum: http://forum.piratebox.cc Build date: 00-00-0000 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 +2. Change password of root user + > sudo passwd root +3. Enable Fake-Timeservice + 3.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 + 3.2 Enable on startup > sudo systemctl enable timesave -3. Enable the Kareha Image and Discussion Board +4. Enable the Kareha Image and Discussion Board > sudo /opt/piratebox/bin/board-autoconf.sh -4. Enable USB thumb drive share OR extend SDCard +5. 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 +6. 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!) +7. Enable RealTimeClock timekeeping (needs DS3231 or 1307 RTC module!) > sudo systemctl enable rpi_hwclock