From b2b94baf7884bc790cb90251818dd9198f6fd557 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 28 Jul 2026 15:35:38 -0300 Subject: [PATCH 1/5] feat: anubis metrics --- .env.sample | 2 ++ abra.sh | 1 + anubis.yml.tmpl | 10 ++++++++++ compose.anubis-metrics.yml | 18 ++++++++++++++++++ compose.anubis.yml | 9 +++++++++ 5 files changed, 40 insertions(+) create mode 100644 anubis.yml.tmpl create mode 100644 compose.anubis-metrics.yml diff --git a/.env.sample b/.env.sample index 9389641..0f394c6 100644 --- a/.env.sample +++ b/.env.sample @@ -222,6 +222,8 @@ WRITE_TIMEOUT=0s #ANUBIS_OG_CACHE_CONSIDER_HOST=true #ANUBIS_SERVE_ROBOTS_TXT=true #ANUBIS_SLOG_LEVEL=INFO +#COMPOSE_FILE="$COMPOSE_FILE:compose.anubis-metrics.yml" +#SECRET_BASIC_AUTH_VERSION=v1 ## Enable onion service support #ONION_ENABLED=1 diff --git a/abra.sh b/abra.sh index d5c01aa..8c8cb8d 100644 --- a/abra.sh +++ b/abra.sh @@ -1,3 +1,4 @@ export TRAEFIK_YML_VERSION=v32 export FILE_PROVIDER_YML_VERSION=v12 export ENTRYPOINT_VERSION=v5 +export ANUBIS_YML_VERSION=v1 diff --git a/anubis.yml.tmpl b/anubis.yml.tmpl new file mode 100644 index 0000000..dbec62a --- /dev/null +++ b/anubis.yml.tmpl @@ -0,0 +1,10 @@ +bots: +- import: (data)/meta/default-config.yaml +{{ if eq (env "ANUBIS_METRICS_ENABLED") "true" }} +metrics: + bind: ":9090" + network: "tcp" + basicAuth: + username: "admin" + password: "{{ secret "basic_auth" }}" +{{ end }} diff --git a/compose.anubis-metrics.yml b/compose.anubis-metrics.yml new file mode 100644 index 0000000..c8de48a --- /dev/null +++ b/compose.anubis-metrics.yml @@ -0,0 +1,18 @@ +--- +version: "3.8" +services: + anubis: + environment: + ANUBIS_METRICS_ENABLED: "true" + secrets: + - "basic_auth" + deploy: + labels: + - "prometheus.io/scrape=true" + - "prometheus.io/port=9090" + - "prometheus.io/path=/metrics" + - "prometheus.io/auth=basic" +secrets: + basic_auth: + external: true + name: "${STACK_NAME}_basic_auth_${SECRET_BASIC_AUTH_VERSION}" diff --git a/compose.anubis.yml b/compose.anubis.yml index cbb259f..1ff960c 100644 --- a/compose.anubis.yml +++ b/compose.anubis.yml @@ -19,6 +19,10 @@ services: OG_CACHE_CONSIDER_HOST: "${ANUBIS_OG_CACHE_CONSIDER_HOST}" SERVE_ROBOTS_TXT: "${ANUBIS_SERVE_ROBOTS_TXT}" SLOG_LEVEL: "${ANUBIS_SLOG_LEVEL:-INFO}" + POLICY_FNAME: "/data/cfg/botPolicy.yaml" + configs: + - source: anubis_yml + target: /data/cfg/botPolicy.yaml networks: - proxy deploy: @@ -29,3 +33,8 @@ services: - "traefik.http.routers.anubis.entrypoints=web-secure" - "traefik.http.services.anubis.loadbalancer.server.port=8080" - "traefik.http.routers.anubis.service=anubis" +configs: + anubis_yml: + name: ${STACK_NAME}_anubis_yml_${ANUBIS_YML_VERSION} + file: anubis.yml.tmpl + template_driver: golang -- 2.52.0 From f05ad9345979dc6ebd61cc529ef537674c25bfea Mon Sep 17 00:00:00 2001 From: f Date: Tue, 28 Jul 2026 19:34:37 -0300 Subject: [PATCH 2/5] doc: anubis metrics --- .env.sample | 2 ++ README.md | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/.env.sample b/.env.sample index 0f394c6..97ea814 100644 --- a/.env.sample +++ b/.env.sample @@ -222,6 +222,8 @@ WRITE_TIMEOUT=0s #ANUBIS_OG_CACHE_CONSIDER_HOST=true #ANUBIS_SERVE_ROBOTS_TXT=true #ANUBIS_SLOG_LEVEL=INFO + +## Anubis metrics #COMPOSE_FILE="$COMPOSE_FILE:compose.anubis-metrics.yml" #SECRET_BASIC_AUTH_VERSION=v1 diff --git a/README.md b/README.md index b845d48..f6485c3 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,11 @@ After deploying these changes, go to each recipe that supports Anubis and follow the process there. **Enabling Anubis here is not enough for protection your apps.** +If you want to collect Prometheus metrics for Anubis, for instance with +[monitoring-ng](/monitoring-ng), uncomment the "Anubis metrics" section +and insert the basic auth password as a secret. The username will be +"admin". + ## Enabling onion service Uncomment the line in the config setting `ONION_ENABLED=1`. This will create a new entrypoint on port 9052 which can be used to bypass forced SSL. For more details, see the [onion recipe](https://recipes.coopcloud.tech/onion). -- 2.52.0 From d0494ea4ccbc11a65f9140fea0ebaf1acf8fa0ec Mon Sep 17 00:00:00 2001 From: f Date: Tue, 28 Jul 2026 19:34:44 -0300 Subject: [PATCH 3/5] fix: don't generate the basic auth password --- .env.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.sample b/.env.sample index 97ea814..2780616 100644 --- a/.env.sample +++ b/.env.sample @@ -225,7 +225,7 @@ WRITE_TIMEOUT=0s ## Anubis metrics #COMPOSE_FILE="$COMPOSE_FILE:compose.anubis-metrics.yml" -#SECRET_BASIC_AUTH_VERSION=v1 +#SECRET_BASIC_AUTH_VERSION=v1 # generate=false ## Enable onion service support #ONION_ENABLED=1 -- 2.52.0 From 242b8099242b696325f527828c7e3f8d8fe15212 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 30 Jul 2026 19:42:52 -0300 Subject: [PATCH 4/5] fix: remove basic auth --- .env.sample | 1 - anubis.yml.tmpl | 3 --- compose.anubis-metrics.yml | 7 ------- 3 files changed, 11 deletions(-) diff --git a/.env.sample b/.env.sample index 2780616..8e8b10c 100644 --- a/.env.sample +++ b/.env.sample @@ -225,7 +225,6 @@ WRITE_TIMEOUT=0s ## Anubis metrics #COMPOSE_FILE="$COMPOSE_FILE:compose.anubis-metrics.yml" -#SECRET_BASIC_AUTH_VERSION=v1 # generate=false ## Enable onion service support #ONION_ENABLED=1 diff --git a/anubis.yml.tmpl b/anubis.yml.tmpl index dbec62a..7526aa9 100644 --- a/anubis.yml.tmpl +++ b/anubis.yml.tmpl @@ -4,7 +4,4 @@ bots: metrics: bind: ":9090" network: "tcp" - basicAuth: - username: "admin" - password: "{{ secret "basic_auth" }}" {{ end }} diff --git a/compose.anubis-metrics.yml b/compose.anubis-metrics.yml index c8de48a..de5baa7 100644 --- a/compose.anubis-metrics.yml +++ b/compose.anubis-metrics.yml @@ -4,15 +4,8 @@ services: anubis: environment: ANUBIS_METRICS_ENABLED: "true" - secrets: - - "basic_auth" deploy: labels: - "prometheus.io/scrape=true" - "prometheus.io/port=9090" - "prometheus.io/path=/metrics" - - "prometheus.io/auth=basic" -secrets: - basic_auth: - external: true - name: "${STACK_NAME}_basic_auth_${SECRET_BASIC_AUTH_VERSION}" -- 2.52.0 From 51c75fb76a478049029b9dcf253d12503b4a287a Mon Sep 17 00:00:00 2001 From: f Date: Sat, 1 Aug 2026 13:05:56 -0300 Subject: [PATCH 5/5] doc: remove basic auth mention --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index f6485c3..35fbcdb 100644 --- a/README.md +++ b/README.md @@ -73,9 +73,7 @@ and follow the process there. **Enabling Anubis here is not enough for protection your apps.** If you want to collect Prometheus metrics for Anubis, for instance with -[monitoring-ng](/monitoring-ng), uncomment the "Anubis metrics" section -and insert the basic auth password as a secret. The username will be -"admin". +[monitoring-ng](/monitoring-ng), uncomment the "Anubis metrics" section. ## Enabling onion service -- 2.52.0