Class: Runner::ReverseProxy
- Defined in:
- lib/shared_infrastructure/runner/reverse_proxy.rb
Overview
Generate reverse proxy config files for Nginx.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #options_for_config(options) ⇒ Object
- #process_args(opts = nil) ⇒ Object
- #process_options ⇒ Object
- #protocol_factory(options) ⇒ Object
Methods inherited from Base
Instance Method Details
#options_for_config(options) ⇒ Object
7 8 9 |
# File 'lib/shared_infrastructure/runner/reverse_proxy.rb', line 7 def () super().merge(proxy_url: ARGV[1]) end |
#process_args(opts = nil) ⇒ Object
11 12 13 14 15 16 17 |
# 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 ⇒ Object
19 20 21 |
# File 'lib/shared_infrastructure/runner/reverse_proxy.rb', line 19 def super(Nginx::Builder::ReverseProxyHttp, Nginx::Builder::ReverseProxyHttps) end |
#protocol_factory(options) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/shared_infrastructure/runner/reverse_proxy.rb', line 23 def protocol_factory() protocol_class = super( , Nginx::Builder::ReverseProxyHttp, Nginx::Builder::ReverseProxyHttps ) domain_name = .delete(:domain_name) proxy_url = .delete(:proxy_url) certificate_domain = .delete(:certificate_domain) domain = SharedInfrastructure::Domain.new(domain_name) protocol_class.new(proxy_url, certificate_domain, domain: domain) end |