mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 07:06:22 +00:00
27 lines
616 B
Ruby
27 lines
616 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Soportar dominios alternativos
|
|
class DeployAlternativeDomain < Deploy
|
|
store :values, accessors: %i[hostname], coder: JSON
|
|
|
|
# Generar un link simbólico del sitio principal al alternativo
|
|
def deploy(**)
|
|
File.symlink?(destination) ||
|
|
File.symlink(site.hostname, destination).zero?
|
|
end
|
|
|
|
# No hay límite para los dominios alternativos
|
|
def limit; end
|
|
|
|
def size
|
|
File.size destination
|
|
end
|
|
|
|
def destination
|
|
@destination ||= File.join(Rails.root, '_deploy', hostname.gsub(/\.\z/, ''))
|
|
end
|
|
|
|
def url
|
|
"https://#{File.basename destination}"
|
|
end
|
|
end
|