feat: anubis metrics #127

Open
fauno wants to merge 4 commits from anubis-metrics into master
Owner
<!-- Thank you for doing recipe maintenance work! Please mark all checklist items which are relevant for your changes. Please remove the checklist items which are not relevant for your changes. Feel free to remove this comment. --> * [x] I have deployed and tested my changes * [ ] I have [updated relevant versions in `abra.sh`](https://docs.coopcloud.tech/maintainers/upgrade/#updating-versions-in-the-abrash) * [ ] I have made my environment variable changes [backwards compatible](https://docs.coopcloud.tech/maintainers/upgrade/#backwards-compatible-environment-variable-changes) * [ ] I have added a [release note entry](https://docs.coopcloud.tech/maintainers/upgrade/#creating-new-release-notes)
fauno added 1 commit 2026-07-28 18:37:13 +00:00
feat: anubis metrics
continuous-integration/drone/pr Build is failing
b2b94baf78
fauno requested review from decentral1se 2026-07-28 18:37:13 +00:00
decentral1se reviewed 2026-07-28 18:43:02 +00:00
decentral1se reviewed 2026-07-28 18:43:27 +00:00
decentral1se left a comment
Owner

👯

👯
@@ -0,0 +6,4 @@
ANUBIS_METRICS_ENABLED: "true"
secrets:
- "basic_auth"
deploy:
Owner

I think this might overwrite the other anubis lables?

deploy:
labels:
- "traefik.enable=true"
- "traefik.http.routers.anubis.rule=Host(`${ANUBIS_DOMAIN}`)"
- "traefik.http.routers.anubis.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.anubis.entrypoints=web-secure"
- "traefik.http.services.anubis.loadbalancer.server.port=8080"
- "traefik.http.routers.anubis.service=anubis"

I think this might overwrite the other `anubis` lables? https://git.coopcloud.tech/coop-cloud/traefik/src/commit/0ff4ef759bea353a2803edb0c4963d1de5f43811/compose.anubis.yml#L24-L31
Author
Owner

aren't they concatenated? that's my experience so far with labels!

aren't they concatenated? that's my experience so far with labels!
decentral1se marked this conversation as resolved
p4u1 reviewed 2026-07-28 20:53:54 +00:00
.env.sample Outdated
@@ -223,2 +223,4 @@
#ANUBIS_SERVE_ROBOTS_TXT=true
#ANUBIS_SLOG_LEVEL=INFO
#COMPOSE_FILE="$COMPOSE_FILE:compose.anubis-metrics.yml"
#SECRET_BASIC_AUTH_VERSION=v1
Owner

I think we now have two basic with secrets in traefik now. Is there a reason you did not reuse the existing one?

I think we now have two basic with secrets in traefik now. Is there a reason you did not reuse the existing one?
Author
Owner

if you're refering to basic auth, that secret contains the whole usersfile:

https://git.coopcloud.tech/coop-cloud/traefik/src/branch/master/compose.basicauth.yml

if you're refering to basic auth, that secret contains the whole usersfile: https://git.coopcloud.tech/coop-cloud/traefik/src/branch/master/compose.basicauth.yml
Owner

OK so they are specified in a differnt way. But I would still prefer if we habe only one way to set the basicnauth for metrics. Maybe we should deprecate the old usersfile? Or if we keep both secrets the new secret should be named more specific

OK so they are specified in a differnt way. But I would still prefer if we habe only one way to set the basicnauth for metrics. Maybe we should deprecate the old usersfile? Or if we keep both secrets the new secret should be named more specific
Author
Owner

not sure, you can have more than one user on the usersfile. should i rename it to metrics_basic_auth?

not sure, you can have more than one user on the usersfile. should i rename it to metrics_basic_auth?
Author
Owner

what was the resolution @decentral1se ?

what was the resolution @decentral1se ?
Owner

not sure, you can have more than one user on the usersfile. should i rename it to metrics_basic_auth?

I think you can. Is there a way to also use a users file with you method of basic auth?
metrics_basic_auth sounds good and then we can make a breaking change to also use that for the traefik metrics

> not sure, you can have more than one user on the usersfile. should i rename it to metrics_basic_auth? I think you can. Is there a way to also use a users file with you method of basic auth? metrics_basic_auth sounds good and then we can make a breaking change to also use that for the traefik metrics
Owner

Btw. the traefik Middleware supports both users and usersFile https://doc.traefik.io/traefik/reference/routing-configuration/http/middlewares/basicauth/

Btw. the traefik Middleware supports both users and usersFile https://doc.traefik.io/traefik/reference/routing-configuration/http/middlewares/basicauth/
Author
Owner

they're different things, one is the basic auth database that traefik protects routes with, and this new secret is for protecting anubis itself.

https://anubis.techaro.lol/docs/admin/policies#http-basic-authentication

since the metrics endpoint is only available locally, not exposed by traefik (thus not protected by basicauth middleware) and authentication is optional, i could remove it altogether to simplify things.

they're different things, one is the basic auth database that traefik protects routes with, and this new secret is for protecting anubis itself. https://anubis.techaro.lol/docs/admin/policies#http-basic-authentication since the metrics endpoint is only available locally, not exposed by traefik (thus not protected by basicauth middleware) and authentication is optional, i could remove it altogether to simplify things.
Owner

OK, my confusion is slowly clearing up 😀

I think I have a slight preference to remove the basic auth for now. We can always add it later and prevent confusion for now

OK, my confusion is slowly clearing up 😀 I think I have a slight preference to remove the basic auth for now. We can always add it later and prevent confusion for now
Author
Owner

@p4u1 done, but i can't re-request review, the page reloads and the status doesn't change

@p4u1 done, but i can't re-request review, the page reloads and the status doesn't change
p4u1 reviewed 2026-07-28 20:54:44 +00:00
p4u1 left a comment
Owner

Can you add a small section about the metric to the readme?

Can you add a small section about the metric to the readme?
fauno added 2 commits 2026-07-28 22:35:00 +00:00
Author
Owner

Can you add a small section about the metric to the readme?

done!

> Can you add a small section about the metric to the readme? done!
fauno requested review from p4u1 2026-07-28 22:35:21 +00:00
p4u1 reviewed 2026-07-29 15:05:44 +00:00
@@ -0,0 +11,4 @@
- "prometheus.io/scrape=true"
- "prometheus.io/port=9090"
- "prometheus.io/path=/metrics"
- "prometheus.io/auth=basic"
Owner

Is this missing the actual basic auch middleware?

Is this missing the actual basic auch middleware?
Author
Owner

no need to, this works for the alloy branch from monitoring-ng and it doesn't go through traefik

no need to, this works for the alloy branch from monitoring-ng and it doesn't go through traefik
Author
Owner

and the basic auth is set up on anubis itself

and the basic auth is set up on anubis itself
Owner

Ah right

Ah right
p4u1 marked this conversation as resolved
fauno added 1 commit 2026-07-30 22:43:07 +00:00
fix: remove basic auth
continuous-integration/drone/pr Build is failing
242b809924
Some checks are pending
continuous-integration/drone/pr Build is failing
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin anubis-metrics:anubis-metrics
git checkout anubis-metrics
Sign in to join this conversation.