Commit Graph

44 Commits

Author SHA1 Message Date
Sam Dornan
4ffc7c5ce1 style: apply the formatting requires-python already implies (#4638) 2026-09-19 12:33:45 -04:00
zurdi
5f02a99fd3 fix: trust the repo root as a safe directory for git branch lookup
Addresses Copilot review feedback on PR #4617.

The Docker dev image's bind-mounted .git is host-owned while the
romm-dev container runs as root; git 2.35.2+ refuses that mismatch
as "dubious ownership" and rev-parse fails, so GIT_BRANCH silently
stayed null and the UI kept showing "development" in the very
workflow the mount was added for. Pass safe.directory scoped to
this one read-only invocation instead of touching global git config.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TDMqXzXexRgC89YxeNjn9q
2026-09-18 13:29:38 +02:00
zurdi
2f2230924d fix(ci): suppress bandit B404/B607 on get_git_branch's subprocess call
Trunk Check failed on the PR: bandit flags importing subprocess
(B404) and invoking "git" by name instead of an absolute path
(B607), on top of the B603 shell=False call already suppressed.
Both are accepted here for the same reason B603 was: git is
resolved from PATH by design so this works across dev setups
(Docker and bare-metal alike), and the arguments are hardcoded.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TDMqXzXexRgC89YxeNjn9q
2026-09-18 13:22:15 +02:00
zurdi
b21d4e2693 review(code-review xhigh --fix): keep About reactive, fix branch URL encoding
- AboutDialog's links list was a static array read once at setup, so it
  never picked up a later heartbeat update; made it a computed.
- useVersionDisplay's GitHub tree link blanket-encoded the branch name,
  breaking "/" as a path separator (e.g. "feature/foo"); now encodes
  each segment. Deduped the dev-build/branch check into one computed.
- Trimmed two over-long comments/docstrings per house style.
- Added coverage: a CalledProcessError case for get_git_branch, and a
  full test file for useVersionDisplay.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TDMqXzXexRgC89YxeNjn9q
2026-09-18 13:06:25 +02:00
zurdi
5440c9f03b feat(about): show current git branch instead of "development"
Local checkouts have no release tag, so heartbeat.SYSTEM.VERSION always
falls back to the literal string "development". Add a GIT_BRANCH field
(backend-resolved via git, display-only, not used in the version string
that also feeds outbound User-Agent headers) and use it in the About
dialog and the auth-screen VersionTag so a dev build shows the branch
being worked on instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TDMqXzXexRgC89YxeNjn9q
2026-09-18 12:51:00 +02:00
Georges-Antoine Assi
45c8a1057f fix(metadata): guard every scene id parse against the int() digit limit
CPython's int() raises past 4300 digits. The bare-digit branch of
scene_id_or_none already caught that, but the URL parsers, the filename
tag extractors and the Pouet 302 Location parser all called int() on an
unbounded (\d+) capture, so a pasted URL or a scanned filename carrying a
long digit run surfaced as a 500.

Promote pouet_handler's private _int_or_none to utils.int_or_none, next
to valid_youtube_id, and route every scene id conversion through it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 21:23:49 -04:00
Georges-Antoine Assi
f353f3c1fe fix(metadata): cap every provider read and validate embedded video ids
Move the response cap onto MetadataHandler as _fetch_capped and route
Demozoo, Pouet, and CSDb through it. Only CSDb was capped before, while
Demozoo and Pouet read an unbounded body into memory before decoding it.
Pouet's title search now streams too: an ambiguous title answers 200 with
HTML we never parse, but the body was still being buffered.

Validate youtube_video_id where it is read rather than where Demozoo
parses it. The four metadata blobs it reads from are writable through the
raw_*_metadata form fields, so the id reaching the embed URL never had to
come from a provider, and IGDB and LaunchBox never checked it at all.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 21:15:50 -04:00
Georges-Antoine Assi
ad5525c484 [ROMM-2547] Flashpoint scrape by ID 2025-10-18 22:18:42 -04:00
Michael Manganiello
7dc7eea34d feat: Initial Sentry support
This change initializes the Sentry SDK, which enables error tracking
when the `SENTRY_DSN` environment variable is set.

Drop-in alternatives to Sentry are also supported, like GlitchTip.
2024-12-27 17:03:45 -03:00
Georges-Antoine Assi
7635bbeac2 run trunk fixes 2024-05-24 16:59:54 -04:00
Georges-Antoine Assi
f73a6f48b9 more refactoring 2024-05-23 21:13:17 -04:00
Georges-Antoine Assi
6d3bcff4f1 move files to utils 2024-04-03 22:33:41 -04:00
Zurdi
4b9e76f550 backend structure refactor 2024-01-12 23:44:27 +01:00
Zurdi
06d041fa30 catch timeout from check new version 2024-01-10 15:17:51 +01:00
Zurdi
5b51bb150f generated new types 2024-01-09 21:40:19 +01:00
Georges-Antoine Assi
5762270f62 Merge branch 'master' into romm-55 2024-01-09 13:06:51 -05:00
Zurdi
cda45e6d9c Merge remote-tracking branch 'origin/master' 2024-01-09 16:26:43 +01:00
Zurdi
eea7e41940 docstrings added to endpoints + organized imports + formatted code 2024-01-09 16:22:31 +01:00
Georges-Antoine Assi
6d5ef25c17 Hotfix excluding files with no extensions 2024-01-09 09:39:51 -05:00
Zurdi
1641e6bd16 timeout to check new version added 2024-01-09 09:57:29 +01:00
Zurdi
4dd35e9e40 check if new version is available 2024-01-09 01:15:17 +01:00
Georges-Antoine Assi
3767401075 Merge branch 'master' into romm-55 2023-12-28 13:46:08 -05:00
Georges-Antoine Assi
c6566bb89c Merge branch 'master' into romm-55 2023-12-28 13:17:46 -05:00
Zurdi
070b23ba23 show configured custom platforms in the settings section 2023-12-27 13:10:50 +01:00
Zurdi
808279b2cd get branch_name and version from backend 2023-12-13 10:43:00 +01:00
Georges-Antoine Assi
43816783a7 Hotfix subtag parsing 2023-12-12 08:26:18 -08:00
Georges-Antoine Assi
08fbae26f7 Merge branch 'master' into romm-55 2023-12-06 21:18:40 -05:00
Georges-Antoine Assi
be0b36c439 Multi lang and multi region support 2023-12-03 11:27:35 -05:00
Georges-Antoine Assi
f560d03b86 Get saves and states loading 2023-11-14 00:00:33 -05:00
Georges-Antoine Assi
f7df912e20 Finish scanning for saves/states 2023-11-13 13:02:54 -05:00
Georges-Antoine Assi
1967879f0c Models for saves and states + scannig 2023-11-13 00:09:38 -05:00
Georges-Antoine Assi
a3a1eb9323 Fix tests 2023-11-04 23:39:41 -04:00
Georges-Antoine Assi
015e5927d6 Less extensive multi extension regex 2023-11-04 23:12:40 -04:00
Georges-Antoine Assi
197f26dabc Use the same regex in file 2023-09-21 20:17:30 -04:00
Georges-Antoine Assi
3bda51c29d Fix tests + regex issue 2023-09-21 10:39:39 -04:00
Georges-Antoine Assi
a9c9d658bb Aggressive removal of file extensions and tags 2023-09-21 09:30:02 -04:00
Georges-Antoine Assi
d830ea531d Add docs for running tests 2023-08-02 09:48:20 -04:00
Georges-Antoine Assi
355d3c7f35 Add tests for utils init 2023-08-01 10:14:06 -04:00
zurdi
753ff6f6f4 regions ordered and formatted 2023-07-31 13:39:12 +02:00
zurdi
fa4ba50ea3 improved region tag detection when using 'reg-[shortcode]' 2023-07-31 13:15:30 +02:00
Georges-Antoine Assi
324c61dfb0 Even more robust tag detection 2023-07-29 11:04:12 -04:00
Georges-Antoine Assi
6f8fc6afed Improved tag detection and support 2023-07-28 19:45:58 -04:00
Georges-Antoine Assi
99afbc8f3f Refactor socket connections 2023-05-18 17:34:45 -04:00
Georges-Antoine Assi
917dbc3295 Rewrite dev setup, switch to poetry and refactor folder strucutre 2023-05-08 19:01:21 -04:00