Skip to content

Commit 2bb257a

Browse files
aecsockettdgao
andauthored
fix: don't allow server projects to have external modpacks with hidden versions (#8015)
* fix: don't allow server projects to have external modpacks with hidden versions * fmt * fix ci * update copy * fix up merge --------- Co-authored-by: tdgao <mr.trumgao@gmail.com>
1 parent 68882eb commit 2bb257a

26 files changed

Lines changed: 250 additions & 92 deletions

‎apps/frontend/src/composables/project-nag-validation.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const projectNagFields = {
7575
'server-region': ['select-country'],
7676
'server-languages': ['all-languages', 'too-many-languages', 'select-language'],
7777
'java-address': ['add-java-address'],
78-
'server-compatibility': ['select-compatibility'],
78+
'server-compatibility': ['select-compatibility', 'modpack-version-not-public'],
7979
tags: [
8080
'select-tags',
8181
'too-many-tags',

‎apps/labrinth/.sqlx/query-052a70e917cdfea5d29785ec8607a3fa040e842dfbcce1e3420d9986bb12017d.json‎

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎apps/labrinth/.sqlx/query-32b564ef51064665b5ba3320f685cfe1c7f370a7de5d5d731201612e38fab606.json‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎apps/labrinth/.sqlx/query-56a9276c3bb5d826fc5d791fccb5badea62230cf9447d490463196adf5d04da8.json‎

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎apps/labrinth/.sqlx/query-a14621ef6ca02af546ae5d2319956c6910d380eb1996c8692bc771a1a67b5937.json‎

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎apps/labrinth/AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
- Use `ApiError` as the error type for API routes
2+
- Always use spaces instead of tabs, and run `cargo fmt` before finishing a turn
23
- Always use `cargo clippy` instead of `cargo check`
34
- The return type of an HTTP route should not be `HttpResponse` if possible; always prefer more specific types
45
- Use `web::Json<T>` for JSON-encoded response

‎apps/labrinth/src/routes/internal/delphi/mod.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ async fn ingest_report_deserialized(
323323
crate::routes::v3::projects::mutation::prepare_technical_review_exits(
324324
&exited_projects,
325325
&mut transaction,
326+
&pool,
326327
&redis,
327328
)
328329
.await?;

‎apps/labrinth/src/routes/internal/moderation/tech_review.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,7 @@ pub async fn submit_report(
12671267
crate::routes::v3::projects::mutation::prepare_mutations(
12681268
&[project_id],
12691269
&mut txn,
1270+
&pool,
12701271
&redis,
12711272
Some(&user),
12721273
)
@@ -1291,7 +1292,7 @@ pub async fn submit_report(
12911292

12921293
if prepared.is_none() && removed.rows_affected() > 0 {
12931294
prepared = Some(crate::routes::v3::projects::mutation::prepare_technical_review_exits(
1294-
&[project_id], &mut txn, &redis,
1295+
&[project_id], &mut txn, &pool, &redis,
12951296
).await?);
12961297
}
12971298

@@ -1483,6 +1484,7 @@ pub async fn update_issue_details(
14831484
crate::routes::v3::projects::mutation::prepare_technical_review_exits(
14841485
&exited_projects,
14851486
&mut txn,
1487+
&pool,
14861488
&redis,
14871489
)
14881490
.await?;
@@ -1623,6 +1625,7 @@ pub async fn update_global_issue_details(
16231625
crate::routes::v3::projects::mutation::prepare_technical_review_exits(
16241626
&exited_projects,
16251627
&mut txn,
1628+
&pool,
16261629
&redis,
16271630
)
16281631
.await?;

‎apps/labrinth/src/routes/internal/moderation/tech_review/rules_scan.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ pub async fn scan_rules(
401401
let _ = sender.send(Bytes::from_static(b": connected\n\n"));
402402

403403
actix_web::rt::spawn(async move {
404-
match run_scan(transaction, &sender, &redis).await {
404+
match run_scan(transaction, &sender, &pool, &redis).await {
405405
Ok(summary) => {
406406
let event = RuleScanEvent {
407407
phase: "complete",
@@ -461,6 +461,7 @@ pub async fn scan_rules(
461461
async fn run_scan(
462462
mut transaction: PgTransaction<'static>,
463463
sender: &mpsc::UnboundedSender<Bytes>,
464+
pool: &PgPool,
464465
redis: &RedisPool,
465466
) -> Result<ScanSummary> {
466467
let project_ids = sqlx::query!(
@@ -797,6 +798,7 @@ async fn run_scan(
797798
crate::routes::v3::projects::mutation::prepare_technical_review_exits(
798799
&exited_projects,
799800
&mut transaction,
801+
pool,
800802
redis,
801803
)
802804
.await?;

‎apps/labrinth/src/routes/v3/disclosures.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ pub async fn modify_project_disclosures(
309309
super::projects::mutation::finalize_mutation(
310310
project.inner.id,
311311
transaction,
312+
&pool,
312313
&redis,
313314
Some(&user),
314315
)

0 commit comments

Comments
 (0)