【问题标题】:Git over ngrok tunnel forwardingGit over ngrok 隧道转发
【发布时间】:2015-03-11 19:56:42
【问题描述】:

我的本​​地实例上有一个 git 存储库。我想从我的家庭网络外部访问它。我应该为此在本地实例上创建一个 git 服务器和 ssh 服务器吗?另外我应该使用 ngrok 隧道的端口是什么。

非常感谢任何输入。

【问题讨论】:

    标签: git ngrok


    【解决方案1】:

    issue 193issue 145ngrok usage 所示,您可以通过身份验证(authtoken)直接公开您的 ssh 端口(22)。

    首先,你需要注册一个 ngrok 账户,到仪表板会得到一个令牌,然后在你的 linux 服务器中执行这样的命令

    ./ngrok -authtoken as80YQhzsxIIMkMFF8gI -proto=tcp 22
    

    在这种情况下,不需要 git 服务器,你可以直接克隆你的 repo:

    git clone ssh://user@ip.of.local.host:/path/to/repo.git
    

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

    git 自带的唯一 git "server" 是 git daemon(与 ssh 无关)

    只有在你的 Git 前面有一个 http 服务器时,你才会使用 ngrok 重定向 http,使用 smart http protocol
    在这种情况下,您可以configure Apache to call git-http-backend

    【讨论】:

    • 谢谢 VonC 我今晚去看看。
    • this talk欧洲的 git-merge 会议上发现了它。
    猜你喜欢
    • 2017-02-21
    • 2017-02-12
    • 2019-03-27
    • 2019-12-04
    • 2016-09-29
    • 2012-03-08
    • 1970-01-01
    • 2021-04-16
    • 2020-01-18
    相关资源
    最近更新 更多