Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

self-hosting git clone support #267

Open
shazow opened this issue Jun 5, 2018 · 2 comments
Open

self-hosting git clone support #267

shazow opened this issue Jun 5, 2018 · 2 comments
Labels

Comments

@shazow
Copy link
Owner

shazow commented Jun 5, 2018

Primarily for the lols, but it would be really cool to be able to do:

$ git clone ssh://chat.shazow.net

to get the source code of the current version running there.

Related tweet: https://twitter.com/shazow/status/1004078941349601281

v1 of this feature:

  • Bundle a snapshot of the source code as an asset in the built binary (probably the output of git archive, or whatever format is most convenient for streaming out to clone requests)
  • Setup the proper response for the git clone request. IIRC it calls it as a subsystem exec and just stream something like a tarball1 a blob back? Would require a bit of research but the final implementation shouldn't be too bad. Worst case there are lots of pure-go git implementations that could be leveraged, but I'm not sure that would even be necessary.

  1. Edited for compliance with @tpope.
@shazow shazow added the Someday label Jun 5, 2018
@dmitshur
Copy link
Contributor

dmitshur commented Jun 5, 2018

In case it's helpful as a reference, here's a proof of concept git server over SSH protocol.

It uses git-upload-pack and git-receive-pack binaries (just git-upload-pack is sufficient for read access).

@shazow
Copy link
Owner Author

shazow commented Jun 5, 2018

@shurcooL Ah perfect, thank you! Here's the meat of what we'd need: https://github.com/shurcooL/play/blob/master/231/sshgit/sshgit.go#L158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants