The dev setup creates frontend/assets/easyrpg with symlinks, and the image build
copies it into the context. It then collides with the real EasyRPG files at the
same path, and the last COPY step fails with 'cannot copy to non-directory'.
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(play): show the automatic Save synced toast at most once every 5 minutes
* fix(saves): let sigil decide when a Pokemon save is the same, ignoring scratch RAM
* pr-ready: code-review
* pr-ready: review-polish
* pr-ready: prose
* fix(play): hold SRAM changes in the browser and upload them once the game goes quiet
* fix(play): upload a held save before a state replaces it, and report only new snapshots
* pr-ready: code-review
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* pr-ready: simplify
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* pr-ready: review-polish
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* pr-ready: prose
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* pr-ready: prose (code-review fixes)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(play): leave a save a running session holds out of other tabs' sync passes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* build(sigil): pin ef9b51e
---------
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(docker): supervise the container with s6-overlay
The init script was a hand-rolled supervisor: PID files, /proc polling, a
5s watchdog loop and a trap-based shutdown. Its shutdown wait was unbounded,
so a process that refused to exit stranded PID 1 and left the container up
and serving nothing, which no restart policy can detect.
s6-rc replaces it with a declared service graph. Ordering and readiness
gates that were sequential bash become dependencies, and the failure modes
become configuration:
- timeout-kill bounds SIGTERM before SIGKILL, and flag-timeout-killpg
escalates to the whole process group.
- S6_BEHAVIOUR_IF_STAGE2_FAILS=2 exits the container when a startup step
fails, so the restart policy retries instead of the container wedging.
- valkey gets --shutdown-on-sigterm force, so it stops refusing to exit
when the snapshot it writes on shutdown cannot be written.
A crashed service is now restarted on its own instead of taking the whole
container down. Its leftover children are swept first, because children
reparented from a hard-killed master keep holding its listening sockets and
would make every replacement fail to bind.
Optional services have no conditional mechanism in s6-rc, so they start,
check their environment variable, and take themselves down with s6-svc -O.
Running with a read-only root filesystem now needs /run mounted exec, since
s6 executes its generated stage scripts from there.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(docker): always start the RQ scheduler under s6
The s6 service carried over the four-flag ENABLE_SCHEDULED_* gate from the
init script, which #4033 has since removed on master. Since this branch
deletes that script, the fix would be lost on rebase.
Nothing else respects the condition: startup.py registers the netplay,
upload-tmp and zip-cache cleanups unconditionally, three more flags gate
periodic tasks absent from the list, and the watcher defers its rescans
through the scheduler. Any of those leaves jobs in the scheduler registry
with no process to run them, and a stuck delayed scan_platforms entry reads
to the concurrent scan guard as a scan already queued, refusing every
manual scan.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(docker): port master's init changes to the s6 services
Master reworked docker/init_scripts/init while this branch replaced it,
so carry those changes into the s6-rc services:
- Replace rq-scheduler with `rq cron` (romm-rq-cron) on tasks.cron_config.
- Add romm-rq-scan-worker (scans queue) and romm-rq-streaming-worker
(streaming queue, down unless config.yml enables streaming).
- Run every worker with --with-scheduler and the RomMRedis connection
class, passing the Redis URL through RQ_REDIS_URL so the password stays
off the command line, and read REDIS_SSL as a boolean.
- Bring gunicorn's flags in line: --no-control-socket, a private-range
FORWARDED_ALLOW_IPS default, 4 workers and a 65s keep-alive.
- Check the sync folder and SSH keys path in romm-init, and switch the
features off through the container environment when they're unusable.
- Accept the backend's truthy values for the watcher flags.
- Point the serving-layer guard tests at the gunicorn run script and
drop the PID-file tests, which guarded the bash watchdog.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(docker): guard the s6-overlay service tree
Check that every service is in the user bundle, depends on something
that exists, and that every longrun has its finish sweep, kill timeout
and process-group flag. Also check that the dev entrypoint starts the
same RQ workers and cron scheduler as the image, since it keeps its own
launcher.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(dev): pass the image's RQ flags in the dev entrypoint
The dev image's RQ cron scheduler and workers ran without the RomMRedis
connection class, and the workers without --results-ttl, so they kept
redis-py's maintenance notification probe and RQ's default result TTL.
The s6 guard test now compares each rq command's flags with the image's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(docker): address Greptile review on the s6 service tree
- Cut the s6 script comments to two lines, keeping the reason each
helper exists.
- Compare the values of the dev entrypoint's RQ options with the
image's, not only their names, allowing for the dev image's path,
PID files and LOGLEVEL default.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* ci(docker): check every s6 service stays up after boot
The heartbeat only proves gunicorn and nginx came up. Enable both watchers
and require each longrun in the s6 tree to report up for 15s straight, so a
crashing or restart-looping worker, cron, valkey or watcher fails the job.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* ci(docker): enable streaming so its worker is checked too
The streaming worker turns itself off when streaming.enabled is false in
config.yml, which the services check read as a failure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(docker): update nginx to 1.30.7 for security fixes
* fix(docker): pin full multi-arch nginx 1.30.7 index digest
The previous digest was an early partial index for nginx:1.30.7-alpine3.24
(amd64, arm/v6, arm64, s390x only). Pin the tag's current index, which
includes all architectures, matching how the 1.30.6 pin was taken.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Georges-Antoine Assi <3247106+gantoine@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore(deps): update js-dos to 8.5.4 and track it with Renovate
Bump the bundled js-dos release and the jsDelivr fallback from 8.4.1 to
8.5.4, which ships a newer DOSBox-X and audio and player cleanup fixes.
8.5.x adds an opt-in DOSBox-X debugger build (wdosbox-x-dbg), stripped
from the image with the other unused files.
Renovate now tracks caiiiycuk/js-dos across both Dockerfiles and the
CDN URL. It can't hash the release zip, so its PRs carry a note to
update JSDOS_SHA256 by hand.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test: assert the js-dos pins match across images and the CDN fallback
CI builds only docker/Dockerfile, so a JSDOS_SHA256 left stale in the
root Dockerfile, or a CDN version left behind, would pass unnoticed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore: condense the js-dos strip comment to two lines
Addresses Greptile's comment-length finding on both Dockerfiles.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test: assert every shared Dockerfile pin matches across both images
Merge the uv and js-dos pin tests into test_dockerfile_pins.py. It now
compares every ARG with a default in both Dockerfiles, so a new shared
pin is covered without a test edit, and keeps the uv range and js-dos
CDN checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(saves): add save channels and snapshots
* feat(saves): close spec gaps in save channels and hash with sigil
* feat(saves): play snapshots in the v2 player, which pushes snapshots
* fix(saves): code review: authorization, retention losses, held-save sync, batched responses
* refactor(saves): simplify pass
* refactor(saves): review-polish pass
* docs(saves): humanizer pass
* feat(saves): run every EmulatorJS page on the v2 player
* feat(saves): per-user snapshot pins
* feat(sigil): store the identity a save restore needs and pin sigil 0f05f25
* fix(saves): meet type-aware lint in the v2 player
* feat(sigil): store N64 header and playlist title ids, pin sigil 0847fda
* feat(saves): convert saves for a core on download and list save layouts
* feat(saves): prune unreachable archival snapshots and empty detached channels on delete
* feat(saves): device sync from the token, held snapshots and shared-card pushes
* feat(saves): arc restores past abandoned snapshots and color channels by age
* fix(saves): code-review and security-audit fixes
* refactor(saves): simplify pass
* chore(saves): review-polish pass
* docs(saves): humanizer pass
* fix(sync): file RetroArch autosave versions as their channel's next snapshot
* fix(saves): address review findings and trim docstrings
* fix(saves): share-lock planned rows by id so PostgreSQL accepts the lock
* test(saves): stub the detached-channels fetch in SaveDataTab stories
* feat(saves): carry the full current snapshot in a 409, pin sigil 2071dff
* chore(sigil): pin 5d4ddb4, which reads .cue and .gdi sheets
* docs(saves): drop v2 wording now that one UI remains
* chore(sigil): pin 0190443, which reads PS2 raw BIN images and cue sheets
* fix(sigil): treat a file too short for its format as routine during scans
* chore(migrations): renumber save channel migrations after upstream's 0154
* fix(snapshots): a hardcore switch on unchanged content makes a new current
* fix(sync): decide a channel's slot from its history and the device's snapshot
* chore(docker): pin sigil at 794d99f for PSP Store release save prefixes
* refactor(db): squash the save channel migrations into 0161
Fold the slot linking (0162) and the rom_files sigil identity columns (0163)
into 0161_save_channels, so the feature ships as one revision.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(saves): close visibility and input gaps found in review (pr-ready step 2)
code-review --fix:
- negotiate_sync drops channel slots on ROMs hidden from the caller
- channel PATCH/attach/DELETE answer 404 when the channel's ROM is hidden
- a push copying a save from a hidden ROM answers 404
- _own_device applies require_token_device to bound client tokens
- adopting a legacy save syncs its sharing with the channel it joins
security-audit follow-ups:
- another user's detached public save or state is no longer downloadable
- profile and option values must be a single path segment
- companions are de-duplicated and capped at 8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(saves): share channel and asset lookups, drop duplicates (pr-ready step 3)
simplify:
- readable_channel_or_404 and channels_on_files replace four copies of the
channel 404 check and two copies of the file-fed channel listing
- readable_rom_asset_or_404 serves both public save and state downloads
- _own_device resolves through require_device; _clone_origin takes the source
- reuse _unprocessable, DESCRIPTOR_EXTENSIONS, SAVE_SLOT_MAX_LENGTH, uniqueBy
and uuidv7; neutral forms default their required pattern to the allowed one
- RetroArch delete checks held rows in one query, a guarded upload lists the
slot only without a channel head, and uploads are read off the event loop
- snapshotSession builds push requests once; player comment cleanups
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(saves): trim two docstrings to two lines (pr-ready step 4)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(saves): answer held RetroArch paths with 423, mirror slot labels
- RetroArch Cloud Sync answers 423 Locked for a PUT over a held unslotted save
and for a DELETE where only held rows sit at the path, instead of 409 and 404
- channelLabelForSlot returns null for blank and state_ slots, as the backend's
channel_label does, so the player files them under no channel either
- document that sharing a channel lets every user read and push into it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(docker): pin sigil at 85f88a8 for Switch .nup containers
* fix(snapshots): a save pushed in another shape or format makes a new current
* refactor(saves): drop the always-true SAVE_SYNC.SNAPSHOTS heartbeat flag
Nothing reads it, and the SAVE_SYNC block's presence already tells a
client the server speaks the snapshot API. Also trim the rom detail
channel field comments to one line each.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(frontend): use uuidv7 for every client-generated id
Drop the randomToken wrapper and the notification inbox's Math.random tab
id, so uuidv7 is the one helper that works outside a secure context.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(saves): trim redundant snapshot API surface, dead code and duplicate logic
API:
- Drop PUT /snapshots/{id}/devices/{device_id}; GET /snapshots/{id}?hold=true holds.
- GET /snapshots is history only (channel_id required); GET /channels serves currents.
- A snapshot carries channel_id instead of an embedded channel.
- POST /saves/{id}/content takes the same query parameters as the GET, plus container_path.
Backend:
- Remove the archival write path, clone.py, DBStatesHandler.get_state, the sigil
identity-hash path, unused relationships and composite snapshot indexes.
- One held/frozen lookup, one bulk-delete guard, SQLAlchemy dialect upserts, and
the shared reserve_version_name in the writer.
- The writer takes a visibility filter and checks the channel and parent itself.
- The restore handler picks per-game or merge; fewer wrapper types and tables.
Frontend:
- Channel delete uses the shared typed confirm; DeleteChannelDialog is gone.
- Held offline pushes go through a per-channel SnapshotSession.
- Remove the slot-based pending upload path.
- The timeline shares the fan's badge logic.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* refactor(saves): release archival backups through module functions
The saves and states handlers each built a private DBSnapshotsHandler to
call release_backup and refresh_backup_digests, since they can't import
the shared instance. Both only ever ran inside the caller's session, so
they are now module functions taking it, like channel_for_slot.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* refactor(saves): share one deleted-assets handler instance
The saves handler built its own DBDeletedAssetsHandler because it can't
import the package's instance. The instance is now built in
deleted_assets_handler.py and re-exported by the package, so both use it.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
X-Accel-Redirect keeps only a few of the backend's response headers, so the
Content-Security-Policy and nosniff headers set for inline files never
reached the browser. Set them on the internal /library/ location, reusing
the resources CSP that already exempts PDFs.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore(deps): update node.js to v26
* chore(deps): move the Node runtime pins to 26.13
Addresses Greptile's review: the engines and @types/node bump needs
frontend/.nvmrc and both Dockerfiles on Node 26 too, or npm ci fails
with EBADENGINE under engine-strict.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Georges-Antoine Assi <contact@me.gantoine.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix: confine provider media paths to the rom's own folders
Media paths in ScreenScraper and LaunchBox metadata sent through
PUT /api/roms/{id} are now kept only when they point at a PNG or video
file in the rom's own folder for that media type. Malformed provider
metadata is rejected with a 422.
nginx serves /assets/romm/resources/ with nosniff and a sandbox CSP,
except for PDFs, so the browser's PDF viewer still opens them.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix: code-review pass on media path confinement
Reject non-string media URLs with a 422, limit stored media file names
to [A-Za-z0-9_-]{1,64}, build the LaunchBox path test from the fixture
rom's ids, and trim the new docstring and nginx comment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor: simplify pass on media path confinement
Raise the 422 directly instead of through a self-caught TypeError, pull
the path check into a predicate, and share the media I/O patches between
the new tests through a class fixture.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: keep only stored media URLs from raw provider metadata
A media URL in client-supplied ScreenScraper or LaunchBox metadata is
kept only when the rom's stored metadata for that provider already holds
it. Otherwise the URL key, or the whole later-disc entry, is dropped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Drop the unused backend-dev-build, dev-slim and dev-full stages. No
workflow or compose file targets them (the dev image is ./Dockerfile),
and because dev-full was the last stage, build_local_image.sh (no
--target) was building an image with the dev extras. full-image is now
the default target.
- Fetch argosy-sigil, mod_zip and nginx with BuildKit's git ADD (which
also pulls submodules) instead of git clone/checkout, as the gme stage
already does, so those stages no longer install git. RALibretro keeps
its clone: its Makefile builds RA_BuildVer.h from .git/HEAD and
`git describe --tags`, which ADD strips.
- Hardcode /var/www/html in place of WEBSERVER_FOLDER: nothing sets the
ARG, and the entrypoint and nginx template hardcode the path anyway.
- Stop copying the CPython headers into the runtime image; nothing
compiles there.
- Remove a no-op chmod and a mislabelled comment.
Claude-Session: https://claude.ai/code/session_01NH5s4fzfhupfVnuw2VKdog
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Gunicorn writes /tmp/gunicorn.pid only once its arbiter starts. On a slow
cold start the watchdog found no pid file and started another gunicorn
every 5s without stopping the earlier ones, until the host ran out of
memory. Record $! at launch, as the RQ workers already do.
Cold starts were slow because the image ships no bytecode while setting
PYTHONDONTWRITEBYTECODE=1, so every process compiled every module from
source. Compile the venv during uv sync and /backend at build time.
Fixes#5246
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(docker): bump nginx to 1.30.6 and drop pip from the runtime image
nginx 1.30.5-r1 carries CVE-2026-15176, CVE-2026-93479 and
CVE-2026-97205, fixed in 1.30.6-r0. The package comes from the pinned
nginx base image, so apk upgrade cannot pick it up.
Trivy also flags urllib3 2.7.0, msgpack 1.1.2 and setuptools 70.3.0
from pip 26.2.2's vendored copies in the system Python. pip 26.2.2 is
the latest release, and nothing in the running image uses pip (the app
runs from the uv venv), so remove it in python-runtime. Build stages
still get the upgraded pip from python-alias.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Apply suggestion from @greptile-apps[bot]
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
The pinned python:3.14-alpine3.24 image (Python 3.14.7) installs pip
from CPython's bundled ensurepip wheel, which is pip 26.2.1. pip 26.2.2
was released on 2026-10-20 for the eMudhra CA compromise. The shipped
image copies /usr/local/lib/python3.14 and /usr/local/bin from that
base, so the old pip landed in every RomM image, and the sigil-build
stage used it to fetch cffi and setuptools from PyPI.
Upgrading in python-alias covers both, since sigil-build and
python-runtime derive from it.
Claude-Session: https://claude.ai/code/session_01MH7wFM9YCxzurL1kP7vvLA
Co-authored-by: Claude <noreply@anthropic.com>
Node 24.22.1 distrusts the compromised eMudhra intermediate CAs, updates
the bundled root store to NSS 3.131.1, and fixes the TLS hostname
verification bypasses (CVE-2026-105483, CVE-2026-106069) and the Brotli
decoder out-of-bounds write (CVE-2026-111497).
Moves .nvmrc (CI and dev-setup), the pinned node:24.22-alpine3.24 build
image and its digest, and the dev container's nvm pin.
Claude-Session: https://claude.ai/code/session_01MH7wFM9YCxzurL1kP7vvLA
Co-authored-by: Claude <noreply@anthropic.com>
uv 0.13.4 distrusts the compromised eMudhra intermediate CAs
(https://emudhra.we-have-a-problem.com/) in its bundled webpki roots.
required-version moves to >=0.13.4,<0.14, so local checkouts need
scripts/dev-setup.sh (or uv self update) after pulling.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(docker): boot when the container runs as a non-default UID
Unraid runs the container as 99:100, which can't write to the image's
/romm (owned by 1000, mode 755), only to the mounted subfolders. The
PSP pending dir at /romm/cache/retroarch_sync was created at import
time, so every gunicorn worker failed to boot.
- Buffer pending PSP save files under the user's assets folder
(assets/users/<user>/retroarch/psp_pending/), beside the other
RetroArch Cloud Sync files and outside the client-reachable blob
categories.
- Move the zip and rom-converto download caches to /tmp/romm/cache,
and point nginx's internal /cache/ alias there.
- Put gunicorn's control socket in /tmp/gunicorn instead of
$HOME/.gunicorn, since HOME is / for that UID.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(docker): honor ROMM_TMP_PATH for caches, explain an unwritable sync folder
- The download caches live under $ROMM_TMP_PATH/cache when it's set,
so installs with a small Docker disk (Unraid's docker.img) can point
them at a share. The entrypoint exports the same path for nginx's
/cache/ alias.
- With ENABLE_SYNC_FOLDER_WATCHER on and /romm/sync not writable, /init
warns and skips the watcher instead of dying on mkdir under errexit.
- The compose example lists the /romm/sync mount the sync features need.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(sync): cover reading back and clearing buffered PSP files
Addresses Greptile's review on #5189.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(sync): apply code-review findings to PSP pending buffer
Remove the emptied psp_pending folder after a merge, define the sync
folder path once in init, update the architecture doc's PSP and blob
locations, and drop a stale .gitignore entry.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(sync): apply simplify findings to PSP pending cleanup
Clear the buffered folder with remove_directory, let the startup check
own creating the sync folder, and reword the test fixture docstring.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(sync): cap buffered PSP files and drop them on delete
Buffered files for an unresolved save folder now count against the
bundle limits, so a folder can't fill the assets share and then fail
every merge once it resolves. A DELETE also removes the buffered copy,
so a deleted file isn't merged back when the folder resolves.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(docker): check the sync folder for push-pull sync too
ENABLE_SYNC_PUSH_PULL keeps SSH keys and device saves under /romm/sync
as well, so an unwritable folder now disables it with the watcher and
warns at boot instead of failing when the task runs.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(docker): strip whitespace from env vars like the backend does
The backend strips every variable it reads, while the init script and
nginx templates used raw values, so a padded ROMM_TMP_PATH sent nginx's
/cache/ alias somewhere the backend never writes.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore(config): drop the CACHE_BASE_PATH comment
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(docker): say which backend config strips env whitespace
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* revert(docker): drop the entrypoint env whitespace trimming
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(sync): apply pr-ready code-review findings
Gate push-pull on its SSH keys path rather than a writable sync folder,
accept the same truthy values as the backend, and clear only the merged
PSP pending files so another worker's buffered file survives.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor: apply pr-ready simplify findings
Share one truthy pattern across init's flag checks (the watcher gates
now accept the same values as the backend), disable gunicorn's unused
control socket instead of placing it, derive the converts redirect from
its own cache path, and factor the unknown PSP folder in tests.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* docs(docker): apply pr-ready humanizer pass to the sync mount note
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(fs): create handler base folders on first write, skip leftover temp files
FSHandler no longer mkdirs its base path when constructed, so a module-level
handler rooted at an unmounted or unwritable folder can't take down boot;
every write path already creates its parent folders. Blob listings skip
.romm_tmp_ files a crashed write left behind, so they are never merged into
a PSP bundle or advertised in the sync manifest. The prefix now lives in one
TEMP_FILE_PREFIX constant.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(player): play RPG Maker 2000/2003 games in the browser with EasyRPG
Embed the EasyRPG web player for extracted game folders on the rpg-maker
platform. The backend generates the player's index.json from the scanned
files and merges in the free EasyRPG RTP under every name the official
and fan RTPs give its assets, so games that lean on the RTP find them.
In-game saves sync with the user's RomM saves through the player's
IndexedDB storage.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(easyrpg): read the free RTP from a fixed path instead of an env var
The full image always keeps the RTP at /var/www/html/assets/easyrpg/rtp,
so the path is a constant beside the web path nginx serves it under. The
dev container links its copy there at startup.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(easyrpg): code-review fixes for the save sync and asset endpoint
- Wait for an in-flight push before the quit push, so the newest save uploads
- Keep Play disabled until the fresh rom (and its saves) is fetched
- Stop onPlay and the rom fetch from acting after the view unmounts
- Leave through usePlayerExit like the other players
- Handle a rejected IDB commit when the run itself fails
- Track uploads by the browser's file name
- Load only visibility and files per asset request, not the full rom
- Serve DEV_MODE files as octet-stream, matching nginx
- Make the traversal test actually reach the endpoint
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(easyrpg): simplify pass over the player and asset endpoint
- Load only file paths per asset request, and look up RTP folders in O(1)
- Reuse RomFile.file_name_for_download and usePlayerFullscreen
- Share one dev/prod serve helper for game and RTP files
- Derive the save sync's game key from the rom
- Have the RTP table tool reuse normalize_name
- Make save-module internals private and tidy the prepare/read loops
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(easyrpg): flag RPG Maker game folders on the rom schemas
Gallery lists carry no files, so the frontend guessed that every multi-file
rom on the rpg-maker platform was playable, including RPG Maker XP/VX/MV
folders. Rom now has a deferred `is_easyrpg_game` subquery (an RPG_RT.ldb at
the folder root), loaded with the other gallery file stats and derived from
loaded files on the with_files path, and the frontend reads it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(easyrpg): drop server save sync, keep saves per user in the browser
Server sync moves to a follow-up that puts the web players on device sync.
Saves now stay in the player's IndexedDB, as js-dos does, with the same note
on the start page. The player is launched as `<rom id>-<user id>` so each
RomM account sharing a browser profile keeps its own saves; nginx and Vite
drop the user id when routing to the backend.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(easyrpg): address Greptile review
- Start timing the play session once the player page loads
- Use object-form props in the view test's button mock
- Keep the RTP table tool's docstring to one sentence
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(easyrpg): keep the RTP table in a fixtures folder
Matches handler/metadata/fixtures, where the other bundled data files live.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(converto): integrate rom-converto for title id extraction and download conversion
* fix(docker): ship rom-converto in the production image
Only the dev Dockerfile installed the binary, so the integration could
never enable on a released image. Fetch the same pinned, checksummed
musl build in a dedicated stage and copy it next to RAHasher.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(converto): skip the update check and batch info calls
The CLI asks api.github.com for a newer release on every run unless
told not to, so pass --no-update-check on each invocation. Inspect a
rom's files in one `info --paths-file` run instead of one subprocess
per file, and read the inspectable extensions from the capabilities
manifest so scans skip files info cannot recognize.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(scan): keep sigil authoritative for title ids
rom-converto ran first and overrode the ids sigil read. Sigil now runs
first and records its per-file ids; rom-converto only fills files sigil
left unset, on new or changed files, in one batch. Restore the base-id
selection for sigil extractions on every platform, as on master.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(downloads): make conversion opt-in and bound the cache
The download endpoint returned a converted file to every client once a
platform had a target, including the browser player and apps that check
hashes against RomFile. Conversion now needs ?converted=true.
A pre-warmed copy is served whatever its size; the in-request size cap
only gates starting a conversion. ROM_CONVERTO_CACHE_MAX_SIZE_GB
(default 20, 0 unbounded) caps the cache: conversions and the pre-warm
task stop when it is full, and cleanup evicts the least recently served
copies.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore(types): regenerate frontend types for the converto schema
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(converto): address code-review findings (pr-ready step 2)
- Fall back to rom-converto's stored ids only when it ran this pass, in
disc order, so a rescan that skipped extraction keeps sigil's save target
- Persist per-file title ids that extraction writes onto reused rows
- Only authenticated callers may start an in-request conversion; past a
240s deadline serve the original and let the conversion finish into the
cache instead of nginx returning 504
- Treat a probe OSError or timeout as a failed probe; kill the subprocess
when the caller is cancelled
- Give the pre-warm task the scan timeout and report progress in the
ConversionStats shape the task UI reads
- Reuse zip_cache constants, walk the cache off the event loop, tolerate
files vanishing mid-cleanup, and trim long comments
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(converto): simplify conversion code (pr-ready step 3)
- Move the converted-download policy (target lookup, cached-first, sync
size cap, deadline) from the endpoint into utils/conversion_cache and
share conversion_target with the pre-warm task
- Share one path lookup between get_cached_converted and get_or_convert;
the pre-warm walks the cache once and tracks a running byte budget
instead of walking it twice per rom
- One normalize_platform_formats beside TARGETS_BY_PLATFORM for the
config loader (via _validated_platform_map) and the settings endpoint;
update_converto_settings takes a ConvertoConfig and is written back
with dataclasses.asdict
- read_infos owns its never-raise contract, so the scan drops its blanket
except; drop the unused RomConvertoInfo.kind and error attributes
- Sort files for the rom-converto identity only when it is used; stat
each cached file once during cleanup
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore(converto): trim comments (pr-ready step 4)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(converto): convert on first download instead of pre-warming
A library pre-warm fought the TTL: cleanup dropped every copy nobody
downloaded within a day. Remove the Convert library task and convert on
demand only. Files over ROM_CONVERTO_MAX_SYNC_SIZE_MB now start their
conversion in the background while the original is served, so the next
download within the TTL gets the converted copy at any size.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(converto): drop decrypt and encrypt download targets
Downloads now only change a rom's container or compression (CHD, RVZ,
CSO, NSZ, ...); serving decrypted files is left for a separate decision.
NDS and PS3 have no remaining targets. Also note that the conversion
concurrency limit applies per process.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(converto): move the cache limits into converto.*
cache_max_size_gb and max_sync_size_mb join cache_ttl_hours in
config.yml and PUT /api/config/converto_settings, replacing the
ROM_CONVERTO_CACHE_MAX_SIZE_GB and ROM_CONVERTO_MAX_SYNC_SIZE_MB env
vars, so every eviction knob is edited in one place at runtime. The
loader takes its defaults from ConvertoConfig and one table holds each
integer's minimum for both the loader and the payload.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(converto): lock conversions with flock instead of a sentinel
A conversion now holds a non-blocking flock on its key dir, which the
kernel releases if the worker dies. That replaces the .partial sentinel,
its 6-hour staleness guess (which a long ROM_CONVERTO_TIMEOUT could
outlive), and the rename-aside takeover. Cleanup skips locked dirs, and
partial output gets a hidden name so it never counts as a served copy.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(converto): parametrize repeated test cases
Collapse the per-platform info parsing, operation resolution and
converto_active cases into parametrized tests, so a new platform or
target is one row.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(scan): run rom-converto first with sigil as the fallback
rom-converto reads each rom's new or changed files first, in one batch,
and its title ids win. sigil still reads what it can, since it alone
provides save targets and Switch content types, and fills the ids
rom-converto left unset.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(converto): store per-file metadata read by rom-converto during scans
* fix(scan): keep the stored save target when sigil reads nothing
* fix(converto): read Xbox 360 disc ids and Wii title versions, store content type as text
* feat(converto): save file icons, banners and backgrounds read by rom-converto
* chore(converto): bump rom-converto to v0.23.0
* fix(converto): address review findings in the conversion cache, scan metadata and settings
* refactor(converto): move per-file metadata out of the conversion PR
Scan-time metadata (title ids, the 17 rom_files columns, artwork and
converto.scan_metadata) moves to its own PR so its columns land with the
UI that reads them. This PR keeps conversion only.
The conversion cache no longer has uncompressed_size_bytes to budget
with, so a conversion to an uncompressed target reserves a fixed
multiple of its input and the cleanup pass after it evicts any overshoot.
Co-Authored-By: DevYukine <20647088+DevYukine@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BuuZVVtVPNLRaCjTN9bgQ
* feat(converto): let the client pick the download format with ?format=
`?format=zso,iso` lists the formats a client can read. The stored file is
served whenever its format is listed, even with conversion off, so most
emulator clients never trigger a conversion. Otherwise the first listed
format with a cached copy is served, then the first one rom-converto can
produce.
A conversion that outlasts a short wait answers 202 with Retry-After
instead of falling back to the original, so a URL never serves two
different files and a client never gets bytes it can't read. 406 means
no listed format can be served. HEAD reports the same without starting
a conversion. This replaces `?converted=true`, the per-platform download
target and `max_sync_size_mb`; `cache_ttl_hours` stays config.yml-only.
Co-Authored-By: DevYukine <20647088+DevYukine@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BuuZVVtVPNLRaCjTN9bgQ
* feat(converto): convert the library in place with a manual task
`converto.platform_formats` now names the format a platform's library is
stored in, and the new "Convert library" task brings every matched rom
to it. Each output is staged in a `.romm_tmp_` directory beside the
original, moved into place, and only then are the originals (and a cue's
tracks) deleted. Single-file roms take the new name, folder roms keep
theirs and get their .m3u entries rewritten, and the file rows refresh,
so a rom keeps its id, saves and collections.
Only lossless conversions qualify, so xbox (xiso trims the dump) has no
library format. Unmatched roms are skipped because a converted file no
longer hash-matches a DAT. `/api/config` now carries the library targets
and, per input extension, the formats a download can be converted to.
Co-Authored-By: DevYukine <20647088+DevYukine@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017BuuZVVtVPNLRaCjTN9bgQ
* fix(converto): address Greptile and Copilot review findings
- Publish a converted library file with a no-replace link, so a file that
appears during conversion is never overwritten.
- Delete originals only after the rom row or its playlists point at the new
file, and keep them if that update fails. Playlists are rewritten atomically.
- Refuse a cue conversion whose tracks another rom or another cue holds.
- Remove stage dirs a killed conversion left behind.
- Try later ?format= targets when a conversion fails, treat any locked key dir
as converting, and cap how many conversions downloads can start.
- Drop the unsupported iso target for CD platforms from the example config and
list the ROM_CONVERTO_* variables in env.template.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(converto): address code-review findings (pr-ready step 2)
Serve converted outputs at 0644, read cue sheets and playlists with a BOM,
stage folder rom conversions outside the rom folder, keep one rom's failure
from stopping the convert library task, accept alias extensions as the stored
format, probe running conversions with a shared lock, and bound the timeout.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(converto): simplify conversion code (pr-ready step 3)
Check and chmod rom-converto output once in the adapter, canonicalize
requested format aliases, reuse LINK_FALLBACK_ERRNOS and the handler's atomic
write, make the download format table a constant, skip the probe lock once
cached, and fold duplicated name checks and cache stat passes.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore(converto): trim comments (pr-ready step 4)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* refactor(converto): find rom-converto on PATH instead of ROM_CONVERTO_PATH
Both images install the binary on PATH, the variable was undocumented,
and RAHasher is already resolved the same way.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Yukine <devyukine@gmx.de>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: DevYukine <20647088+DevYukine@users.noreply.github.com>
report_task_failure can run in the worker parent when a work horse is
killed, so it now enqueues notify_task_failure on the default queue
instead of loading the notification stack there.
enqueue_task defaults to the queue its spec names. The streaming worker
runs as PreloadingWorker, which imports the enabled scheduled tasks of
its queues, so the reaper's per-minute horse inherits its stack. Spec
tests now read config in a fresh interpreter instead of comparing a
value with itself.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- A failed login keeps the attempted username only when it names an
account, so a password typed into the username box is never stored.
- Gunicorn trusts X-Forwarded-For only from loopback and private ranges
(FORWARDED_ALLOW_IPS, documented in env.template), so a client can no
longer choose the address the audit log and rate limits see.
- A player's fetch (purpose=play) is recorded as rom.player_load instead
of being skipped, so the marker can't hide a download.
- Play-session ingest treats a rom hidden from the caller as unknown, so
its session and rom.play event don't name it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test checks the one line the watchdog relies on, next to the keepalive
pair instead of between it, and the comment states RQ's late write once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds a test that start_rq_worker records $! instead of passing --pid, and
moves the comment next to the line it explains.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The watchdog restarts any process whose PID file is missing, and RQ's --pid
writes that file only after importing the worker class. Since RomMWorker
imports tasks.tasks (and with it config, SQLAlchemy and the auth and socket
handlers), reaching that point takes seconds on a cold, bytecode-less image,
so on a slower host the watchdog started a fresh pair of workers every 5 s
and each one lived on as a duplicate. The init script now writes $! like it
does for the cron scheduler and the watchers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
master refreshed the Alpine 3.23 digest and added the python-runtime
stage; this branch moves the same pins to Alpine 3.24 and nginx 1.30.5.
Kept 3.24 and re-resolved every tag to its current manifest-list digest,
so the base images carry the patches master was reaching for.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The image logs a spurious notice on every start:
[notice] 113#113: js vm init njs: 00007F16E1CA0B00
njs logs one line per config VM it initialises (nginx/ngx_js.c) and the
config imports a single VM at the http level, so it is noise rather than
a symptom. njs 0.9.7 removed the line (nginx/njs#1042, nginx/njs#1047),
but nginx:1.29.8-alpine was built six days earlier and ships njs 0.9.6.
nginx:1.30.5-alpine3.24 ships njs 1.0.1.
1.30 is nginx's stable branch: 1.29.8 was the last mainline of that tree
and 1.30.0 the same code a week later. Both branches carry the same-day
CVE-2026-90439 fix, so the move gives up no security fix.
The nginx tag is what forces the Alpine move: each nginx release ships
one Alpine flavour and there is no 1.29.8-alpine3.24. Alpine 3.24 is
supported to 2028-06-01, 3.23 only to 2027-11-01.
Verified: the repo's own config logs the notice on 1.29.8-alpine and
does not on 1.30.5-alpine3.24; mod_zip compiles against release-1.30.5
on the new base; every apk add list in this file resolves on 3.24.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Release builds import a persistent registry cache, and an `apk upgrade` off a
fixed base digest has no changing input, so the layer would be reused from a
previous release and reship its package set.
`no-cache-filters` forces both upgrade stages to run on every release. The
Python-side upgrade moves into its own `python-runtime` stage so that busting
it does not also rebuild the venv and the sigil bindings.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The base images are pinned by digest, so the image ships whatever packages
were current when upstream last rebuilt them. Alpine backports fixes to its
3.23 repo well ahead of that, leaving known-vulnerable curl, openssl,
libexpat, util-linux, libpng and nghttp2 in the published image.
`apk upgrade` in production-stage takes those patches, and the same call in
python-alias keeps the /usr/lib copy from putting stale libs back. The Alpine
digest is also refreshed to 3.23.5, for the builder stages.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The vite plugin parsed the COOP/COEP patterns out of the nginx template at
config load, but the Dockerfile's frontend-build stage copies frontend/
alone, so the config threw ENOENT and the image build failed.
Restate the two patterns in the plugin and let its test assert they still
match the template's map, which also drops the dev container mount that
existed only to feed that read.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The dev server now parses the isolated URLs out of the nginx template
instead of restating them, and refuses a template that yields none.
js-dos skips the runtime preload on the leg it is about to reload away,
records its play session on pagehide, and takes the relaunch marker from
the composable that defines it.
Also drops a redundant parameter and a duplicated derivation from
applyLaunchIntent, collapses the repeated id checks in isLaunchIntent,
gives the js-dos asset bases one home, and trims the comments.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Findings from the review pass over the SPA launch change, plus the two bot
reviews on the PR.
Correctness:
- Presence stops were addressed to the device, not to a rom, so a view that
never announced anything could clear what another tab was playing. A stop now
needs a started session, and happens once; `useActivityPresence` grows the
`stop()` the two call sites were spelling out by hand.
- The EmulatorJS exit read `window.EJS_emulator`, which a departure taken while
the loader was still injecting would not see yet, so the runtime could be left
in a document a later launch then failed to load into. It tracks the injection
itself.
- js-dos resolved its asset base per view: a second launch in a document whose
runtime came from the CDN looked for the payloads locally. Two views mounting
at once could also both inject the runtime. Both now go through one
document-level loader, which resolves with the base it served from and lets a
later mount retry a failed load.
- A blocked sessionStorage threw while every EmulatorJS view was initialising.
Storage that cannot be read is an absent intent, and one that cannot be
written cancels the relaunch rather than losing the selection to it.
- Outside a secure context the headers cannot expose SharedArrayBuffer, so the
reload only delayed the same error by a round trip. It is refused up front.
- The dev server mirrored one of the two nginx isolation entries, leaving the
console player unisolated there.
Reuse and cover:
- `usePlayerExit` owns the whole rule again: `departing` moved in, so both views
use `guard` rather than one of them restating it, and the `leaving` flag it
never needed is gone.
- Resolving an intent back into a selection is a pure pair in `launchIntent.ts`
with its own tests, rather than closures the view kept to itself.
- The Vite plugin is a script beside `precompress`, so the regexes that have to
track nginx are tested.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R1VFUvsR5wYK3axxR1gebc