Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git over ngrok tunnel forwarding

Tags:

git

ngrok

I have a git repo on my local instance. I want to access this from outside my home network. Should I create a git server and ssh server on my local instance for this? Also what is the port I should tunnel using ngrok.

Any inputs are greatly appreciated.

like image 555
Gokul N K Avatar asked Jan 13 '15 18:01

Gokul N K


People also ask

How do I use TCP in Ngrok?

To do this, first, log in to your ngrok.com dashboard and click "Reserve Address" in the "Reserved TCP Addresses" section. Then use the --remote-addr option when invoking ngrok to bind a tunnel on your reserved TCP address. Make sure the --region you specify matches the region in which you reserved your address.


1 Answers

As illustrated in issue 193 or issue 145, and ngrok usage, you can directly expose your ssh port (22), with authencation (authtoken).

First, you need register a ngrok account, go to the dashboard will get a token, then execute command like this in you linux server

./ngrok -authtoken as80YQhzsxIIMkMFF8gI -proto=tcp 22

In that case, no git server would be needed, you could clone directly your repo with:

git clone ssh://[email protected]:/path/to/repo.git

('repo.git' because you should use a bare repo to push back to)

The only git "server" which comes with git is the git daemon (nothing to do with ssh)

You would use ngrok to redirect http only if you had an http server in front of your Git, using the smart http protocol.
In that case, you could configure Apache to call git-http-backend.

like image 176
VonC Avatar answered Sep 23 '22 03:09

VonC