Commit Graph

351 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
08324e8461 Disable Valkey snapshot write lock for internal cache
Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-06-12 19:24:54 +00:00
Georges-Antoine Assi
21f60b64aa add smol comment 2026-06-06 10:28:02 -04:00
Georges-Antoine Assi
a69f09b7f8 cleanup 2026-06-06 10:24:08 -04:00
Claude
6d533e0a25 fix(docker): declare /romm as single volume to enable asset hardlinks
PR #3388 added hardlink-based asset import/export (os.link with a
shutil.copy2 fallback) to avoid duplicating disk space. The Dockerfile
VOLUME instruction listed each /romm subdirectory (resources, library,
assets, config, sync) separately, which makes Docker create an
independent mount point for each one — even when the user bind-mounts a
single parent at /romm. Each mount point is its own st_dev, so every
cross-directory os.link() failed with EXDEV and silently fell back to a
full copy, defeating the optimization.

Declare the parent /romm directory instead so all subdirectories share a
single filesystem and hardlinks can succeed when paths reside on the same
underlying host filesystem.
2026-06-06 14:20:29 +00:00
Georges-Antoine Assi
619e03ab32 fix: stop serving private user assets via unauthenticated nginx static route
The default Docker image symlinked /romm/assets into the nginx static web
root (/assets/romm/assets), where it was served by an unauthenticated
`location /assets { try_files ... }` block. /romm/assets holds private user
data (save files, save states, screenshots, avatars) that is meant to be
accessible only through the authenticated /api/raw/assets/{path} route
(Scope.ASSETS_READ). The static symlink bypassed that protection, letting any
unauthenticated caller read another user's files given a (guessable) path.
Avatar URLs leaked the hex user ID through the same static route, making path
construction straightforward.

Fix:
- Drop the /romm/assets symlink from the Docker image build and both
  entrypoint scripts; only /romm/resources (public cover art, screenshots,
  manuals) remains statically served.
- Point the frontend avatar URLs at the authenticated /api/raw/assets/ route
  instead of /assets/romm/assets/. Browser <img> loads authenticate via the
  existing session cookie.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 17:34:30 -04:00
Georges-Antoine Assi
d4bc2418a5 Merge pull request #3428 from Spinnich/fix/m3u-crc-non-ascii-filenames
fix(nginx): use Buffer for binary-safe base64 decode in m3u endpoint
2026-05-25 08:34:03 -04:00
Spinnich
e943cc7e2d fix(nginx): use Buffer for binary-safe base64 decode in m3u endpoint
atob() decodes base64 to a JS string, which r.return() then re-encodes
as UTF-8. For filenames with non-ASCII characters (e.g. Pokémon), bytes
above 0x7F get double-encoded — serving different content than what the
backend computed the CRC32 over, causing mod_zip to report CRC failure
on the .m3u file.

Buffer.from(value, 'base64') decodes directly to a byte array and
r.return() sends it verbatim, matching the CRC exactly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 00:16:23 +00:00
Georges-Antoine Assi
354207d683 Drop redundant out_arr reset in otel_prefix
All callers declare a fresh `local -a wrap=()` before invoking, so the
in-function reset is unnecessary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 15:17:42 -04:00
Georges-Antoine Assi
a4f1f516bc Simplify OTEL wrapper helper and fix shell quoting
Collapse `otel_prefix` and `otel_prefix_str` into a single nameref-based
helper. Watchfiles call sites embed the array as a shell-quoted prefix
via `${wrap[*]@Q}`, which also fixes a quoting bug where an
`OTEL_SERVICE_NAME_PREFIX` containing a single quote would produce an
invalid command string and break the watcher.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 14:57:52 -04:00
Claude
f434fde772 Refactor OTEL wrapping into shared helpers
Collapse the duplicated OTEL_SDK_DISABLED / opentelemetry-instrument
branches in run_startup, start_bin_gunicorn, start_bin_watcher, and
start_bin_sync_watcher into two small helpers:

- otel_prefix: emits the wrapper as NUL-delimited argv tokens (for
  direct process invocation).
