Commit Graph

9170 Commits

Author SHA1 Message Date
Georges-Antoine Assi
00a10f32f2 fix 2026-04-09 23:06:25 -04:00
Georges-Antoine Assi
9a574e076a Add if_not_exists/if_exists guards to all alembic create_index/drop_index ops
Prevents errors when migrations are re-run against a database that
already has (or has already dropped) the target indexes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 23:04:08 -04:00
Georges-Antoine Assi
ccf5f656b7 Add if_not_exists/if_exists guards to all alembic add_column/drop_column ops 2026-04-09 22:50:07 -04:00
Georges-Antoine Assi
6317740466 Add if_not_exists/if_exists guards to all alembic table create/drop ops
Prevents errors when migrations are re-run against a database that
already has (or has already dropped) the target tables.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:46:41 -04:00
Georges-Antoine Assi
2d87625ed6 Merge pull request #3236 from rommapp/romm-3235
[ROMM-3235] Improve light mode text
2026-04-08 11:19:43 -04:00
Georges-Antoine Assi
1b23a3ebb3 changes from bot review 2026-04-08 11:17:17 -04:00
Georges-Antoine Assi
702c062499 [ROMM-3235] Improve light mode text 2026-04-08 09:22:40 -04:00
Georges-Antoine Assi
c7eaa292be add DC and PSX to DS_3DS_PLATFORMS for jewel-case aspect ratios 2026-04-08 08:33:23 -04:00
Georges-Antoine Assi
2ae675bade Merge pull request #3234 from rommapp/romm-3232
[ROMM-3232] Fix content_hash not updated
2026-04-07 22:56:59 -04:00
Georges-Antoine Assi
6db9d45928 actually fix 2026-04-07 22:53:44 -04:00
Georges-Antoine Assi
5529fdad7b Merge branch 'master' into romm-3232 2026-04-07 22:39:22 -04:00
Georges-Antoine Assi
ff560af6f6 Merge pull request #3233 from TechnicallyComputers/patch-1
Parse Content-Type essence before validating resource downloads
2026-04-07 22:37:43 -04:00
Georges-Antoine Assi
f227a3145d changes from bot review 2026-04-07 22:32:40 -04:00
Georges-Antoine Assi
6a6da209fa Merge pull request #3231 from rommapp/copilot/fix-registration-link-redirects
fix: registration links redirect to login for unauthenticated users
2026-04-07 22:18:20 -04:00
Georges-Antoine Assi
1faa585e0c fix vite conf 2026-04-07 22:16:47 -04:00
Georges-Antoine Assi
932a5f63bd manual fix 2026-04-07 21:55:13 -04:00
Georges-Antoine Assi
6c88e098ba [ROMM-3232] Fix content_hash not updated 2026-04-07 21:48:51 -04:00
Alex Vanderveen
6aca8fdfcf Parse Content-Type essence before validating resource downloads
Problem
_check_content_type used the full Content-Type header string (lowercased) and matched it with startswith(...) against allowed prefixes.

That is mostly fine when the server sends a bare type like application/pdf. It breaks down when vendors send parameters on the same header (e.g. name="…", charset=…). In theory application/force-download; name="…" should still start with application/force-download, but in practice you can get:

Leading whitespace or a UTF‑8 BOM before the type token, so the string no longer starts with your prefix even though the MIME type is correct.
Confusing logs: logging only the lowercased full header is fine, but the decision should be based on the standardized MIME essence (type + subtype, no parameters), which is what other stacks use for “what is this?”
So the fix is to parse the header the usual way and only then apply your allowlist.

What changed
_content_type_essence(header_value)

Takes everything before the first ; (the essence).
Strips whitespace, lowercases, strips a leading BOM (\ufeff) so odd clients/proxies don’t break the check.
_check_content_type

Reads the raw content-type header once.
Runs startswith on the essence, not on the full header with parameters.
Rejects if the essence is empty (missing or useless header).
Logging uses the raw header string (or (missing header)), so operators still see exactly what the server sent.
Call sites and allowed prefixes (image/, application/pdf, etc.) are unchanged; only how the string is normalized before comparison changes.

Security / SSRF
This does not replace URL / SSRF controls; it only makes post-fetch type checking consistent with how Content-Type is defined (essence vs parameters). You are not widening the allowlist—same prefixes, stricter handling of “empty” and clearer matching on the actual type token.

Risk / regression
Low: same allowed prefixes, strictly more tolerant of benign formatting (whitespace, BOM, parameters). The only stricter case is empty essence after strip (e.g. malformed header), which correctly fails the check.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

I have reviewed the proposal and these edits will handle cases where the string we match against for the content_type is cleaned up more before comparing against the allow list of content_types.

