Commit Graph

228 Commits

Author SHA1 Message Date
Sam Dornan
3c547dfbd0 chore(python): move the backend to Python 3.14
Bumps the runtime everywhere it is pinned: requires-python, the
.python-version uv reads, both Dockerfiles (with the python:3.14-alpine3.23
and uv 3.14 image digests), the six workflows that install Python, and the
contributor docs.

Several locked C-extension versions had no cp314 wheels, so the Alpine
image fell back to building them from source and failed on the missing
C++ and Rust toolchains. Those packages are upgraded within their existing
pyproject ranges: pydantic 2.11.7 -> 2.13.5 (pydantic-core 2.46.5), uvloop
0.22.1, grpcio 1.83.1, httptools 0.8.0, inflate64 1.0.4, markupsafe 3.0.3,
pyyaml 6.0.3 and streaming-form-data 1.20.0. The lockfile also drops the
3.13-only resolution branches.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 08:57:10 -05:00
dependabot[bot]
b4e493cfb7 chore(deps): Bump cryptography from 49.0.0 to 50.0.0
Bumps [cryptography](https://github.com/pyca/cryptography) from 49.0.0 to 50.0.0.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/49.0.0...50.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-version: 50.0.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-04 07:40:07 +00:00
Georges-Antoine Assi
32f9e338e7 Merge pull request #4274 from sdornan/claude/rq-native-scheduler
refactor(tasks): schedule with RQ instead of rq-scheduler
2026-09-03 11:50:20 -04:00
Sam Dornan
b13a2373fb chore: drop the vcrpy exclude-newer override
The override let vcrpy 8.2.1 past the rolling 7-day exclude-newer window
on the day after its release. The window has since caught up, and the
fixed 2026-06-17 cutoff was now holding vcrpy back from 8.3.0. The
aiohttp 3.14 compatibility fix the comment referred to landed in 8.2.0
and is present in every later release, so nothing needs the override.

Upgrade vcrpy to 8.3.0 in the lock so the change exercises what the
removal permits; all cassette-backed tests pass on it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-02 18:41:22 -05:00
Sam Dornan
535db9a415 chore(deps): drop the rq freshness-window exclusion
The rolling seven-day window has reached rq 2.11.0, so `rq ~= 2.11`
resolves without an exclusion of its own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-02 15:02:04 -05:00
Sam Dornan
4e59217275 refactor(tasks): schedule with RQ instead of rq-scheduler
rq-scheduler has one release since 2023, 109 open issues, and RomM ran a
fork of it for Redis username and SSL options that upstream never took.
Everything it was here for now ships with RQ.

Its two failure modes were the reason for the workarounds in 9e9f59c04.
It reads a job's function name before taking the job out of its registry,
so one unreadable job stalls it for good; RQ's scheduler removes every id
it looked at whether or not the job could be read. And cancelling a
delayed job needed both `Scheduler.cancel` and `Job.cancel`, because the
first left the status alone and the second left the registry entry, which
the scheduler then queued anyway; `Job.cancel` on its own now clears the
scheduled registry.

Delayed jobs, which is how the watcher defers a rescan, go onto the queue
with `Queue.enqueue_in` and are released by the worker running with
`--with-scheduler`. Periodic tasks are declared in `tasks/cron_config.py`
and loaded by an `rq cron` process, replacing `rqscheduler`. A task is
registered only when it is enabled and has a cron string, so the
schedule-then-unschedule dance around the env toggles is gone, and with
it `PeriodicTask.init/schedule/unschedule`.

Jobs are enqueued by task name through `run_task_by_name`, resolved
against a catalog in `tasks/registry.py`. Nothing pickles a task instance
into Redis any more, which is what made a payload unreadable across
upgrades in the first place. The catalog also gives the tasks endpoint
one home for what a task is, rather than a list of its own.

Scan discovery keys off the type a job carries rather than the scheduled
rescan's function name, since every task now shares one entry point. That
also drops SCAN_LIBRARY_TASK_FUNC, which only existed to name a function
across an import cycle.

The watcher's dedupe worked on `job.args[0]` while scans are enqueued with
keyword arguments, so it never matched and every filesystem change
scheduled another scan. It reads `platform_ids` from the payload now, and
deliberately ignores a scan already running: that one may have walked past
the folder that just changed.

Startup clears what the old scheduler left in Redis, once.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-02 15:02:04 -05:00
Sam Dornan
ac52682495 chore(deps): upgrade rq to 2.11
The lockfile sat on 2.9.0 while the constraint allowed anything under
3.0, so the floor now names the version the code is tested against.

2.11 carries what the scheduler work ahead needs: RQScheduler acquires
and refreshes its lock before enqueueing, each CronJob has a name and
keeps the ids of the jobs it created, and calling create_cron() twice no
longer duplicates jobs. 2.10 added webhook notifications and a stable
scheduler identity, and 2.9.1 covers redis-py >= 8.

2.11.0 was published inside the rolling 7-day window, so it needs a
per-package exclusion until 2026-08-24, when the window reaches it and
the entry can go.

The constraint stays under 3.0 deliberately. That release moves
get_current_job() to contextvars, reworks dependency handling behind a
ReadyJobRegistry, and changes the Worker.handle_job_success() signature,
which RomMWorker subclasses around.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-02 15:02:04 -05:00
Sam Dornan
e93eb879a2 chore(deps): bump starlette from 1.0.1 to 1.6.0
Drop the `exclude-newer-package` pin that froze starlette resolution at
1.0.1, and widen the version specifier to allow the 1.6.x line.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 09:00:58 -05:00
dependabot[bot]
00345956e0 build(deps): bump pillow from 12.2.0 to 12.3.0
Bumps [pillow](https://github.com/python-pillow/Pillow) from 12.2.0 to 12.3.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/12.2.0...12.3.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-version: 12.3.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-21 10:10:45 +00:00
dependabot[bot]
6f834ae29b chore(deps): bump joserfc from 1.6.7 to 1.6.8
Bumps [joserfc](https://github.com/authlib/joserfc) from 1.6.7 to 1.6.8.
- [Release notes](https://github.com/authlib/joserfc/releases)
- [Changelog](https://github.com/authlib/joserfc/blob/main/docs/changelog.rst)
- [Commits](https://github.com/authlib/joserfc/compare/1.6.7...1.6.8)

---
updated-dependencies:
- dependency-name: joserfc
  dependency-version: 1.6.8
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-04 16:19:40 +00:00
Spinnich
174fad915e fix(retroachievements): hash GameCube and Wii RVZ/WIA images natively
RAHasher can't read the block-compressed RVZ/WIA containers Dolphin
creates, so GameCube and Wii games stored as .rvz/.wia never matched on
RetroAchievements ("Not a Gamecube disc" / "Not a supported Wii file").

Add utils/rvz_hasher.py, which reconstructs only the disc byte ranges
the RA hash covers, mirroring rcheevos:

- An RVZ/WIA reader with random access over raw-data and partition
  groups (NONE/bzip2/LZMA/LZMA2/Zstandard codecs, RVZ packing with the
  lagged-Fibonacci junk PRNG, and stored hash exceptions).
- GameCube: MD5 of the boot header, apploader and main.dol segments.
- Wii: the hash additionally covers encrypted cluster bytes, so the
  reader recalculates the H0/H1/H2 hash tree, applies the container's
  hash exceptions and re-encrypts clusters with the embedded title key
  (AES-128-CBC) to reproduce the exact retail disc bytes.

RAHasherService tries the native path for .rvz/.wia on the GameCube and
Wii platforms and falls back to RAHasher on any failure.

Verified against Mario Kart: Double Dash!! (USA) and Super Mario Galaxy
(USA) RVZ dumps: the computed hashes are present in the official RA
hash lists (games 7693 and 189), and RAHasher 1.8.3 produces identical
hashes when run on disc images reconstructed by the same reader.

Closes #3649
Closes #3650

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-01 21:58:10 +00:00
Georges-Antoine Assi
9740793673 Merge pull request #3628 from rommapp/dependabot/uv/python-socketio-5.16.2
build(deps): bump python-socketio from 5.14.0 to 5.16.2
2026-06-29 10:10:42 -04:00
Georges-Antoine Assi
5fb6d97685 fix fmt 2026-06-29 10:06:06 -04:00
dependabot[bot]
d2d2b87a9f build(deps): bump python-socketio from 5.14.0 to 5.16.2
Bumps [python-socketio](https://github.com/miguelgrinberg/python-socketio) from 5.14.0 to 5.16.2.
- [Release notes](https://github.com/miguelgrinberg/python-socketio/releases)
- [Changelog](https://github.com/miguelgrinberg/python-socketio/blob/main/CHANGES.md)
- [Commits](https://github.com/miguelgrinberg/python-socketio/compare/v5.14.0...v5.16.2)

---
updated-dependencies:
- dependency-name: python-socketio
  dependency-version: 5.16.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-29 11:42:28 +00:00
dependabot[bot]
a56e34671e build(deps): bump joserfc from 1.6.3 to 1.6.7
Bumps [joserfc](https://github.com/authlib/joserfc) from 1.6.3 to 1.6.7.
- [Release notes](https://github.com/authlib/joserfc/releases)
- [Changelog](https://github.com/authlib/joserfc/blob/main/docs/changelog.rst)
- [Commits](https://github.com/authlib/joserfc/compare/1.6.3...1.6.7)

---
updated-dependencies:
- dependency-name: joserfc
  dependency-version: 1.6.7
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-29 02:29:37 +00:00
Claude
23dbffd17a fix(deps): bump dependencies to patch reported vulnerabilities
Address vulnerabilities flagged by the security scanner:

Backend (pyproject.toml / uv.lock):
- cryptography 46.0.5 -> 49.0.0 (CVE-2026-39892, memory buffer)
- mako 1.3.10 -> 1.3.12 (CVE-2026-41205/44307, path traversal)
- gunicorn 23.0.0 -> 26.0.0 (HTTP request smuggling hardening)
- yarl 1.20.1 -> 1.24.2 (SSRF via host parsing)

Frontend (package.json / package-lock.json):
- axios ^1.16.0 -> ^1.18.1 (sensitive data exposure)
- form-data pinned to ^4.0.6 via override (CVE-2026-12143, CRLF injection)

starlette is already on 1.0.1, which is the patched release for the
BadHost advisory (CVE-2026-48710), so no change is needed there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W5nnYmsCNdUjNpuwRxqUiR
2026-06-24 17:45:22 +00:00
Georges-Antoine Assi
02815ec403 Run backend tests in parallel with pytest-xdist
Add pytest-xdist and run the backend test suite across multiple workers
(`-n 4` in CI). Each worker gets its own database so the autouse
`clear_database` fixture can't wipe rows another worker is mid-test with:

- Rootdir `backend/conftest.py` sets a per-worker `DB_NAME`
  (`romm_test_gw0`, ...) before any app module is imported, so each
  worker's engine binds to its own database.
- `tests/conftest.py` creates the per-worker database on demand (mariadb/
  mysql and postgresql paths) just before migrations run.
- The test user's grant is widened to `*.*` (setup.sql + CI) so it can
  `CREATE DATABASE` for the workers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 21:02:47 -04:00
Georges-Antoine Assi
1e78a2ed59 Merge branch 'master' into claude/exciting-heisenberg-61PF9 2026-06-18 19:59:00 -04:00
zurdi
85952d850f chore: remove unused lint scripts from package.json and update bcrypt dependency in pyproject.toml 2026-06-17 09:59:32 +02:00
zurdi
0780c3820b chore: update package dependencies and configurations
- Added "esbuild" version "^0.28.1" to frontend package overrides.
- Updated "exclude-newer-package" in pyproject.toml to include "vcrpy" with a date of "2026-06-17".
- Modified uv.lock to reflect the new "vcrpy" version "8.2.1" and removed platform-specific markers for dependencies.
2026-06-17 01:27:08 +02:00
zurdi
f01eda9227 Merge remote-tracking branch 'origin/master' into chore/frontend-v2 2026-06-16 18:21:14 +02:00
dependabot[bot]
23316bc8bd build(deps): bump aiohttp from 3.13.4 to 3.14.1
---
updated-dependencies:
- dependency-name: aiohttp
  dependency-version: 3.14.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-16 00:36:11 +00:00
zurdi
6274f83716 Merge remote-tracking branch 'origin/feat/soundtrack-support' into chore/frontend-v2 2026-05-28 09:24:54 +00:00
Zurdi
f8bbd85d23 Merge branch 'master' into feat/soundtrack-support 2026-05-28 11:20:58 +02:00
dependabot[bot]
98fafe0c91 chore(deps): bump asyncssh from 2.22.0 to 2.23.0
Bumps [asyncssh](https://github.com/ronf/asyncssh) from 2.22.0 to 2.23.0.
- [Changelog](https://github.com/ronf/asyncssh/blob/develop/docs/changes.rst)
- [Commits](https://github.com/ronf/asyncssh/compare/v2.22.0...v2.23.0)

---
updated-dependencies:
- dependency-name: asyncssh
  dependency-version: 2.23.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-27 22:19:34 +00:00
Zurdi
7839a01702 Merge branch 'master' into feat/soundtrack-support 2026-05-27 21:33:04 +02:00
zurdi
07c536ad79 Merge remote-tracking branch 'origin/master' into chore/frontend-v2 2026-05-27 19:21:29 +00:00
Georges-Antoine Assi
e013ee78e1 fix 2026-05-26 19:26:52 -04:00
Claude
8b21487099 fix(deps): bump starlette to 1.0.1 for CVE-2026-48710
Starlette versions 0.8.3-1.0.0 are vulnerable to improper Host header
validation when reconstructing request.url, which can cause
request.url.path to differ from the actual requested path and bypass
path-based security checks. Patched in 1.0.1.

Bumps fastapi to 0.134.0 since 0.121.x pins starlette<0.50.0.

https://claude.ai/code/session_01P9NtqqFN9dVW1c5Uno6oRC
2026-05-26 19:22:31 +00:00
zurdi
17ea8da23d Merge remote-tracking branch 'origin/master' into chore/frontend-v2 2026-05-25 07:56:38 +00:00
Claude
95958b6687 test: integrate Hypothesis property-based testing for backend
Add Hypothesis to the test dependency group with CI/dev profiles, and
introduce property-based tests for high-value pure functions: crc32_to_hex,
filesystem and LaunchBox filename sanitization, LaunchBox metadata parsers,
and ROM filename tag parsing.

https://claude.ai/code/session_01GCTFmzuhvqNbSAfw3rGxmj
2026-05-21 16:40:04 +00:00
dependabot[bot]
e6662e9968 chore(deps): bump authlib from 1.6.9 to 1.6.12
Bumps [authlib](https://github.com/authlib/authlib) from 1.6.9 to 1.6.12.
- [Release notes](https://github.com/authlib/authlib/releases)
- [Changelog](https://github.com/authlib/authlib/blob/1.6.12/docs/changelog.rst)
- [Commits](https://github.com/authlib/authlib/compare/v1.6.9...1.6.12)

---
updated-dependencies:
- dependency-name: authlib
  dependency-version: 1.6.12
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-14 00:22:55 +00:00
dependabot[bot]
6ed4c3206c chore(deps): bump aiohttp from 3.13.3 to 3.13.4
---
updated-dependencies:
- dependency-name: aiohttp
  dependency-version: 3.13.4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-08 15:43:35 +00:00
copilot-swe-agent[bot]
bffde45f2b fix: bump rq minimum version to 2.7 in pyproject.toml
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/efd0c66d-f72c-4e62-a976-4f2c3deb3608

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-04-29 19:38:26 +00:00
copilot-swe-agent[bot]
af870e0278 fix: replace deprecated job.get_id() with job.id for rq >= 2.7.0 compatibility
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/4326c200-57f5-4a27-96e8-570df82968e5

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-04-29 19:31:13 +00:00
zurdi
d868c65c0d Merge remote-tracking branch 'origin/master' into chore/frontend-v2 2026-04-23 23:01:51 +00:00
Zurdi
72395fda4b Merge branch 'master' into feat/soundtrack-support 2026-04-23 17:21:14 +02:00
zurdi
b5197341a6 Merge branch 'feat/soundtrack-support' into chore/frontend-v3
Bring in manual/soundtrack backend + shared frontend code so v2 can expose
the new media features. Resolved RomM.vue by keeping both the v2 gate and
the app-wide SoundtrackMiniPlayer; took the branch's uv.lock.
2026-04-22 11:30:35 +00:00
zurdi
cc2556da7b Refactor code structure for improved readability and maintainability 2026-04-22 09:57:42 +00:00
dependabot[bot]
98bbdba095 chore(deps): bump python-dotenv from 1.0.1 to 1.2.2
Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 1.0.1 to 1.2.2.
- [Release notes](https://github.com/theskumar/python-dotenv/releases)
- [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md)
- [Commits](https://github.com/theskumar/python-dotenv/compare/v1.0.1...v1.2.2)

---
updated-dependencies:
- dependency-name: python-dotenv
  dependency-version: 1.2.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-21 21:02:34 +00:00
zurdi
9f7435c9a6 feat(soundtrack): server-side metadata, cover persistence, streaming fix
Backend
- Extract audio tags + duration via mutagen at upload/scan time, store as
  rom_files.audio_meta JSON. Frontend reads everything from the DB instead of
  downloading every blob to parse ID3 client-side.
- Persist embedded cover art under resources/roms/{platform_id}/{rom_id}/
  soundtracks/{file_id}.{ext} on upload/scan; store relative path in
  audio_meta.cover_path. Cleaned up on delete. Removed the on-the-fly
  /soundtracks/{file_id}/cover endpoint (DB is source of truth).
- New GET /roms/{id}/soundtracks/metadata returns the compact per-ROM
  metadata payload.
- Fix /files/content/{name}: serve audio inline with proper MIME
  (audio/flac, audio/ogg, audio/mp4, ...) and let Starlette handle Range
  natively in DEV_MODE. Browsers can now seek and progressively stream;
  scrubbing returns 206 Partial Content instead of pulling the whole file.
- Squashed the audio_meta column into the existing 0080 migration.

Frontend
- Drop jsmediatags entirely.
- New persistent SoundtrackMiniPlayer + reusable VolumeControl components.
- Pinia store: loadPlaylistForRom, activePlaylistRomId, throttled
  reportCurrentTime (200 ms), isBuffering driven by waiting/canplay events.
- SoundtrackPlayer reads metadata via one JSON request (AbortController on
  unmount/track change), shows per-track + total durations, lazy-loads
  thumbnails, resolves covers via the static resources path.
- Wrap most scoped CSS into Vuetify utility classes.

Tests
- 12 backend tests covering upload extraction + cover persist, metadata
  endpoint shape, delete cleanup, range support.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 01:20:17 +00:00
zurdi
916e8945e7 media resources revamp (manuals + soundtrack) 2026-04-17 16:02:37 +00:00
Georges-Antoine Assi
f5474ee588 fix(tests): bump pytest-asyncio for pytest 9 compatibility
pytest-asyncio 0.23 is incompatible with pytest 9 (it calls the removed
Package.obj attribute, causing an INTERNALERROR during collection).
Bump to ~= 1.1 and set asyncio_default_fixture_loop_scope to silence the
1.x deprecation warning.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 19:43:53 -04:00
dependabot[bot]
64330f397f chore(deps): bump pytest from 8.4.1 to 9.0.3
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.4.1 to 9.0.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.4.1...9.0.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 9.0.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-15 19:46:30 +00:00
dependabot[bot]
4b71e0aab0 chore(deps): bump pillow from 12.1.1 to 12.2.0
Bumps [pillow](https://github.com/python-pillow/Pillow) from 12.1.1 to 12.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/12.1.1...12.2.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-version: 12.2.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-13 23:39:05 +00: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
f2e8e337b2 Merge branch 'master' into save-sync 2026-04-05 21:47:53 -04:00
Georges-Antoine Assi
f5f6aeb051 Lockdown package isntalls 2026-03-31 08:19:06 -04:00
Georges-Antoine Assi
29112b4ddc create device on login web 2026-03-15 11:25:39 -04:00
Georges-Antoine Assi
e6ddc5da11 bot attempt at save sync 2026-03-14 22:13:38 -04:00