class SharedInfrastructure::Domain
Attributes
domain_names[R]
Public Class Methods
new(domain_names)
click to toggle source
# File lib/shared_infrastructure/domain.rb, line 25 def initialize(domain_names) domain_names = [domain_names] unless domain_names.respond_to?(:map) @domain_names = domain_names end
Public Instance Methods
available_site()
click to toggle source
# File lib/shared_infrastructure/domain.rb, line 5 def available_site "/etc/nginx/sites-available/#{domain_name}" end
certbot_domain_names()
click to toggle source
# File lib/shared_infrastructure/domain.rb, line 9 def certbot_domain_names domain_names.map { |domain| "#{domain} www.#{domain}" }.join(" ") end
certificate_directory()
click to toggle source
# File lib/shared_infrastructure/domain.rb, line 13 def certificate_directory "/etc/letsencrypt/live/#{domain_name}" end
domain_name()
click to toggle source
# File lib/shared_infrastructure/domain.rb, line 17 def domain_name domain_names.first end
enabled_site()
click to toggle source
# File lib/shared_infrastructure/domain.rb, line 21 def enabled_site "/etc/nginx/sites-enabled/#{domain_name}" end
rails_env_log(rails_env = "production")
click to toggle source
# File lib/shared_infrastructure/domain.rb, line 30 def rails_env_log(rails_env = "production") "/var/www/#{domain_name}/log/#{rails_env}.log" end
root()
click to toggle source
# File lib/shared_infrastructure/domain.rb, line 34 def root "/var/www/#{domain_name}" end
secrets()
click to toggle source
TODO: Remove this if not needed.
# File lib/shared_infrastructure/domain.rb, line 39 def secrets File.join(site_root, "secrets") end
site_root()
click to toggle source
# File lib/shared_infrastructure/domain.rb, line 43 def site_root File.join(root, "html") end