From 03e304a63e8e19eb8838861f8f792073c2c66cb4 Mon Sep 17 00:00:00 2001 From: Mark Bundschuh Date: Mon, 16 Dec 2024 02:00:50 -0500 Subject: [PATCH] clean up --- examples/demo/config.yaml | 2 +- examples/standalone/challenges/loader.yaml | 2 +- .../challenges/my-first-web/challenge.yaml | 24 +++++++++---------- rhombus/src/internal/database/libsql.rs | 4 ++-- rhombus/src/internal/routes/scoreboard.rs | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/demo/config.yaml b/examples/demo/config.yaml index be1dcdc..7ef3574 100644 --- a/examples/demo/config.yaml +++ b/examples/demo/config.yaml @@ -22,7 +22,7 @@ discord: guild_id: 1160610137703186636 client_id: 1160076447977848945 author_role_id: 1198496803130183770 - # first_blood_channel_id: 1240422645938389102 + first_blood_channel_id: 1240422645938389102 support_channel_id: 1173026578385617010 verified_role_id: 1170429782270431283 ctftime: diff --git a/examples/standalone/challenges/loader.yaml b/examples/standalone/challenges/loader.yaml index 90de160..331b5ca 100644 --- a/examples/standalone/challenges/loader.yaml +++ b/examples/standalone/challenges/loader.yaml @@ -9,7 +9,7 @@ categories: color: "#a855f7" authors: - name: mbund - avatar: https://cdn.discordapp.com/avatars/1014305712312172595/340125dd44579b7dd380e468ce3e61a4 + avatar: https://www.gravatar.com/avatar discord_id: 1014305712312172595 - name: mbunk avatar: https://www.gravatar.com/avatar diff --git a/examples/standalone/challenges/my-first-web/challenge.yaml b/examples/standalone/challenges/my-first-web/challenge.yaml index 97c24f1..09e1607 100644 --- a/examples/standalone/challenges/my-first-web/challenge.yaml +++ b/examples/standalone/challenges/my-first-web/challenge.yaml @@ -1,20 +1,20 @@ stable_id: my-first-web -name: quotes +name: my-first-web description: | - I'm launching 🚀 my new ✨ SaaS providing quotes 📝 as an API 💪! + this is a super [cool](https://example.com) *web* challenge - [quotes.challs.pwnoh.io/quote](https://quotes.challs.pwnoh.io/quote) -flag: bctf{numb3r5_4nd_57r1n65_4r3_4mb16u0u5_1n_j5_831b8aa8cbe58ed4} + hi! +flag: flag{this_is_a_fake_flag} category: web author: mbund -difficulty: easy -points: dynamic -ticket_template: | - ## Please describe the issue you are experiencing - - ## Steps to reproduce - +score_type: dynamic +dynamic: + decay: 20 files: - src: hello.py - dst: quotes.zip + dst: main.py + - url: https://upload.wikimedia.org/wikipedia/commons/1/14/Symmetries_of_square.svg + dst: quadrilaterals.svg +ticket_template: | + # Web template healthscript: https://example.com diff --git a/rhombus/src/internal/database/libsql.rs b/rhombus/src/internal/database/libsql.rs index 5cf10b4..f33863e 100644 --- a/rhombus/src/internal/database/libsql.rs +++ b/rhombus/src/internal/database/libsql.rs @@ -1871,6 +1871,8 @@ impl Database for T { ) .await?; + tx.commit().await?; + let mut teams: BTreeMap = BTreeMap::new(); let now = chrono::Utc::now().timestamp(); while let Some(row) = db_teams.next().await? { @@ -1900,8 +1902,6 @@ impl Database for T { .push(series_point); } - tx.commit().await?; - Ok(Arc::new(ScoreboardInner::new(teams))) } diff --git a/rhombus/src/internal/routes/scoreboard.rs b/rhombus/src/internal/routes/scoreboard.rs index 7b87f52..5af1489 100644 --- a/rhombus/src/internal/routes/scoreboard.rs +++ b/rhombus/src/internal/routes/scoreboard.rs @@ -49,7 +49,7 @@ pub async fn route_scoreboard( #[derive(Deserialize)] pub struct PageParams { - page: Option, + page: Option, } pub async fn route_scoreboard_division( @@ -60,7 +60,7 @@ pub async fn route_scoreboard_division( params: Query, uri: Uri, ) -> impl IntoResponse { - let page_num = params.page.unwrap_or(1).saturating_sub(1) as usize; + let page_num = params.page.unwrap_or(1).saturating_sub(1); let division_id = division_id.strip_suffix(".json").unwrap_or(&division_id);