[Urgent]How to change PirateBox Shared Folder to USB by default

Posted by rahulmahale 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
[Urgent]How to change PirateBox Shared Folder to USB by default
May 12, 2014 01:47PM
Hi,
I am enjoying the Piratebox on the Raspberry Pi, smiling smiley
but stuck on how to configure the Piratebox Shared folder to USB. sad smiley
I have tried it by adding links but it didnt work I hope there may be the Permissions issue
I want the following directory to link with my Shared Directory in Usb
pi@raspberrypi ~ $ ls -lh  /opt/piratebox/share/Shared/
total 124K
-rw------- 1 nobody nogroup 120K May 12 09:44 07.png
drwxrwxrwx 3 root   root    4.0K May 12 09:24 Apps

My Shared directory on the usb is
pi@raspberrypi ~ $ ls -lh /media/usb0/
total 16K
drwxr-xr-x 2 root root 16K May 12 10:44 Shared

I need to make this Shared directory as default for Droopy server's file uploading and also the folder for default file storage.
please tell me the changes in /opt/piratebox/piratebox.conf and the user permissions and directory permissions.

thanks in advance

Thanks and regards,
Rahul.



Edited 1 time(s). Last edit at 05/12/2014 01:48PM by rahulmahale.
Re: [Urgent]How to change PirateBox Shared Folder to USB by default
May 12, 2014 10:21PM
Hi,
which filesystem is you USB Stick?
How does the USB stick get mounted?
Where did you configure what?

if you run
/opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf part2
that should initialize the folders to the correct permissions.

can you additional post the output of the following commands, please

mount
ls -l /opt/piratebox/
ls -l /opt/piratebox/share
ls -l /opt/piratebox/www

grep DROOPY /opt/piratebox/conf/piratebox.conf
grep FOLDER /opt/piratebox/conf/piratebox.conf
grep LIGHTTPD /opt/piratebox/conf/piratebox.conf

Thanks in advance
Matthias
Re: [Urgent]How to change PirateBox Shared Folder to USB by default
May 13, 2014 06:39AM
Hi
File System of My USB Stick is FAT32
My USB stick is automunted by the tool usbmount I installed it by the following command and now my USB is automounted to /media/usb0
sudo apt-get install usbmount

My Piratebox is Configured at /opt/piratebox and my contents are at /opt/piratebox/share/Shared/
I need to change the Shared folder to USB so initially I tried to symlink with the following command
sudo ln -s /opt/piratebox/share/Shared /media/usb0/Shared
but still I am not getting the expected result and my droopy server fails for file uploading.
then I tried with changing the Share folder path in /opt/piraterbox/conf/piratebox.xonf
SHARE_FOLDER="$PIRATEBOX_FOLDER/share
changed it to
SHARE_FOLDER="/media/usb0/share/Shared"
still I was not able to achieve the expected result and droopy file uploading failed

------------------------------------
output of commands
pi@raspberrypi ~ $ mount
/dev/root on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=215824k,nr_inodes=53956,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=44820k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
/dev/sda1 on /media/usb0 type vfat (rw,nodev,noexec,noatime,nodiratime,sync,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=89620k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
/dev/mmcblk0p5 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)

pi@raspberrypi ~ $ ls -l /opt/piratebox/
total 36
drwxr-xr-x 3 root   root    4096 May 12 07:18 bin
drwxr-xr-x 3 root   root    4096 May 12 07:19 conf
drwxr-xr-x 2 root   root    4096 May 12 07:18 init.d
drwxr-xr-x 2 root   root    4096 May 12 07:20 python_lib
drwxr-xr-x 5 nobody nogroup 4096 May 12 07:19 share
drwxr-xr-x 2 root   root    4096 May 12 07:18 src
drwxr-xr-x 2 nobody nogroup 4096 May 12 13:17 tmp
-rw-r--r-- 1 root   root      18 May 12 07:18 version
drwxr-xr-x 4 nobody nogroup 4096 May 12 09:10 www

pi@raspberrypi ~ $ ls -l /opt/piratebox/share
total 20
drwxr-xr-x 2 nobody nogroup 4096 May 12 07:19 board
-rwxr-xr-x 1 root   root    4318 May 12 07:19 index.html
drwxrwxrwx 5 nobody nogroup 4096 May 12 11:10 Shared
drwxr-xr-x 2 nobody nogroup 4096 May 12 07:19 tmp

