aboutsummaryrefslogtreecommitdiff
path: root/internal/cmd
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-02-29 16:29:17 +0800
committerGitHub <noreply@github.com>2020-02-29 16:29:17 +0800
commit17ae0ed3eef54d96bd179ff7fec0540cf3024748 (patch)
treea9111282717da16feb83baf352ffb2ee5178ca0d /internal/cmd
parentd59b0f6ff7ee24d94eaa5ad68173405faea6a81c (diff)
conf: overhaul settings (#5953)
* Overhaul cache settings * Overhaul HTTP settings * conf: overhaul more settings * log: make LGTM happy * travis: upload report to Codecov * Add codecov.yml
Diffstat (limited to 'internal/cmd')
-rw-r--r--internal/cmd/import.go2
-rw-r--r--internal/cmd/serv.go2
-rw-r--r--internal/cmd/web.go14
3 files changed, 9 insertions, 9 deletions
diff --git a/internal/cmd/import.go b/internal/cmd/import.go
index 5dbac9c1..bfc83852 100644
--- a/internal/cmd/import.go
+++ b/internal/cmd/import.go
@@ -66,7 +66,7 @@ func runImportLocale(c *cli.Context) error {
escapedQuotes := []byte(`\"`)
regularQuotes := []byte(`"`)
// Cut out en-US.
- for _, lang := range conf.Langs[1:] {
+ for _, lang := range conf.I18n.Langs[1:] {
name := fmt.Sprintf("locale_%s.ini", lang)
source := filepath.Join(c.String("source"), name)
target := filepath.Join(c.String("target"), name)
diff --git a/internal/cmd/serv.go b/internal/cmd/serv.go
index e00a392b..0efb139b 100644
--- a/internal/cmd/serv.go
+++ b/internal/cmd/serv.go
@@ -68,7 +68,7 @@ func setup(c *cli.Context, logPath string, connectDB bool) {
err = log.NewFile(log.FileConfig{
Level: level,
- Filename: filepath.Join(conf.LogRootPath, logPath),
+ Filename: filepath.Join(conf.Log.RootPath, logPath),
FileRotationConfig: log.FileRotationConfig{
Rotate: true,
Daily: true,
diff --git a/internal/cmd/web.go b/internal/cmd/web.go
index 728d5c80..078678b4 100644
--- a/internal/cmd/web.go
+++ b/internal/cmd/web.go
@@ -92,14 +92,14 @@ func newMacaron() *macaron.Macaron {
))
m.Use(macaron.Static(
- conf.AvatarUploadPath,
+ conf.Picture.AvatarUploadPath,
macaron.StaticOptions{
Prefix: db.USER_AVATAR_URL_PREFIX,
SkipLogging: conf.Server.DisableRouterLog,
},
))
m.Use(macaron.Static(
- conf.RepositoryAvatarUploadPath,
+ conf.Picture.RepositoryAvatarUploadPath,
macaron.StaticOptions{
Prefix: db.REPO_AVATAR_URL_PREFIX,
SkipLogging: conf.Server.DisableRouterLog,
@@ -129,15 +129,15 @@ func newMacaron() *macaron.Macaron {
SubURL: conf.Server.Subpath,
Files: localeFiles,
CustomDirectory: filepath.Join(conf.CustomDir(), "conf", "locale"),
- Langs: conf.Langs,
- Names: conf.Names,
+ Langs: conf.I18n.Langs,
+ Names: conf.I18n.Names,
DefaultLang: "en-US",
Redirect: true,
}))
m.Use(cache.Cacher(cache.Options{
- Adapter: conf.CacheAdapter,
- AdapterConfig: conf.CacheConn,
- Interval: conf.CacheInterval,
+ Adapter: conf.Cache.Adapter,
+ AdapterConfig: conf.Cache.Host,
+ Interval: conf.Cache.Interval,
}))
m.Use(captcha.Captchaer(captcha.Options{
SubURL: conf.Server.Subpath,