Trying to accomplish something. I want to limit how many times an IP address can download a file per hour. I think we have the code to accomplish this, but We do not know where to add this code .
So my question is:
What php file handles downloads. e.g. download.php?
That isn’t what I asked. I want to know what file handles downloads…
But since you brought this solution up, my issue is I want to limit 5 requests per ip address per hour. Nginx rate limiting only allows integers for seconds and minutes not hours.
And actually just tried it with the following code:
limit_req_zone $binary_remote_addr zone=download:10m rate=1r/m;
server {
location /download/ {
limit_req zone=download;
}
}
And it did not work.
So do you know what file handles downloads or not? Or any solution that meets my needs.
What you’re asking for is not a normal function of Nextcloud. Being a solution for hosting and accessing your own data, bandwidth restrictions would generally be counterproductive.
Really? I wrote this: https://cloud.server.tld/index.php/s/<link-to-share???>/download
And with this http-request (find on client and server) you can calculate the MB and GB for each client/user. You can search the source code and modify it. Also you can perhaps set bandwith on the router between client and server.
I found the solution for this but after reading your rude replies, i dont feel like sharing it without. Everyone report this @CesiumOS and whoever wants that solution please dm.