5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 16:11:42 +00:00

fix: intentar crear siempre los registros en njalla

This commit is contained in:
f 2023-03-27 14:10:35 -03:00
parent 42c7e93ac9
commit bef171d3ac

View file

@ -30,7 +30,7 @@ class DeployDistributedPress < Deploy
time_start
create_remote_site! if remote_site_id.blank?
create_njalla_records! if remote_info['njalla'].blank?
create_njalla_records!
save
if remote_site_id.blank? || remote_info['njalla'].blank?
@ -134,10 +134,10 @@ class DeployDistributedPress < Deploy
# que eliminarlo.
unless site.name.end_with? '.'
self.remote_info ||= {}
self.remote_info['njalla'] = {}
self.remote_info['njalla']['a'] = njalla.add_record(name: site.name, type: 'CNAME', content: "#{Site.domain}.").to_h
self.remote_info['njalla']['cname'] = njalla.add_record(name: "www.#{site.name}", type: 'CNAME', content: "#{Site.domain}.").to_h
self.remote_info['njalla']['ns'] = njalla.add_record(name: "_dnslink.#{site.name}", type: 'NS', content: "#{publisher.hostname}.").to_h
self.remote_info['njalla'] ||= {}
self.remote_info['njalla']['a'] ||= njalla.add_record(name: site.name, type: 'CNAME', content: "#{Site.domain}.").to_h
self.remote_info['njalla']['cname'] ||= njalla.add_record(name: "www.#{site.name}", type: 'CNAME', content: "#{Site.domain}.").to_h
self.remote_info['njalla']['ns'] ||= njalla.add_record(name: "_dnslink.#{site.name}", type: 'NS', content: "#{publisher.hostname}.").to_h
end
rescue HTTParty::Error => e
ExceptionNotifier.notify_exception(e, data: { site: site.name })