57 Commits

Author SHA1 Message Date
Geometrically
e33738a876
Fix queries, also add error message for database (#152) 2021-01-28 14:36:53 -07:00
Geometrically
de7e869ca9
Fix some mods and versions 'dissapearing' 2021-01-28 09:07:10 -07:00
Geometrically
bee11a6d41
Fix several bugs 2021-01-27 15:43:44 -07:00
Geometrically
4a5d46915d
Fix version get 2021-01-27 08:46:38 -07:00
Geometrically
710528c01a
Fixes 2021-01-25 14:42:26 -07:00
Geometrically
269884d9f3
Fix docker build failing 2021-01-25 13:15:32 -07:00
Geometrically
fcd548c313
Fix queries not working 2021-01-25 13:00:04 -07:00
Geometrically
140a8b6804
Fix docker image build failing 2021-01-24 22:49:28 -07:00
Geometrically
b5378c1296
Query Optimization 2021-01-24 21:33:32 -07:00
Geometrically
5385431051
make compile 2021-01-23 11:37:25 -07:00
Geometrically
f14f4498fb
Hotfix everything broken 2021-01-23 11:32:32 -07:00
Geometrically
174dbb5e74
Fix auth params, Add params to indexing, Order version game versions, Remove version moderation, Return donation platforms in get routes 2021-01-18 10:10:45 -07:00
Geometrically
ec3c31a106
Move descriptions to database, switch to SHA-512 hashes, fix declining invites not working, allow user deletion, fix broken permission checks for many things, security fixes 2021-01-14 10:08:38 -07:00
Geometrically
b8d2ef1eb5
Fix SQLX errors 2020-12-31 19:09:23 -07:00
Geometrically
9d50f03cb1
Fix game version editing for versions 2020-12-27 18:58:27 -07:00
Geometrically
8c1688657a
Fix revocation of invites, allow for /user_id/teams to be useful 2020-12-27 18:50:10 -07:00
Geometrically
bd5d84abcd
Add 'accepted' field to TeamMember 2020-12-26 22:49:07 -07:00
Geometrically
4beace1bb0
Fix inites (again) 2020-12-26 15:17:51 -07:00
Geometrically
f0b73fd696
Change index interval, add slug to search documents (#110)
* Change index interval, add slug to search documents

* Allow the removal of '@' for slug get

* Fix

* Remove name and rename side type

* Run prepare
2020-12-13 18:10:58 -07:00
Geometrically
a7be6504a2
Fix hash (#106)
* More mod info

* Downloading mods

* Run prepare

* User editing + icon editing

* Finish

* Some fixes

* Fix clippy errors

* Fix hash lookup

* Run prepare

* Run formatter
2020-11-29 14:27:40 -07:00
Geometrically
1da5357df6
More mod info (#104)
* More mod info

* Downloading mods

* Run prepare

* User editing + icon editing

* Finish

* Some fixes

* Fix clippy errors
2020-11-27 10:57:04 -07:00
Geometrically
0500994def
Moderation + Mod Editing (#101)
* Moderation + Mod Editing WIP

* Run prepare, fix perms

* Make it compile

* Finish moderation and edit routes

* More fixes

* Use better queries

* Final Fixes
2020-11-15 19:58:11 -07:00
Aeledfyr
da911bfeb8
Minor fixes to orderings and permission serialization (#102)
* Fix latest_version in search results

* Handle users with invalid permissions instead of skipping them

* Specify order of some queries, fix serialization of permissions

* Run sqlx prepare
2020-11-10 09:27:36 -07:00
Geometrically
578d673a4e
Team routes (#92)
* Team routes template

* More work on teams

* Updating routes WIP

* Edit routes

* Fixes

* Run prepare, prevent non-members from seeing perms

* More fixes

* Finish team routes

* More fixes

* Unpushed changes

* Some more fixes and error handling

* Fix sqlx prepare, formatting

Co-authored-by: Aeledfyr <aeledfyr@gmail.com>
2020-11-09 19:39:23 -07:00
Aeledfyr
d477874535
Optimize and fix some bugs in indexing (#98)
* Improve curseforge and local indexing

This should make curseforge indexing more efficient, and reuses
some of the normal local indexing for the queued indexing of
recently created mods.

* Unify impls for single and multiple routes for mods and versions

This uses the same backend for the single and multiple query
routes so that they no longer return inconsistent information.

* Cache valid curseforge mod ids to reduce request load

This caches the ids of minecraft mods and reuses them on indexing
to reduce the amount of unused addons that are returned.
2020-11-03 17:55:50 -07:00
Aeledfyr
da79386cc3
Track and sort by release date of game_versions tags (#95) 2020-10-31 21:06:47 -07:00
Aeledfyr
a4ba6d1444
Game Version types, indexing, and bugfixes (#91)
* Add types to game_versions, allow filtering by version type

- Fixes an issue with version numbers in the initial mod indexing
  queue
- Modifies the /api/v1/categories/game_versions route to take an
  optional query parameter `type` to filter the listed game versions
- Creating tags is now idempotent
- Creating game_versions now requires a JSON body that specifies
  the version type

* Implement automatic indexing of new Minecraft versions

It's currently set to run every 6 hours and isn't configurable; we
could add config for it, but it doesn't seem likely to be rate
limited or have issues with frequency.
2020-10-28 09:11:49 -07:00
Geometrically
ef28459b61
Rate limiting + version fixes (#90)
* Rate limiting + version fixes

* Move patch to proper place

* More fixes

* Fix commit hash pin
2020-10-25 13:51:07 -07:00
Geometrically
1ff8c908b8
Add way to fetch team members (#89)
* Add way to fetch team members, fix files not being returned with version route

* Make it compile

* Fixes

* Use default error handling
2020-10-21 12:30:35 -07:00
Aeledfyr
e966ef96e5
Await an unused future and change #![allow(unused)] to dead_code (#88)
Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
2020-10-19 22:24:40 -07:00
Geometrically
b05b38b269
Add files to initial versions/mods (#84)
* Add files to initial versions/mods

* Remove useless code, fix actual problem

* Remove debug text

* Rename body to description
2020-10-19 22:08:47 -07:00
Aeledfyr
d0fb5c3bd5
Refactor mod creation route, add more checks (#80)
This also removes the `team_members` field of `InitialModData`, as
team members are no longer specified at mod creation.
2020-10-17 19:34:23 -07:00
Geometrically
285a97aaf8
Creation fix (#74)
* Lots of little fixes

* Change + Add TODOs back that were incomplete

* Fix migrations

* Run prepare

* Minor fixes

* Fix formatting

* SQLX Prepare

* Add status to creation query
2020-10-14 20:43:40 -07:00
Geometrically
ad29f2477e
Lots of little fixes (#73)
* Lots of little fixes

* Change + Add TODOs back that were incomplete

* Fix migrations

* Run prepare

* Minor fixes

* Fix formatting

* SQLX Prepare
2020-10-14 13:19:38 -07:00
Geometrically
2719ae5df2
Add API routes to request multiple of an item (#70)
* Change header name

* Add default bio value

* Remove default

* Make name null

* Run prepare

* Add new API Routes for requesting multiple of an item

* Run formatter

* Simplify get mods query

* Run prepare

* Refactor to use one query for most routes, change version create route to have mod_id in data

* More fixes
2020-10-05 14:25:32 -07:00
Geometrically
68ee2bdcdc
Fix another GitHub OAuth Bug, allow users to register with null names. (#69)
* Change header name

* Add default bio value

* Remove default

* Make name null

* Run prepare
2020-10-03 16:31:10 -07:00
Aeledfyr
c4fb7b7928
General cleanup: fix some bugs, some refactoring (#65)
* Merged mod file upload in version creation, mod creation and
  version file add to one function;  This makes sure that they are
  consistent
* Made some fields on `User` optional: `github_id`, `avatar_url`, `bio`.
    * We may not want to publicly show the `github_id` to everyone
      with access to the API
    * If we allow non-github users, some of those fields would be
      invalid; some oauth providers may not have avatars or bios
* Made CORS origins should configurable
* Made `--reconfigure-indices` and `--reset-indices` exit after
  completion instead of starting the server
2020-09-30 22:07:52 -07:00
Jai A
2e514735ec User retrieval routes 2020-09-28 22:30:13 -07:00
Jai A
3d32c30d2d Authenticate protected routes 2020-09-28 21:05:42 -07:00
Jai A
05235f8385 Implement users in API 2020-09-28 10:48:15 -07:00
Jai A
cd28a75c86 Authentication workflow complete, add database link 2020-09-27 22:49:38 -07:00
Jai A
34075738ea Basic GitHub integration 2020-09-26 22:49:16 -07:00
Geometrically
b99f45874f
Add more info to search route (#60)
* Add more info to search route:

* Run formatter
2020-09-06 08:19:53 -07:00
Redblueflame
38b7d9724e
feat(migration): Added automatic migration (#54) 2020-08-28 08:48:01 -07:00
Aeledfyr
781f0c843e
Implement more database methods and basic API routes (#50)
* feat: Implement more database methods & add mod and version routes

* feat: Implement deleting mods/versions & implement categories

* feat: Implement routes for categories, game versions & loaders

* feat: Reorganize API routes in a (hopefully) usable way
2020-08-12 12:54:03 -07:00
Geometrically
e2bf474332
Version Creation (#47)
* Creation Stuff

* Make it work

* Response structs + Mod ID validation

* Run code formatter

* Push local changes

* Finish up version creation - fix comments, impl file creation

* fix: Add sqlx prepare data

Co-authored-by: Aeledfyr <aeledfyr@gmail.com>
2020-08-12 11:05:49 -07:00
Aeledfyr
c05ae6e94c
fix(postgres): Fix sqlx's misinterpretation of Ids, update sqlx (#46) 2020-07-30 20:45:22 -07:00
AppleTheGolden
ee69653a83
Switch to Postgres (#39)
* WIP Switch to Postgres

* feat(postgres): more work on porting to postgres, now compiles

* feat(docker-compose): Changed the docker-compose.yml file to use postgres.

* Update docker, documentation, gh actions...

* Remove bson dependency

* Remove bson import

* feat: move mock filehost to trait rather than cargo feature

* feat(postgres): transactions for mod creation, multipart refactor

* fix: Add Cargo.lock so that sqlx functions

* Update sqlx offline build data

* fix: Use SQLX_OFFLINE to force sqlx into offline mode for CI

* Default release channels

* feat(postgres): refactor database models to fit postgres models

* fix: Fix sqlx prepare, fix double allocation in indexing

* Add dockerfile (#40)

Co-authored-by: Charalampos Fanoulis <charalampos.fanoulis@gmail.com>

Co-authored-by: Aeledfyr <aeledfyr@gmail.com>
Co-authored-by: redblueflame <contact@redblueflame.com>
Co-authored-by: Jai A <jai.a@tuta.io>
Co-authored-by: Valentin Ricard <redblueflame1@gmail.Com>
Co-authored-by: Charalampos Fanoulis <charalampos.fanoulis@gmail.com>
2020-07-23 22:46:33 +02:00
Geometrically
39b1435725
Mod Creation (#34)
* Inital creation stuff

* File Reader

* Upload bodies

* Major rework:

* Finish Multiple Files

* Proper Error Handling

* Switch to database models

* Run formatter

* Make dependencies dependent on Versions over mods

* Fixes

* Fix clippy

* Run lint one last time

* Update src/models/mods.rs

Co-authored-by: AppleTheGolden <scotsbox@protonmail.com>

Co-authored-by: AppleTheGolden <scotsbox@protonmail.com>
2020-07-16 10:16:35 -07:00
Aeledfyr
6ff7fa74e2
Improve error handling (#33)
* refactor: improve error handling

* fix: specify bind address instead of port

* fix: remove temporary testing file

* fix(errors): change error names to snake_case

* refactor(errors): split indexing error types, remove unused errors

* feat: add env variable checking at program start

This just checks whether the enviroment variables exist and can
parse to the given type and gives a warning if they can't. This
should prevent cases where the program fails at runtime due to
checking an environment variable that doesn't exist.
2020-07-03 10:44:39 -07:00