5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 02:26:21 +00:00
panel/app/models/deploy_alternative_domain.rb

28 lines
612 B
Ruby
Raw Permalink Normal View History

2020-02-19 22:29:06 +00:00
# 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
2022-04-06 23:07:14 +00:00
@destination ||= File.join(Rails.root, '_deploy', hostname.gsub(/\.\z/, ''))
end
def url
"https://#{File.basename destination}"
2020-02-19 22:29:06 +00:00
end
end