summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
Diffstat (limited to 'routers')
-rw-r--r--routers/private/serv.go2
-rw-r--r--routers/repo/http.go1
2 files changed, 3 insertions, 0 deletions
diff --git a/routers/private/serv.go b/routers/private/serv.go
index 182fe27245..90e1d30b01 100644
--- a/routers/private/serv.go
+++ b/routers/private/serv.go
@@ -132,6 +132,7 @@ func ServCommand(ctx *macaron.Context) {
for _, verb := range ctx.QueryStrings("verb") {
if "git-upload-pack" == verb {
// User is fetching/cloning a non-existent repository
+ log.Error("Failed authentication attempt (cannot find repository: %s/%s) from %s", results.OwnerName, results.RepoName, ctx.RemoteAddr())
ctx.JSON(http.StatusNotFound, map[string]interface{}{
"results": results,
"type": "ErrRepoNotExist",
@@ -317,6 +318,7 @@ func ServCommand(ctx *macaron.Context) {
userMode := perm.UnitAccessMode(unitType)
if userMode < mode {
+ log.Error("Failed authentication attempt for %s with key %s (not authorized to %s %s/%s) from %s", user.Name, key.Name, modeString, ownerName, repoName, ctx.RemoteAddr())
ctx.JSON(http.StatusUnauthorized, map[string]interface{}{
"results": results,
"type": "ErrUnauthorized",
diff --git a/routers/repo/http.go b/routers/repo/http.go
index 40c1f36bc3..d4464ec62e 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -102,6 +102,7 @@ func HTTP(ctx *context.Context) {
owner, err := models.GetUserByName(username)
if err != nil {
+ log.Error("Attempted access of unknown user from %s", ctx.RemoteAddr())
ctx.NotFoundOrServerError("GetUserByName", models.IsErrUserNotExist, err)
return
}