4 stable releases

new 2.1.0 Apr 26, 2025
2.0.0 Apr 13, 2025
1.1.0 Mar 16, 2025
1.0.0 Mar 1, 2025

#114 in Template engine

Download history 136/week @ 2025-02-26 13/week @ 2025-03-05 104/week @ 2025-03-12 24/week @ 2025-03-19 7/week @ 2025-03-26 110/week @ 2025-04-09 20/week @ 2025-04-16 113/week @ 2025-04-23

244 downloads per month

MIT license

49KB
1K SLoC

iocaine

Build status Container image Demo Documentation

The deadliest poison known to AI.

This is a tarpit, modeled after Nepenthes, intended to catch unwelcome web crawlers, but with a slightly different, more aggressive intended usage scenario. The core idea is to configure a reverse proxy to serve content generated by iocaine to AI crawlers, but normal content to every other visitor. This differs from Nepenthes, where the idea is to link to it, and trap crawlers that way. Not with iocaine, where the trap is laid by the reverse proxy.

iocaine does not try to slow crawlers. It does not try to waste their time that way - that is left up to the reverse proxy. iocaine is purely about generating garbage.

For more information about what this is, how it works, and how to deploy it, have a look at the dedicated website.

Lets make AI poisoning the norm. If we all do it, they won't have anything to crawl.

Development

Assuming you have rust and cargo installed, you can build iocaine with:

cargo build

You can use the maze-data/ directory to store your textual sources and configuration:

mkdir maze-data

# For convenience, we use the README as a markov source.
# A longer document would be better.
cp README.md maze-data/markov.txt

# Build a word list from the markov source
cat maze-data/markov.txt | tr -s ' ' '\n' | sed 's/[^a-Z]*//g' | sort | uniq > maze-data/words.txt

# Copy the templates for easier editing
cp -r templates/* maze-data/

# Create a config.toml file
cat > maze-data/config.toml <<EOF
[server]
  bind = "0.0.0.0:42069"

[templates]
  directory = "maze-data/"

[sources]
  words = "maze-data/words.txt"
  markov = ["maze-data/markov.txt"]

[generator]
initial_seed = ""
EOF

To build and run iocaine with your local changes, run:

cargo run -- --config-file maze-data/config.toml

If you have epubs around and pandoc installed, you can very easily build a word list and a markov source like this:

pandoc maze-data/*.epub -t plain > maze-data/markov.txt
cat maze-data/markov.txt | tr -s ' ' '\n' | sed 's/[^a-Z]*//g' | sort | uniq > maze-data/words.txt

Run tests with:

cargo test

Dependencies

~31–45MB
~693K SLoC