mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-02 01:59:36 +08:00
LFS support to be stored on minio (#12518)
* LFS support to be stored on minio * Fix test * Fix lint * Fix lint * Fix check * Fix test * Update documents and add migration for LFS * Fix some bugs
This commit is contained in:
@ -18,6 +18,7 @@ import (
|
||||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/modules/lfs"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/storage"
|
||||
|
||||
"gitea.com/macaron/gzip"
|
||||
gzipp "github.com/klauspost/compress/gzip"
|
||||
@ -49,8 +50,10 @@ func storeObjectInRepo(t *testing.T, repositoryID int64, content *[]byte) string
|
||||
lfsID++
|
||||
lfsMetaObject, err = models.NewLFSMetaObject(lfsMetaObject)
|
||||
assert.NoError(t, err)
|
||||
contentStore := &lfs.ContentStore{BasePath: setting.LFS.ContentPath}
|
||||
if !contentStore.Exists(lfsMetaObject) {
|
||||
contentStore := &lfs.ContentStore{ObjectStorage: storage.LFS}
|
||||
exist, err := contentStore.Exists(lfsMetaObject)
|
||||
assert.NoError(t, err)
|
||||
if !exist {
|
||||
err := contentStore.Put(lfsMetaObject, bytes.NewReader(*content))
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
@ -36,13 +36,23 @@ ROOT_URL = http://localhost:3001/
|
||||
DISABLE_SSH = false
|
||||
SSH_LISTEN_HOST = localhost
|
||||
SSH_PORT = 2201
|
||||
START_SSH_SERVER = true
|
||||
LFS_START_SERVER = true
|
||||
LFS_CONTENT_PATH = integrations/gitea-integration-mysql/datalfs-mysql
|
||||
OFFLINE_MODE = false
|
||||
LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w
|
||||
APP_DATA_PATH = integrations/gitea-integration-mysql/data
|
||||
BUILTIN_SSH_SERVER_USER = git
|
||||
START_SSH_SERVER = true
|
||||
OFFLINE_MODE = false
|
||||
|
||||
LFS_START_SERVER = true
|
||||
LFS_CONTENT_PATH = integrations/gitea-integration-mysql/datalfs-mysql
|
||||
LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w
|
||||
LFS_STORE_TYPE = minio
|
||||
LFS_SERVE_DIRECT = false
|
||||
LFS_MINIO_ENDPOINT = minio:9000
|
||||
LFS_MINIO_ACCESS_KEY_ID = 123456
|
||||
LFS_MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
LFS_MINIO_BUCKET = gitea
|
||||
LFS_MINIO_LOCATION = us-east-1
|
||||
LFS_MINIO_BASE_PATH = lfs/
|
||||
LFS_MINIO_USE_SSL = false
|
||||
|
||||
[attachment]
|
||||
STORE_TYPE = minio
|
||||
|
Reference in New Issue
Block a user