unmojang / drasl

Yggdrasil-compatible API server for Minecraft
GNU General Public License v3.0
69 stars 11 forks source link

Control of indexing DRASL pages by search engines #81

Open hectorskypl opened 3 weeks ago

hectorskypl commented 3 weeks ago

I've proposed it on Matrix channel, so though i make that suggestion there. It would be nice have option to have setting to discourage search engines from indexing DRASL pages, for example via robots.txt

I did it on my own by placing robots.txt at public and making rewrite in main.go for it, it could be simple "if" though.

    e.Pre(middleware.Rewrite(map[string]string{
        "/authlib-injector/authserver/*":        "/auth/$1",
        "/authlib-injector/api/*":               "/account/$1",
        "/authlib-injector/sessionserver/*":     "/session/$1",
        "/authlib-injector/minecraftservices/*": "/services/$1",
        "/robots.txt":               "/drasl/public/robots.txt",
    }))

content of robots.txt

User-agent: *
Disallow: /