Install git server

Install git server

Postby BobBobBob » Sun Jan 21, 2018 4:38 pm

Is it possible to setup a git server on FVDW and use a special shared directory for the git files?

If so, please can you help me set this up?
BobBobBob
 
Posts: 5
Joined: Sun Dec 24, 2017 10:57 am

Re: Install git server

Postby fvdw » Mon Jan 22, 2018 5:41 pm

in principle a webserver could be setup but currently I have time for this, sorry
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Install git server

Postby BobBobBob » Mon Jan 22, 2018 6:50 pm

I understand how to configure the git side of things, but just need a way to get it onto the NAS - is there anything I can do to learn to do this myself if you are too busy at the moment? I'm happy to share my findings with everyone else if it helps other people setup git.

Thanks
BobBobBob
 
Posts: 5
Joined: Sun Dec 24, 2017 10:57 am

Re: Install git server

Postby fvdw » Thu Jan 25, 2018 8:37 am

A short investigation learned that a git server is different from a normal web server and that several packages needs to be compiled. I will try to have a look at it next week if we can make an addon
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Install git server

Postby fvdw » Thu Jan 25, 2018 10:47 pm

well I have given it a try and it seems the firmware contains the required dependencies except perl. But that is no problem we have a package containing perl that can be installed as addon. I have added git server to it. It is the latest version git-2.9.5. It is compiled with prefix /usr/local. Compile went smooth so I guess it is ok

Attached a rar archive, extract it and you will get a tar archive with name git-server.tar. This archive is containing the files for the addon with perl and git server version 2.9.5. It must be installed as addon to the firmware

Read this topic to prepare your nas to be able to install addons viewtopic.php?f=15&t=645

After you have done this place the git-server.tar archive in the subfolder addons of the shared folder fvdw (fvdw/addons)

Now connect to the nas using ssh server (using putty) and give these commands

Code: Select all
cd /direct-usb/fvdw/addons
tar -xvf git-server.tar

After that your package is ready to use for your experiments
It is in /usr/local (that folder is linked to /direct-usb/fvdw/addons)

Let us know if you can get it working and how to set it up, success !
You do not have the required permissions to view the files attached to this post.
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Install git server

Postby fvdw » Thu Jan 25, 2018 10:54 pm

seems to work I tested it very basic
Code: Select all
root@fvdwsl-5big2:/ # git --version
git version 2.9.5

root@fvdwsl-5big2:/ # git --help
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

These are common Git commands used in various situations:

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
root@fvdwsl-5big2:/ #


fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Install git server

Postby BobBobBob » Fri Jan 26, 2018 10:27 pm

Thank you so much for going to the trouble of doing this. It's a little late here but I plan to have a go with this over the weekend and will report back.
Thank you again!
BobBobBob
 
Posts: 5
Joined: Sun Dec 24, 2017 10:57 am

Re: Install git server

Postby BobBobBob » Sat Jan 27, 2018 4:01 pm

First update. Everything installed perfectly and I have setup a quick test repository "test.git"

Code: Select all
root@LaCie:/share/1100/homes/bob/test # git clone /share/1100/repos/sites/test.git .
Cloning into '.'...
warning: You appear to have cloned an empty repository.
done.


This works when cloning on the NAS, but if I try and clone a repository on my computer from the NAS, it fails:

Code: Select all
git clone ssh://root@192.168.1.210/share/1100/repos/sites/test.git .
Cloning into '.'...
sh: git-upload-pack: not found
fatal: Could not read from remote repository.


The git-upload-pack seems fine, but I am wondering if this is a path issue?

Code: Select all
root@LaCie:/share/1100/homes/bob/test # which git-upload-pack
/usr/local/bin/git-upload-pack


I have setup my SSH key so I can login as the root user, but have also setup a "git" user which I want to only give access to the /share/1100/repos directory so that normal NAS users cannot mess up the git structure by accident.
BobBobBob
 
Posts: 5
Joined: Sun Dec 24, 2017 10:57 am

Re: Install git server

Postby Jocko » Sun Jan 28, 2018 10:30 am

Hi BobBobBob
I do not understand well on what side you did this try:
BobBobBob wrote:This works when cloning on the NAS, but if I try and clone a repository on my computer from the NAS, it fails:
Code: Select all
git clone ssh://root@192.168.1.210/share/1100/repos/sites/test.git .
Cloning into '.'...
sh: git-upload-pack: not found
fatal: Could not read from remote repository.
So that would mean you tried t do it from your laptop: commands sent from a terminal on your laptop (localhost)
and so you need to add ( known client key) the public client key used by your laptop.

Otherwise your can try the scp syntax
Code: Select all
git clone root@192.168.1.210:/share/1100/repos/sites/test.git .
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Install git server

Postby BobBobBob » Tue Jan 30, 2018 9:10 am

Hi Jocko,

Sorry if I didn't explain it very clearly.

The problem I have is when I try a git clone from my computer (localhost) to the Lacie (git server):

Code: Select all
git clone ssh://root@192.168.1.210/share/1100/repos/sites/test.git .
Cloning into '.'...
sh: git-upload-pack: not found
fatal: Could not read from remote repository.


I can SSH from my computer (localhost) to the Lacie (git server) as I added my SSH key to the Lacie root authorized_keys - this works fine.

I will try the SCP syntax, but am hoping that I can get the ssh:// to work. I double checked the path "/share/1100/repos/sites/test.git" is correct. Maybe the permissions are wrong?
BobBobBob
 
Posts: 5
Joined: Sun Dec 24, 2017 10:57 am


Return to Lacie 5Big Network vs1

Who is online

Users browsing this forum: No registered users and 5 guests