mirror of
https://git.ari.lt/ari.lt/ari.lt.git
synced 2025-02-04 09:39:25 +01:00
Use Flask-NoAI for AI blocking.
Signed-off-by: Ari Archer <ari@ari.lt>
This commit is contained in:
parent
cc08a0f210
commit
b9d8c51867
2 changed files with 4 additions and 34 deletions
|
@ -11,3 +11,4 @@ web-mini
|
|||
flask-limiter
|
||||
flask-ishuman
|
||||
pymemcache
|
||||
flask-noai
|
||||
|
|
|
@ -13,6 +13,7 @@ from typing import Any
|
|||
import flask
|
||||
import web_mini
|
||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||
from flask_noai import noai
|
||||
|
||||
from . import util
|
||||
|
||||
|
@ -35,39 +36,7 @@ def assign_http(app: flask.Flask) -> flask.Flask:
|
|||
robots: str = (
|
||||
f"""User-agent: *
|
||||
Sitemap: {app.config['PREFERRED_URL_SCHEME']}://{app.config['DOMAIN']}/sitemap.xml
|
||||
Disallow: /vote/*/*
|
||||
|
||||
# We are not slaves for machines.
|
||||
|
||||
User-agent: Amazonbot
|
||||
User-agent: anthropic-ai
|
||||
User-agent: Applebot-Extended
|
||||
User-agent: Bytespider
|
||||
User-agent: CCBot
|
||||
User-agent: ChatGPT-User
|
||||
User-agent: ClaudeBot
|
||||
User-agent: Claude-Web
|
||||
User-agent: cohere-ai
|
||||
User-agent: Diffbot
|
||||
User-agent: FacebookBot
|
||||
User-agent: facebookexternalhit
|
||||
User-agent: FriendlyCrawler
|
||||
User-agent: Google-Extended
|
||||
User-agent: GPTBot
|
||||
User-agent: ICC-Crawler
|
||||
User-agent: ImagesiftBot
|
||||
User-agent: img2dataset
|
||||
User-agent: meta-externalagent
|
||||
User-agent: OAI-SearchBot
|
||||
User-agent: Omgili
|
||||
User-agent: Omgilibot
|
||||
User-agent: PerplexityBot
|
||||
User-agent: PetalBot
|
||||
User-agent: Scrapy
|
||||
User-agent: Timpibot
|
||||
User-agent: VelenPublicWebCrawler
|
||||
User-agent: YouBot
|
||||
Disallow: /"""
|
||||
Disallow: /vote/*/*"""
|
||||
)
|
||||
|
||||
return flask.Response(robots, mimetype="text/plain")
|
||||
|
@ -210,4 +179,4 @@ def create_app(name: str) -> flask.Flask:
|
|||
"b64encode": b64encode,
|
||||
}
|
||||
|
||||
return assign_http(app)
|
||||
return noai(assign_http(app))
|
||||
|
|
Loading…
Add table
Reference in a new issue