Guest User

Untitled

a guest
Jun 21st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. task :config => :environment do
  2. facebook_config = File.dirname(__FILE__) + '/../../../../../config/facebooker.yml'
  3. FACEBOOKER = YAML.load_file(facebook_config)[RAILS_ENV]
  4. @public_host_username = FACEBOOKER['tunnel']['public_host_username']
  5. @public_host = FACEBOOKER['tunnel']['public_host']
  6. @public_port = FACEBOOKER['tunnel']['public_port']
  7. @local_port = FACEBOOKER['tunnel']['local_port']
  8. @ssh_port = FACEBOOKER['tunnel']['ssh_port'] || 22
  9. @server_alive_interval = FACEBOOKER['tunnel']['server_alive_interval'] || 0
  10. @notification = "Starting tunnel #{@public_host}:#{@public_port} to 0.0.0.0:#{@local_port}"
  11. @notification << " using SSH port #{@ssh_port}" unless @ssh_port == 22
  12. # "GatewayPorts yes" needs to be enabled in the remote's sshd config
  13. @ssh_command = %Q[ssh -v -p #{@ssh_port} -nNT4 -o "ServerAliveInterval #{@server_alive_interval}" -R *:#{@public_port}:localhost:#{@local_port} #{@public_host_username}@#{@public_host}]
  14. end
Add Comment
Please, Sign In to add comment