Merge remote-tracking branch 'github/development' into LEDE_adjustments

Conflicts:
	Makefile
This commit is contained in:
Matthias Strubel 2017-06-29 03:29:37 -05:00
commit 2418016fd6
28 changed files with 488 additions and 177 deletions

View File

@ -24,6 +24,8 @@ Contributors for modifications:
# Mike Weaver
# bartschat - RTC RPi feature
# casdr
# jdieg0
# a-ira
# ... and all others I might have forgotten.

View File

@ -1,5 +1,19 @@
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

View File

@ -3,7 +3,7 @@
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"
echo "\t/opt/piratebox/bin/install_piratebox.sh imageboard"
else
echo -n "Imageboard admin password: "
read -s BOARDPASSWORD

View File

@ -42,13 +42,13 @@ 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
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
. "$PIRATEBOX_CONFIG" || exit 6
. "$FIREWALL_CONFIG" || exit 5
if [ "$run" = "start" ] ; then
IPT_FLAG="-A"

View File

@ -148,6 +148,7 @@ generate_lighttpd_env() {
local SHOUTBOX_CLIENT_TIMESTAMP=$7
local IN_UPLOAD_PATH=$8
local DISK_GEN_HTMLFILE=$9
local HOSTNAME=$10
echo "Generating Environment-config for lighttpd ....."
@ -162,10 +163,13 @@ generate_lighttpd_env() {
\"SHOUTBOX_CHATFILE\" => \"$SHOUTBOX_CHATFILE\" ,
\"SHOUTBOX_CLIENT_TIMESTAMP\" => \"$SHOUTBOX_CLIENT_TIMESTAMP\" ,
\"UPLOAD_PATH\" => \"$IN_UPLOAD_PATH\" ,
\"PIRATEBOX_HOSTNAME\" => \"$HOSTNAME\" ,
\"DISK_GEN_HTMLFILE\" => \"$DISK_GEN_HTMLFILE\" ,
$LIGHTTPD_ENV_BR_LINE
)"
)
var.PIRATEBOX_HOSTNAME = $HOSTNAME
"
echo $LIGHTTPD_ENV > $LIGHTTPD_ENV_CONFIG
}
@ -203,7 +207,7 @@ if [ "$IPV6_ENABLE" = "yes" ] ; then
fi
generate_hosts $HOST $IP $IPV6
generate_dnsmasq $NET $IP_SHORT $START_LEASE $END_LEASE $LEASE_DURATION $DNSMASQ_INTERFACE
generate_lighttpd_env $GLOBAL_CHAT "$GLOBAL_DEST" $PIRATEBOX_PYTHONPATH $GEN_CHATFILE $PIRATEBOX_FOLDER $CHATFILE $SHOUTBOX_CLIENT_TIMESTAMP $UPLOADFOLDER $GEN_DISKFILE
generate_lighttpd_env $GLOBAL_CHAT "$GLOBAL_DEST" $PIRATEBOX_PYTHONPATH $GEN_CHATFILE $PIRATEBOX_FOLDER $CHATFILE $SHOUTBOX_CLIENT_TIMESTAMP $UPLOADFOLDER $GEN_DISKFILE $HOST
COMPLETE_HOST=$HOST

View File

