Implement Matrix .well-known Delegation for GitHub Pages
High-Level Request
Read MATRIX_SETUP.md and implement the necessary changes to modify the GitHub Pages part of the repository to report the correct Matrix homeserver delegation values.
Actions Taken
Analysis and Setup
- Repository Structure Understanding: Analyzed the current GitHub Pages setup using Jekyll with docs/ as the source directory
- MATRIX_SETUP.md Review: Read the documentation which specified the need for
.well-known/matrix/clientfile for Matrix homeserver delegation - Identified Target Domain: Current GitHub Pages site serves from
anicolao.github.io/morpheumbased on _config.yml
Implementation
- Created Directory Structure: Added
docs/.well-known/matrix/directory for Matrix delegation files - Matrix Client Configuration: Created
docs/.well-known/matrix/clientfile with proper JSON content:{ "m.homeserver": { "base_url": "https://matrix.morpheum.dev" } } - Jekyll Configuration: Updated
docs/_config.ymlto include.well-knowndirectory in Jekyll build process by adding: ```yaml include:- .well-known ```
- Documentation Fix: Corrected malformed markdown link syntax in MATRIX_SETUP.md where the JSON example had
"[https://matrix.morpheum.dev](https://matrix.morpheum.dev)"instead of proper"https://matrix.morpheum.dev"
Validation
- JSON Syntax: Validated the client file contains valid JSON using
python3 -m json.tool - File Structure: Verified the directory structure and file placement matches MATRIX_SETUP.md requirements
- Git Integration: Successfully committed and pushed changes to the PR branch
Current Status
✅ Completed
- Matrix .well-known delegation file created and properly configured
- Jekyll configuration updated to serve .well-known files
- Documentation corrected to show proper JSON format
- Changes committed and pushed to PR branch
⏳ Pending
- GitHub Pages Deployment: Workflow triggered but requires manual approval for PR deployments (expected security behavior)
- Endpoint Verification: Once deployed, the Matrix delegation should be accessible at
https://anicolao.github.io/morpheum/.well-known/matrix/client
Technical Details
Matrix Delegation Configuration
The implementation follows the Matrix specification for client discovery delegation:
- Purpose: Allows Matrix clients to discover the homeserver at
matrix.morpheum.devwhen users try to log in with@username:morpheum.devaddresses - Standard Compliance: Uses the standard
.well-known/matrix/clientendpoint as specified in Matrix MSC1929 - JSON Structure: Contains the required
m.homeserver.base_urlfield pointing to the actual homeserver
Jekyll Integration
- File Inclusion: Jekyll by default excludes dot-files, so the
include: [.well-known]directive ensures the directory is processed and served - Content Type: Jekyll will serve the file with appropriate headers for JSON content discovery
Expected Outcome
When deployed and merged to main:
- Matrix clients will be able to perform homeserver discovery via
https://morpheum.dev/.well-known/matrix/client(once custom domain is configured) - Users can log in with
@username:morpheum.devaddresses and clients will automatically discover the homeserver atmatrix.morpheum.dev - The delegation setup enables the clean separation between user-facing domain and actual homeserver location
Next Steps
- Wait for PR approval and merge to main branch for deployment to production
- Verify the endpoint works correctly after deployment
- Consider adding custom domain configuration if
morpheum.devdomain will be used instead ofanicolao.github.io/morpheum
Morpheum