diff --git a/SparkleLib/Git/SparkleFetcherGit.cs b/SparkleLib/Git/SparkleFetcherGit.cs index bebb2692..2dc1cf25 100755 --- a/SparkleLib/Git/SparkleFetcherGit.cs +++ b/SparkleLib/Git/SparkleFetcherGit.cs @@ -70,9 +70,9 @@ namespace SparkleLib.Git { !uri.Scheme.Equals ("http")) { if (uri.Port == -1) - uri = new Uri (uri.Scheme + "://git@" + uri.Host + uri.AbsolutePath); + uri = new Uri (uri.Scheme + "://storage@" + uri.Host + uri.AbsolutePath); else - uri = new Uri (uri.Scheme + "://git@" + uri.Host + ":" + uri.Port + uri.AbsolutePath); + uri = new Uri (uri.Scheme + "://storage@" + uri.Host + ":" + uri.Port + uri.AbsolutePath); } this.use_git_bin = false; // TODO diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index 230ef8ce..fc772471 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -530,6 +530,8 @@ namespace SparkleLib.Git { if (revision == null) throw new ArgumentNullException ("revision"); + path = path.Replace ("\\", "/"); + SparkleGit git = new SparkleGit (LocalPath, "checkout " + revision + " \"" + path + "\""); git.StartAndWaitForExit (); @@ -567,6 +569,8 @@ namespace SparkleLib.Git { "--format=medium --no-color --no-merges"); } else { + path = path.Replace ("\\", "/"); + git = new SparkleGit (LocalPath, "log -" + count + " --raw --find-renames --date=iso " + "--format=medium --no-color --no-merges -- " + path); } diff --git a/setting-up-sparkleshare.html b/setting-up-sparkleshare.html new file mode 100644 index 00000000..fea17f47 --- /dev/null +++ b/setting-up-sparkleshare.html @@ -0,0 +1,114 @@ + + + Setting up SparkleShare + + + + +

Setting up SparkleShare

+ +

1. Setting up the server

+ +

1.1. Creating a new user

+ +
+# Create a new user called "storage"
+sudo useradd storage --create-home --user-group
+
+ +

All clients connect through this user account, there's not need to add more users to link more clients.

+ +

1.2. Configuring SSH

+ +
+# Create a file to store authorized public keys
+sudo mkdir /home/storage/.ssh
+sudo touch /home/storage/.ssh/authorized_keys
+
+# Set the right permissions in the file
+sudo chmod 700 /home/storage/.ssh
+sudo chmod 600 /home/storage/.ssh/authorized_keys
+
+ +

Every SparkleShare client uses its own SSH public key. This key can be found in ~/SparkleShare/Your Name's link code.txt after you've started and configured a client for the first time. Paste the contents of this file on a new line in authorized_keys to link a client.

+ +

Open /etc/ssh/sshd_config in an editor and add the following lines:

+ +
+Match User storage
+    PasswordAuthentication no
+
+ +

Finally, restart the SSH daemon to use the new configuration:

+ +
+# Restart SSH
+sudo /etc/init.d/ssh restart # on Debian
+sudo /etc/init.d/sshd restart # on Fedora
+
+ +

1.3. Setting up Git repositories

+ +
+# Install Git
+sudo apt-get install git-core
+sudo yum install git
+
+# Create a Git repository (create as many as you need)
+sudo git init --bare /home/storage/MyProject
+sudo chown -R storage:storage /home/storage
+
+ +

2. Setting up a client

+ +

Click the SparkleShare status icon and select Add Hosted Project. Select On my own server, enter your server address in the Address field and /home/storage/MyProject in the Remote Path field. Click Add.

+ +

SparkleShare has now been linked to your server!

+ + + +