Class: SharedInfrastructure::Domain

Inherits:
Object
  • Object
show all
Defined in:
lib/shared_infrastructure/domain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain_name) ⇒ Domain

Returns a new instance of Domain.



19
20
21
# File 'lib/shared_infrastructure/domain.rb', line 19

def initialize(domain_name)
  @domain_name = domain_name
end

Instance Attribute Details

#domain_nameObject (readonly)

Returns the value of attribute domain_name.



35
36
37
# File 'lib/shared_infrastructure/domain.rb', line 35

def domain_name
  @domain_name
end

Instance Method Details

#available_siteObject



3
4
5
# File 'lib/shared_infrastructure/domain.rb', line 3

def available_site
  "/etc/nginx/sites-available/#{domain_name}"
end

#certbot_domain_namesObject



7
8
9
# File 'lib/shared_infrastructure/domain.rb', line 7

def certbot_domain_names
  "#{domain_name} www.#{domain_name}"
end

#certificate_directoryObject



11
12
13
# File 'lib/shared_infrastructure/domain.rb', line 11

def certificate_directory
  "/etc/letsencrypt/live/#{domain_name}"
end

#enabled_siteObject



15
16
17
# File 'lib/shared_infrastructure/domain.rb', line 15

def enabled_site
  "/etc/nginx/sites-enabled/#{domain_name}"
end

#production_logObject



23
24
25
# File 'lib/shared_infrastructure/domain.rb', line 23

def production_log
  "/var/www/#{domain_name}/log/production.log"
end

#secretsObject



27
28
29
# File 'lib/shared_infrastructure/domain.rb', line 27

def secrets
  File.join(site_root, "secrets")
end

#site_rootObject



31
32
33
# File 'lib/shared_infrastructure/domain.rb', line 31

def site_root
  "/var/www/#{domain_name}/html"
end