Skip to content

Conversation

FoxxMD
Copy link

@FoxxMD FoxxMD commented May 28, 2025

* Implement blocking non-robots routes based on ai.robots.txt
  * Add test for blocking
* Add caching for ai.robots.txt solution-libre#8
@FoxxMD
Copy link
Author

FoxxMD commented May 28, 2025

I have not had much experience with Go so I'm sure my code is sloppy and not using best practices. Please feel free to suggest changes or make them yourself.

These changes implement caching for ai.robots.txt and an optional behavior to block non robots.txt routes based on the User-Agent identifiers found in ai.robots.txt (also cached).

Most of the code for blocking is pulled from https://github.com/edelbluth/tm_no_ai_bots

@FoxxMD
Copy link
Author

FoxxMD commented May 28, 2025

All of the functionality works when using local mode on my prod traefik instance BUT making a change to any of the options for the middleware seems to cause an error when traefik reloads config...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant