From 57e9d05c7fff2c87060e1c77491b3ebb1c69cf21 Mon Sep 17 00:00:00 2001 From: Catherine Date: Wed, 22 Apr 2026 00:47:49 +0000 Subject: [PATCH] Update default index branch name for `codeberg-pages-compat` quirk. The actual Codeberg Pages v2 server uses the Forgejo default branch for the index repository. The quirk previously used the `main` branch unconditionally. This is complex to implement, so per discussion with gusted we have decided to change the default branch to `pages` so that it has parity with non-Codeberg-specific behavior. --- src/auth.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/auth.go b/src/auth.go index 4101420..2c7e7f7 100644 --- a/src/auth.go +++ b/src/auth.go @@ -315,17 +315,16 @@ func authorizeCodebergPagesV2(r *http.Request) (*Authorization, error) { if domainParts[0] == "page" && domainParts[1] == "codeberg" { // map of domain names to allowed repository and branch: // * {username}.codeberg.page => - // https://codeberg.org/{username}/pages.git#main + // https://codeberg.org/{username}/pages.git#pages // * {reponame}.{username}.codeberg.page => // https://codeberg.org/{username}/{reponame}.git#pages // * {branch}.{reponame}.{username}.codeberg.page => // https://codeberg.org/{username}/{reponame}.git#{branch} username := domainParts[2] reponame := "pages" - branch := "main" + branch := "pages" if len(domainParts) >= 4 { reponame = domainParts[3] - branch = "pages" } if len(domainParts) == 5 { branch = domainParts[4]