Class: SharedInfrastructure::Domain
- Inherits:
-
Object
- Object
- SharedInfrastructure::Domain
- Defined in:
- lib/shared_infrastructure/domain.rb
Instance Attribute Summary collapse
-
#domain_name ⇒ Object
readonly
Returns the value of attribute domain_name.
Instance Method Summary collapse
- #available_site ⇒ Object
- #certbot_domain_names ⇒ Object
- #certificate_directory ⇒ Object
- #enabled_site ⇒ Object
-
#initialize(domain_name) ⇒ Domain
constructor
A new instance of Domain.
- #rails_env_log(rails_env = "production") ⇒ Object
- #root ⇒ Object
-
#secrets ⇒ Object
TODO: Remove this if not needed.
- #site_root ⇒ Object
Constructor Details
#initialize(domain_name) ⇒ Domain
Returns a new instance of Domain.
21 22 23 |
# File 'lib/shared_infrastructure/domain.rb', line 21 def initialize(domain_name) @domain_name = domain_name end |
Instance Attribute Details
#domain_name ⇒ Object (readonly)
Returns the value of attribute domain_name.
42 43 44 |
# File 'lib/shared_infrastructure/domain.rb', line 42 def domain_name @domain_name end |
Instance Method Details
#available_site ⇒ Object
5 6 7 |
# File 'lib/shared_infrastructure/domain.rb', line 5 def available_site "/etc/nginx/sites-available/#{domain_name}" end |
#certbot_domain_names ⇒ Object
9 10 11 |
# File 'lib/shared_infrastructure/domain.rb', line 9 def certbot_domain_names "#{domain_name} www.#{domain_name}" end |
#certificate_directory ⇒ Object
13 14 15 |
# File 'lib/shared_infrastructure/domain.rb', line 13 def certificate_directory "/etc/letsencrypt/live/#{domain_name}" end |
#enabled_site ⇒ Object
17 18 19 |
# File 'lib/shared_infrastructure/domain.rb', line 17 def enabled_site "/etc/nginx/sites-enabled/#{domain_name}" end |
#rails_env_log(rails_env = "production") ⇒ Object
25 26 27 |
# File 'lib/shared_infrastructure/domain.rb', line 25 def rails_env_log(rails_env = "production") "/var/www/#{domain_name}/log/#{rails_env}.log" end |
#root ⇒ Object
29 30 31 |
# File 'lib/shared_infrastructure/domain.rb', line 29 def root "/var/www/#{domain_name}" end |
#secrets ⇒ Object
TODO: Remove this if not needed.
34 35 36 |
# File 'lib/shared_infrastructure/domain.rb', line 34 def secrets File.join(site_root, "secrets") end |
#site_root ⇒ Object
38 39 40 |
# File 'lib/shared_infrastructure/domain.rb', line 38 def site_root File.join(root, "html") end |