fix: opening dot files returns 403 error #580
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Viewing files that start with a dot (e.g.,
.gitignore,.env.example,.mokogitea/manifest.xml) in the web UI returns a 403 Forbidden error.Root Cause
The nginx config has a rule that denies access to hidden files:
This blocks all paths containing
/.except/api/routes. This was intended to protect.git/directory access but it also blocks legitimate dot files viewed through the Gitea UI (e.g.,/:owner/:repo/src/branch/main/.gitignore).Fix
Update the nginx regex to exclude Gitea's file browsing routes (
/src/,/raw/,/media/) in addition to/api/.Branch created:
feature/580-fix-opening-dot-files-returns-403-error