Sixty seconds cut off extraction of mid-sized disc images, so their scan
fell back to hashing the archive itself.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- no-color-literal: scan declarations after nested blocks, skip nested
selectors and quoted strings.
- no-layout-media-query: allow the Media Queries 4 `or` keyword.
- no-emdash-in-comment: bound each search to its comment.
- Primitive import limits also cover the `@v2/` alias, `@/locales`, and
`@/plugins/router`, and skip `*.spec.ts`.
- block-order puts scoped styles before unscoped ones.
- no-emdash (Trunk) points Python columns at the comment and treats .mdx
as Markdown.
- Drop stale ESLint ignores and the unused sfc() lang parameter; update the
scripts table in FRONTEND_ARCHITECTURE.md.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Move connect-time user resolution and login-session binding into
SocketHandler.authenticate, shared by the /ws and netplay servers.
- Add SocketHandler.get_session and drop the per-module copies.
- Fold disconnect into leave-room, and the user load into the ROM gate.
- Read the room password only from the field EmulatorJS sends.
- Close both servers' sockets for a revoked session concurrently.
- Correct the join-room password rule in the architecture doc.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Bind netplay sockets to their login session, keying the socket set per
channel so revoking a session closes sockets on both servers.
- Read the room password from the top-level field EmulatorJS sends, and
compare it in constant time.
- Namespace Socket.IO room names so a room id cannot collide with a sid.
- Refuse a duplicate player id on join, and leave the current room before
opening or joining another.
- Coerce client-supplied maxPlayers and names, and store the resolved ROM id.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Pasting a service's own URL (a Discord webhook's) or an Apprise URL
in the channel dialog fills its fields in as soon as it's pasted, or
says why it can't. POST /api/notification-channels/apprise-services/parse
instantiates the plugin and matches the URL Apprise writes for it
against the service's templates, so it works for every service; a new
channel moves to the service the URL is for.
- A failed delivery's error carries the start of the service's reply
after Apprise's warning, so a 400 says why (Discord refuses a bot name
containing "discord"). Apprise's log stays out of the server log.
- Setup guides link Apprise's wiki instead of appriseit.com.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Name what the helpers return: checked_fields gives back the fields to
keep, _defuse_mentions breaks up pings.
- Declare AppriseFieldValue as an explicit TypeAlias, which mypy under
trunk needs to use it in annotations.
- Trim the comments that restated a field list or defended a limit, fix
the Apprise type's comment still describing a single URL, and split
the dense channels paragraph in the architecture doc.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Leave FCM out of the catalog: its keyfile token makes Apprise open a
local path or fetch a URL itself.
- Treat credential-named tokens as secrets even when Apprise doesn't
(Mastodon, Misskey, Plivo, SMSEagle, LaMetric, Rocket.Chat, a JSON
path), and hide any secret left in the masked target or in the
errors that reach last_error and the logs.
- A secret left out of an edit keeps its value, an empty one removes it,
and a kept secret no longer follows the channel to another host,
port, schema, SMTP server or ntfy mode. The form offers "Remove it"
for stored secrets and names them through `stored_secrets`.
- Break up @everyone, @here and <@…> so a notification pings nobody, as
the removed Discord payload did.
- Keep only the fields the service takes, cap lists at 20 items, and
accept only a hostname or address as a host.
- Give the channel test the same 60 s budget as a queued delivery, and
build the service catalog response once per process.
- Don't require a stored secret list (Bark) again on edit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Forward notifications to any of the 100+ services Apprise reaches instead
of the two hand-coded webhook formats. The channel form lists every
Apprise service with the fields it takes, and the backend builds the
Apprise URL from them.
- New `apprise` channel type, admin only: Apprise opens its own
connections, past the SSRF guard. The owner's role is checked again at
every delivery.
- GET /api/notification-channels/apprise-services describes each service
from Apprise's plugin details: URL tokens as fields, options as
advanced fields. A field is required only when every URL template
needs it.
- A channel stores the service and its fields sealed; the URL is built
from the template those fields fill at each send. Local schemas, the
options that read files and the ones RomM sets are never offered.
Apprise follows no redirects, does not retry and its timeouts are
capped.
- The RomM JSON webhook keeps its payload and HMAC signature; its
Discord and ntfy formats go, Apprise covers them. Email is unchanged.
- The v2 dialog picks the type from one searchable list and renders the
service's fields, options folded under "Advanced options".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The kiosk guest may PROPFIND the root and browse or download under
roms/, as it can in the web UI. The manifest, saves, states, blobs and
OPTIONS still challenge it, so RetroArch sends credentials.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Rewrite the RetroArch Cloud Sync architecture section: add the PSP,
kiosk, size cap and missing-file behavior, drop the stale hash note
- Document SYNC_RETROARCH_PSP_SERIAL_MAP in env.template and the env table
- Trim two docstrings and reuse CLIENT_DEVICE_IDENTIFIER for the device type
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
FSRetroArchSyncBlobHandler becomes FSRetroArchSyncHandler, and
SYNC_RETROARCH_BLOB_BASE_PATH becomes SYNC_RETROARCH_BASE_PATH, stored
under /romm/retroarch_sync.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Each manifest.server fetch creates the user's RetroArch device if it is
missing, or bumps its last_seen, so RetroArch shows up alongside the
user's other devices. RetroArch's requests carry no install identity, so
it is one device per user, deduped on client_device_identifier.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The manifest protocol is RetroArch's own, so name it after RetroArch
rather than its WebDAV transport, and group it with the existing sync
code: endpoints/sync/ becomes a package with the RetroArch router as a
subroute, and the handlers move under handler/sync/retroarch/. Settings
move into the SYNC config section as SYNC_RETROARCH_*.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Group the handler modules under handler/webdav_cloud_sync/ (sync_handler,
psp, emulator_names, browser) and rename the endpoint, blob handler, tests,
config settings, storage folders and cache keys to match. The route moves
from /api/cloud-sync to /api/webdav-cloud-sync.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Bound /api/cloud-sync uploads with the asset size limit
- Cap PSP bundle member count and uncompressed size
- Keep PSP writes and deletes on the existing bundle row, one member at a time
- Match PSP bundles by exact folder, support the no-core-folder layout
- Reject . and .. PSP segments; map parse_sfo struct errors and write
errors to 4xx
- Require ROMS_READ for roms/ browsing
- Clear missing_from_fs on overwrite
- Resolve state screenshots by exact name, never a gallery screenshot
- Round-trip unknown core folder names exactly
- Keep + allowed in the shared sanitizer, strip it only on ROM rename (#2746)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- PUT /collections/{id}/visibility and /collections/smart/{id}/visibility
flip is_public alone. The settings switch used the full update, which
rewrote membership from the client's rom_ids and ran the cover branch.
- update_save, update_state and update_screenshot derive the file-name
columns from file_name, like update_rom does for fs_name, so the rename
path hands them a name instead of building the columns itself.
- Name fields use notBlank, AssetEditDialog picks its own title from its
type, ScreenshotEditDialog shares one canSubmit, the collection tile and
row drop a virtual guard their callers already cover, and PublicBadge
uses the pill radius token.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Saves and states could only be renamed by downloading, renaming and
uploading them again (#2653).
Backend: PUT /api/saves/{id}/file-name and PUT /api/states/{id}/file-name
rename the file on disk and the row, and take the auto-captured thumbnail
along so it stays bound by stem. A name another save/state of the ROM
holds, or one that would bind another screenshot, is a 409. Renaming
keeps updated_at, like the other annotations, so device sync does not
see a new version.
Frontend (v2): the Save data tab's per-row actions are now download,
edit, favorite and delete. Edit opens one form with the file name (stem
preselected), labels and visibility; a taken name is flagged in the
field. Public saves and states carry the same globe badge as shared
screenshots. RTextField now puts `autofocus` on its native field, which
is what RDialog looks for, so autofocused fields in dialogs get focus
instead of the close button.
Fixes#2653
Co-Authored-By: Claude Opus 5.5 <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>
Trim comments to what the code can't say, type the remaining test
fixtures, and document the audit_events table, GET /api/audit-events
and the cleanup_audit_log task in the backend architecture guide.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Bound a webhook delivery: 15 s in all, and only the first KiB of a
refusal's body is read, so a hostile endpoint can't hold the API or a
worker with an endless or slow reply.
- Key the confirmation-code cooldown per user and per address instead of
per channel, which a delete and re-create reset, so a user can't mail
an address without limit.
- Don't carry a stored secret to another origin or format: it has to be
given again (Discord, which uses none, drops it), so a changed URL
can't be used to read an ntfy token or HMAC key.
- Refuse a webhook URL whose port isn't a number; one got saved and then
broke the channel list with a 500.
- Refuse an unknown SMTP_SECURITY instead of logging in over plaintext.
- Tell the reset form whether reset links are really emailed, which also
needs a shareable ROMM_BASE_URL (heartbeat NOTIFICATIONS.EMAILS_RESET_LINKS).
- Say a code went out only when the address is new to the channel.
- Match a channel's address whole, so a trailing newline isn't kept.
- Test that forgot-password answers alike and sends the link afterwards,
and document the new cache keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit carried only the renames of this change, when staging
the rest failed on a path the rename had already moved. This is the change
itself.
A reset link only ever went to the server log, for an admin to pass on. It
now goes to the user's email address when SMTP is set up, the user has one
and ROMM_BASE_URL is shareable, falling back to the log otherwise or when the
server refuses the message. The link is built from ROMM_BASE_URL alone, never
the request's Host, so a forged header can't aim it at another server; it
goes out after the response, so its timing doesn't reveal whether the
username exists; and a user's inbox gets at most one a minute.
The SMTP sender moves from the notification channels to
handler/email_handler.py now that it has a second caller. The v2 reset form
says the link is on its way when the server sends email.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Trims the comments the earlier passes left long or unwrapped, and documents
the shared `socket_handler.emit_to_user` and the netplay channel split in
the backend architecture notes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Notifications could only come from backend code, and only in the kinds the
web client knows how to translate. Anyone can now send one that carries its
own text.
- A notification can carry its own title, body, icon and in-app link. RomM's
own kinds stay translated; `custom` and any other kind (`argosy.sync_done`)
is shown with its own content.
- POST /api/notifications: anyone with me.write notifies themselves; an admin
can also notify user ids, `admins` or `all`, and is shown as the sender.
RomM's own kinds are reserved, links must stay inside RomM, and `data` is
capped at 4 KB.
- notify()/notify_admins() accept the same title/body/link/icon.
- Frontend: `snackbar.success(msg, { persist: true })` (or
`{ persist: { body, link } }`) also keeps the message in the inbox. The
first of the request's answer or the socket push shows the toast, so it
appears once.
- Documented in BACKEND_ARCHITECTURE and the backend and frontend skills.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-ups on the authorization work.
The listing carried its own copy of the ROM visibility decision. The shared
`assert_rom_visible` already masks a hidden ROM as a missing one, so the route
uses that instead and a private duplicate disappears. Hidden and unknown ids
now answer 404 rather than `200 {}`, which the in-tree client already maps to
no rooms.
The socket module's docstrings are cut to the one sentence each that carries
something the code does not, and the new test helpers are typed, which also
drops an unused `sid` argument from every call site.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The connect-time identity was cached for the life of the socket, so an
account disabled afterwards kept its access until it disconnected. The
signal relay trusted the room id stored on the session, which a departed
socket still carried, so it could keep injecting offers into the room it
had left, and the game data relay had the same stale room. The room
listing answered for asset-read tokens, though what it discloses is
ROM-scoped.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The netplay namespace served /netplay/socket.io with no identity at all: any
client, from any origin, could open a room, join one, and relay WebRTC signals
to any socket id it named, with the ROM id and the player identity supplied
entirely by the client.
The socket now resolves its user from the session cookie once, at connect, into
the server-side socket session, the same way the main /ws namespace does.
open-room requires that user to hold roms.read and to be allowed to see the
ROM being played, which is the gate the ROM endpoints apply. join-room accepts
an anonymous client only when it supplies the room password the owner set, the
invite path a guest uses; otherwise it applies the same ROM gate. WebRTC
signals relay only to peers of the caller's own room.
The connect handler never refuses a connection, so guest joins keep working.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Keep `typecheck` to vue-tsc and move the tsconfig.node.json pass to
`typecheck:scripts`, run as a separate CI step so a failure names the
pass that broke. Drop the JSON-invalid comments from tsconfig.node.json.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dpdm cannot resolve or parse Vue SFCs, so it saw none of the ~519
components: `.vue` imports were dead ends and the graph stopped at the
first one. `import-x/no-cycle` runs on the ESLint config that already
parses `.vue` with type awareness, and Trunk already runs ESLint in CI,
so the check needs no separate tool, config file or CI step.
Lazy route components make the router reachable from the views it
renders, so dynamic edges are excluded; without that the rule reports
390 files instead of the real 3. Those 3 are the frozen-v1 `src/console`
cycles dpdm also found, so the two tools agree on today's graph and the
swap is not a cleanup.
Drop the `circular` script, `dpdm.config.ts`, the `@dpdm-ignore`
directive and dpdm itself.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
code-review pass.
dpdm cannot parse Vue SFCs, so the four entry points only reached 133 of
the frontend's modules: every `.vue` import was an unresolved dead end and
traversal stopped there. Make every `.ts` module an entry instead, which
brings the analysed graph to 771 modules. Frozen v1 `src/console` is carved
out because it still holds cycles we are not refactoring.
Take `ROUTES` and `isAuthExemptRoute` from the leaf module statically, and
keep only the router instance lazy. Guard the dynamic import so a failed
chunk load still rejects with the original AxiosError.
Move the `getDownloadPath` tests next to the module that now owns them.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A session whose heartbeat went stale was only torn down when a new claim
found every container of its platform held, so a player who left without
the pagehide release landing kept the emulator running. A scheduled task
now sweeps every configured container and hands stale sessions to the
existing abandoned-session teardown, which is made public for it.