aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/http.go
diff options
context:
space:
mode:
authorkolaente <konrad@kola-entertainments.de>2019-01-23 19:58:38 +0100
committertechknowlogick <matti@mdranta.net>2019-01-23 13:58:38 -0500
commit0b510725c97452bac57ff0080df10f6177aa2a6e (patch)
treeb9405cf290057698b32cf0acacc0d627f223ed6d /routers/repo/http.go
parent6ad834e236756e7ba3de27e59681080a7ec4fcf1 (diff)
downloadgitea-0b510725c97452bac57ff0080df10f6177aa2a6e.tar.gz
gitea-0b510725c97452bac57ff0080df10f6177aa2a6e.zip
Feature: Archive repos (#5009)
Diffstat (limited to 'routers/repo/http.go')
-rw-r--r--routers/repo/http.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go
index 01c84b3708..893401e902 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -95,6 +95,12 @@ func HTTP(ctx *context.Context) {
return
}
+ // Don't allow pushing if the repo is archived
+ if repo.IsArchived && !isPull {
+ ctx.HandleText(http.StatusForbidden, "This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.")
+ return
+ }
+
// Only public pull don't need auth.
isPublicPull := !repo.IsPrivate && isPull
var (