Commit Graph

4461 Commits

Author SHA1 Message Date
Michael Manganiello
7e64a02e08 misc: Add MariaDB healthcheck recommendation to Docker Compose config
This commit adds a healthcheck configuration to the MariaDB service in the
Docker Compose example configuration. The healthcheck script is a simple
shell script that checks if the MariaDB server is ready to accept connections.

The application will wait for the MariaDB service to be healthy before
starting the application service. This should solve issues where the
database takes longer to start than the application, and logs some
`Something went horribly wrong with our database` errors.

This change also stops recommending the `linuxserver/mariadb` image as
an alternative. We have had users that change the image because of the
first time run triggering those errors, but the `linuxserver/mariadb`
image requires a different configuration that could be confusing for new
users (e.g. volume mountpoint needs to be `/config` instead of
`/var/lib/mysql`).
2024-11-06 15:00:59 -03:00
Zurdi
277470b74e Merge pull request #1271 from rommapp/fix/details-personal
fix: Personal tab mobile responsive
2024-11-01 02:12:06 +01:00
Michael Manganiello
9f28c9582b Merge pull request #1272 from rommapp/misc/use-tini-as-container-entrypoint
misc: Use tini as container entrypoint
2024-10-31 21:22:08 -03:00
Michael Manganiello
26dcefa9f0 misc: Use tini as container entrypoint
Use tini [1] as the container entrypoint to ensure that the container
process is properly reaped when the container is stopped.

This is needed as the main container command is a shell script.

A simple way to test this change is to:

1. Build the container image and run it using `docker compose up`.
2. Within the same terminal, stop the container using `Ctrl+C`.
3. Verify that the container is properly stopped right away.

Without `tini`, the container takes a few seconds to stop, and it makes
one CPU core to be used at 100% during that time.

[1] https://github.com/krallin/tini
2024-10-30 09:15:02 -03:00
Michael Manganiello
009a436915 Merge pull request #1265 from rommapp/misc/initial-igdb-typehints
misc: Initial addition of IGDB typehints
2024-10-29 13:23:02 -03:00
Michael Manganiello
4f78f3b46e Merge pull request #1264 from rommapp/fix/source-image-manual-match
fix: Show source image on each result for Manual match
2024-10-29 13:22:47 -03:00
Michael Manganiello
6410b6b981 Merge pull request #1263 from rommapp/fix/download-igdb-screenshot-right-aspect-ratio
fix: Download IGDB screenshots with right aspect ratio
2024-10-29 13:22:36 -03:00
Michael Manganiello
2ff37f268d Merge pull request #1261 from rommapp/fix/broken-igdb-age-rating-image-links
fix: Broken IGDB age rating image links
2024-10-29 13:22:25 -03:00
Michael Manganiello
e79ff38ce0 Merge pull request #1260 from rommapp/fix/tar-decompression-only-consider-files
fix: Make tar decompression only consider regular files
2024-10-29 13:22:13 -03:00
zurdi
43e9365c7b fixed margin for personal tab 2024-10-29 15:40:49 +00:00
Michael Manganiello
4bb5cb5149 misc: Initial addition of IGDB typehints
The short-term goal is to completely typehint the IGDB API responses. This
first change adds the base structures and enums RomM currently uses.

The `ExpandableField` type will allow us to model the expansion
mechanism the IGDB API provides, where a field can include either an ID,
or the full nested structure.
2024-10-27 00:02:01 -03:00
Michael Manganiello
1c7880b4e2 fix: Show source image on each result for Manual match
The source image was not being shown on the results of the manual match
dialog, because scrapper image names do not match the source names. To
avoid this issue, the `MatchedSource` type was updated to include a
`logo_path` property, which will be used to set the correct image path.
2024-10-26 21:35:14 -03:00
Michael Manganiello
752096451e fix: Download IGDB screenshots with right aspect ratio
The IGDB API provides screenshots in a 1280x720 resolution, when either
`screenshot_huge` or `720p` size values are used [1]. The
`screenshot_huge` uses `Lfill`, while `720p` uses `Fit` as the resizing
method.

That means that either `screenshot_huge` or `720p` will provide the
correct aspect ratio for 16:9 platforms. However, for platforms with a
different aspect ratio, we need to use the `720p` size value to get the
correct image instead of a cropped one.

Example:
- [`screenshot_huge`](https://images.igdb.com/igdb/image/upload/t_screenshot_huge/c77bodnkwu73gs2jwhw4.jpg)
- [`720p`](https://images.igdb.com/igdb/image/upload/t_720p/c77bodnkwu73gs2jwhw4.jpg)

[1] https://api-docs.igdb.com/#images
2024-10-26 18:26:00 -03:00
Michael Manganiello
0190566530 fix: Broken IGDB age rating image links
Some of the image links for IGDB age ratings were broken. This commit
fixes all of them.
2024-10-26 01:19:57 -03:00
Michael Manganiello
8fd680ab84 fix: Make tar decompression only consider regular files
The `tar` decompression function was failing for some users, with error
message:

```
'NoneType' object does not support the context manager protocol
```

As explained in the official documentation [1], the `extractfile` method
returns `None` if the member is not a regular file or a link. This
change skips any member that is not a regular file.

[1] https://docs.python.org/3/library/tarfile.html#tarfile.TarFile.extractfile
2024-10-26 01:07:27 -03:00
zurdi
c41e8ec40f fixed rom personal details on mobile 2024-10-25 16:19:53 +00:00
Zurdi
373757e3ad Merge pull request #1254 from rommapp/feature/enable-config-exclusions-from-UI
feat: Enable editable exclusions from webUI
2024-10-25 09:22:17 +02:00
zurdi
8b11bff131 Merge remote-tracking branch 'origin/master' into feature/enable-config-exclusions-from-UI 2024-10-25 07:08:25 +00:00
Zurdi
c6cf605393 Merge pull request #1256 from rommapp/docs/update-readme-preview
docs: Updated readme preview
2024-10-25 09:06:32 +02:00
Michael Manganiello
cc20e847fd Merge pull request #1247 from rommapp/misc/scope-enum
misc: Create enum for authorization scopes
2024-10-25 00:06:43 -03:00
zurdi
a4fd446c9a added typeguard for exclusion keys 2024-10-24 23:47:20 +00:00
zurdi
12cb76ccf1 reverted test changes 2024-10-24 17:50:26 +00:00
zurdi
c78a5f5f0b tweak edit rom dialog 2024-10-24 17:42:53 +00:00
zurdi
f33996c19a removed unused logs 2024-10-24 17:07:13 +00:00
zurdi
764533144c fixed visual bug when adding platform version 2024-10-24 17:03:57 +00:00
zurdi
c44b27f25b added add and remove features to the frontend + backend 2024-10-24 16:58:46 +00:00
zurdi
d1faaad05a updated readme preview 2024-10-24 15:43:19 +00:00
zurdi
a7e17892d1 added actions buttons to exclusion dialog 2024-10-24 15:39:23 +00:00
zurdi
56270e62f9 fixed exclusion tests 2024-10-24 12:19:09 +00:00
zurdi
310d51fc21 added 'add exclusion' endpoint and enabled UI 2024-10-24 10:13:41 +00:00
Michael Manganiello
beeb9f0c31 misc: Create enum for authorization scopes
Instead of using just strings, this change converts the scopes to a
`StrEnum`, to be compatible with places where a string is expected. This
avoids typos when using these scopes, simplifies searching for usages,
and improves type hints.

An extra change was the fix to the Firmware download endpoint, which
wasn't respecting the `DISABLE_DOWNLOAD_ENDPOINT_AUTH` flag.
2024-10-18 23:57:42 -03:00
Michael Manganiello
fc8cbb7226 Merge pull request #1242 from rommapp/fix/simplify-query-to-validate-username-exists
fix: Simplify query that validates new username already exists
3.6.0-rc.1
2024-10-14 20:49:15 -03:00
Georges-Antoine Assi
5b73c4e6cb Merge pull request #1236 from yuri-becker/feature/configurable-upload-timeout
#1228 Configurable upload timeout
2024-10-14 16:37:26 -04:00
Georges-Antoine Assi
4dd82a9b72 Merge pull request #1243 from drcursor/patch-1
Update variables to MariaDB
2024-10-14 15:08:06 -04:00
Eduardo Balsa
fb7bfe74f1 Update docker-compose.yml
Added comment directing people. to the example docker compose file. Changed variables to MARIADB as we are using the MARIADB container
2024-10-14 20:20:06 +02:00
Eduardo Balsa
48f198cbef Update docker-compose.example.yml
Switched to MARIADB variables as we are using the MARIADB container
2024-10-14 20:15:25 +02:00
Michael Manganiello
eba2971ffb fix: Simplify query that validates new username already exists
Instead of fetching all users and checking if the new username is present
in the list, we can directly query the database for the username.
2024-10-14 01:10:31 -03:00
Michael Manganiello
2a24f5f128 Merge pull request #1241 from rommapp/fix/avoid-query-add_user-at-import-time
fix: Avoid query during import time to set add_user endpoint scopes
2024-10-14 00:43:07 -03:00
Georges-Antoine Assi
72182b9f22 Merge pull request #1240 from alisci01/add-offset-to-get-roms-endpoint
Add offset parameter to get_roms endpoint
2024-10-13 22:31:14 -04:00
Michael Manganiello
1df27079c4 fix: Avoid query during import time to set add_user endpoint scopes
The `add_user` endpoint was querying the database at import time, to
decide whether to enforce the `users.write` scope or not. This is
problematic because the database might not be ready at import time.

Also, the decided `scopes` was being maintained for the entire
application lifetime, which is not ideal, as users can be created
without having the `users.write` scope, until the application is
restarted.
2024-10-13 22:27:14 -03:00
Michael Manganiello
4c5221916d Merge pull request #1237 from rommapp/misc/upgrade-ralibretro-1.8.0
misc: Upgrade RALibretro to v1.8.0
2024-10-12 18:32:47 -03:00
Michael Manganiello
d35f772395 Merge pull request #1239 from rommapp/fix/avoid-image-requests-to-undefined.ico
fix: Avoid image requests for undefined.ico platform icon
2024-10-12 13:34:39 -03:00
Michael Manganiello
a594eff413 Merge pull request #1238 from rommapp/fix-save-small-artworks
fix: Correctly resize and save small artwork
2024-10-12 13:34:30 -03:00
Michael Manganiello
c91611fe99 Merge pull request #1234 from rommapp/fix/scanning-skip-if-already-scheduled
fix: Skip scanning task by checking against the correct function name
2024-10-12 13:17:22 -03:00
Michael Manganiello
ae9939ded8 Merge pull request #1235 from rommapp/fix/improve-redis-url-handling
fix: Improve handling of Redis URL
2024-10-12 13:17:07 -03:00
Yuri Becker
eb6a48eb3a Use seconds for UPLOAD_TIMEOUT 2024-10-12 12:50:56 +02:00
Ali Scissons
5acbdfdf8b add offset parameter to get_roms endpoint 2024-10-11 23:28:30 -05:00
Michael Manganiello
1127cf9065 fix: Avoid image requests for undefined.ico platform icon
when a platform slog is not present in `PLATFORMS_VERSIONS`, which is
the common case overall, the component was trying to fetch an
`undefined.ico` image.

Instead of that, we should check if the platform slug is present in
`PLATFORMS_VERSIONS` and if not, fallback to the platform slug itself.
2024-10-12 01:25:03 -03:00
Michael Manganiello
a9ac322618 fix: Correctly resize and save small artwork
The previous implementation was calling `resize_cover_to_small` within
the context manager that was writing the image to the filesystem. This
was causing `PIL` to raise an error because it could not identify the
open and temporarily created file as a valid image.

Instead of saving the original image to the filesystem and then resizing
it, we now open the image in memory, resize it, and then save it to the
filesystem. We also avoid reading the `BytesIO` object twice by saving
small and big images from the same initial `Image` object.

Fixes #1191.
2024-10-12 00:55:06 -03:00
Michael Manganiello
b59411ccb7 misc: Upgrade RALibretro to v1.8.0 2024-10-11 22:45:05 -03:00