- otel_prefix_str: emits the wrapper as a shell-string prefix (for
  embedding inside `watchfiles --target-type command`).

Each call site becomes a single command instead of a 2- or 3-way
branch with a fully duplicated command body. As a side effect, the
watcher functions now also gain the `command -v opentelemetry-instrument`
fallback that the gunicorn/startup paths added.
2026-05-24 18:21:40 +00:00
copilot-swe-agent[bot]
84a0dd9ef2 Conditionally disable opentelemetry wrapper during init startup
Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-05-24 14:14:32 +00:00
Georges-Antoine Assi
ba25477a2d changes from bot review 2026-05-17 19:07:57 -04:00
Georges-Antoine Assi
887bdad0ef mark local 2026-05-17 17:52:47 -04:00
Georges-Antoine Assi
3557850701 refactor 2026-05-17 17:52:14 -04:00
Georges-Antoine Assi
51f0522193 undo 2026-05-17 17:39:47 -04:00
Georges-Antoine Assi
ea22b06502 fix(sync): export SYNC_BASE_PATH so the Python child inherits it
The shell fallback was assigned locally but never exported, so
sync_watcher.py and the Python config layer never saw the resolved
value. They happened to land on the same /var/lib/romm/sync default by
coincidence; export it so the shell and Python defaults stay linked
through a single source of truth.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 17:22:54 -04:00
Georges-Antoine Assi
e5c9d0faf7 fix(sync): create SYNC_BASE_PATH at startup before watching
The prod Dockerfile creates /var/lib/romm/sync at build time, but if a
user overrides SYNC_BASE_PATH to a path that doesn't exist (or runs the
dev entrypoint, which never created the default), watchfiles fails to
start because its target directory is missing. Have both entrypoints
mkdir -p the resolved path before handing it to watchfiles.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 14:12:16 -04:00
Georges-Antoine Assi
10d3eb2079 feat(sync): default SYNC_BASE_PATH to /var/lib/romm/sync
Move the sync staging folder out of ROMM_BASE_PATH so it lives on a
dedicated writable mount. This lets the container run with a read-only
root filesystem without losing in-flight save uploads, and keeps
app-owned state separate from the user-curated library volume.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 09:28:39 -04:00
Georges-Antoine Assi
3f52ab616e fix(docker): generate gunicorn logging config to writable /tmp path
The init script ran `sed -i` against /etc/gunicorn/logging.conf, which
fails both on read-only root filesystems and when the container runs
as a non-root UID (since /etc/gunicorn is not chmod'd writable). Copy
the config to /tmp/gunicorn/logging.conf at startup and edit/use that
copy instead, leaving the image file untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 18:14:59 -04:00
Georges-Antoine Assi
faed12e407 remove log-level from rqscheduler 2026-05-08 19:30:43 -04:00
copilot-swe-agent[bot]
681efc6a46 fix: enable COEP/COOP headers for console play route to fix MSDOS games
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/487d4506-1203-499e-afc4-a45ee1f2438b

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-04-20 18:08:38 +00:00
Dang Mai
47eb47a8f1 Small spacing fix 2026-04-17 16:26:24 -07:00
Dang Mai
a5ff6010cd Fix RAHasher prod build 2026-04-17 16:24:31 -07:00
Georges-Antoine Assi
3104a55ae1 update libretro to 1.8.3 in prod 2026-04-16 22:15:06 -04:00
copilot-swe-agent[bot]
80d20eec51 fix: bump RAHasher version from 1.8.1 to 1.8.3 in docker/Dockerfile
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/59aeb3a2-1a8c-47f5-9f90-f6d537765977

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-04-17 01:44:30 +00:00
Georges-Antoine Assi
abc69c790f fix scanning 2026-04-12 09:35:34 -04:00
Georges-Antoine Assi
485b6af0dd fix: wire LOGLEVEL into gunicorn logger level and RQ worker/scheduler
The gunicorn logging config hard-coded level=INFO, ignoring LOGLEVEL.
Patch it at startup via sed. Also pass --logging_level to rq worker
and rqscheduler so their framework logging respects LOGLEVEL.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 10:09:03 -04:00
Georges-Antoine Assi
af2d1f3471 changes from bot review 2026-04-11 09:58:32 -04:00
copilot-swe-agent[bot]
bc9961cfe5 fix: remove dynamic gunicorn logging config generator from init script
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/bdfc3221-ba18-445d-9cf7-f4b495e82577

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-04-11 02:48:15 +00:00
Georges-Antoine Assi
3f9d71f741 run fmt 2026-04-10 22:45:14 -04:00
copilot-swe-agent[bot]
6e2f502b67 fix: use dynamic log level in gunicorn format and add auto-generated comment
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/0b5ef21c-89e1-4f08-b402-03f3276aab08

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-04-11 02:15:01 +00:00
copilot-swe-agent[bot]
d6036cb5ef fix: respect LOGLEVEL env var for all log output sources
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/0b5ef21c-89e1-4f08-b402-03f3276aab08

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-04-11 02:13:20 +00:00
Georges-Antoine Assi
f2e8e337b2 Merge branch 'master' into save-sync 2026-04-05 21:47:53 -04:00
Georges-Antoine Assi
9a6beba18b udpate uv version dockerfiule 2026-04-01 08:30:19 -04:00
Georges-Antoine Assi
f13f929d7d tweaks based on self review 2026-03-14 22:26:53 -04:00
zurdi
d6fae786b0 Increase proxy read timeout to 300 seconds for backend API calls 2026-03-03 23:23:25 +00:00
Georges-Antoine Assi
cccee5ab57 pin nginx to 1.29.5 2026-02-21 12:48:37 -05:00
Georges-Antoine Assi
5f5c7afb7a revert nginx version pin 2026-02-17 15:21:19 -05:00
Georges-Antoine Assi
695a12a21a upgrade some base images 2026-02-16 22:11:47 -05:00
Christian Rehm
91ee163585 fix(watcher): skip opentelemetry-instrument when OTEL is disabled
When OTEL_SDK_DISABLED=true (set automatically when no OTEL_ env vars
are present), the opentelemetry-instrument wrapper does not properly
pass through the WATCHFILES_CHANGES environment variable to watcher.py.

This causes the filesystem watcher to silently fail - watchfiles detects
changes but watcher.py receives an empty WATCHFILES_CHANGES and exits
immediately without scheduling any rescans.

The fix skips the opentelemetry-instrument wrapper when OTEL is disabled,
allowing watchfiles to pass WATCHFILES_CHANGES directly to watcher.py.

Fixes automatic rescan on filesystem change for users who don't configure
OpenTelemetry (the majority of self-hosted deployments).
2026-01-30 23:18:49 +00:00
Georges-Antoine Assi
f40dcb25a6 change it again 2026-01-10 14:32:32 -05:00
Georges-Antoine Assi
53330536e0 change to WEB_SERVER_GUNICORN_WAIT 2026-01-10 14:26:36 -05:00
Georges-Antoine Assi
91ff88a008 Add WEB_SERVER_GUNICORN_RETRIES env var for slow systems 2026-01-10 14:24:31 -05:00
Georges-Antoine Assi
27c83e4736 add config entry to enable netplay 2025-12-08 22:58:48 -05:00
Georges-Antoine Assi
09dbb2e244 use redis to store netplay data 2025-12-07 12:02:35 -05:00
Georges-Antoine Assi
ebe8fac3d7 unupdate dockerfile 2025-11-21 23:44:02 -05:00
Georges-Antoine Assi
8c769a5fe8 hacks with working netplayu 2025-11-21 19:15:20 -05:00
Georges-Antoine Assi
82ca819ab2 start work on netplay endpoints 2025-11-21 11:25:31 -05:00
Georges-Antoine Assi
fad5f7fd23 Bump dockerfile baselayer image tags 2025-10-20 10:56:42 -04:00
Georges-Antoine Assi
7e4e27db62 commit frontend code 2025-10-16 15:40:27 -04:00