From 97139b5414343bd69724c7421b7ee45bbbea60e2 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Wed, 24 Jun 2026 17:05:17 +0200 Subject: [PATCH] in Upstream() call CheckIfOwnerExists to block requests for new users/orgs --- server/upstream/upstream.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/upstream/upstream.go b/server/upstream/upstream.go index 9aac271..59e4106 100644 --- a/server/upstream/upstream.go +++ b/server/upstream/upstream.go @@ -134,6 +134,12 @@ func (o *Options) Upstream(ctx *context.Context, giteaClient *gitea.Client, redi return true } + exists, _ := giteaClient.GiteaCheckIfOwnerExists(o.TargetOwner) + if !exists { + html.ReturnErrorPage(ctx, "forge client: new users/orgs are not allowed to use the old pages server. See https://codeberg.page on using git-pages", http.StatusBadRequest) + return true + } + // Check if the branch exists and when it was modified if o.BranchTimestamp.IsZero() { branchExist, err := o.GetBranchTimestamp(giteaClient)