tower-no-ai

Crates.iotower-no-ai
lib.rstower-no-ai
version
sourcesrc
created_at2024-06-30 01:51:18.221522
updated_at2024-12-01 06:00:58.460277
descriptionA tower Service and Layer to redirect all AI scraping bots
homepage
repositoryhttps://github.com/itsjunetime/tower-no-ai
max_upload_size
id1287732
Cargo.toml error:TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
June (itsjunetime)

documentation

README

tower-no-ai

A very simple crate to extend tower with the ability to redirect all AI-scraper bot User-Agent headers to a user-defined URL.

This can be done with something like the following (with axum):

use tower_no_ai::NoAiLayer;
use axum::routing::{get, Router};

let route = Router::new()
	.route("/", get(hello_world))
	// route them to a hetzner 10GB speed test file
	.layer(NoAiLayer::new("https://fsn1-speed.hetzner.com/10GB.bin"));

As this is built on tower, it should work perfectly with all tower-based backends.

Contributions, bug reports, and suggestions are welcome.

Dual-Licensed MIT and Apache 2.0

Commit count: 7

cargo fmt