Create domain verification system #10
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
SquareCows/pages-server#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Custom domains in .pages files should be verified by DNS TXT records. If a page has a custom domain of test.squarecows.com then the user should create a record in DNS of TXT test.squarecows.com and the value should be a hash of the full repository name. If the DNS record does not match the DNS TXT value it will not be added as a custom domain mapping. This will prevent a malicious user taking over the sites by creating lots of repositories. This feature should be enabled by the admins with a setting in the middlewares.yml file for Traefik.
✅ Implementation Complete
DNS TXT record verification for custom domains has been implemented on branch
0.1.0.Implementation Summary
Security Feature: Prevents malicious users from hijacking custom domains by requiring DNS TXT record verification before registering custom domain mappings.
How It Works
Configuration: Admin enables DNS verification in Traefik middleware config:
DNS TXT Record Format:
Where
<SHA256_HASH>is the SHA256 hash ofowner/repositoryVerification Process:
.pagesfile specifies a custom domainExample
For repository
squarecows/bovine-websitewith custom domainbovine.squarecows.com:Generate hash:
Add DNS TXT record:
Add to
.pagesfile:Activate: Visit
https://squarecows.pages.example.com/bovine-websiteto register (DNS verification will be performed automatically)Features
✅ Security:
crypto/subtle.ConstantTimeCompare✅ Admin Control:
✅ Usability:
✅ Quality:
Files Changed
pages.go- Core verification logicdns_verification_test.go- Test suite (new file)examples/generate-dns-verification-hash.sh- Helper script (new file)README.md- Complete documentationCHANGELOG.md- Feature documentationConfiguration Reference
Documentation
Complete setup guide, troubleshooting, and examples available in:
examples/generate-dns-verification-hash.shBranch
Feature available on branch:
0.1.0Will be included in version 0.1.0 release
Testing
To test locally: