From 79fd1b7fbbc6e7fcc92c143e775a3490adde187d Mon Sep 17 00:00:00 2001 From: f Date: Fri, 21 Apr 2023 15:24:40 -0300 Subject: [PATCH 1/4] BREAKING CHANGE: usar rsyncd en lugar de ssh #13171 --- app/services/site_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/site_service.rb b/app/services/site_service.rb index 5d28bf91..d9c7783e 100644 --- a/app/services/site_service.rb +++ b/app/services/site_service.rb @@ -215,7 +215,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do # Crea los deploys necesarios para sincronizar a otros nodos de Sutty def sync_nodes Rails.application.nodes.each do |node| - site.deploys.build(type: 'DeployFullRsync', destination: "sutty@#{node}:") + site.deploys.build(type: 'DeployFullRsync', destination: "rsync://#{node}/deploys/") end end From a6bba8c3cbb84051fd709fb45be3eb6ae7e3ce14 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 21 Apr 2023 15:42:16 -0300 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20cambiar=20las=20direcciones=20de=20s?= =?UTF-8?q?incronizaci=C3=B3n=20a=20rsyncd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...421182627_change_full_rsync_destination.rb | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 db/migrate/20230421182627_change_full_rsync_destination.rb diff --git a/db/migrate/20230421182627_change_full_rsync_destination.rb b/db/migrate/20230421182627_change_full_rsync_destination.rb new file mode 100644 index 00000000..47352139 --- /dev/null +++ b/db/migrate/20230421182627_change_full_rsync_destination.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# Envía los cambios a través de rsyncd +class ChangeFullRsyncDestination < ActiveRecord::Migration[6.1] + def up + DeployFullRsync.find_each do |deploy| + Rails.application.nodes.each do |node| + deploy.destination = "rsync://#{node}/deploys/" + deploy.save + end + end + end + + def down + DeployFullRsync.find_each do |deploy| + Rails.application.nodes.each do |node| + deploy.destination = "sutty@#{node}:" + deploy.save + end + end + end +end From 79398d0448bd707906c2a15e719fc76acb72db98 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 21 Apr 2023 15:44:22 -0300 Subject: [PATCH 3/4] =?UTF-8?q?fixup!=20fix:=20cambiar=20las=20direcciones?= =?UTF-8?q?=20de=20sincronizaci=C3=B3n=20a=20rsyncd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20230421182627_change_full_rsync_destination.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20230421182627_change_full_rsync_destination.rb b/db/migrate/20230421182627_change_full_rsync_destination.rb index 47352139..3a22aea6 100644 --- a/db/migrate/20230421182627_change_full_rsync_destination.rb +++ b/db/migrate/20230421182627_change_full_rsync_destination.rb @@ -5,7 +5,7 @@ class ChangeFullRsyncDestination < ActiveRecord::Migration[6.1] def up DeployFullRsync.find_each do |deploy| Rails.application.nodes.each do |node| - deploy.destination = "rsync://#{node}/deploys/" + deploy.destination = "rsync://rsyncd.#{node}/deploys/" deploy.save end end From 4f74c6f6cad3e62d2841e3811e9f31add3f8b566 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 21 Apr 2023 15:48:09 -0300 Subject: [PATCH 4/4] fix: no configurar ssh para rsyncd --- app/models/deploy_rsync.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/deploy_rsync.rb b/app/models/deploy_rsync.rb index 1dff2d99..fcc5a65d 100644 --- a/app/models/deploy_rsync.rb +++ b/app/models/deploy_rsync.rb @@ -38,6 +38,7 @@ class DeployRsync < Deploy # # @return [Boolean] def ssh? + return true if destination.start_with? 'rsync://' user, host = user_host ssh_available = false