Deploying a source code hosting app

So I’m currently building a github/gitlab clone (not visually, just an app to host remote repos that allows you to do pushes and clones and see the repo’s files)

Now, I did read through the Git Book’s chapter on setting up git on the server, but I’m a bit stuck.

2 issues, for me, at least:

  1. I’d like to be able to test my app works locally. Meaning I’d like to be able to maybe navigate to some folder and say git clone repo_url and it would hit my application and be able to successfully clone the repo Here I have a few “sub questions”:
  • I’ve noticed that, maybe with SSH, I’d need to learn some configuration so that my app only trusts keys in a specific place (say some folder in the app). Is that a correct assessment?
  • Otherwise, if I try to hit it with an http url, how do I configure the application? The book only mentions setting up apache with a CGI script. I know what these are at a high level, but I don’t know what this entails for a Rails app nor how to set this up locally
  1. Any recommendations on how to set up a git server using something like heroku or fly? Is it even possible?

Thanks in advance!

There are gems for things like this. Try searching ruby gems.org for… “git”

Yeah, so the reason I was avoiding the gems is that, being an exercise, I’m trying to implement this specific behavior on my own

Sure, but you can look at the source of those gems to get an idea how you’d go about implementing it yourself.

Well, yes. I’ve actually gone through gitlab’s code to get some ideas, for starters. But as much as I know that reading source code can help, I tried asking here precisely to try a more direct route, in case anyone happened to know hahaha

But yeah, I’ll probably end up looking at these gems then.

Thanks, everyone!