diff options
Diffstat (limited to 'internal/route')
-rw-r--r-- | internal/route/admin/admin.go | 31 | ||||
-rw-r--r-- | internal/route/install.go | 9 | ||||
-rw-r--r-- | internal/route/repo/issue.go | 24 | ||||
-rw-r--r-- | internal/route/repo/pull.go | 2 |
4 files changed, 32 insertions, 34 deletions
diff --git a/internal/route/admin/admin.go b/internal/route/admin/admin.go index e6a3a61a..380c4c54 100644 --- a/internal/route/admin/admin.go +++ b/internal/route/admin/admin.go @@ -206,37 +206,36 @@ func Config(c *context.Context) { c.Data["Auth"] = conf.Auth c.Data["User"] = conf.User c.Data["Session"] = conf.Session - - c.Data["LogRootPath"] = conf.LogRootPath - + c.Data["Cache"] = conf.Cache c.Data["HTTP"] = conf.HTTP - c.Data["Webhook"] = conf.Webhook - - c.Data["CacheAdapter"] = conf.CacheAdapter - c.Data["CacheInterval"] = conf.CacheInterval - c.Data["CacheConn"] = conf.CacheConn - - c.Data["DisableGravatar"] = conf.DisableGravatar - c.Data["EnableFederatedAvatar"] = conf.EnableFederatedAvatar + // TODO + c.Data["Attachment"] = conf.Attachment + c.Data["Release"] = conf.Release + c.Data["Time"] = conf.Time + c.Data["Picture"] = conf.Picture + c.Data["Mirror"] = conf.Mirror + // ??? + c.Data["Webhook"] = conf.Webhook c.Data["Git"] = conf.Git + c.Data["LogRootPath"] = conf.Log.RootPath type logger struct { Mode, Config string } - loggers := make([]*logger, len(conf.LogModes)) - for i := range conf.LogModes { + loggers := make([]*logger, len(conf.Log.Modes)) + for i := range conf.Log.Modes { loggers[i] = &logger{ - Mode: strings.Title(conf.LogModes[i]), + Mode: strings.Title(conf.Log.Modes[i]), } - result, _ := jsoniter.MarshalIndent(conf.LogConfigs[i], "", " ") + result, _ := jsoniter.MarshalIndent(conf.Log.Configs[i], "", " ") loggers[i].Config = string(result) } c.Data["Loggers"] = loggers - c.HTML(200, CONFIG) + c.Success(CONFIG) } func Monitor(c *context.Context) { diff --git a/internal/route/install.go b/internal/route/install.go index c9d13d98..e14a60aa 100644 --- a/internal/route/install.go +++ b/internal/route/install.go @@ -59,7 +59,7 @@ func GlobalInit(customConf string) error { log.Trace("Work directory: %s", conf.WorkDir()) log.Trace("Custom path: %s", conf.CustomDir()) log.Trace("Custom config: %s", conf.CustomConf) - log.Trace("Log path: %s", conf.LogRootPath) + log.Trace("Log path: %s", conf.Log.RootPath) log.Trace("Build time: %s", conf.BuildTime) log.Trace("Build commit: %s", conf.BuildCommit) @@ -67,7 +67,6 @@ func GlobalInit(customConf string) error { log.Trace("Email service is enabled") } - conf.NewServices() email.NewContext() if conf.Security.InstallLock { @@ -172,7 +171,7 @@ func Install(c *context.Context) { f.UseBuiltinSSHServer = conf.SSH.StartBuiltinServer f.HTTPPort = conf.Server.HTTPPort f.AppUrl = conf.Server.ExternalURL - f.LogRootPath = conf.LogRootPath + f.LogRootPath = conf.Log.RootPath // E-mail service settings if conf.Email.Enabled { @@ -185,8 +184,8 @@ func Install(c *context.Context) { // Server and other services settings f.OfflineMode = conf.Server.OfflineMode - f.DisableGravatar = conf.DisableGravatar - f.EnableFederatedAvatar = conf.EnableFederatedAvatar + f.DisableGravatar = conf.Picture.DisableGravatar + f.EnableFederatedAvatar = conf.Picture.EnableFederatedAvatar f.DisableRegistration = conf.Auth.DisableRegistration f.EnableCaptcha = conf.Auth.EnableRegistrationCaptcha f.RequireSignInView = conf.Auth.RequireSigninView diff --git a/internal/route/repo/issue.go b/internal/route/repo/issue.go index 2cc065e0..c8756d28 100644 --- a/internal/route/repo/issue.go +++ b/internal/route/repo/issue.go @@ -256,10 +256,10 @@ func Pulls(c *context.Context) { func renderAttachmentSettings(c *context.Context) { c.Data["RequireDropzone"] = true - c.Data["IsAttachmentEnabled"] = conf.AttachmentEnabled - c.Data["AttachmentAllowedTypes"] = conf.AttachmentAllowedTypes - c.Data["AttachmentMaxSize"] = conf.AttachmentMaxSize - c.Data["AttachmentMaxFiles"] = conf.AttachmentMaxFiles + c.Data["IsAttachmentEnabled"] = conf.Attachment.Enabled + c.Data["AttachmentAllowedTypes"] = conf.Attachment.AllowedTypes + c.Data["AttachmentMaxSize"] = conf.Attachment.MaxSize + c.Data["AttachmentMaxFiles"] = conf.Attachment.MaxFiles } func RetrieveRepoMilestonesAndAssignees(c *context.Context, repo *db.Repository) { @@ -429,7 +429,7 @@ func NewIssuePost(c *context.Context, f form.NewIssue) { } var attachments []string - if conf.AttachmentEnabled { + if conf.Attachment.Enabled { attachments = f.Files } @@ -493,12 +493,12 @@ func uploadAttachment(c *context.Context, allowedTypes []string) { } func UploadIssueAttachment(c *context.Context) { - if !conf.AttachmentEnabled { + if !conf.Attachment.Enabled { c.NotFound() return } - uploadAttachment(c, strings.Split(conf.AttachmentAllowedTypes, ",")) + uploadAttachment(c, conf.Attachment.AllowedTypes) } func viewIssue(c *context.Context, isPullList bool) { @@ -845,7 +845,7 @@ func NewComment(c *context.Context, f form.CreateComment) { } var attachments []string - if conf.AttachmentEnabled { + if conf.Attachment.Enabled { attachments = f.Files } @@ -1130,7 +1130,7 @@ func NewMilestone(c *context.Context) { c.Data["PageIsIssueList"] = true c.Data["PageIsMilestones"] = true c.Data["RequireDatetimepicker"] = true - c.Data["DateLang"] = conf.DateLang(c.Locale.Language()) + c.Data["DateLang"] = conf.I18n.DateLang(c.Locale.Language()) c.HTML(200, MILESTONE_NEW) } @@ -1139,7 +1139,7 @@ func NewMilestonePost(c *context.Context, f form.CreateMilestone) { c.Data["PageIsIssueList"] = true c.Data["PageIsMilestones"] = true c.Data["RequireDatetimepicker"] = true - c.Data["DateLang"] = conf.DateLang(c.Locale.Language()) + c.Data["DateLang"] = conf.I18n.DateLang(c.Locale.Language()) if c.HasError() { c.HTML(200, MILESTONE_NEW) @@ -1175,7 +1175,7 @@ func EditMilestone(c *context.Context) { c.Data["PageIsMilestones"] = true c.Data["PageIsEditMilestone"] = true c.Data["RequireDatetimepicker"] = true - c.Data["DateLang"] = conf.DateLang(c.Locale.Language()) + c.Data["DateLang"] = conf.I18n.DateLang(c.Locale.Language()) m, err := db.GetMilestoneByRepoID(c.Repo.Repository.ID, c.ParamsInt64(":id")) if err != nil { @@ -1199,7 +1199,7 @@ func EditMilestonePost(c *context.Context, f form.CreateMilestone) { c.Data["PageIsMilestones"] = true c.Data["PageIsEditMilestone"] = true c.Data["RequireDatetimepicker"] = true - c.Data["DateLang"] = conf.DateLang(c.Locale.Language()) + c.Data["DateLang"] = conf.I18n.DateLang(c.Locale.Language()) if c.HasError() { c.HTML(200, MILESTONE_NEW) diff --git a/internal/route/repo/pull.go b/internal/route/repo/pull.go index 52e7281a..b819857b 100644 --- a/internal/route/repo/pull.go +++ b/internal/route/repo/pull.go @@ -677,7 +677,7 @@ func CompareAndPullRequestPost(c *context.Context, f form.NewIssue) { return } - if conf.AttachmentEnabled { + if conf.Attachment.Enabled { attachments = f.Files } |