Add default storage configurations#12813
Conversation
422b2be to
f8905a5
Compare
0cf27dc to
469a28b
Compare
Codecov Report
@@ Coverage Diff @@
## master #12813 +/- ##
==========================================
+ Coverage 42.54% 42.58% +0.03%
==========================================
Files 670 671 +1
Lines 73522 73627 +105
==========================================
+ Hits 31281 31354 +73
- Misses 37175 37188 +13
- Partials 5066 5085 +19
Continue to review full report at Codecov.
|
|
We should probably prefix filenames with type (ex. |
|
This also fixes #12828 |
|
@lafriks |
There was a problem hiding this comment.
Do we really need this?
This is a bad sign, we should be removing lint exceptions not adding them.
There was a problem hiding this comment.
I removed
- path: modules/setting/attachment.go
linters:
- dupl
- path: modules/setting/lfs.go
linters:
- dupl
but still keep cmd/dump.go because it reports the duplicated codes but I think merging them as a function is not a good choice.
bd58ab2 to
3c9f56f
Compare
Signed-off-by: Andrew Thornton <art27@cantab.net>
Add IterateObjects
|
@zeripath Merged. |
|
@lunny backend lint fails |
|
Why did you decide to prestash the storage configs here: func getStorage(sec *ini.Section) Storage {
var storage Storage
storage.Type = sec.Key("STORAGE_TYPE").MustString(LocalStorageType)
storage.Section = sec
storage.ServeDirect = sec.Key("SERVE_DIRECT").MustBool(false)
sec.Key("MINIO_ENDPOINT").MustString("localhost:9000")
sec.Key("MINIO_ACCESS_KEY_ID").MustString("")
sec.Key("MINIO_SECRET_ACCESS_KEY").MustString("")
sec.Key("MINIO_BUCKET").MustString("gitea")
sec.Key("MINIO_LOCATION").MustString("us-east-1")
sec.Key("MINIO_USE_SSL").MustBool(false)
return storage
}
func newStorageService() {
sec := Cfg.Section("storage")
storages["default"] = getStorage(sec)
for _, sec := range Cfg.Section("storage").ChildSections() {
name := strings.TrimPrefix(sec.Name(), "storage.")
if name == "default" || name == LocalStorageType || name == MinioStorageType {
log.Error("storage name %s is system reserved!", name)
continue
}
storages[name] = getStorage(sec)
}
}Instead of following the pattern of func GetStorageSettings(name string) { ... }? |
|
@zeripath because these configurations maybe inherit or override. |
|
@zeripath Could you send your PR directly to gitea once this merged? |
|
looks like I'll have to |
LFS_*to under[lfs]