Daily Archives: June 24, 2024

Raspberry Pi

Sparkleshare on Raspberry Pi

This was my process of setting up Sparkleshare, server side on the Raspberry Pi. This guide is basically a dump of the terminal that I noted important points on.

This guide is color coded

My Input on Command Line

My  Notes

Run the Dazzle script via Curl

…from https://www.sparkleshare.org/ under Setting Up a Host.

erick@raspberrypi ~ $ sudo curl https://raw.githubusercontent.com/hbons/Dazzle/master/dazzle.sh \
>   –output /usr/bin/dazzle && chmod +x /usr/bin/dazzle
[sudo] password for erick:
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100  8639  100  8639    0     0   2954      0  0:00:02  0:00:02 –:–:–  4674
chmod: changing permissions of `/usr/bin/dazzle’: Operation not permitted

 Using sudo causes this, so just execute the last line again with sudo…

erick@raspberrypi ~ $ sudo chmod +x /usr/bin/dazzle

Next Run Dazzle Setup

Interesting stuff going on when the project is created, look at the dump to get an idea of what it is doing.
erick@raspberrypi ~ $ sudo dazzle setup
1/4 | Installing the Git package…
-> The Git package has already been installed (version 1.7.10.4).
2/4 | Creating account “storage”…
-> useradd storage –create-home –home /home/storage –system –shell /usr/bin/git-shell –password “*” –user-group
3/4 | Configuring account “storage”…
-> mkdir –parents /home/storage/.ssh
-> touch /home/storage/.ssh/authorized_keys
-> chmod 700 /home/storage/.ssh
-> chmod 600 /home/storage/.ssh/authorized_keys
4/4 | Reloading the SSH config…
-> /etc/init.d/ssh reload

Setup complete!
To create a new project, run “dazzle create PROJECT_NAME”.

Creating a Project called Rasp_Pi_Main_Share

Interesting stuff going on when the project is created, look at the dump to get an idea of what it is doing.

erick@raspberrypi ~ $ sudo dazzle create Rasp_Pi_Main_Share
Creating project “Rasp_Pi_Main_Share”…
-> /usr/bin/git init –bare /home/storage/Rasp_Pi_Main_Share
-> /usr/bin/git config –file /home/storage/Rasp_Pi_Main_Share/config receive.denyNonFastForwards true
-> echo “*.jpg -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.JPG -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.jpeg -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes     -> echo “*.JPEG -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes     -> echo “*.png -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.PNG -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.tiff -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes     -> echo “*.TIFF -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes     -> echo “*.gif -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.GIF -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.psd -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.PSD -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.xcf -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.XCF -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.flac -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes     -> echo “*.FLAC -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes     -> echo “*.mp3 -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.MP3 -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.ogg -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.OGG -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.oga -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.OGA -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.avi -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.AVI -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.mov -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.MOV -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.mpg -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.MPG -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.mpeg -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes     -> echo “*.MPEG -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes     -> echo “*.mkv -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.MKV -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.ogv -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.OGV -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.ogx -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.OGX -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.webm -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes     -> echo “*.WEBM -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes     -> echo “*.zip -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.ZIP -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.gz -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes       -> echo “*.GZ -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes       -> echo “*.bz -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes       -> echo “*.BZ -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes       -> echo “*.xz -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes       -> echo “*.XZ -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes       -> echo “*.bz2 -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.BZ2 -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.rpm -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.RPM -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.deb -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.DEB -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.tgz -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.TGZ -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.rar -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.RAR -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.ace -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.ACE -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.7z -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes       -> echo “*.7Z -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes       -> echo “*.pak -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.PAK -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.msi -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.MSI -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.iso -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.ISO -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.dmg -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes      -> echo “*.DMG -delta” >> /home/storage/Rasp_Pi_Main_Share/info/attributes
-> chown –recursive storage:storage /home/storage
-> chmod –recursive o-rwx /home/storage/Rasp_Pi_Main_Share

Project “Rasp_Pi_Main_Share” was successfully created.
To link up a SparkleShare client, enter the following
details into the “Add Hosted Project…” dialog:

Address: ssh://storage@192.168.1.17:22
Remote Path: /home/storage/Rasp_Pi_Main_Share

To link up (more) computers, use the “dazzle link” command.

Save this info somewhere good!

Address: ssh://storage@192.168.1.17:22
Remote Path: /home/storage/Rasp_Pi_Main_Share

You will need it to hook up clients to the server.

Dazzle Link, Linking clients to server

All that the dazzle link command does is add the key to the authorized_keys in the .ssh folder of the /home/storage directory.

erick@raspberrypi /home/storage $ sudo dazzle link
Paste your Client ID (found in the status icon menu) below and press <ENTER>.

Client ID: ssh-rsa AAAAB3Nza………………………….Plex-790

The client with this ID can now access projects.
Repeat this step to give access to more clients.

 

Optional:Moving this repository to the USB Stick

To get the storage folder off of the SD card and onto the external media, i.e. USB stick in my case…

Move the files…

sudo rsync -rPz /home/storage/Rasp_Pi_Main_Share/ /media/sda/Rasp_Pi_Main_Share/

Mount with bind. Using a symlink might not work here as it might not get followed. I haven’t tried it.

sudo mount --bind /media/sda/Rasp_Pi_Main_Share/ /home/storage/Rasp_Pi_Main_Share/

..this is optional, but with the limited SD card storage on the Raspberry Pi, it makes it much more useful for a shared storage device.

To Install on Client: Linux

To install Sparkleshare on the client Linux computer, Ubuntu/Mint based..

sudo apt-get install sparkleshare