@ -1,28 +1,30 @@
#!/bin/sh
## PirateBox installer script
## created by Matthias Strubel (c)2011-2014 GPL-3
## created by Matthias Strubel (c)2011-2017 GPL-3
##
PIRATEBOX_CONFIG="/opt/piratebox/conf/piratebox.con"
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
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
[ ! -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
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 <part>"
if [ -z "$1" ]; then
echo "Usage install_piratebox <part>"
echo " Parts: "
echo " part2 : sets Permissions and links correctly"
echo " imageboard : configures kareha imageboard with Basic configuration"
@ -35,142 +37,152 @@ if [ -z $1 ] || [ -z $2 ]; then
fi
if [ ! -f $1 ] ; then
echo "Config-File $1 not found..."
if [ ! -f "$PIRATEBOX_CONFIG" ] ; then
echo "Config-File $PIRATEBOX_CONFIG not found..."
exit 1
fi
#Load config
PIRATEBOX_CONFIG=$1
. $1
. "$PIRATEBOX_CONFIG"
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
if [ "$1" = '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
if [ "$1" = '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
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
"$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
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
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
[ ! -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 [ "$1" = 'imageboard' ] ; then
if [ -e $PIRATEBOX_FOLDER/share/board/init_done ] ; 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
cd "$PIRATEBOX_FOLDER/tmp" || exit 99
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
if [ ! -e "$PIRATEBOX_FOLDER/tmp/$KAREHA_RELEASE" ] ; then
echo " Wgetting kareha-zip file "
if ! wget "http://wakaba.c3.cx/releases/$KAREHA_RELEASE" ; then
echo "wget kareha failed.. you can place the current file your to $PIRATEBOX_FOLDER/tmp "
fi
fi
fi
if [ -e $PIRATEBOX_FOLDER/tmp/$KAREHA_RELEASE ] ; then
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*
unzip "$KAREHA_RELEASE"
mv kareha/* "$PIRATEBOX_FOLDER/share/board"
rm -rf "$PIRATEBOX_FOLDER"/tmp/kareha*
cd $PIRATEBOX_FOLDER/share/board
cd "$PIRATEBOX_FOLDER/share/board" || exit
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
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/
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
cd /tmp || exit 1
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
touch "$PIRATEBOX_FOLDER/share/board/init_done"
fi
if [ $2 = "station_cnt" ] ; then
if [ "$1" = "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
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"
if ! crontab "$PIRATEBOX_FOLDER/tmp/crontab" ; then
echo "an error occured" && exit 254
fi
"$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"
if [ "$1" = "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"
if crontab "$PIRATEBOX_FOLDER"/tmp/crontab ; then
echo "Installed crontab for flushing dnsmasq requlary"
else
echo "an error occured" && exit 254
fi
fi
set_hostname() {
local name=$1 ; shift;
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
sed -e "s|#####HOST#####|$name|g" \
"$PIRATEBOX_FOLDER"/src/redirect.html.schema > \
"$WWW_FOLDER"/redirect.html
sed -e "s|HOST=\"$HOST\"|HOST=\"$name\"|" -i "$PIRATEBOX_CONFIG"
}
if [ $2 = "hostname" ] ; then
echo "Switching hostname to $3"
set_hostname "$3"
if [ "$1" = "hostname" ] ; then
echo "Switching hostname to $2"
set_hostname "$2"
echo "..done"
fi
if [ $2 = "content" ] ; then
if [ "$1" = "content" ] ; then
create_content_folder
fi

View File

@ -31,7 +31,7 @@ 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
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

View File

@ -1,11 +1,23 @@
interface=wlan0
driver=nl80211
ssid=PirateBox - Share Freely
hw_mode=g
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

View File

@ -0,0 +1,7 @@
# 404 Error Page with redirect
# only for non piratebox Domains, that makes UI development easier.
$HTTP["host"] != var.PIRATEBOX_HOSTNAME {
server.error-handler-404 = "/redirect.html"
}

View File

@ -0,0 +1,22 @@
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 = " "

View File

@ -0,0 +1,10 @@
# 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"
}

View File

@ -3,10 +3,9 @@
server.modules = (
# "mod_access", not needed!
"mod_alias",
# "mod_compress", Disabled, fixing reload Problem??
"mod_redirect",
# "mod_rewrite",
"mod_setenv",
"mod_setenv",
"mod_cgi",
"mod_fastcgi"
)
@ -23,8 +22,8 @@ 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"
server.username = "nobody"
server.groupname = "nogroup"
@ -41,31 +40,9 @@ 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" )
# Enable default directory listing
include "/opt/piratebox/conf/lighttpd/dirlisting-html.conf"
#n.a. on router include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include "/opt/piratebox/conf/lighttpd/mime.types"
@ -74,10 +51,7 @@ include "/opt/piratebox/conf/lighttpd/mime.types"
include "/opt/piratebox/conf/lighttpd/env"
#----------- cgi.conf --------------
server.modules += ( "mod_cgi" )
$HTTP["url"] =~ "^/cgi-bin/" {
# cgi.assign = ( "" => "" )
cgi.assign = ( ".py" => "/usr/bin/python" )
}
@ -94,11 +68,11 @@ $HTTP["url"] =~ "^/board/" {
}
#-------------------------------------
# Avoid lazy browser caching
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"
include "/opt/piratebox/conf/lighttpd/all-redirect.conf"
## for better debugging
#server.modules += ( "mod_accesslog" )
@ -106,15 +80,7 @@ server.error-handler-404 = "/redirect.html"
# 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/iOS7-fix.conf"
include "/opt/piratebox/conf/lighttpd/fastcgi-php-generate203.conf"

View File

@ -63,7 +63,7 @@ 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/install_piratebox.sh part2
$PIRATEBOX/bin/hooks/hook_post_init.sh "$CONF"
touch $PIRATEBOX/conf/init_done
fi
@ -73,7 +73,7 @@ fi
# only if it is not already existing.
# This can be any time.
if [ ! -d $WWW_CONTENT ] ; then
$PIRATEBOX/bin/install_piratebox.sh "$CONF" content
$PIRATEBOX/bin/install_piratebox.sh content
fi
# Command Line for DNSMASQ, use extra config file generated from command above
@ -155,7 +155,7 @@ case "$1" in
log_end_msg $?
if [ "$IPV6_ENABLE" == "yes" ] && [ "$IPV6_ADVERT" == "radvd" ] ; then
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 $?

View File

@ -56,7 +56,7 @@ 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/install_piratebox.sh part2
$PIRATEBOX/bin/hooks/hook_post_init.sh "$CONF"
touch $PIRATEBOX/conf/init_done
fi
@ -66,7 +66,7 @@ fi
# only if it is not already existing.
# This can be any time.
if [ ! -d $WWW_CONTENT ] ; then
$PIRATEBOX/bin/install_piratebox.sh "$CONF" content
$PIRATEBOX/bin/install_piratebox.sh content
fi
@ -148,7 +148,7 @@ case "$1" in
$PIRATEBOX_FOLDER/bin/firewall.sh -s
echo $?
if [ "$IPV6_ENABLE" == "yes" ] && [ "$IPV6_ADVERT" == "radvd" ] ; then
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 $?

View File

@ -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

View File

@ -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

View File

@ -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" <<EOF
n
p
3
+256M
n
p
4
w
EOF
echo Reloading partition table
partprobe "$SDCARD"
if test -e "$SDCARD"p3 ; then
if test -e "$SDCARD"p4 ; then
echo "Ok, all partitions available"
else
echo "ERROR: Data partition is missing."
exit 1
fi
else
echo "ERROR: SWAP missing."
exit 1
fi
mkswap /dev/mmcblk0p3
if [ $? -ne 0 ] ; then
echo "Error formating swap"
exit 1
fi
SWAP_UUID=$( blkid | grep "/dev/mmc*.*TYPE=\"swap\"" | egrep -o " UUID=\"([a-zA-Z0-9-])*\"" | sed 's/ //g' )
if grep -q "${SWAP_UUID}" /etc/fstab ; then
echo "Error: swap is already configured in fstab"
exit 1
fi
echo "Adding swap to fstab"
echo "${SWAP_UUID} none swap defaults 0 0" >> /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

View File

@ -1,3 +1,18 @@
#!/bin/sh
# Try to setup WiFi and if it succeeds, start the PirateBox
/bin/sh -c /opt/piratebox/rpi/bin/wifi_detect.sh && /usr/bin/systemctl start 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

View File

@ -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

View File

@ -39,4 +39,8 @@ else
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

View File

@ -3,29 +3,69 @@
# 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 list | grep > /dev/null "* AP$"; then
if iw phy phy"${CARD_ID}" info | grep -q "* AP$"; then
echo "Found nl80211 device capable of AP mode..."
yes | pacman -U --needed "${PACKAGE_PATH}/hostapd-2"* > /dev/null
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 dmesg | grep > /dev/null "r8188eu:"; then
if echo "$DRIVER_NAME" | grep -q "r8188eu:"; then
echo "Found r8188eu enabled device..."
yes | pacman -U --needed "${PACKAGE_PATH}/hostapd-8188eu-"* > /dev/null
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 dmesg | grep > /dev/null "rtl8192cu"; then
if echo "$DRIVER_NAME" | grep -q "rtl8192cu"; then
echo "Found rtl8192cu enabled device..."
yes | pacman -U --needed "${PACKAGE_PATH}/hostapd-8192cu-"* > /dev/null
pacman --noconfirm -U --needed "${PACKAGE_PATH}/hostapd-8192cu-"* > /dev/null
sed -i 's/^driver=nl80211/#driver=nl80211/' "${CONFIG_PATH}"
exit 0
fi
@ -34,9 +74,9 @@ 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
echo "Found wpa_supplicant conf, trying to connect..."
wpa_supplicant -iwlan0 -c /boot/wpa_supplicant.conf -B -D wext
dhcpcd wlan0
/opt/piratebox/rpi/bin/run_client.sh
exit 1
# Exit =! 0 will result in not starting piratebox service
fi
exit 1

View File

@ -5,8 +5,8 @@ ____________________.__ __ __________
|____|_ /|____| |__||__| (____ /__| \___ >______ /\____/__/\_ \
\/ \/ \/ \/ \/
Website: http://piratebox.cc PirateBox Version: 1.1.1
Forum: http://forum.piratebox.cc RPi Image Version: 1.1.1-1
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
@ -23,8 +23,9 @@ First Steps After Flashing
> 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
> sudo /opt/piratebox/rpi/bin/usb_share.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

View File

@ -64,11 +64,11 @@ import time
# ============================================================================
# Where the threads are stored. This folder must exist.
DATA_PATH = '/opt/piratebox/forumspace/'
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 = '/forest.css'
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

View File

@ -70,7 +70,7 @@
<form method="POST" name="psowrte" id="sb_form" onsubmit='getTime();'>
<div id="shoutbox-input">
<input class="nickname" type="text" name="name" value="Anonymous" placeholder="Nickname" data-l10n-id="mainChatName" >
<input class="message" type="text" name="data" placeholder="Message..." data-l10n-id="mainChatMessage.placeholder" >
<input class="message" type="text" name="data" placeholder="Message..." data-l10n-id="mainChatMessage" >
<input class="button" type="submit" name="submit" value="Send" id="send-button" data-l10n-id="mainChatSend" >
</div>
<div id="shoutbox-options">

View File

@ -56,6 +56,7 @@ $(document).ready(function() {
}
});
post_diskusage();
// smooth scrolling for internal links
function filterPath(string) {

View File

@ -5,35 +5,35 @@ link = link
navbarHome = Home
navbarForum = Forum
navbarFiles = Dateien
navbarAbout.innerHTML = &uuml;ber
navbarAbout.innerHTML = &Uuml;ber
logoIMG.alt = PirateBox
logoIMG.title = PirateBox - Share Freely
welcomeWelcome = Wilkommen
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 fuer volle Anonymitaet. Hab Spass, chatte mit Menschen und teile Dateien, die du magst.
welcomeThanksButton.value = Thanks
sidebarUpload = Go to Upload ->
sidebarIframeNotSupported = Your browser does not support iframes.. If you want to upload something, follow this
sidebarBrowseFiles.innerHTML = St&ouml;bere Dateien ->
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&uuml;r volle Anonymit&auml;t. Hab Spa&szlig;, chatte mit Menschen und teile Dateien, die du magst.
welcomeThanksButton.value = Alles klar!
sidebarUpload = Upload ->
sidebarIframeNotSupported = Dein Browser unterst&uuml;tzt keine Iframes. Wenn du etwas hochladen m&ouml;chtest, hier entlang:
sidebarBrowseFiles.innerHTML = Dateien durchst&ouml;bern ->
diskUsage = Disk Usage
refreshButton.value = Refresh
refreshButton.title = Disk usage can only be refreshed every 5 minutes
diskUsage = Belegter Speicherplatz
refreshButton.value = Aktualisieren
refreshButton.title = Der belegte Speicherplatz kann nur alle 5 Minuten neu abgefragt werden.
mainChatChat = Chat
mainChatSend.value = Send
mainChatSend.value = Senden
mainChatName.placeholder = Alias
mainChatName.value = Anonymous
mainChatMessage.placeholder = Message...
mainChatTextColor = Text Color:
mainShoutboxDefault = Default
mainShoutboxBlue = Blue
mainShoutboxGreen = Green
mainChatMessage.placeholder = Nachricht...
mainChatTextColor = Textfarbe:
mainShoutboxDefault = Standard
mainShoutboxBlue = Blau
mainShoutboxGreen = Gruen
mainShoutboxOrange = Orange
mainShoutboxRed = Red
mainShoutboxRed = Rot
footerBackToTop = Back to top
footerAbout = About
footerInspired = Inspiriert durch Piratensender und der Freien Kultur Bewegung, ist die PirateBox ein in sich abgeschlossenes Geraet zur mobilen Zusammenarbeit und zum Filesharing. Die PirateBox nutzt freie, offene Software (FLOSS) um mobile, drahtlose Filesharing-Netzwerke aufzubauen, wo Nutzer Bilder, Video-, Audio-Dateien, Dokumente und andere digitale Inhalte teilen koennen.
footerFilesTopSafety = Die PirateBox wurde designt um sicher und ungefaehrlich zu sein. Es sind keine Logins/Anmeldungen erforderlich und keine Benutzer-Daten werden geloggt. Um Tracking zu vermeiden und Datenschutz sicherzustellen, ist das System absichtlich nicht mit dem Internet verbunden.
footerBackToTop = Zum Seitenanfang
footerAbout.innerHTML = &Uuml;ber
footerInspired.innerHTML = Inspiriert durch Piratensender und der Freien-Kultur-Bewegung, ist die PirateBox ein in sich abgeschlossenes Ger&auml;t zur mobilen Zusammenarbeit und zum Filesharing. Die PirateBox nutzt freie, offene Software (FLOSS), um mobile, drahtlose Filesharing-Netzwerke aufzubauen, wo Nutzer Bilder, Video-, Audio-Dateien, Dokumente und andere digitale Inhalte teilen k&ouml;nnen.
footerFilesTopSafety.innerHTML = Die PirateBox wurde designt, um sicher und ungef&auml;hrlich zu sein. Es sind keine Logins/Registrierungen erforderlich und keine Benutzer-Daten werden geloggt. Um Tracking zu vermeiden und Datenschutz sicherzustellen, ist das System absichtlich nicht mit dem Internet verbunden.
footerLicenceMain = PirateBox ist lizensiert unter GPLv3.

View File

@ -0,0 +1,48 @@
# Portuguese (Brazilian) strings
# vim: ft=jproperties
link = link
#Some words like "link", "chat" and "upload" I chose to keep in English, because they are kind of part of the Brazilian vocabulary and more appropriate in this case ... -- 'Akira
navbarHome = Página Inicial
navbarForum = Fórum
navbarFiles = Arquivos
navbarAbout = Sobre
logoIMG.alt = PirateBox
logoIMG.title = PirateBox - Compartilhe Livremente
welcomeWelcome = Bem-vindx
# In portuguese, we have a lot of words that are flexible to gender. In the majority of the cases, these words are used in the masculine form to refer to all the genders. This pratice makes the language machist, while excluding thos who do not feel represented by this writing of the language. So, some people started to write those words with an "x" at the "end" (instead of the vowel "o" for masculine and "a" for feminine) in the hope to make this people more comfortable and included =D -- 'Akira
welcomeDescription.innerHTML = Primeiramente, não há nada ilegal ou assustador acontecendo aqui. Este é um lugar social onde você pode conversar e compartilhar arquivos com pessoas do seu entorno de forma <strong>anônima</strong>! Esta e uma rede off-line, especialmente desenhada e desenvolvida para o compartilhamento de arquivos e serviços de chat. Estar fora do grid computacional é uma precaução para manter sua total anonimidade. Por favor, divirta-se, converse com pessoas e sinta-se livre para compartilhar os arquivos que quiser.
welcomeThanksButton.value = Obrigadx
sidebarUpload = Ir para o Upload ->
sidebarIframeNotSupported = Seu navegador não suporta o iframes.. Caso você queira fazer o upload de algo siga, siga isto
sidebarBrowseFiles = Navegue pelos Arquivos ->
diskUsage = Uso do Disco
refreshButton.value = Recarregar
refreshButton.title = O uso do disco pode ser recarregado apenas a cada 5 minutos
mainChatChat = Chat
mainChatSend.value = Enviar
mainChatName.placeholder = Pseudônimo
mainChatName.value = Anônimx
mainChatMessage.placeholder = Mensagem...
mainChatTextColor = Cor do Texto:
mainShoutboxDefault = Padrão
mainShoutboxBlue = Azul
mainShoutboxGreen = Verde
mainShoutboxOrange = Laranja
mainShoutboxRed = Vermelho
footerBackToTop = Voltar ao topo
footerAbout = Sobre
footerInspired = Inspirado pelo rádio pirata e pelo movimento da cultura livre, PirateBox é um dispositivo móvel de colaboração e compartilhamento de arquivos auto-contido. PirateBox utiliza software Livre e de Código Aberto (FLOSS, da sigla em inglês) para criar redes moveis de compartilhamento de arquivos em que usuárixs podem compartilhar imagens, vídeo, áudio, documentos e outros conteúdos digitais, de forma anônima.
footerFilesTopSafety = PirateBox é desenhado com segurança em mente. Nenhum login é requerido e nenhum dado sobre x usuárix é gravado. O sistema é propositalmente nõo conectado à Internet, de forma a prevenir o rastreamento e preservar a privacidade dxs usuárixs.
#In portuguese both words "safe" and "secure" could be translated as "segurança" (more precisely "seguro") in this context. So I had to change the sentence slightly for something similar (in a gross translation from portuguese to english) to "PirateBox is designed with safety and security in mind".
footerLicenceMain = PirateBox é licenciado pela GPLv3.

View File

@ -6,3 +6,6 @@
[fr]
@import url(data.fr.properties)
[pt-br]
@import url(data.pt-br.properties)