chore: cargo fmt across workspace; add analytics domain to CSP
Build and Deploy / build-and-push (push) Successful in 4m46s

- Apply cargo fmt to solitaire_engine, solitaire_server formatting.
- solitaire_server/src/lib.rs: add https://analytics.aleshym.co to
  script-src, img-src, and connect-src so the analytics beacon loads
  without a CSP violation.
- docs and README updates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-06-02 12:21:32 -07:00
parent baf524ec75
commit 1cdb78caf2
25 changed files with 229 additions and 130 deletions
+3 -3
View File
@@ -249,11 +249,11 @@ fn build_router_inner(state: AppState, rate_limit: bool) -> Router {
const CSP: &str = concat!(
"default-src 'self'; ",
"script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval'; ",
"script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval' https://analytics.aleshym.co; ",
"style-src 'self' 'unsafe-inline'; ",
"font-src 'self'; ",
"img-src 'self' data:; ",
"connect-src 'self'; ",
"img-src 'self' data: https://analytics.aleshym.co; ",
"connect-src 'self' https://analytics.aleshym.co; ",
"object-src 'none'; ",
"frame-ancestors 'none'",
);
+5 -8
View File
@@ -196,14 +196,11 @@ async fn update_leaderboard_if_opted_in(
user_id: &str,
payload: &SyncPayload,
) -> Result<(), AppError> {
let opted_in = sqlx::query!(
"SELECT leaderboard_opt_in FROM users WHERE id = ?",
user_id
)
.fetch_optional(pool)
.await?
.map(|r| r.leaderboard_opt_in)
.unwrap_or(0);
let opted_in = sqlx::query!("SELECT leaderboard_opt_in FROM users WHERE id = ?", user_id)
.fetch_optional(pool)
.await?
.map(|r| r.leaderboard_opt_in)
.unwrap_or(0);
if opted_in != 1 {
return Ok(());