aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2024-01-24 03:32:57 +0100
committerGitHub <noreply@github.com>2024-01-24 02:32:57 +0000
commitf3ba3e922dde7d12999a90d6cee15805a56cc7ff (patch)
tree1c61b2cf05fa7fb067627ba4544b3e19fb4ebc07 /routers/web/repo
parent1af45689f9bdac7267400a8c9d77c23676b33935 (diff)
downloadgitea-f3ba3e922dde7d12999a90d6cee15805a56cc7ff.tar.gz
gitea-f3ba3e922dde7d12999a90d6cee15805a56cc7ff.zip
Don't run push mirrors for archived repos (#27140)
Fixes https://codeberg.org/forgejo/forgejo/issues/612 At the moment push mirrors are still run if a repo is archived. This PR fixes this.
Diffstat (limited to 'routers/web/repo')
-rw-r--r--routers/web/repo/setting/setting.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/routers/web/repo/setting/setting.go b/routers/web/repo/setting/setting.go
index e721b7c739..fc1403b3cc 100644
--- a/routers/web/repo/setting/setting.go
+++ b/routers/web/repo/setting/setting.go
@@ -185,7 +185,7 @@ func SettingsPost(ctx *context.Context) {
ctx.Redirect(repo.Link() + "/settings")
case "mirror":
- if !setting.Mirror.Enabled || !repo.IsMirror {
+ if !setting.Mirror.Enabled || !repo.IsMirror || repo.IsArchived {
ctx.NotFound("", nil)
return
}
@@ -278,7 +278,7 @@ func SettingsPost(ctx *context.Context) {
ctx.Redirect(repo.Link() + "/settings")
case "mirror-sync":
- if !setting.Mirror.Enabled || !repo.IsMirror {
+ if !setting.Mirror.Enabled || !repo.IsMirror || repo.IsArchived {
ctx.NotFound("", nil)
return
}
@@ -306,7 +306,7 @@ func SettingsPost(ctx *context.Context) {
ctx.Redirect(repo.Link() + "/settings")
case "push-mirror-update":
- if !setting.Mirror.Enabled {
+ if !setting.Mirror.Enabled || repo.IsArchived {
ctx.NotFound("", nil)
return
}
@@ -343,7 +343,7 @@ func SettingsPost(ctx *context.Context) {
ctx.Redirect(repo.Link() + "/settings")
case "push-mirror-remove":
- if !setting.Mirror.Enabled {
+ if !setting.Mirror.Enabled || repo.IsArchived {
ctx.NotFound("", nil)
return
}
@@ -372,7 +372,7 @@ func SettingsPost(ctx *context.Context) {
ctx.Redirect(repo.Link() + "/settings")
case "push-mirror-add":
- if setting.Mirror.DisableNewPush {
+ if setting.Mirror.DisableNewPush || repo.IsArchived {
ctx.NotFound("", nil)
return
}