From 2291712661f41d3605a413168d872abadc5e0d17 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Mon, 1 Sep 2025 13:41:24 +0200 Subject: [PATCH] fix: abra app move docs/patches --- cli/app/move.go | 48 +++++++++++---------- pkg/i18n/locales/abra.pot | 83 ++++++++++++++++++------------------- pkg/i18n/locales/es.po | 87 +++++++++++++++++++-------------------- 3 files changed, 106 insertions(+), 112 deletions(-) diff --git a/cli/app/move.go b/cli/app/move.go index 97b8d6ab..2d22baf1 100644 --- a/cli/app/move.go +++ b/cli/app/move.go @@ -46,9 +46,8 @@ old server to the new one. The app MUST be deployed on the old server before doing the move. The app will be undeployed from the current server but not deployed on the new server. -This command requires the "cat" command to be present on the app containers -when retrieving secrets. Some "distroless" images will not support this. Not -all apps are therefore moveable. Rsync is required on your local machine for +The "tar" command is required on both the old and new server as well as "sudo" +permissions. The "rsync" command is required on your local machine for transferring volumes. Do not forget to update your DNS records. Don't panic, it might take a while @@ -150,51 +149,50 @@ Use "--dry-run/-r" to see which secrets and volumes will be moved.`), log.Fatal(i18n.G("failed to create volume %s on %s: %s", v.Name, newServer, err)) } - outgoingFilename := fmt.Sprintf("%s_outgoing.tar.gz", v.Name) - log.Debug(i18n.G("creating %s on %s", outgoingFilename, app.Server)) - tarCmd := fmt.Sprintf("sudo tar --same-owner -czhpf %s -C /var/lib/docker/volumes %s", outgoingFilename, v.Name) + filename := fmt.Sprintf("%s_outgoing.tar.gz", v.Name) + log.Debug(i18n.G("creating %s on %s", filename, app.Server)) + tarCmd := fmt.Sprintf("sudo tar --same-owner -czhpf %s -C /var/lib/docker/volumes %s", filename, v.Name) cmd := exec.Command("ssh", app.Server, "-tt", tarCmd) if out, err := cmd.CombinedOutput(); err != nil { log.Fatal(i18n.G("%s failed on %s: output:%s err:%s", tarCmd, app.Server, string(out), err)) } - log.Debug(i18n.G("rsyncing %s from %s to local machine", outgoingFilename, app.Server)) - cmd = exec.Command("rsync", "-a", "-v", fmt.Sprintf("%s:%s", app.Server, outgoingFilename), outgoingFilename) + log.Debug(i18n.G("rsyncing %s from %s to local machine", filename, app.Server)) + cmd = exec.Command("rsync", "-a", "-v", fmt.Sprintf("%s:%s", app.Server, filename), filename) if out, err := cmd.CombinedOutput(); err != nil { - log.Fatal(i18n.G("failed to copy %s from %s to local machine: output:%s err:%s", outgoingFilename, app.Server, string(out), err)) + log.Fatal(i18n.G("failed to copy %s from %s to local machine: output:%s err:%s", filename, app.Server, string(out), err)) } - incomingFilename := fmt.Sprintf("%s_incoming.tar.gz", v.Name) - log.Debug(i18n.G("rsyncing %s (renaming to %s) to %s from local machine", outgoingFilename, incomingFilename, newServer)) - cmd = exec.Command("rsync", "-a", "-v", outgoingFilename, fmt.Sprintf("%s:%s", newServer, incomingFilename)) + log.Debug(i18n.G("rsyncing %s to %s from local machine", filename, filename, newServer)) + cmd = exec.Command("rsync", "-a", "-v", filename, fmt.Sprintf("%s:%s", newServer, filename)) if out, err := cmd.CombinedOutput(); err != nil { - log.Fatal(i18n.G("failed to copy %s from local machine to %s: output:%s err:%s", outgoingFilename, newServer, string(out), err)) + log.Fatal(i18n.G("failed to copy %s from local machine to %s: output:%s err:%s", filename, newServer, string(out), err)) } - log.Debug(i18n.G("extracting %s on %s", incomingFilename, newServer)) - tarExtractCmd := fmt.Sprintf("sudo tar --same-owner -xzpf %s -C /var/lib/docker/volumes", outgoingFilename) + log.Debug(i18n.G("extracting %s on %s", filename, newServer)) + tarExtractCmd := fmt.Sprintf("sudo tar --same-owner -xzpf %s -C /var/lib/docker/volumes", filename) cmd = exec.Command("ssh", newServer, "-tt", tarExtractCmd) if out, err := cmd.CombinedOutput(); err != nil { - log.Fatal(i18n.G("%s failed to extract %s on %s: output:%s err:%s", tarExtractCmd, outgoingFilename, newServer, string(out), err)) + log.Fatal(i18n.G("%s failed to extract %s on %s: output:%s err:%s", tarExtractCmd, filename, newServer, string(out), err)) } // Remove tar files - log.Debug(i18n.G("removing %s from %s", incomingFilename, newServer)) - cmd = exec.Command("ssh", newServer, "-tt", fmt.Sprintf("sudo rm %s", incomingFilename)) + log.Debug(i18n.G("removing %s from %s", filename, newServer)) + cmd = exec.Command("ssh", newServer, "-tt", fmt.Sprintf("sudo rm -rf %s", filename)) if out, err := cmd.CombinedOutput(); err != nil { - log.Fatal(i18n.G("failed to remove %s from %s: output:%s err:%s", incomingFilename, newServer, string(out), err)) + log.Fatal(i18n.G("failed to remove %s from %s: output:%s err:%s", filename, newServer, string(out), err)) } - log.Debug(i18n.G("removing %s from %s", outgoingFilename, app.Server)) - cmd = exec.Command("ssh", app.Server, "-tt", fmt.Sprintf("sudo rm %s", outgoingFilename)) + log.Debug(i18n.G("removing %s from %s", filename, app.Server)) + cmd = exec.Command("ssh", app.Server, "-tt", fmt.Sprintf("sudo rm -rf %s", filename)) if out, err := cmd.CombinedOutput(); err != nil { - log.Fatal(i18n.G("failed to remove %s from %s: output:%s err:%s", outgoingFilename, app.Server, string(out), err)) + log.Fatal(i18n.G("failed to remove %s from %s: output:%s err:%s", filename, app.Server, string(out), err)) } - log.Debug(i18n.G("removing %s from local machine", outgoingFilename)) - cmd = exec.Command("rm", outgoingFilename) + log.Debug(i18n.G("removing %s from local machine", filename)) + cmd = exec.Command("rm", "-r", "-f", filename) if out, err := cmd.CombinedOutput(); err != nil { - log.Fatal(i18n.G("failed to remove %s on local machine: output:%s err:%s", outgoingFilename, string(out), err)) + log.Fatal(i18n.G("failed to remove %s on local machine: output:%s err:%s", filename, string(out), err)) } } diff --git a/pkg/i18n/locales/abra.pot b/pkg/i18n/locales/abra.pot index 1022f84d..0192a879 100644 --- a/pkg/i18n/locales/abra.pot +++ b/pkg/i18n/locales/abra.pot @@ -7,7 +7,7 @@ msgid "" msgstr "Project-Id-Version: \n" "Report-Msgid-Bugs-To: EMAIL\n" - "POT-Creation-Date: 2025-09-01 11:17+0200\n" + "POT-Creation-Date: 2025-09-01 13:48+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -76,7 +76,7 @@ msgid " # list apps of all servers without live status\n" " abra app ls -r gitea" msgstr "" -#: ./cli/app/move.go:60 +#: ./cli/app/move.go:59 msgid " # move an app\n" " abra app move nextcloud.1312.net myserver.com" msgstr "" @@ -251,12 +251,12 @@ msgstr "" msgid "%s doesn't have a %s function" msgstr "" -#: ./cli/app/move.go:158 ./cli/app/move.go:318 +#: ./cli/app/move.go:157 ./cli/app/move.go:316 #, c-format msgid "%s failed on %s: output:%s err:%s" msgstr "" -#: ./cli/app/move.go:178 +#: ./cli/app/move.go:176 #, c-format msgid "%s failed to extract %s on %s: output:%s err:%s" msgstr "" @@ -366,7 +366,7 @@ msgstr "" msgid "%s missing from %s.env" msgstr "" -#: ./cli/app/move.go:100 +#: ./cli/app/move.go:99 #, c-format msgid "%s must first be deployed on %s before moving" msgstr "" @@ -426,7 +426,7 @@ msgstr "" msgid "%s successfully stored on server" msgstr "" -#: ./cli/app/move.go:211 +#: ./cli/app/move.go:209 #, c-format msgid "%s was successfully moved from %s to %s 🎉" msgstr "" @@ -996,9 +996,8 @@ msgid "Move an app to a differnt server.\n" "doing the move. The app will be undeployed from the current server but not\n" "deployed on the new server.\n" "\n" - "This command requires the \"cat\" command to be present on the app containers\n" - "when retrieving secrets. Some \"distroless\" images will not support this. Not\n" - "all apps are therefore moveable. Rsync is required on your local machine for\n" + "The \"tar\" command is required on both the old and new server as well as \"sudo\"\n" + "permissions. The \"rsync\" command is required on your local machine for\n" "transferring volumes.\n" "\n" "Do not forget to update your DNS records. Don't panic, it might take a while\n" @@ -1827,7 +1826,7 @@ msgstr "" msgid "bad status: %s" msgstr "" -#: ./cli/app/move.go:110 +#: ./cli/app/move.go:109 #, c-format msgid "bailing out: %s" msgstr "" @@ -2224,7 +2223,7 @@ msgstr "" msgid "created client for %s" msgstr "" -#: ./cli/app/move.go:134 +#: ./cli/app/move.go:133 #, c-format msgid "created secret on %s: %s" msgstr "" @@ -2244,7 +2243,7 @@ msgstr "" msgid "creating %s" msgstr "" -#: ./cli/app/move.go:154 +#: ./cli/app/move.go:153 #, c-format msgid "creating %s on %s" msgstr "" @@ -2264,7 +2263,7 @@ msgstr "" msgid "creating secret %s" msgstr "" -#: ./cli/app/move.go:144 +#: ./cli/app/move.go:143 #, c-format msgid "creating volume %s on %s" msgstr "" @@ -2514,7 +2513,7 @@ msgstr "" msgid "dry run: remote %s (%s) not created" msgstr "" -#: ./cli/app/move.go:347 ./cli/catalogue/catalogue.go:301 ./cli/recipe/release.go:639 ./cli/recipe/sync.go:269 +#: ./cli/app/move.go:345 ./cli/catalogue/catalogue.go:301 ./cli/recipe/release.go:639 ./cli/recipe/sync.go:269 msgid "dry-run" msgstr "" @@ -2636,12 +2635,12 @@ msgstr "" msgid "expected 1 service but found %v: %s" msgstr "" -#: ./cli/app/move.go:174 +#: ./cli/app/move.go:172 #, c-format msgid "extracting %s on %s" msgstr "" -#: ./cli/app/move.go:313 +#: ./cli/app/move.go:311 #, c-format msgid "extracting secret %s on %s" msgstr "" @@ -2672,12 +2671,12 @@ msgstr "" msgid "failed to commit changes: %s" msgstr "" -#: ./cli/app/move.go:164 +#: ./cli/app/move.go:163 #, c-format msgid "failed to copy %s from %s to local machine: output:%s err:%s" msgstr "" -#: ./cli/app/move.go:171 +#: ./cli/app/move.go:169 #, c-format msgid "failed to copy %s from local machine to %s: output:%s err:%s" msgstr "" @@ -2702,7 +2701,7 @@ msgstr "" msgid "failed to create secret %s" msgstr "" -#: ./cli/app/move.go:150 +#: ./cli/app/move.go:149 #, c-format msgid "failed to create volume %s on %s: %s" msgstr "" @@ -2735,7 +2734,7 @@ msgstr "" msgid "failed to match chosen service" msgstr "" -#: ./cli/app/move.go:204 +#: ./cli/app/move.go:202 #, c-format msgid "failed to migrate app config: %s" msgstr "" @@ -2750,17 +2749,17 @@ msgstr "" msgid "failed to publish new release: %s" msgstr "" -#: ./cli/app/move.go:185 ./cli/app/move.go:191 +#: ./cli/app/move.go:183 ./cli/app/move.go:189 #, c-format msgid "failed to remove %s from %s: output:%s err:%s" msgstr "" -#: ./cli/app/move.go:197 +#: ./cli/app/move.go:195 #, c-format msgid "failed to remove %s on local machine: output:%s err:%s" msgstr "" -#: ./cli/app/move.go:119 +#: ./cli/app/move.go:118 #, c-format msgid "failed to remove app from %s: %s" msgstr "" @@ -2809,7 +2808,7 @@ msgstr "" msgid "failed to select default branch in %s" msgstr "" -#: ./cli/app/move.go:132 +#: ./cli/app/move.go:131 #, c-format msgid "failed to store secret on %s: %s" msgstr "" @@ -3444,7 +3443,7 @@ msgstr "" msgid "man [flags]" msgstr "" -#: ./cli/app/move.go:202 +#: ./cli/app/move.go:200 #, c-format msgid "migrating app config from %s to %s" msgstr "" @@ -3483,7 +3482,7 @@ msgstr "" msgid "move [flags]" msgstr "" -#: ./cli/app/move.go:138 +#: ./cli/app/move.go:137 #, c-format msgid "moving volume %s from %s to %s" msgstr "" @@ -3693,7 +3692,7 @@ msgstr "" msgid "no server provided" msgstr "" -#: ./cli/app/move.go:81 +#: ./cli/app/move.go:80 msgid "no server provided?" msgstr "" @@ -3982,7 +3981,7 @@ msgstr "" #. with no spaces in between #. translators: `abra recipe` aliases. use a comma separated list of aliases #. with no spaces in between -#: ./cli/app/backup.go:327 ./cli/app/list.go:303 ./cli/app/move.go:348 ./cli/app/run.go:23 ./cli/app/upgrade.go:463 ./cli/catalogue/catalogue.go:302 ./cli/recipe/recipe.go:12 ./cli/recipe/release.go:640 ./cli/recipe/sync.go:270 +#: ./cli/app/backup.go:327 ./cli/app/list.go:303 ./cli/app/move.go:346 ./cli/app/run.go:23 ./cli/app/upgrade.go:463 ./cli/catalogue/catalogue.go:302 ./cli/recipe/recipe.go:12 ./cli/recipe/release.go:640 ./cli/recipe/sync.go:270 msgid "r" msgstr "" @@ -4162,12 +4161,12 @@ msgstr "" msgid "removed freshly created tag %s" msgstr "" -#: ./cli/app/move.go:182 ./cli/app/move.go:188 +#: ./cli/app/move.go:180 ./cli/app/move.go:186 #, c-format msgid "removing %s from %s" msgstr "" -#: ./cli/app/move.go:194 +#: ./cli/app/move.go:192 #, c-format msgid "removing %s from local machine" msgstr "" @@ -4229,7 +4228,7 @@ msgstr "" msgid "repo set config: %s" msgstr "" -#: ./cli/app/move.go:350 ./cli/catalogue/catalogue.go:304 ./cli/recipe/release.go:642 ./cli/recipe/sync.go:272 +#: ./cli/app/move.go:348 ./cli/catalogue/catalogue.go:304 ./cli/recipe/release.go:642 ./cli/recipe/sync.go:272 msgid "report changes that would be made" msgstr "" @@ -4370,16 +4369,16 @@ msgstr "" msgid "rs" msgstr "" -#: ./cli/app/move.go:168 -#, c-format -msgid "rsyncing %s (renaming to %s) to %s from local machine" -msgstr "" - -#: ./cli/app/move.go:161 +#: ./cli/app/move.go:160 #, c-format msgid "rsyncing %s from %s to local machine" msgstr "" +#: ./cli/app/move.go:166 +#, c-format +msgid "rsyncing %s to %s from local machine" +msgstr "" + #: ./cli/recipe/lint.go:41 msgid "rule" msgstr "" @@ -4638,7 +4637,7 @@ msgstr "" msgid "skipped" msgstr "" -#: ./cli/app/move.go:280 +#: ./cli/app/move.go:278 #, c-format msgid "skipping %s as it does not match %s" msgstr "" @@ -5013,7 +5012,7 @@ msgstr "" msgid "unable to fetch tags in %s: %s" msgstr "" -#: ./cli/app/move.go:299 +#: ./cli/app/move.go:297 #, c-format msgid "unable to get container matching %s: %s" msgstr "" @@ -5097,7 +5096,7 @@ msgstr "" msgid "unable to read version for %s from synced label. Did you try running \"abra recipe sync %s\" already?" msgstr "" -#: ./cli/app/move.go:208 +#: ./cli/app/move.go:206 #, c-format msgid "unable to remove %s: %s" msgstr "" @@ -5127,7 +5126,7 @@ msgstr "" msgid "unable to resolve IPv4 for %s" msgstr "" -#: ./cli/app/move.go:105 +#: ./cli/app/move.go:104 #, c-format msgid "unable to retrieve %s resources on %s: %s" msgstr "" @@ -5191,7 +5190,7 @@ msgstr "" msgid "undeploy succeeded 🟢" msgstr "" -#: ./cli/app/move.go:113 +#: ./cli/app/move.go:112 #, c-format msgid "undeploying %s on %s" msgstr "" diff --git a/pkg/i18n/locales/es.po b/pkg/i18n/locales/es.po index 3a97bdbf..ff09713f 100644 --- a/pkg/i18n/locales/es.po +++ b/pkg/i18n/locales/es.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: EMAIL\n" -"POT-Creation-Date: 2025-09-01 11:17+0200\n" +"POT-Creation-Date: 2025-09-01 13:48+0200\n" "PO-Revision-Date: 2025-08-29 21:45+0000\n" "Last-Translator: chasqui \n" "Language-Team: Spanish [flags]" msgstr "borrar [flags]" -#: cli/app/move.go:138 +#: cli/app/move.go:137 #, c-format msgid "moving volume %s from %s to %s" msgstr "" @@ -3919,7 +3916,7 @@ msgstr "" msgid "no server provided" msgstr "" -#: cli/app/move.go:81 +#: cli/app/move.go:80 msgid "no server provided?" msgstr "" @@ -4222,7 +4219,7 @@ msgstr "" #. with no spaces in between #. translators: `abra recipe` aliases. use a comma separated list of aliases #. with no spaces in between -#: cli/app/backup.go:327 cli/app/list.go:303 cli/app/move.go:348 +#: cli/app/backup.go:327 cli/app/list.go:303 cli/app/move.go:346 #: cli/app/run.go:23 cli/app/upgrade.go:463 cli/catalogue/catalogue.go:302 #: cli/recipe/recipe.go:12 cli/recipe/release.go:640 cli/recipe/sync.go:270 msgid "r" @@ -4406,12 +4403,12 @@ msgstr "" msgid "removed freshly created tag %s" msgstr "" -#: cli/app/move.go:182 cli/app/move.go:188 +#: cli/app/move.go:180 cli/app/move.go:186 #, c-format msgid "removing %s from %s" msgstr "" -#: cli/app/move.go:194 +#: cli/app/move.go:192 #, c-format msgid "removing %s from local machine" msgstr "" @@ -4473,7 +4470,7 @@ msgstr "" msgid "repo set config: %s" msgstr "" -#: cli/app/move.go:350 cli/catalogue/catalogue.go:304 cli/recipe/release.go:642 +#: cli/app/move.go:348 cli/catalogue/catalogue.go:304 cli/recipe/release.go:642 #: cli/recipe/sync.go:272 msgid "report changes that would be made" msgstr "" @@ -4616,16 +4613,16 @@ msgstr "" msgid "rs" msgstr "" -#: cli/app/move.go:168 -#, c-format -msgid "rsyncing %s (renaming to %s) to %s from local machine" -msgstr "" - -#: cli/app/move.go:161 +#: cli/app/move.go:160 #, c-format msgid "rsyncing %s from %s to local machine" msgstr "" +#: cli/app/move.go:166 +#, c-format +msgid "rsyncing %s to %s from local machine" +msgstr "" + #: cli/recipe/lint.go:41 msgid "rule" msgstr "" @@ -4891,7 +4888,7 @@ msgstr "" msgid "skipped" msgstr "" -#: cli/app/move.go:280 +#: cli/app/move.go:278 #, c-format msgid "skipping %s as it does not match %s" msgstr "" @@ -5270,7 +5267,7 @@ msgstr "" msgid "unable to fetch tags in %s: %s" msgstr "" -#: cli/app/move.go:299 +#: cli/app/move.go:297 #, c-format msgid "unable to get container matching %s: %s" msgstr "" @@ -5357,7 +5354,7 @@ msgid "" "recipe sync %s\" already?" msgstr "" -#: cli/app/move.go:208 +#: cli/app/move.go:206 #, c-format msgid "unable to remove %s: %s" msgstr "" @@ -5388,7 +5385,7 @@ msgstr "" msgid "unable to resolve IPv4 for %s" msgstr "" -#: cli/app/move.go:105 +#: cli/app/move.go:104 #, c-format msgid "unable to retrieve %s resources on %s: %s" msgstr "" @@ -5452,7 +5449,7 @@ msgstr "desarmar [flags]" msgid "undeploy succeeded 🟢" msgstr "" -#: cli/app/move.go:113 +#: cli/app/move.go:112 #, c-format msgid "undeploying %s on %s" msgstr "" -- 2.49.0