diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-06-24 05:12:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-23 17:12:38 -0400 |
commit | b223d361955f8b722f7dd0b358b2e57e6f359edf (patch) | |
tree | caa934320b264b969df679508eb19458e0cc6029 /modules/setting | |
parent | c9c7afda1a80bda7b61ded222163db796132b78f (diff) | |
download | gitea-b223d361955f8b722f7dd0b358b2e57e6f359edf.tar.gz gitea-b223d361955f8b722f7dd0b358b2e57e6f359edf.zip |
Rework repository archive (#14723)
* Use storage to store archive files
* Fix backend lint
* Add archiver table on database
* Finish archive download
* Fix test
* Add database migrations
* Add status for archiver
* Fix lint
* Add queue
* Add doctor to check and delete old archives
* Improve archive queue
* Fix tests
* improve archive storage
* Delete repo archives
* Add missing fixture
* fix fixture
* Fix fixture
* Fix test
* Fix archiver cleaning
* Fix bug
* Add docs for repository archive storage
* remove repo-archive configuration
* Fix test
* Fix test
* Fix lint
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/repository.go | 6 | ||||
-rw-r--r-- | modules/setting/storage.go | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/modules/setting/repository.go b/modules/setting/repository.go index a7666895e1..c2a6357d94 100644 --- a/modules/setting/repository.go +++ b/modules/setting/repository.go @@ -251,6 +251,10 @@ var ( } RepoRootPath string ScriptType = "bash" + + RepoArchive = struct { + Storage + }{} ) func newRepository() { @@ -328,4 +332,6 @@ func newRepository() { if !filepath.IsAbs(Repository.Upload.TempPath) { Repository.Upload.TempPath = path.Join(AppWorkPath, Repository.Upload.TempPath) } + + RepoArchive.Storage = getStorage("repo-archive", "", nil) } diff --git a/modules/setting/storage.go b/modules/setting/storage.go index 3ab08d8d2a..075152db59 100644 --- a/modules/setting/storage.go +++ b/modules/setting/storage.go @@ -43,6 +43,10 @@ func getStorage(name, typ string, targetSec *ini.Section) Storage { sec.Key("MINIO_LOCATION").MustString("us-east-1") sec.Key("MINIO_USE_SSL").MustBool(false) + if targetSec == nil { + targetSec, _ = Cfg.NewSection(name) + } + var storage Storage storage.Section = targetSec storage.Type = typ |