From e8a022ac9aa4fc65a5405825c4e5124328030acc Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Sun, 29 Dec 2024 19:52:10 +0100 Subject: [PATCH] dump: add option to skip repository archives data One might want to exclude this data when dumping, esp. since repository archives are more of temporary data by nature. Signed-off-by: Christoph Heiss --- cmd/dump.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/dump.go b/cmd/dump.go index 6bf1a1dc89..14f9a00b58 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -160,6 +160,10 @@ It can be used for backup and capture Forgejo server image to send to maintainer Name: "skip-index", Usage: "Skip bleve index data", }, + &cli.BoolFlag{ + Name: "skip-repo-archives", + Usage: "Skip repository archives", + }, &cli.GenericFlag{ Name: "type", Value: outputTypeEnum, @@ -360,6 +364,11 @@ func runDump(ctx *cli.Context) error { excludes = append(excludes, setting.Indexer.IssuePath) } + if ctx.IsSet("skip-repo-archives") && ctx.Bool("skip-repo-archives") { + log.Info("Skipping repository archives data") + excludes = append(excludes, setting.RepoArchive.Storage.Path) + } + excludes = append(excludes, setting.RepoRootPath) excludes = append(excludes, setting.LFS.Storage.Path) excludes = append(excludes, setting.Attachment.Storage.Path)