aboutsummaryrefslogtreecommitdiff
path: root/internal/cmd/serv.go
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-02-27 18:06:38 +0800
committerGitHub <noreply@github.com>2020-02-27 18:06:38 +0800
commit7950f2d17d97c37fca22b88d48056de1c00b4d77 (patch)
tree962531de3ff86417dc06cc4ece6eb22176fb5b8c /internal/cmd/serv.go
parentcf3d55fa10f9b16d0ba996f8129f50743b2cd4ad (diff)
conf: overhaul auth and user settings (#5942)
* conf: overhaul auth and user settings * ci: update travis Go versions
Diffstat (limited to 'internal/cmd/serv.go')
1 files changed, 4 insertions, 5 deletions
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)
}
}