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

Migrar los onions primero

Como hostname también es un método de values, al preferir hostname antes
que onion el deploy ya había inicializado el hostname temporal
This commit is contained in:
f 2021-09-12 21:21:05 -03:00
parent 955604b05a
commit 64d7fb6df0

View file

@ -32,7 +32,7 @@ class AddHostnameToDeploys < ActiveRecord::Migration[6.1]
site.name = site.name.split('.', 2).first if site.name.include?('.') site.name = site.name.split('.', 2).first if site.name.include?('.')
site.deploys.find_each do |deploy| site.deploys.find_each do |deploy|
hostname = (deploy.values[:hostname] || deploy.values[:onion] || deploy.hostname || "#{SecureRandom.hex}.invalid").dup.sub(/\.\z/, '') hostname = (deploy.values[:onion] || deploy.values[:hostname] || deploy.hostname || "#{SecureRandom.hex}.invalid").dup.sub(/\.\z/, '')
deploy.update_columns hostname_tmp: hostname deploy.update_columns hostname_tmp: hostname
end end
end end