git-gateway icon indicating copy to clipboard operation
git-gateway copied to clipboard

Git-gateway with multiple repos

Open rustyb opened this issue 6 years ago • 1 comments

Hi There - Not a bug to report, simply just not sure where exactly to ask this question.

Is it possible to use git-gateway against multiple repos in a single instance?

I have a working self hosted version of the git-gateway and gotrue working with no issue. But from what I can see the git-gateway instance can only be used against a single repo.

rustyb avatar Oct 09 '18 18:10 rustyb

I've been trying to answer this question lately, and after digging through the code in this repo it seems like this microservice does have a "multi-tenant mode" that you can activate by using ./git-gateway multi which seems to alter how the service responds. It seems that they refer to different repos as "instances" which have an automatically generated UUID, a name, and a JSON config in the field raw_base_config. From what I can see, you put your common config values (GITGATEWAY_JWT_SECRET, GITGATEWAY_API_HOST, etc.) in your .env file and the values that change; GITGATEWAY_GITHUB_ACCESS_TOKEN, GITGATEWAY_GITHUB_ENDPOINT and GITGATEWAY_GITHUB_REPO go into this raw_base_config field. In instance.go, there is a function called mergeConfig which seems to take your base config and smashes these values into it. It's strange that it doesn't seem to be set up to work with Gitlab or Bitbucket, even through it supports these backends.

gumaerc avatar Jan 07 '20 22:01 gumaerc