bug: /_continuwuity/metrics should require token #2504

Closed
opened 2026-11-11 18:36:34 +00:00 by Aranjedeath · 4 comments
Owner

What is the bug?

It seems like the metrics endpoint would be publicly accessible if there is no prometheus_metrics_token token specified, and it should just be unavailable/not served/etc.

Steps to reproduce

1: allow_prometheus_metrics = true
2: don't set prometheus_metrics_token
3: ???

Server name and version

explodie.org 26.11.0-alpha.1 (67dc7fc57)

Additional context

No response

### What is the bug? It seems like the metrics endpoint would be publicly accessible if there is no prometheus_metrics_token token specified, and it should just be unavailable/not served/etc. ### Steps to reproduce 1: allow_prometheus_metrics = true 2: don't set prometheus_metrics_token 3: ??? ### Server name and version explodie.org 26.11.0-alpha.1 (67dc7fc57) ### Additional context _No response_
Contributor

this is standards practice especially if there is another port to listen to as you can hide it with firewall

this is standards practice especially if there is another port to listen to as you can hide it with firewall
Owner

Yeah this is a feature in my eyes - my own servers don't set a token because the metrics endpoint is inaccessible outside of my LAN, and I'm not too worried about monsters in my LAN being able to see the performance metrics of my deployments. The only reason I told you to set a token when setting up my prometheus collector for you is because that's going over the internet.

Preventing the metrics endpoint being accessible via the reverse proxy is as easy as

matrix.example {
    respond /_continuwuity/metrics 403
    reverse_proxy hostname:port
}

if one is inclined to expose metrics without a token - this also allows for some nifty stuff like IP allowlisting with route matchers and such.
I'm pretty sure there's warning on startup if you enable metrics without a token anyway, and the docs seem sufficiently detailed

Yeah this is a feature in my eyes - my own servers don't set a token because the metrics endpoint is inaccessible outside of my LAN, and I'm not too worried about monsters in my LAN being able to see the performance metrics of my deployments. The only reason I told you to set a token when setting up my prometheus collector for you is because that's going over the internet. Preventing the metrics endpoint being accessible via the reverse proxy is as easy as ```caddyfile matrix.example { respond /_continuwuity/metrics 403 reverse_proxy hostname:port } ``` if one is inclined to expose metrics without a token - this also allows for some nifty stuff like IP allowlisting with route matchers and such. I'm pretty sure there's warning on startup if you enable metrics without a token anyway, and the docs seem sufficiently detailed
Contributor

yep this is the best practice #2354

yep this is the best practice https://forgejo.ellis.link/continuwuation/continuwuity/pulls/2354
Owner

I'm going to close this as invalid considering this is intentional and documented behaviour. Feel free to re-open if you disagree :)

I'm going to close this as invalid considering this is intentional and documented behaviour. Feel free to re-open if you disagree :)
nex 2026-11-19 23:46:05 +00:00
Sign in to join this conversation.
No milestone
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
continuwuation/continuwuity#2504
No description provided.