Running a secure git repository on FreeNAS is pretty straight forward, once you understand what your trying to do. If you have looked over my previous post “Creating a secure Git repository server” you understand that all you really need to do is connect to the git repository via ssh/ssl and copy back what you need. The hardest part of using FreeNAS is creating the keys.
To start out, you need to create a user account on the FreeNAS system. This will be a generic account that everyone who has write access will use. You may also create a account for each person, and grant each of them access to the central repository.
After you have your account, follow my post on “Enable SSH Key Authorization on FreeNAS” to copy over the SSL key and setup the account. Once you are able to log in as your FreeNAS git user, you may follow my previous post “Creating a secure Git repository server” to setup the git repository.
Really nice posts concerning git.
But there is one question left for me. How did you installed git on your freenas server? Where did you get the package and did you have to resolve dependencies?
Thank you,
Hani
The wonderful part of git, it that it’s not installed on the server. No part of the git program is installed on my FreeNAS box, just the repository was copied over. I’m using SSH and Apache to communicate with the repository alone, nothing else.
Hi Matt
I have followed your ‘Creating a secure Git repository server’ and I am using FreeNAS.
As git is not installed on my FreeNAS server, I had to use git on my local system to actually initialize the repo on the FreeNAS:
cd /y/vol1/git/gitusers <-- /y is my local mount-pointmkdir testgit
cd testgit
git init --bare
Trying to do:
git push origin masterresults in the following printout:
$ git push origin mastergit@192.168.200.9's password: <-- I entered git user passwd (works with ssh)
git-receive-pack: not found
fatal: The remote end hung up unexpectedly
Looking at our example on how to init remote repo, it seems like you are logged in on remote system and thus need git installed on remote system.
regards
ole
To create the remote repo, just create it on your local system, using the –bare flag, and copy the folder to your freenas system. But make sure your not creating the local repo with the –bare flag.
-Matt
This is not working since this is a remote command, it needs to be installed on the server side also.
Git dose not need to be installed to pull/push changes to the repository. Git is not Subversion, as long as your not using the git protocol , you don’t need the git binary installed on the server.
It will be not subversion, but this command
“$ git push origin master
git@192.168.200.9′s password: <– I entered git user passwd (works with ssh)
git-receive-pack: not found
fatal: The remote end hung up unexpectedly"
is looking for the remote git-receive-pack
Try to make sparkleshare work with this setup and you will see what is happening
…
@Victor,
It looks like you may be missing the path on your local computer for git when using OpenSSL5, See: http://www.wiredrevolution.com/git/fix-git-upload-pack-and-git-receive-pack-errors-on-shared-hosting & http://www.twohard.com/blog/remedy-git-upload-pack-or-git-receive-pack-command-not-found-errors-when-you-have-limited-acces
Hi Matt,
Thanks for your help but I do can not make it work and I think that is not possible.
The instructions that you sent me are to force git to set the path of the binaries in the remote server (because bashrc is ignore through ssh commanding)… But if you don’t have the binaries installed in the remote server there is no way to go.
I tried both things without success and I found a simpler one, but getting the same result:
git clone -u /usr/local/git/bin/git-upload-pack ssh://user@xx.xx.xx.xx/test test2
…
/usr/local/git/bin/git-upload-pack: No such file or directory
…
As soon as you put the binaries in the remote machin (the one acting as server) in any path but specified within this command all goes flawlessly. Do you have any other idea?
Cheers and thanks again
Pingback: Using FreeNAS With VirtualBox To Create A True Personal Storage Cloud? | EssayBoard
Pingback: Configuring FreeNAS To Host Time Machine Volume, Allowing Mac Users To Backup Data Across Network Using Time Machine | EssayBoard