feat: serve matrix .well-known endpoints directly from Node server.js
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 13s

This commit is contained in:
Kroonk
2026-05-22 12:31:55 +02:00
parent fb3c7a99f1
commit 687a6a947b

View File

@@ -1059,6 +1059,27 @@ async function serveStatic(req, res) {
} }
const server = http.createServer(async (req, res) => { const server = http.createServer(async (req, res) => {
if (req.url?.startsWith('/.well-known/matrix/server')) {
res.writeHead(200, {
'Content-Type': 'application/json; charset=utf-8',
'Access-Control-Allow-Origin': '*'
});
res.end(JSON.stringify({ "m.server": "matrix.mischlabs.de:443" }));
return;
}
if (req.url?.startsWith('/.well-known/matrix/client')) {
res.writeHead(200, {
'Content-Type': 'application/json; charset=utf-8',
'Access-Control-Allow-Origin': '*'
});
res.end(JSON.stringify({
"m.homeserver": { "base_url": "https://matrix.mischlabs.de" },
"org.matrix.msc3575.proxy": { "url": "https://matrix.mischlabs.de" }
}));
return;
}
if (req.url?.startsWith('/api/auth/config')) { if (req.url?.startsWith('/api/auth/config')) {
if (req.method !== 'GET') { if (req.method !== 'GET') {
json(res, 405, { error: 'Method not allowed' }); json(res, 405, { error: 'Method not allowed' });