Skip to content

Commit

Permalink
Merge branch 'hotfix-1.1.4'
Browse files Browse the repository at this point in the history
* hotfix-1.1.4: (40 commits)
  CHANGELOG: Update latest changes
  A bunch of fixes for timesave.         - Apply shellcheck issues         - Make timesave working properly on RPi images
  CHANGELOG: Add latest RPi fixes
  RPi: Fix r8188eu wifi detection problem
  Remove whitespace
  Changelog Add latest fixes
  Fix for radvd startup on OpenWrt
  IRC: cleaning up stop issues
  Adding latest RPi image generation changelog
  Adjust version to 1.1.4
  CHANGELOG: add latest stuff
  Fixes IRC startup issues
  Rename to avoid confusion of git checkout development
  Add russian locale
  Run timesave systemd unit on shutdown
  Add note to change root password
  RPi: Move toward generated MotD
  Notice language files
  Add files via upload
  Note latest changes
  ...
  • Loading branch information
MaStr committed Feb 27, 2018
2 parents 150ba18 + 759f6cd commit 8370426
Show file tree
Hide file tree
Showing 26 changed files with 239 additions and 80 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Contributors for modifications:
# casdr
# jdieg0
# a-ira
# ponsfrilus
# ... and all others I might have forgotten.


Expand Down
53 changes: 41 additions & 12 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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 </head> 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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
19 changes: 11 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
NAME = piratebox-ws
VERSION = 1.1.3
VERSION = 1.1.4
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
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
Expand All @@ -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)
Expand All @@ -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

Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
Expand Down
8 changes: 5 additions & 3 deletions piratebox/piratebox/bin/install_piratebox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down
16 changes: 8 additions & 8 deletions piratebox/piratebox/bin/timesave.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <path to piratebox.conf> <step>"
echo " Valid steps are:"
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion piratebox/piratebox/conf/lighttpd/lighttpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
Expand Down
2 changes: 1 addition & 1 deletion piratebox/piratebox/conf/lighttpd/mime.types
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
6 changes: 2 additions & 4 deletions piratebox/piratebox/conf/piratebox.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions piratebox/piratebox/init.d/piratebox
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
15 changes: 10 additions & 5 deletions piratebox/piratebox/init.d/piratebox_alt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
Loading

0 comments on commit 8370426

Please sign in to comment.