MetaGit is project allow anyone to setup a git server under their designated domain name while hosting the actual content on any git hosting provider. It works as a reverse proxy that rewrite git over HTTP requests and redirect them to the actual git repo.
The following format applies for defining a mapping
<domain>=<actual-git-repo-prefix>
multiple mappings can be defined by adding a comma "," to seperate mappings.
for example:
a.com=github.com/a, b.com=gitlab.com/b
the above defined two mappings, (a.com to github.com/a) and (b.com to gitlab.com/b)
There are two ways to specify your mapping.
The -m / --mapping flags can be used to define the mapping under the serve command
example:
$ metagit serve -m "a.com=github.com/a,b.com=gitlab.com/b"
The MAPPPING environment variable can be used to define the mapping
example:
$ MAPPING="a.com=github.com/a,b.com=gitlab.com/b" metagit serve
By default, metagit is served under port 8000. This can be specified by adding an argument in the serve command (e.g. metagit serve :80)
Metagit will also read the environment variable PORT for the port being served. This will be useful when deployed to Heroku or Cloud Run.