Skip to content
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

Merged
merged 24 commits into from
Nov 7, 2023
Merged

Conversation

PartyWumpus
Copy link
Member

@PartyWumpus PartyWumpus commented Oct 14, 2023

This adds two integer fields to the Artifact table, downloads and updates 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:

@TrainDoctor TrainDoctor added the enhancement New feature or request label Oct 14, 2023
plugin_store/api/__init__.py Outdated Show resolved Hide resolved
plugin_store/api/__init__.py Outdated Show resolved Hide resolved
plugin_store/database/database.py Outdated Show resolved Hide resolved
@PartyWumpus
Copy link
Member Author

PartyWumpus commented Oct 16, 2023

endpoint is now /increment/{version_hash}?isUpdate=bool and recorded per version.

@PartyWumpus
Copy link
Member Author

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.

@PartyWumpus
Copy link
Member Author

PartyWumpus commented Oct 19, 2023

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.

@PartyWumpus PartyWumpus marked this pull request as ready for review November 7, 2023 17:23
@PartyWumpus PartyWumpus merged commit 485aab0 into main Nov 7, 2023
7 checks passed
@PartyWumpus PartyWumpus deleted the counting-installs branch November 18, 2023 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants