fix(pages): keep underscores in git-pages owner hostnames #226
No reviewers
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
codefloe/forgejo-codefloe!226
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pages-underscore-owners"
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?
Fixes https://forum.codefloe.com/t/pages-usernames-with-an-underscore-get-malformed-host-name-http-400/207.
Problem
Sites owned by a user with an underscore in their name never publish on the git-pages backend.
The fork sanitised the owner into a DNS label (
bodo_te→bodo-te).git-pages maps the host label back to the owner to check push rights with the forge, so it checked
bodo-te/blog, which does not exist, and refused the upload.The settings page therefore stays at "Not published yet", and
bodo-te.codefloe.pageanswerssite not found.The same mapping is also a collision: the publish token can push anywhere, so if a
bodo-teuser existed, the check would pass and the upload would overwrite that user's site.Separately, git-pages rejects
bodo_te.codefloe.pagewith400 malformed host namebecause its strict IDNA check refuses_.That half is fixed on the nodes by enabling git-pages'
relaxed-idnafeature in the pages-node ansible role.Change
gitPagesOwnerLabel), for publishing, the managed URL, the CNAME target, and the edge site-map.*.codefloe.pagecertificate does not cover, and replacing it would bring the collision back.GET /api/v1/admin/pages/site-map.Deploy order
Roll out
relaxed-idnaon the pages nodes before or together with this change, otherwise underscored sites publish but cannot be served.59e81f8d970dc90511fb