From e73fd251c31ad4ddf42dc3a7be38690084874cc6 Mon Sep 17 00:00:00 2001 From: Marco Blessing Date: Mon, 21 Feb 2022 15:03:46 +0100 Subject: [PATCH 1/6] adds docke restore section --- .../doc/usage/backup-and-restore.en-us.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/content/doc/usage/backup-and-restore.en-us.md b/docs/content/doc/usage/backup-and-restore.en-us.md index fcb669b836a00..0680b41a72fd3 100644 --- a/docs/content/doc/usage/backup-and-restore.en-us.md +++ b/docs/content/doc/usage/backup-and-restore.en-us.md @@ -95,3 +95,37 @@ Repository Git Hooks should be regenerated if installation method is changed (eg With Gitea running, and from the directory Gitea's binary is located, execute: `./gitea admin regenerate hooks` This ensures that application and configuration file paths in repository Git Hooks are consistent and applicable to the current installation. If these paths are not updated, repository `push` actions will fail. + +### Using Docker (`restore`) + +There is also no support fot a recovery command in a docker based gitea instance. The restore process contains the same steps like described in re previous section but with different paths. + +Example: + +```sh +# open bash session in contianer +docker exec --user git -it bash +# unzip your backup file within the container +unzip gitea-dump-1610949662.zip +cd gitea-dump-1610949662 +# restore the gitea data +mv data/* /data/gitea +# restore the repositories itself +mv repos/* /data/git/repositories/ +# adjust file permissions +chown -R git:git /data +# Regenerate Git Hooks +/app/gitea/gitea -c '/data/gitea/conf/app.ini' admin regenerate hooks +``` + +The default user in the gitea container is `git` (1000:1000). + +These are the default paths used in the container: + +```text +DEFAULT CONFIGURATION: + CustomPath: /data/gitea (GITEA_CUSTOM) + CustomConf: /data/gitea/conf/app.ini + AppPath: /usr/local/bin/gitea + AppWorkPath: /usr/local/bin +``` \ No newline at end of file From 8d5accfeb7a6d76261d39bf4989c06fdc9379908 Mon Sep 17 00:00:00 2001 From: Marco Blessing Date: Mon, 21 Feb 2022 15:38:56 +0100 Subject: [PATCH 2/6] fix typo --- docs/content/doc/usage/backup-and-restore.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/doc/usage/backup-and-restore.en-us.md b/docs/content/doc/usage/backup-and-restore.en-us.md index 0680b41a72fd3..eddd05129a25b 100644 --- a/docs/content/doc/usage/backup-and-restore.en-us.md +++ b/docs/content/doc/usage/backup-and-restore.en-us.md @@ -103,7 +103,7 @@ There is also no support fot a recovery command in a docker based gitea instance Example: ```sh -# open bash session in contianer +# open bash session in container docker exec --user git -it bash # unzip your backup file within the container unzip gitea-dump-1610949662.zip From 9c9c4528937fc1f011c75f169da4376e44482a1f Mon Sep 17 00:00:00 2001 From: Marco Blessing Date: Thu, 24 Feb 2022 07:04:38 +0100 Subject: [PATCH 3/6] Update docs/content/doc/usage/backup-and-restore.en-us.md Co-authored-by: Gusted --- docs/content/doc/usage/backup-and-restore.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/doc/usage/backup-and-restore.en-us.md b/docs/content/doc/usage/backup-and-restore.en-us.md index eddd05129a25b..a88e431d13669 100644 --- a/docs/content/doc/usage/backup-and-restore.en-us.md +++ b/docs/content/doc/usage/backup-and-restore.en-us.md @@ -98,7 +98,7 @@ This ensures that application and configuration file paths in repository Git Hoo ### Using Docker (`restore`) -There is also no support fot a recovery command in a docker based gitea instance. The restore process contains the same steps like described in re previous section but with different paths. +There is also no support for a recovery command in a Docker-based gitea instance. The restore process contains the same steps as described in the previous section but with different paths. Example: From d1a1e89bbb66c62bdff053db2c00665f18d5cd54 Mon Sep 17 00:00:00 2001 From: Marco Blessing Date: Thu, 24 Feb 2022 07:11:54 +0100 Subject: [PATCH 4/6] fix container id placeholder --- docs/content/doc/usage/backup-and-restore.en-us.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/doc/usage/backup-and-restore.en-us.md b/docs/content/doc/usage/backup-and-restore.en-us.md index a88e431d13669..a03fc367e43bb 100644 --- a/docs/content/doc/usage/backup-and-restore.en-us.md +++ b/docs/content/doc/usage/backup-and-restore.en-us.md @@ -104,7 +104,7 @@ Example: ```sh # open bash session in container -docker exec --user git -it bash +docker exec --user git -it 2a83b293548e bash # unzip your backup file within the container unzip gitea-dump-1610949662.zip cd gitea-dump-1610949662 @@ -118,7 +118,7 @@ chown -R git:git /data /app/gitea/gitea -c '/data/gitea/conf/app.ini' admin regenerate hooks ``` -The default user in the gitea container is `git` (1000:1000). +The default user in the gitea container is `git` (1000:1000). Please replace `2a83b293548e` with your gitea container id or name. These are the default paths used in the container: @@ -128,4 +128,4 @@ DEFAULT CONFIGURATION: CustomConf: /data/gitea/conf/app.ini AppPath: /usr/local/bin/gitea AppWorkPath: /usr/local/bin -``` \ No newline at end of file +``` From 29a9305105719e3b423591e4d462a2fd641e58e2 Mon Sep 17 00:00:00 2001 From: Marco Blessing Date: Mon, 28 Feb 2022 08:09:21 +0100 Subject: [PATCH 5/6] adds restore help for docker-rootless --- .../doc/usage/backup-and-restore.en-us.md | 36 +++++++++++++++---- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/docs/content/doc/usage/backup-and-restore.en-us.md b/docs/content/doc/usage/backup-and-restore.en-us.md index a03fc367e43bb..6e169254bec69 100644 --- a/docs/content/doc/usage/backup-and-restore.en-us.md +++ b/docs/content/doc/usage/backup-and-restore.en-us.md @@ -1,16 +1,16 @@ --- -date: "2017-01-01T16:00:00+02:00" -title: "Usage: Backup and Restore" -slug: "backup-and-restore" +date: '2017-01-01T16:00:00+02:00' +title: 'Usage: Backup and Restore' +slug: 'backup-and-restore' weight: 11 toc: false draft: false menu: sidebar: - parent: "usage" - name: "Backup and Restore" + parent: 'usage' + name: 'Backup and Restore' weight: 11 - identifier: "backup-and-restore" + identifier: 'backup-and-restore' --- # Backup and Restore @@ -115,7 +115,7 @@ mv repos/* /data/git/repositories/ # adjust file permissions chown -R git:git /data # Regenerate Git Hooks -/app/gitea/gitea -c '/data/gitea/conf/app.ini' admin regenerate hooks +/usr/local/bin/gitea -c '/data/gitea/conf/app.ini' admin regenerate hooks ``` The default user in the gitea container is `git` (1000:1000). Please replace `2a83b293548e` with your gitea container id or name. @@ -129,3 +129,25 @@ DEFAULT CONFIGURATION: AppPath: /usr/local/bin/gitea AppWorkPath: /usr/local/bin ``` + +### Using Docker-rootless (`restore`) + +The restore workflow in Docker-rootless containers differs only in the directories to be used: + +```sh +# open bash session in container +docker exec --user git -it 2a83b293548e bash +# unzip your backup file within the container +unzip gitea-dump-1610949662.zip +cd gitea-dump-1610949662 +# restore the app.ini +mv data/conf/app.ini /etc/gitea/app.ini +# restore the gitea data +mv data/* /var/lib/gitea +# restore the repositories itself +mv repos/* /var/lib/gitea/git/repositories +# adjust file permissions +chown -R git:git /etc/gitea/app.ini /var/lib/gitea +# Regenerate Git Hooks +/usr/local/bin/gitea -c '/etc/gitea/app.ini' admin regenerate hooks +``` From 22e030989e9ceaf602bdcb7e8fa7f505963c4e7d Mon Sep 17 00:00:00 2001 From: Marco Blessing Date: Mon, 28 Feb 2022 08:15:51 +0100 Subject: [PATCH 6/6] restore yml autoformater quotes --- docs/content/doc/usage/backup-and-restore.en-us.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/content/doc/usage/backup-and-restore.en-us.md b/docs/content/doc/usage/backup-and-restore.en-us.md index 6e169254bec69..8d90379abefab 100644 --- a/docs/content/doc/usage/backup-and-restore.en-us.md +++ b/docs/content/doc/usage/backup-and-restore.en-us.md @@ -1,16 +1,16 @@ --- -date: '2017-01-01T16:00:00+02:00' -title: 'Usage: Backup and Restore' -slug: 'backup-and-restore' +date: "2017-01-01T16:00:00+02:00" +title: "Usage: Backup and Restore" +slug: "backup-and-restore" weight: 11 toc: false draft: false menu: sidebar: - parent: 'usage' - name: 'Backup and Restore' + parent: "usage" + name: "Backup and Restore" weight: 11 - identifier: 'backup-and-restore' + identifier: "backup-and-restore" --- # Backup and Restore