Adding robots.txt override via admin control panel

This is a requested low priority feature in #418 - I created the changes
to follow similarly to how the Instance Description is handled.
This commit is contained in:
Kinetix 2025-01-28 15:57:45 -08:00
parent 4b104879cd
commit 993532bc1f
10 changed files with 62 additions and 1 deletions

View file

@ -488,7 +488,14 @@ export class ClientServerService {
});
fastify.get('/robots.txt', async (request, reply) => {
return await reply.sendFile('/robots.txt', staticAssets);
if (this.meta.robotsTxt) {
let content = '';
content += this.meta.robotsTxt;
reply.header('Content-Type', 'text/plain');
return await reply.send(content);
} else {
return await reply.sendFile('/robots.txt', staticAssets);
}
});
// OpenSearch XML