简体   繁体   English

在http代理后面的capistrano

[英]capistrano behind http proxy

Is there a way to set http proxy for capistrano ? 有没有办法为capistrano设置http代理?

I have a deployment server behind proxy, capistrano just hangs while fetching from the github repository with https protocol. 我有一个代理服务器后面的部署服务器,capistrano只是在使用https协议从github存储库获取时挂起。

How can I tell capistrano to use the proxy server ? 如何告诉capistrano使用代理服务器?

You can use the gateway option, when accessing your remote server through a proxy 通过代理访问远程服务器时,可以使用网关选项

set :gateway, "proxy-user@100.200.300.400"
ssh_options[:keys] = "~/.ssh/your-key"

Make sure you have added your remote servers ssh key into your github repo deploy keys. 确保已将远程服务器ssh密钥添加到github repo部署密钥中。

You can also try the forward_agent option to make the remote server use your local machine ssh key to access github. 您还可以尝试使用forward_agent选项使远程服务器使用本地计算机ssh密钥来访问github。

ssh_options[:forward_agent] = true

Hope this helps. 希望这可以帮助。

Configure git itself to use a proxy. 配置git本身以使用代理。 As a user on the deployment server, use git directly to access github via the proxy. 作为部署服务器上的用户,直接使用git通过代理访问github。 Setting $http_proxy seems to be the trick: 设置$ http_proxy似乎是诀窍:

How do I pull from a Git repository through an HTTP proxy? 如何通过HTTP代理从Git存储库中提取?

Setup the deployment user's environment correctly and it should allow git to work. 正确设置部署用户的环境,它应该允许git工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM