* Create base shared instance migration and initial routes
* Fix build
* Add version uploads
* Add permissions field for shared instance users
* Actually use permissions field
* Add "public" flag to shared instances that allow GETing them without authorization
* Add the ability to get and list shared instance versions
* Add the ability to delete shared instance versions
* Fix build after merge
* Secured file hosting (#3784)
* Remove Backblaze-specific file-hosting backend
* Added S3_USES_PATH_STYLE_BUCKETS
* Remove unused file_id parameter from delete_file_version
* Add support for separate public and private buckets in labrinth::file_hosting
* Rename delete_file_version to delete_file
* Add (untested) get_url_for_private_file
* Remove url field from shared instance routes
* Remove url field from shared instance routes
* Use private bucket for shared instance versions
* Make S3 environment variables fully separate between public and private buckets
* Change file host expiry for shared instances to 180 seconds
* Fix lint
* Merge shared instance migrations into a single migration
* Replace shared instance owners with Ghost instead of deleting the instance
* feat(labrinth): rework v3 side types to a single `environment` field
This field is meant to be able to represent the existing v2 side type
information and beyond, in a way that may also be slightly easier to
comprehend.
* chore(labrinth/migrations): use proper val for `HAVING` clause
* feat(labrinth): add `side_types_migration_review_status` field to projects
* fix(labrinth): ensure versions get removed from search indexes before ending route execution
* chore: run `sqlx prepare`
* chore(labrinth): simplify `remove_documents` a little
* chore: tweak new comment
* Fix random_projects route not returning the requested number of projects
* fix(labrinth): further improve random project route SQL query
* chore: fix typo in comment
* tweak(labrinth): more apparent and fast randomness for `random_projects_get`
* tweak(labrinth): even better random projects query
* chore: address formatting review
---------
Co-authored-by: Alejandro González <me@alegon.dev>
* Put all ID types in the labrinth::models::ids, and reduce code duplication with them
* Rewrite labrinth::database::models::ids and rename most DB interface ID structs to be prefixed with DB
* Run sqlx prepare
---------
Co-authored-by: Alejandro González <7822554+AlexTMjugador@users.noreply.github.com>
* Fix `updated` field including deleted versions
Four years ago, I created issue modrinth/labrinth#200. Today, while it adorns a different name (modrinth/code#2766), the issue remains the same. In celebration of Modrinth's oldest bug report, here is a fix.
Instead of having a separate `updated` field, it simply pulls the publish date of the most recent version. This should also allow the `updated` column on the `mods` table to be dropped at a later date, but I would rather get confirmation that it works before we go ahead with that.
Fixes#2766
* Update apps/labrinth/src/database/models/project_item.rs
Co-authored-by: Alejandro González <7822554+AlexTMjugador@users.noreply.github.com>
Signed-off-by: Emma Alexia <wafflecoffee7@gmail.com>
---------
Signed-off-by: Emma Alexia <wafflecoffee7@gmail.com>
Co-authored-by: Alejandro González <7822554+AlexTMjugador@users.noreply.github.com>
* Revert "fix: capitalization of ID org route breaks projects list (#3621)"
This reverts commit e4adbb9469b241c9bdd0e0f1839a023802445e1c.
* Fix organization projects route properly
Reverted #3621 because it caused more bugs to be created, in the form of organizations with capital letters not showing any projects
* Update apps/labrinth/src/routes/v3/organizations.rs
Co-authored-by: Alejandro González <7822554+AlexTMjugador@users.noreply.github.com>
Signed-off-by: Emma Alexia <wafflecoffee7@gmail.com>
* fix copy-paste error
---------
Signed-off-by: Emma Alexia <wafflecoffee7@gmail.com>
Co-authored-by: Alejandro González <7822554+AlexTMjugador@users.noreply.github.com>
* Fixes error when an admin tries transferring project ownership
* Fixes error when trying to delete a user when they previously have a transaction
Co-authored-by: Jai Agrawal <18202329+Geometrically@users.noreply.github.com>
* Move a lot of scheduled tasks to be runnable from the command-line
* Use pubsub to handle sockets connected to multiple Labrinths
* Clippy fix
* Fix build and merge some stuff
* Fix build fmt
:
---------
Signed-off-by: Jai Agrawal <18202329+Geometrically@users.noreply.github.com>
Co-authored-by: Jai A <jaiagr+gpg@pm.me>
Co-authored-by: Jai Agrawal <18202329+Geometrically@users.noreply.github.com>
* Fix not being able to connect to local friends socket
* Start basic work on tunneling protocol and move some code into a common crate
* Commonize message serialization logic
* Serialize Base62Ids as u64 when human-readability is not required
* Move ActiveSockets tuple into struct
* Make CI run when rust-common is updated
CI is currently broken for labrinth, however
* Fix theseus-release.yml to reference itself correctly
* Implement Labrinth side of tunneling
* Implement non-friend part of theseus tunneling
* Implement client-side except for socket loop
* Implement the socket loop
Doesn't work though. Debugging time!
* Fix config.rs
* Fix deadlock in labrinth socket handling
* Update dockerfile
* switch to workspace prepare at root level
* Wait for connection before tunneling in playground
* Move rust-common into labrinth
* Remove rust-common references from Actions
* Revert "Update dockerfile"
This reverts commit 3caad59bb474ce425d0b8928d7cee7ae1a5011bd.
* Fix Docker build
* Rebuild Theseus if common code changes
* Allow multiple connections from the same user
* Fix test building
* Move FriendSocketListening and FriendSocketStoppedListening to non-panicking TODO for now
* Make message_serialization macro take varargs for binary messages
* Improve syntax of message_serialization macro
* Remove the ability to connect to a virtual socket, and disable the ability to listen on one
* Allow the app to compile without running labrinth
* Clippy fix
* Update Rust and Clippy fix again
---------
Co-authored-by: Jai A <jaiagr+gpg@pm.me>