gabrielcsapo / node-git-server

🎡 A configurable git server written in Node.js
https://gabrielcsapo.github.io/node-git-server
MIT License
253 stars 73 forks source link

Serve bare git repo from a remote server? #54

Open saoudrizwan opened 5 years ago

saoudrizwan commented 5 years ago

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!

gilbert commented 5 years ago

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

akif-ih commented 4 years ago

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 commented 4 years ago

@gabrielcsapo Please could u help or can guide us ?

luzzif commented 4 years ago

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

chmac commented 4 years ago

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.

vadolasi commented 1 year ago

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.