Sparkleshare Setup for My Cloud Mirror as abstracted from the Dazzle Script
The dazzle script sets up a user and group, etc. which can be done, but for the sake of simplicity, the default sshd user can be used. It may be possible to create a different ssh user, but I did not explore this. I have not tried these instructions, as I used the dazzle script on the my cloud mirror share, mounted on a linux box. If I create additional repositories, I will be doing this.
Install the git app on the my cloud mirror from the my cloud dashboard/web interface.
Create a share, and possibly a subfolder that will be used house the git repository. In the ssh terminal, cd to the relevant share/folder.
Create a repository using "git init --bare It is essential to use the “–bare” flag so that sparkleshare can find it.
Run additional git commands to make the repository suitable for Sparkleshare:
git config --file “/config” receive.denyNonFastForwards true
- Add the following lines to the /info/attributes file in order to prevent useless compression (add any other file types if relevant):
- The script now sets ownership and group for the git user, which I don’t think is relevant for my cloud mirror. If you manage to create a separate user, you may need to do this. The repository must have permissions as set by:
chmod -R o-rwx ,
but I’m not sure if this is necessary either. That should be all in creating the repository.
- On the client(s) machine(s) find or create a private and public ssh key, e.g. on a mac, run ssh-keygen in a terminal. Copy the public key (e.g. on a mac, in $HOME/.ssh/id_rsa.pub).
The ssh home directory on the My Cloud is /home/root. From there, cd into the .ssh folder and create (if it does not already exist) a text file called “authorized_keys”. Paste the public key into this file, and append the public keys for any other clients you wish to connect to sparkleshare.
NOTE: the “authorized_keys” file must be chmod 600 and the .ssh folder must be chmod 700 in order to work. E.g. use the command “chmod 600 authorized_keys” and “chmod 700 .” from the .ssh folder while in the ssh terminal, in the .ssh folder.
If the public key is set up properly, you should now be able to ssh login to your My Cloud without a password, since the authentication is done with the keys.
Install sparkleshare on the machine where you just set up the ssh keys. Click “add a hosted project”, and then select “my own server”. For the address, use ssh://sshd@hostname. You can use the IP address for the hostname, but if you want to used it outside the network, it would be advisable to set up a dyndns address pointing to ssh on your network. For the remote path, use /shares/sharename/subfolder/, depending on where you put the repository.
If everthing went well, you should now have Sparkleshare up and running, and files will automatically sync between client machines, just like dropbox.
a. I have this working on a mac, but not yet on windows, due to the kludges needed to get ssh forwarding or tunneling working on windows. If anyone gets this working, please share your secrets. I have tried a couple of putty variations with no success.
b. the mobile (e.g. iPad) client depends on the additional installation of a sparkleshare dashboard on the server, which may be a no go on the my cloud. My workaround was to create another folder(s) on the my cloud and do a git clone, to check out the files. I just use the my cloud app to access the files that way, and iSSH to sync the repositories as needed. Not elegant, but it works.