pi@raspberrypi ~ $ ls -l /opt/piratebox/www
total 208
-rw-r--r-- 1 root   root     1236 May 12 09:07 AppAddaIcon.png
-rw-r--r-- 1 root   root    23186 May 12 09:08 Appadda.png
lrwxrwxrwx 1 root   root       26 May 12 07:19 board -> /opt/piratebox/share/board
drwxr-xr-x 2 nobody nogroup  4096 May 12 07:19 cgi-bin
-rw-r--r-- 1 nobody nogroup   637 May 12 13:17 chat_content.html
-rwxr-xr-x 1 nobody nogroup  1518 May 12 07:18 chat.html
-rwxr-xr-x 1 root   root        0 May 12 09:10 CheckCoupon.html
-rwxr-xr-x 1 nobody nogroup  1406 May 12 07:18 favicon.ico
-rwxr-xr-x 1 nobody nogroup   172 May 12 07:18 forum.html
-rw-r--r-- 1 root   root     4886 May 12 09:07 index.html
-rw-r--r-- 1 nobody nogroup 94840 May 12 07:18 jquery.min.js
drwxr-xr-x 3 nobody nogroup  4096 May 12 07:18 library
-rw-r--r-- 1 nobody nogroup    15 May 12 07:18 ncsi.txt
-rwxr-xr-x 1 nobody nogroup 16453 May 12 07:18 piratebox-logo.png
-rwxr-xr-x 1 nobody nogroup 12637 May 12 07:18 piratebox-logo-small.png
-rwxr-xr-x 1 nobody nogroup   200 May 12 09:25 redirect.html
lrwxrwxrwx 1 root   root       27 May 12 07:19 Shared -> /opt/piratebox/share/Shared
-rw-r--r-- 1 root   root      122 May 12 13:38 station_cnt.txt
-rwxr-xr-x 1 nobody nogroup   298 May 12 07:18 style.css


pi@raspberrypi ~ $ grep DROOPY /opt/piratebox/conf/piratebox.conf
DROOPY_ENABLED="yes"
DROOPY_TXT=""
DROOPY_PORT="8080"
DROOPY_USERDIR=""
#DROOPY_USERDIR=" -u True "
DROOPY_USE_USER="yes"

pi@raspberrypi ~ $ grep FOLDER /opt/piratebox/conf/piratebox.conf
PIRATEBOX_FOLDER="/opt/piratebox"
WWW_FOLDER="/opt/piratebox/www"
PIRATEBOX_PYTHONPATH="$PIRATEBOX_FOLDER/python_lib"
#SHARE_FOLDER="/media/usb0/share/Shared"
SHARE_FOLDER="$PIRATEBOX_FOLDER/share"
# UPLOADFOLDER="$SHARE_FOLDER/Upload"
UPLOADFOLDER="$SHARE_FOLDER/Shared"
 . $PIRATEBOX_FOLDER/conf/ipv6.conf
IMAGE="$PIRATEBOX_FOLDER/src/$IMAGENAME"
CHATFILE="$WWW_FOLDER/cgi-bin/data.pso"
GEN_CHATFILE="$WWW_FOLDER/chat_content.html"
.  $PIRATEBOX_FOLDER/conf/hook_custom.conf

pi@raspberrypi ~ $ grep LIGHTTPD /opt/piratebox/conf/piratebox.conf
LIGHTTPD_USER=nobody
LIGHTTPD_GROUP=nogroup

Thanks for quick response, and I hope some trick will work for me.

Thanks and regards,
Rahul.
Re: [Urgent]How to change PirateBox Shared Folder to USB by default
May 13, 2014 12:46PM
Hi,
I Solved the Shared folder issue by simply adding the symlink as
sudo ln -s /media/usb0/Shared/ /opt/piratebox/www/Shared

but I am not able to change the droopy Upload folder to
/media/usb0/Shared/Upload

Thanks and regards,
Rahul.
Re: [Urgent]How to change PirateBox Shared Folder to USB by default
May 13, 2014 03:59PM
hi,
you can edit /opt/piratebox/conf/piratebox.conf and change the line

 UPLOADFOLDER="$SHARE_FOLDER/Shared"

exchange it with the absolute path.
after changing you need to restart the PirateBox I.e

/etc/init.d/piratebox restart

regards Matthias
Hi There

I am having the same problem. I installed Piratebox on a 32gb sdcard for my raspberry pi B, I have been unable to get the default storage set to USB. I have a 64gb flash formatted to FAT 32. I desperately need your help! I want to show off your idea at a festival this coming weekend
Hi VantagE,
I would suggest you some primary steps.
first mount the USB Storage or install any automunting tool,
make a Shared folder in your USB drive,
then create a link by the following command,
sudo ln -s /media/usb0/Shared/ /opt/piratebox/www/Shared

Note:- Please check the mount path of your USB drive.

Thanks and regards,
Rahul.