diff --git a/modules/base/conf.go b/modules/base/conf.go index b4e0de97bdc..d3122a53397 100644 --- a/modules/base/conf.go +++ b/modules/base/conf.go @@ -100,7 +100,7 @@ func newService() { Service.EnableCacheAvatar = Cfg.MustBool("service", "ENABLE_CACHE_AVATAR", false) } -func NewLogService() { +func newLogService() { // Get and check log mode. LogMode = Cfg.MustValue("log", "MODE", "console") modeSec := "log." + LogMode @@ -296,7 +296,7 @@ func NewConfigContext() { func NewServices() { newService() - NewLogService() + newLogService() newCacheService() newSessionService() newMailService() diff --git a/serve.go b/serve.go index 06815b65df7..c3eb233c76d 100644 --- a/serve.go +++ b/serve.go @@ -45,6 +45,7 @@ gogs serv provide access auth for repositories`, } func init() { + os.MkdirAll("log", os.ModePerm) log.NewLogger(10000, "file", fmt.Sprintf(`{"filename":"%s"}`, "log/serv.log")) } @@ -72,7 +73,6 @@ func runServ(k *cli.Context) { base.NewConfigContext() models.LoadModelsConfig() models.NewEngine() - base.NewLogService() keys := strings.Split(os.Args[2], "-") if len(keys) != 2 { diff --git a/web.go b/web.go index 9717c9384a9..70da899a796 100644 --- a/web.go +++ b/web.go @@ -89,7 +89,7 @@ func runWeb(*cli.Context) { reqSignOut := middleware.Toggle(&middleware.ToggleOptions{SignOutRequire: true}) // Routers. - m.Get("/", reqSignIn, routers.Home) + m.Get("/", ignSignIn, routers.Home) m.Get("/issues", reqSignIn, user.Issues) m.Get("/pulls", reqSignIn, user.Pulls) m.Get("/stars", reqSignIn, user.Stars)