Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3273090
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:53:44+00:00 2026-05-17T18:53:44+00:00

I am developing an application that resides on a public host but whose source

  • 0

I am developing an application that resides on a public host but whose source I must keep in a Git repository behind a corporate firewall. I’m getting very tired of the slowness of deploying via scp (copying the whole repository and shipping it over SSH on each deploy) and would like to have the remote host simply do a git pull to update. The problem is that the firewall prohibits incoming SSH connections.

Would it be possible for me to set up an SSH tunnel from my computer to the deployment computer and use my repository as the source for the git pull? After all, git is distributed, so my copy is just as valid a repository as the central one. If this is possible, what would the tunnel command and the Capistrano configuration be?

I think the tunnel will look something like

ssh -R something:deployserver.com:something deploybot@deployserver.com
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:53:44+00:00Added an answer on May 17, 2026 at 6:53 pm

    Net::SSH implements remote forwarding. I have looked over all Capistrano’s source code and couldn’t see any references to it in the current release. None the less, that doesn’t stop you from establishing remote forwarding before you deploy with Capistrano.

    What you’ll want to do is set the :local_repository and :repository paths individually. :local_repository is referenced locally to determine which commit will be used for the deployment before the connection is initiated. That leaves :repository for the remote server to pull from after the connection has been initiated. This is where you can specify the path to the repository behind the firewall.

    # deploy.rb
    set :local_repository, "ssh://git@serverbehindfirewall/path/to/project.git"
    set :repository,  "ssh://git@localhost:9000/path/to/project.git"
    

    Before you deploy, be sure to establish the remote forward. You’ll need to repeat this for each server you deploy to.

    $ ssh -R 9000:serverbehindfirewall:22 deploybot@deployserver.com
    # CTRL + C + A (Screen) or ⌘ + T (Terminal.app) to open new tab
    $ cap HOSTFILTER=deployserver.com deploy # HOSTFILTER reduces set to specified host. Only useful if you have multiple servers.
    

    Using Net::SSH this could easily be turned into a task which is executed before anything else providing greater flexibility when deploying to multiple servers.

    Lastly, given you’ve been using scp, you might want to set deploy_via, :remote_cache which keeps a copy of the repository on the remote server. This greatly decreases your deployment time reduces the chance of corruption.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I`m developing an application that needs to keep some Twitter4J statuses on a MySql
I am developing application that uses shared preferences and content provider. But everytime I
i'm developing an application that'll be played by different's users, but i'm using the
Iam developing an application that show google maps,but the map could not shown {only
I'm developing application that can be useful only in my country(Ukraine). In Ukraine people
I've been developing an application that handles accounts and transactions made over these accounts.
I'm developing an application that requires FAST semantic role tagging in java. Can you
I am developing an application that receives a stream of audio samples from a
I am developing a application that uses core data. In my application i would
I am currently developing an application that makes use of an SQL database. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.