class Runner::ReverseProxy

Generate reverse proxy config files for Nginx.

Public Instance Methods

options_for_config(options) click to toggle source
Calls superclass method Runner::Base#options_for_config
# File lib/shared_infrastructure/runner/reverse_proxy.rb, line 7
def options_for_config(options)
  super(options).merge(proxy_url: ARGV[1])
end
process_args(opts = nil) click to toggle source
# File lib/shared_infrastructure/runner/reverse_proxy.rb, line 11
def process_args(opts = nil)
  raise MissingArgument.new("domain and target url required", opts) unless ARGV.size == 2
  {
    domain_name: [ARGV.first],
    proxy_url: ARGV[1]
  }
end
process_options() click to toggle source
Calls superclass method Runner::Base#process_options
# File lib/shared_infrastructure/runner/reverse_proxy.rb, line 19
def process_options
  super(Nginx::Builder::ReverseProxyHttp, Nginx::Builder::ReverseProxyHttps)
end
protocol_factory(options) click to toggle source
Calls superclass method Runner::Base#protocol_factory
# File lib/shared_infrastructure/runner/reverse_proxy.rb, line 23
def protocol_factory(options)
  protocol_class = super(
    options,
    Nginx::Builder::ReverseProxyHttp,
    Nginx::Builder::ReverseProxyHttps
  )

  domain_name = options.delete(:domain_name)
  proxy_url = options.delete(:proxy_url)
  certificate_domain = options.delete(:certificate_domain)
  domain = SharedInfrastructure::Domain.new(domain_name)
  protocol_class.new(proxy_url, certificate_domain, domain: domain)
end