diff options
Diffstat (limited to 'internal/cmd')
-rw-r--r-- | internal/cmd/hook.go | 3 | ||||
-rw-r--r-- | internal/cmd/serv.go | 9 | ||||
-rw-r--r-- | internal/cmd/web.go | 2 |
3 files changed, 6 insertions, 8 deletions
diff --git a/internal/cmd/hook.go b/internal/cmd/hook.go index c6b2d952..1d103d47 100644 --- a/internal/cmd/hook.go +++ b/internal/cmd/hook.go @@ -23,8 +23,8 @@ import ( "gogs.io/gogs/internal/conf" "gogs.io/gogs/internal/db" "gogs.io/gogs/internal/db/errors" - "gogs.io/gogs/internal/httplib" "gogs.io/gogs/internal/email" + "gogs.io/gogs/internal/httplib" "gogs.io/gogs/internal/template" ) @@ -198,7 +198,6 @@ func runHookPostReceive(c *cli.Context) error { // Post-receive hook does more than just gather Git information, // so we need to setup additional services for email notifications. - conf.NewPostReceiveHookServices() email.NewContext() isWiki := strings.Contains(os.Getenv(db.ENV_REPO_CUSTOM_HOOKS_PATH), ".wiki.git/") diff --git a/internal/cmd/serv.go b/internal/cmd/serv.go index b6df787e..e00a392b 100644 --- a/internal/cmd/serv.go +++ b/internal/cmd/serv.go @@ -220,12 +220,11 @@ func runServ(c *cli.Context) error { } } } else { - conf.NewService() // Check if the key can access to the repository in case of it is a deploy key (a deploy keys != user key). - // A deploy key doesn't represent a signed in user, so in a site with Service.RequireSignInView activated - // we should give read access only in repositories where this deploy key is in use. In other case, a server - // or system using an active deploy key can get read access to all the repositories in a Gogs service. - if key.IsDeployKey() && conf.Service.RequireSignInView { + // A deploy key doesn't represent a signed in user, so in a site with Auth.RequireSignInView enabled, + // we should give read access only in repositories where this deploy key is in use. In other cases, + // a server or system using an active deploy key can get read access to all repositories on a Gogs instace. + if key.IsDeployKey() && conf.Auth.RequireSigninView { checkDeployKey(key, repo) } } diff --git a/internal/cmd/web.go b/internal/cmd/web.go index 0d7cc6de..4cf1edac 100644 --- a/internal/cmd/web.go +++ b/internal/cmd/web.go @@ -171,7 +171,7 @@ func runWeb(c *cli.Context) error { m := newMacaron() reqSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: true}) - ignSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: conf.Service.RequireSignInView}) + ignSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: conf.Auth.RequireSigninView}) ignSignInAndCsrf := context.Toggle(&context.ToggleOptions{DisableCSRF: true}) reqSignOut := context.Toggle(&context.ToggleOptions{SignOutRequired: true}) |