Permalink
Browse files

first collection of files

  • Loading branch information...
1 parent 38b73c5 commit 8e9f5859cab7ba91440c73bef14d86e6ae1233f6 @MaStr MaStr committed Apr 14, 2012
View
Binary file not shown.
@@ -0,0 +1,114 @@
+#!/bin/sh
+## PirateBox installer script v.01
+## created by Matthias Strubel 2011-08-04
+##
+
+# 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 <part>"
+ echo " Parts: "
+ echo " init_openwrt : Stuff needed on openwrt-systems"
+ echo " part2 : sets Permissions and links correctly"
+ echo " imageboard : configures kareha imageboard with Basic configuration"
+ echo " should be installed in <Piratebox-Folder>/share/board"
+ echo " pyForum : Simple PythonForum"
+ exit 1
+fi
+
+
+if [ ! -f $1 ] ; then
+ echo "Config-File $1 not found..."
+ exit 1
+fi
+
+#Load config
+. $1
+
+if [ $2 = 'init_openwrt' ] ; then
+ echo "-------------- Initialize PirateBoxScripts -----------"
+ #Load openwrt-common config and procedures file!
+ . /etc/piratebox.common
+ # cp -v $pb_pbmount/src/* "$pb_share"
+ # cp -v $pb_pbmount/src/.* $pb_share
+ cp_src $pb_pbmount/src $pb_share
+ touch "$pb_pbmount/conf/init_done"
+
+ # Copy Removed, File is included in lib folder..
+ #cp /usr/share/piratebox/CGIHTTPServer.py $pb_pbmount/chat
+ rm -r $pb_pbmount/share
+ ln -sf $pb_share $pb_pbmount/share
+ chmod a+rw $CHATFILE
+ fi
+
+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
+ echo "Copied the file. Now edit conf/piratebox.conf and uncomment #FORUM_LINK_HTML "
+fi
+
+
+
+if [ $2 = 'part2' ] ; then
+#Create directories
+ mkdir -p $PIRATEBOX_FOLDER/share/unsorted
+ 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
+
+#Copy over the index.html for redirect to Droopy-Landing page
+ cp $PIRATEBOX_FOLDER/www/index.html $PIRATEBOX_FOLDER/share
+
+#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
+
+ ln -s $PIRATEBOX_FOLDER/share/board $PIRATEBOX_FOLDER/www/board
+ ln -s $PIRATEBOX_FOLDER/share/unsorted $PIRATEBOX_FOLDER/www/unsorted
+fi
+
+#Install the image-board
+if [ $2 = 'imageboard' ] ; then
+
+ if [ "$OPENWRT" = "yes" ] ; then
+ if ! opkg update
+ then
+ echo "ERROR: Not Internet Conenction"
+ exit 5
+ fi
+
+ for package in ${OPENWRT_PACKAGES[@]}
+ do
+ echo "Start install package $package ...."
+ opkg -d piratebox install $package
+ if [ $? ne 0 ] ; then
+ echo "ERROR installing $package"
+ exit 5
+ fi
+ done
+ fi
+
+ cd $PIRATEBOX_FOLDER/share/board
+ cp -R mode_image/* ./
+ cp $PIRATEBOX_FOLDER/src/kareha_img_config.pl $PIRATEBOX_FOLDER/share/board/config.pl
+ chown -R $LIGHTTPD_USER:$LIGHTTPD_GROUP $PIRATEBOX_FOLDER/share/board
+ #Install filetype thumbnails
+ mv $PIRATEBOX_FOLDER/share/board/extras/icons $PIRATEBOX_FOLDER/share/board/
+fi
+
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+# 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
+
+# Load configfile
+
+if [ -z $1 ] || [ -z $2 ]; then
+ echo "Usage piratebox_setup_wlan.sh my_config <start|stop>"
+ 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
+
+elif [ $2 = "stop" ] ; then
+ echo "Stopping wifi interface $INTERFACE "
+ ifconfig $INTERFACE down
+fi
@@ -0,0 +1,7 @@
+interface=wlan0
+driver=nl80211
+ssid=piratebox: free share
+hw_mode=g
+channel=1
+#auth_algs=1
+#ieee80211n=1
@@ -0,0 +1,2 @@
+192.168.77.1 piratebox.lan
+192.168.77.1 piratebox
@@ -0,0 +1,93 @@
+## Configuration for Piratebox
+
+server.modules = (
+# "mod_access", not needed!
+# "mod_alias",
+# "mod_compress", Disabled, fixing reload Problem??
+ "mod_redirect",
+# "mod_rewrite",
+)
+
+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 = "www-data"
+ server.groupname = "www-data"
+
+
+
+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" )
+
+#include_shell "/usr/share/lighttpd/use-ipv6.pl"
+
+dir-listing.encoding = "utf-8"
+server.dir-listing = "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"
+## mimetype mapping
+mimetype.assign = (
+ ".pdf" => "application/pdf",
+ ".class" => "application/octet-stream",
+ ".pac" => "application/x-ns-proxy-autoconfig",
+ ".swf" => "application/x-shockwave-flash",
+ ".wav" => "audio/x-wav",
+ ".gif" => "image/gif",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".png" => "image/png",
+ ".css" => "text/css",
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".js" => "text/javascript",
+ ".txt" => "text/plain",
+ ".dtd" => "text/xml",
+ ".xml" => "text/xml"
+ )
+
+
+#----------- cgi.conf --------------
+server.modules += ( "mod_cgi" )
+
+$HTTP["url"] =~ "^/cgi-bin/" {
+ cgi.assign = ( "" => "" )
+}
+
+## 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 = "/index.html"
+
+## for better debugging
+#server.modules += ( "mod_accesslog" )
+#accesslog.filename = "/opt/piratebox/tmp/access.log"
+
+
+
@@ -0,0 +1,104 @@
+#########
+## 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
+##
+########
+
+#######
+## 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.
+
+
+#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"
+
+#Start services...
+# act like a apn / <yes|no>
+# 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:
+# bin/droopy
+# conf/hosts
+HOST="piratebox.lan"
+
+
+#Option for enabling special checks under openwrt
+OPENWRT="no"
+
+#----------------- 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="-i wlan0"
+
+#Brdige add interfacce (setr yes to enable bridging)
+DO_BRIDGE="no"
+BRIDGE="br-lan"
+
+# Define your favorite piratebox ip (please change piratebox/conf/hosts , too)
+IP=192.168.77.1
+
+# Define the netmask
+NETMASK=255.255.255.0
+
+#Config for dhcp ( should be in the same range like defined ip)
+IPSTART=192.168.77.10
+IPEND=192.168.77.120
+
+
+#----------------- Configuration for the pure piratebox -------------------#
+## droopy, webserver, shoutbox- and forum-server
+
+PIRATEBOX_FOLDER="/opt/piratebox"
+WWW_FOLDER="/opt/piratebox/www"
+
+
+#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
+
+#Image-SRC
+IMAGENAME="piratebox-logo-small.png"
+IMAGE="$PIRATEBOX_FOLDER/src/$IMAGENAME"
+
+#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"
+
+# Reset Shoutbox on Startup?
+RESET_CHAT="yes"
+
+#Inititiation Chat-Message
+CHATMSG="<date>00:00:00</date>&nbsp;&nbsp;<name>PirateBox:</name>&nbsp;&nbsp;&nbsp;<data class='def'>Chat and share files anonymously!</data><br>"
+
+#------------------------ Additional configuration for lighttpd
+LIGHTTPD_USER=www-data
+LIGHTTPD_GROUP=www-data
+
+
Oops, something went wrong.

0 comments on commit 8e9f585

Please sign in to comment.