I have tested this, and confirm that I do not get any errors loading PDFs for game manuals using this.  Please consider this, as this should be compatible with the existing content type allowlist, and easily work with any new types added to it.
2026-04-07 20:25:55 -04:00
copilot-swe-agent[bot]
4c9b70e4b2 fix: skip login redirect on 403 when on auth-exempt routes (register, reset-password, pair)
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/df124007-1c2c-41d7-bb04-fccba2482fd1

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-04-07 20:58:40 +00:00
copilot-swe-agent[bot]
37b3b3a83b Initial plan 2026-04-07 20:54:46 +00:00
Georges-Antoine Assi
b36a8b0cdf manual types should support octet-stream and force-download response 2026-04-07 14:22:43 -04:00
Georges-Antoine Assi
cb5d68b757 Merge pull request #3227 from rommapp/dependabot/npm_and_yarn/frontend/vite-6.4.2
chore(deps-dev): bump vite from 6.4.1 to 6.4.2 in /frontend
2026-04-07 09:10:31 -04:00
dependabot[bot]
dfcd4126f7 chore(deps-dev): bump vite from 6.4.1 to 6.4.2 in /frontend
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.4.1 to 6.4.2.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.4.2/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.4.2/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.4.2
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-07 04:31:41 +00:00
Georges-Antoine Assi
74cd9d2d6a Merge pull request #3153 from rommapp/pegasus-metadata-export
Add Pegasus Frontend metadata export support
2026-04-06 12:41:13 -04:00
Georges-Antoine Assi
0e7a75010b fix tests 2026-04-06 12:34:49 -04:00
Georges-Antoine Assi
bc58425fc9 fix tests 2026-04-06 11:29:33 -04:00
Georges-Antoine Assi
2dc1678931 changes from bot review 2026-04-06 11:22:44 -04:00
Georges-Antoine Assi
f2619ac0d1 Merge branch 'master' into pegasus-metadata-export 2026-04-06 11:06:08 -04:00
Georges-Antoine Assi
5d80910e0e Merge pull request #3137 from rommapp/save-sync
Save sync engine
2026-04-06 10:58:12 -04:00
Georges-Antoine Assi
a9cc7cb543 fix migrations 2026-04-06 10:48:59 -04:00
Georges-Antoine Assi
21eee327b0 Merge branch 'master' into save-sync 2026-04-06 09:09:53 -04:00
Georges-Antoine Assi
26387c3bc1 fix check 2026-04-06 09:09:46 -04:00
Georges-Antoine Assi
08d1649f47 Merge pull request #3202 from vargash/gamelist-customize
Gamelist export improvements
2026-04-06 09:01:34 -04:00
Georges-Antoine Assi
e50f157987 fix check 2026-04-06 08:56:36 -04:00
Georges-Antoine Assi
af69630481 more self review 2026-04-05 23:17:57 -04:00
Georges-Antoine Assi
844e4a5d98 comment cleanup 2026-04-05 23:16:49 -04:00
Georges-Antoine Assi
1501f45220 more changes from review 2026-04-05 23:15:42 -04:00
Georges-Antoine Assi
da3cd453e2 thing 2026-04-05 22:41:34 -04:00
Georges-Antoine Assi
2057c147d9 export true in bato conffig 2026-04-05 22:40:04 -04:00
Georges-Antoine Assi
4b7e83a8b6 restore 0070 2026-04-05 22:38:39 -04:00
Georges-Antoine Assi
fafb804bc6 mega cleanup 2026-04-05 22:35:37 -04:00
Georges-Antoine Assi
a61ff81e22 Merge branch 'master' into gamelist-customize 2026-04-05 22:11:02 -04:00
Georges-Antoine Assi
9b5feefb4f fix migrations 2026-04-05 22:06:04 -04:00
Georges-Antoine Assi
f2e8e337b2 Merge branch 'master' into save-sync 2026-04-05 21:47:53 -04:00
Georges-Antoine Assi
ea63639317 Merge pull request #3223 from rommapp/copilot/fix-age-ratings-parsing-issue
Fix age_ratings Pydantic validation error on MySQL/MariaDB for single-element arrays
2026-04-05 20:21:43 -04:00
Georges-Antoine Assi
83be44a240 Merge pull request #3221 from rommapp/4.8.1-hotfixes
4.8.1 hotfixes
2026-04-05 20:21:31 -04:00
Georges-Antoine Assi
6837070512 again 2026-04-05 20:15:06 -04:00
Georges-Antoine Assi
6c2c1db7b0 remove unused test 2026-04-05 20:06:18 -04:00
Georges-Antoine Assi
b79bcbcfce remove clud meta ID 2026-04-05 19:50:37 -04:00
Georges-Antoine Assi
8664f6203f bad removal 2026-04-05 19:19:06 -04:00