1# Anubis {#module-services-anubis} 2 3[Anubis](https://anubis.techaro.lol) is a scraper defense software that blocks AI scrapers. It is designed to sit 4between a reverse proxy and the service to be protected. 5 6## Quickstart {#module-services-anubis-quickstart} 7 8This module is designed to use Unix domain sockets as the socket paths can be automatically configured for multiple 9instances, but TCP sockets are also supported. 10 11A minimal configuration with [nginx](#opt-services.nginx.enable) may look like the following: 12 13```nix 14{ config, ... }: 15{ 16 services.anubis.instances.default.settings.TARGET = "http://localhost:8000"; 17 18 # required due to unix socket permissions 19 users.users.nginx.extraGroups = [ config.users.groups.anubis.name ]; 20 services.nginx.virtualHosts."example.com" = { 21 locations = { 22 "/".proxyPass = "http://unix:${config.services.anubis.instances.default.settings.BIND}"; 23 }; 24 }; 25} 26``` 27 28If Unix domain sockets are not needed or desired, this module supports operating with only TCP sockets. 29 30```nix 31{ 32 services.anubis = { 33 instances.default = { 34 settings = { 35 TARGET = "http://localhost:8080"; 36 BIND = ":9000"; 37 BIND_NETWORK = "tcp"; 38 METRICS_BIND = "127.0.0.1:9001"; 39 METRICS_BIND_NETWORK = "tcp"; 40 }; 41 }; 42 }; 43} 44``` 45 46## Configuration {#module-services-anubis-configuration} 47 48It is possible to configure default settings for all instances of Anubis, via {option}`services.anubis.defaultOptions`. 49 50```nix 51{ 52 services.anubis.defaultOptions = { 53 botPolicy = { 54 dnsbl = false; 55 }; 56 settings.DIFFICULTY = 3; 57 }; 58} 59``` 60 61Note that at the moment, a custom bot policy is not merged with the baked-in one. That means to only override a setting 62like `dnsbl`, copying the entire bot policy is required. Check 63[the upstream repository](https://github.com/TecharoHQ/anubis/blob/1509b06cb921aff842e71fbb6636646be6ed5b46/cmd/anubis/botPolicies.json) 64for the policy.