-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
.golangci.yml
Outdated
- path: modules/setting/attachment.go | ||
linters: | ||
- dupl | ||
- path: modules/setting/lfs.go | ||
linters: | ||
- dupl | ||
- path: cmd/dump.go | ||
linters: | ||
- dupl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
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]