Skip to content

Commit 2687962

Browse files
remove rsync restore method used by GHES versions prior to 2.13
GHES 2.13 is already out of support and therefore I think we should remove the code. Furthermore the `ghe-restore-pages-rsync` script uses `share/github-backup-utils/ghe-restore-userdata` which I think does not quote/escape the variable `$dirname` properly. As a consequence GitHub pages with whitespaces in their path cause errors on restore.
1 parent 1916f1c commit 2687962

File tree

4 files changed

+10
-136
lines changed

4 files changed

+10
-136
lines changed

bin/ghe-restore

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -262,28 +262,17 @@ commands=("
262262
echo \"Restoring Redis database ...\"
263263
ghe-ssh \"$GHE_HOSTNAME\" -- 'ghe-import-redis' < \"$GHE_RESTORE_SNAPSHOT_PATH/redis.rdb\" 1>&3")
264264

265-
# Unified and enhanced restore method to 2.13.0 and newer
266-
if $CLUSTER || [ "$(version $GHE_REMOTE_VERSION)" -ge "$(version 2.13.0)" ]; then
267-
commands+=("
268-
echo \"Restoring Git repositories ...\"
269-
ghe-restore-repositories \"$GHE_HOSTNAME\"")
270-
271-
commands+=("
272-
echo \"Restoring Gists ...\"
273-
ghe-restore-repositories-gist \"$GHE_HOSTNAME\"")
265+
commands+=("
266+
echo \"Restoring Git repositories ...\"
267+
ghe-restore-repositories \"$GHE_HOSTNAME\"")
274268

275-
commands+=("
276-
echo \"Restoring GitHub Pages artifacts ...\"
277-
ghe-restore-pages \"$GHE_HOSTNAME\" 1>&3")
278-
else
279-
commands+=("
280-
echo \"Restoring Git repositories and Gists ...\"
281-
ghe-restore-repositories-rsync \"$GHE_HOSTNAME\" 1>&3")
269+
commands+=("
270+
echo \"Restoring Gists ...\"
271+
ghe-restore-repositories-gist \"$GHE_HOSTNAME\"")
282272

283-
commands+=("
284-
echo \"Restoring GitHub Pages ...\"
285-
ghe-restore-pages-rsync \"$GHE_HOSTNAME\" 1>&3")
286-
fi
273+
commands+=("
274+
echo \"Restoring GitHub Pages artifacts ...\"
275+
ghe-restore-pages \"$GHE_HOSTNAME\" 1>&3")
287276

288277
commands+=("
289278
echo \"Restoring SSH authorized keys ...\"
@@ -318,7 +307,7 @@ if $CLUSTER || [ "$(version $GHE_REMOTE_VERSION)" -ge "$(version 2.12.9)" ]; the
318307
echo \"Restoring Audit logs ...\"
319308
ghe-restore-es-audit-log \"$GHE_HOSTNAME\" 1>&3")
320309
fi
321-
310+
322311
commands+=("
323312
echo \"Restoring hookshot logs ...\"
324313
ghe-restore-es-hookshot \"$GHE_HOSTNAME\" 1>&3")

share/github-backup-utils/ghe-restore-pages-rsync

Lines changed: 0 additions & 21 deletions
This file was deleted.

share/github-backup-utils/ghe-restore-repositories-rsync

Lines changed: 0 additions & 47 deletions
This file was deleted.

share/github-backup-utils/ghe-restore-userdata

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)