-
Notifications
You must be signed in to change notification settings - Fork 8
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
adding install & update counting to the store #52
Conversation
endpoint is now |
uncertain how i would properly add a test for sorting by downloads or how to add rate limiting. other than those two questions the PR is done. |
I've managed to add rate limiting per plugin per IP (2 a day). It uses redis so adds another docker container, but it could just store in memory instead if you'd prefer. I also have no idea if it will work properly behind the cloudflare proxy. |
This adds two integer fields to the Artifact table,
downloads
andupdates
to count the installs for each plugin. It also adds an/increment
endpoint which anyone can visit at any time to add one to either the downloads or updates for a plugin. (downloads is only incremented on the first install of a plugin)We don't really need the updates field, i just thought it would be fun to track it as well.
TODO:
Test it locally lolAdd migration to extend the database properlyAdd CI testsAdd rate limit somewhere (cloudflare limit appears to be 10s)Wait for Add sorting by name or creation date to the /plugins endpoint #51 to finish and then add an option to sort by number of downloads (and maybe by updates but idk 🤷)