node-git-server icon indicating copy to clipboard operation
node-git-server copied to clipboard

Serve bare git repo from a remote server?

Open saoudrizwan opened this issue 6 years ago • 6 comments

Hello, firstly - thanks for the amazing repo.

I understand that in your implementation (and stackdot's), you use git-upload-pack and git-receive-pack processes to allow the client and server to talk to each other (figure out what packets the other needs, etc.) To my knowledge, this git command accepts a local directory, but what if I host all my bare git repositories on a separate server, like an AWS S3 bucket? Could I stream a remote bare repo to these git commands, that then stream the necessary packets to the client? I don't want to host all my bare git repos on my heroku instance, since the storage is ephemeral and limited. Any guidance would be appreciated!

saoudrizwan avatar Apr 04 '19 06:04 saoudrizwan

I would like to know the answer to this too. Bonus points for proxying to another git server like GitHub itself!

gilbert avatar Apr 19 '19 03:04 gilbert

I am facing this problem too, i want to host all my repos to s3 instead of my own server and clone them using the same method.

akif-ih avatar Oct 24 '19 13:10 akif-ih

@gabrielcsapo Please could u help or can guide us ?

akif-ih avatar Oct 24 '19 13:10 akif-ih

+1, this would be super nice (I could also contribute if needed)

luzzif avatar Jun 12 '20 20:06 luzzif

This question is quite old, but having spent a little time in the node-git-server code, I think the answer to this is not easily.

This package calls git on the host's operating system like so:

https://github.com/gabrielcsapo/node-git-server/blob/5279f64b200b3d8e8f3d537c28c86793033e6285/lib/service.js#L107-L112

Converting that to instead using streams and pulling from remote hosts would, in my opinion, be a lot of work. Also, if you check the philosophy section of this package, it aims to have zero dependencies. Adding streaming from remote hosts would definitely require dependencies.

chmac avatar Aug 27 '20 16:08 chmac

I found a solution for this, maybe not the best of all but it works well:

There are some tools like s3fs and goofys that allow you to mount an s3 bucket on the filesystem.

vadolasi avatar Nov 28 '22 20:11 vadolasi