diff --git a/app/models/deploy_distributed_press.rb b/app/models/deploy_distributed_press.rb index d8fd3f61..32a3049e 100644 --- a/app/models/deploy_distributed_press.rb +++ b/app/models/deploy_distributed_press.rb @@ -80,6 +80,12 @@ class DeployDistributedPress < Deploy # Devuelve las URLs de todos los protocolos def urls + protocol_urls + gateway_urls + end + + private + + def gateway_urls remote_info.dig(:distributed_press, :links).values.map do |protocol| [ protocol[:link], protocol[:gateway] ] end.flatten.compact.select do |link| @@ -87,7 +93,13 @@ class DeployDistributedPress < Deploy end end - private + def protocol_urls + remote_info.dig(:distributed_press, :protocols).select do |_, enabled| + enabled + end.map do |protocol, _| + "#{protocol}://#{site.hostname}" + end + end # El cliente de la API #