-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow administrator to disable logging of ping requests #3550
Allow administrator to disable logging of ping requests #3550
Conversation
9978758
to
282a0f3
Compare
Ok, so I’ve opened this PR as a draft because I’m not sure if this is the correct way to do this. It should work, but it feels a bit messy (like what if we add a new path?) Also, should we let the administrator configure this feature? |
I think it looks like a good start! If we want to add a new path it can be But maybe some people use the request logging to monitor potential attacks, then I guess this can be a bad solution. |
Hello, It should not be the responsibility of the client to decide whether or not to log the request. So please instead of using a query parameter, add a config key below https://github.com/Chocobozzz/PeerTube/blob/develop/config/production.yaml.example#L102 |
Why not just whitelist the IP emitting the health check? |
282a0f3
to
2075310
Compare
2075310
to
8f0458c
Compare
I chose to use snake case (i.e.
I don’t see how having logs disabled on that specific endpoint allows any attack. I also doubt many PeerTube instance in production are facing the internet directly. Most of them are probably deployed behind a reverse proxy with access logs enabled. Anyway this is now at the administrator discretion.
I feel like this would be a bit too much for just disabling logs from this endpoint. Also, in some environments (e.g. Docker and Kubernetes) the source IP address is dynamic so you would end up allowing a subnet for the whole cluster which would have the same effect as just disabling logging on that endpoint |
8f0458c
to
a04f698
Compare
The failing test doesn’t seem to be related with my changes. |
a04f698
to
300f0e4
Compare
Thanks @johanfleury |
Description
Allow administrator to disable logging of ping requests on
/api/v1/ping
.This is disabled by default, but can be enabled by setting
log.log_ping_requests
totrue
(or thePEERTUBE_LOG_PING_REQUESTS
environment variable in Docker).Related issues
Implements #3544
Has this been tested?
Not sure how I can implement unit test for that.