* Hopefully fix collection visibility once and for all
Follow up to #3408 and #3864
* Use same unlisted approach for collections as is used for projects
* Allow modification of failed charges on admin billing page
Allows cancelling a failed subscription and forcing another charge attempt
* use addNotification
Fixes#1485
Also fixes an issue where email_verified was being set to true regardless of whether the oauth provider provides an email (thus indicating that a null email is verified)
We standarized on using `rustls` as a TLS implementation across the
monorepo, which is written in Rust and has better ergonomics,
integration with the Rust ecosystem, and consistent behavior among
platforms. However, the Labrinth Clickhouse client was the last
remaining exception to this, using the native, OS-provided TLS
implementation, which on Linux is OpenSSL and requires developers and
Docker images to install OpenSSL development packages to build Labrinth,
in addition to introducing an additional runtime dependency to Labrinth.
Let's make the process of building Labrinth slightly simpler by
switching such client to `rustls` as well, which results in finally
using the same TLS implementation for everything, a simplified build and
distribution process, less transitive dependencies, and potentially
smaller binaries (since `rustls` was already being pulled in for, e.g.,
the SMTP client).
* dist(docker): add `.dockerignore` as symlink to `.gitignore`
This ensures that no files outside of version control are transferred to
the Docker build context for Labrinth and Daedalus images, which
significantly improves build speed (if a `target` directory is already
present) and build reproducibility.
* chore(dist/docker): simplify out unneeeded statements, move `SQLX_OFFLINE` env var setting to build command itself
The latter approach ensures that developers building the image locally
don't forget to set `SQLX_OFFLINE`, too.
* dist(docker): add `curl` package to Labrinth image
* Fix wrong email address
Signed-off-by: Ken <131881470+Keniis0712@users.noreply.github.com>
* Decouple SMTP auth identity from message sender
Signed-off-by: Ken <131881470+Keniis0712@users.noreply.github.com>
* Add new configurations to .env file
Signed-off-by: Ken <131881470+Keniis0712@users.noreply.github.com>
* Update mod.rs
Signed-off-by: Ken <131881470+Keniis0712@users.noreply.github.com>
* Remove unused import
Signed-off-by: Ken <131881470+Keniis0712@users.noreply.github.com>
* Give SMTP_FROM_ADDRESS a default value
Co-authored-by: Alejandro González <7822554+AlexTMjugador@users.noreply.github.com>
Signed-off-by: Ken <131881470+Keniis0712@users.noreply.github.com>
* Add the correct host name
Signed-off-by: Ken <131881470+Keniis0712@users.noreply.github.com>
* Fix CI failure
Signed-off-by: Ken <131881470+Keniis0712@users.noreply.github.com>
* Update mod.rs
Signed-off-by: Ken <131881470+Keniis0712@users.noreply.github.com>
---------
Signed-off-by: Ken <131881470+Keniis0712@users.noreply.github.com>
Co-authored-by: Alejandro González <7822554+AlexTMjugador@users.noreply.github.com>
Co-authored-by: Emma Alexia <emma@modrinth.com>
Some users elect to try to perform their upgrade immediately before their subscription renews. However, we throw an error whenever the proration charge is under 30 cents because we lose more money on fees than we gain by charging the customer. This PR changes charges so that the user's server will simply be provided a free upgrade instead of requiring them to wait until after their next renewal.
* Clear owner's project cache after deleting organization
Fixes an issue where people would think their projects were deleted along with their organization, when this isn't actually the case.
* address PR review
* Update apps/labrinth/src/routes/v3/organizations.rs
Signed-off-by: Emma Alexia <wafflecoffee7@gmail.com>
* Fix lint
* actually fix lint
---------
Signed-off-by: Emma Alexia <wafflecoffee7@gmail.com>
* Remove new-projects channel emojis
With new loaders, this functionality has become unwieldy. We don't have enough emoji slots in the server for the number of emojis we'd need for the loaders. It is easiest to simply format them in the same way knossos does.
Note: I forgor how the borrow checker works, this compiles but I'm sure it's gore to anyone who actually knows the difference between a string slice and a String, I come from Javaland though so pls forgive
* Rename func accordingly
* 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): return version artifact size exceeded error eagerly
Now we don't wait until the result memory buffer has grown to a size
greater than the maximum allowed, and instead we return such an error
before the buffer is grown with the current chunk, which should reduce
memory usage.
* fix(labrinth): proper supported game versions range for datapacks
* feat(labrinth): allow protected resource and data packs to pass validation
* 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
* chore(clippy): enable and fix many stricter lints
These ensure that the codebase uses more idiomatic, performant, and
concise language constructions.
* chore: make non-Clippy compiler warnings also deny by default
* refactor: inherit Clippy lint config and Rust edition from workspace
This also ensures developers running `clippy lint` locally get the same
lints as during CI, especially when the Rust toolchain version is fixed
through a `rust-toolchain.toml` file.
* chore(clippy.toml): bump MSRV to 1.87
* 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>
* fix(labrinth/billing): add Spain and Singapore to the list of countries for currency inferences
This should fix payments in those countries not going through with their
local currencies for products that do not have USD-only pricing.
* fix(labrinth/billing): tentative fix for subscription periods not updating
* chore(labrinth): fix typos, simplify out `remove_duplicates` func
* fix(labrinth): implement `capitalize_first` so that it can't panic on wide chars
* chore(labrinth): refactor out unneeded clone highlighted by nightly Clippy lints
* chore(labrinth): simplify `capitalize_first` implementation
* fix(labrinth): preserve ordering when deduplicating project field values
This addresses an unintended behavior change on
157647faf2778c74096e624aeef9cdb79539489c.
* fix(labrinth/tests): make `index_swaps` test run successfully
I wonder why we don't run these more often...
* refactor: rename `.env.example` files to `.env.local`, make local envs more consistent between frontend and backend
* chore(labrinth/.env.local): proper email verif. and password reset paths
* 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>