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)