303 Commits

Author SHA1 Message Date
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
Georges-Antoine Assi
0d357d59e5
[ROMM-2470] Skip bind IPV6 if IPV4_ONLY is true 2025-10-07 09:07:30 -04:00
Georges-Antoine Assi
3d698c06b1
make gunicorn a warn not an error 2025-10-02 16:41:03 -04:00
Georges-Antoine Assi
e2d7e73ed4
Use uppercase loglevel check in init script 2025-09-29 08:45:55 -04:00
Georges-Antoine Assi
c4d8450009
fix typo 2025-09-18 17:01:28 -04:00
Georges-Antoine Assi
873b59c951
use non-slim nginx 2025-09-18 15:30:04 -04:00
Georges-Antoine Assi
b0c37c193f
drop setting user 2025-09-18 14:44:23 -04:00
Georges-Antoine Assi
f1750951cf
install devs deps to build images 2025-09-18 11:45:38 -04:00
Georges-Antoine Assi
536a5dd3dd
atempt fix ralibretro 2025-09-18 11:38:39 -04:00
Georges-Antoine Assi
1a41190fb8
add NGINX_VERSION to local 2025-09-18 11:28:29 -04:00
Georges-Antoine Assi
57e488d8b4
copy from uv image direct 2025-09-18 10:58:47 -04:00
Georges-Antoine Assi
d91be2c16a
first attempt to fix build failure 2025-09-18 10:34:50 -04:00
Georges-Antoine Assi
90fc571eb4
Use hashes for each later + set USER 2025-09-18 09:46:36 -04:00
Michael Manganiello
0f0d1a1903
fix: Remove mod_zip workaround for upstream subrequests to internal locations
Related `mod_zip` issue https://github.com/evanmiller/mod_zip/issues/90
has been fixed in commit
288d66541c

By upgrading `mod_zip` to include this fix, we can remove the workaround
that involved using a separate internal location and server to serve
files for zipping.
2025-09-11 18:24:12 -03:00
Michael Manganiello
8c52b7828b
feat: Add COEP and COOP headers for EmulatorJS within Nginx config
The COEP (Cross-Origin Embedder Policy) and COOP (Cross-Origin Opener
Policy) headers are needed by EmulatorJS to use the `SharedArrayBuffer`
feature, and enable multi-threaded cores.

These headers are only being set by Nginx for responses to requests
made to the EmulatorJS player path. This is because cross-origin
isolation breaks other features in the application (such as YouTube
embeds), so we only want to enable it for the EmulatorJS player.

It's important to mention that this change does not work when `DEV_MODE`
is set, as we would need Vite server to also set these headers in that
case. This could be implemented separately, if needed.

These changes are not enough to enable multi-threaded cores in the
frontend. Because our application is a SPA, we also need to ensure
that navigation to the EmulatorJS player path results in a full page
reload, so that the cross-origin isolation can be applied. This will be
handled in a separate PR.
2025-08-31 21:43:32 -03:00
Georges-Antoine Assi
2bf87e7425
Merge branch 'master' into console-mode 2025-08-29 13:07:05 -05:00
Georges-Antoine Assi
798ffa31b3
switch names to WEB_SERVER_ 2025-08-26 23:53:55 -04:00
Georges-Antoine Assi
a4a714475f
changes from review 2025-08-26 23:11:16 -04:00
Georges-Antoine Assi
e32e51a1e2
use correct arguments 2025-08-26 19:11:39 -04:00
Georges-Antoine Assi
603f6ec5af
Add options to gunicorn call 2025-08-26 18:16:52 -04:00
Georges-Antoine Assi
3075ffeab4
centralize routes 2025-08-25 13:25:34 -04:00
Georges-Antoine Assi
a1519a4b05
Make default ROMM_AUTH_SECRET_KEY consistent between workers 2025-08-15 12:46:46 -04:00
Michael Manganiello
6e7edd2b89
misc: Upgrade Ruffle to v2025-08-14 2025-08-15 12:16:34 -03:00
Michael Manganiello
eaad91422a
fix: Disable OpenTelemetry integration if not configured
OpenTelemetry tries to send traces to a default `localhost:4317`
endpoint if no configuration is provided, which is not what we want if
users don't configure OpenTelemetry explicitly.

This change sets the `OTEL_SDK_DISABLED` environment variable to
`true` if no `OTEL_` prefixed environment variables are found, which
disables the OpenTelemetry SDK.
2025-08-14 09:45:04 -03:00
Michael Manganiello
80291f4be1
misc: Move cache initialization to startup script
Guarantee that cache is initialized during startup, and only once,
instead of every time a `MetadataHandler` object is instantiated.

Also, improve logic to determine `fixtures` paths.
2025-08-13 12:26:15 -03:00
Michael Manganiello
63f84b78d5
misc: Create startup script to run initial tasks before main application
For steps that need to run before the web application starts, such as
scheduling tasks, this new `startup.py` script is introduced.

This fixes a recently introduced issue where task scheduling was not
being triggered, because of it being included in the
`if __name__ == "__main__":` block, which is not executed when
the application is run by Gunicorn in production environments.

We do not include this logic as part of FastAPI's lifespan
implementation, as running multiple workers with Gunicorn would
cause this logic to be executed multiple times.
2025-08-12 23:14:26 -03:00
Michael Manganiello
f95e0edff4
feat: Add OpenTelemetry integration to file watcher
Run file watcher using `opentelemetry-instrument` to enable tracing for
the watcher service.
2025-08-12 11:25:40 -03:00
Michael Manganiello
652df5d4cd
feat: Add OpenTelemetry integration for API service
This change introduces OpenTelemetry dependencies, and uses
`opentelemetry-instrument` auto-instrumentation to allow users to
configure OpenTelemetry settings via environment variables [1].

The only custom environment variable added is
`OTEL_SERVICE_NAME_PREFIX`, which allows users to set a prefix to the
service names included by RomM to differentiate between `api`, `worker`,
and `watcher` services.

The instrumentation of RQ workers and file watcher will be added in
subsequent pull requests.

[1] https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
2025-08-12 09:18:59 -03:00
Michael Manganiello
4eea761d87
misc: Do not warn when REDIS_HOST is set
Change log level to info when REDIS_HOST is set, as this is a valid
and common configuration.
2025-08-09 21:21:24 -03:00
Georges-Antoine Assi
d005dba90b
fix a bunch of shit 2025-08-09 11:16:12 -04:00
Michael Manganiello
86b7d021b7
Merge pull request #2238 from rommapp/fix/docker-build-fixes
fix: Docker build and init fixes
2025-08-08 15:35:57 -03:00
Michael Manganiello
676079f1e5
fix: Docker build and init fixes
* Added `linux-headers` back, but only for development stage.
* Fixed initialization script, as `uv` is not included in the final
  Docker image.
* Initialize variable `ENABLE_SCHEDULED_UPDATE_LAUNCHBOX_METADATA`.
2025-08-08 15:09:27 -03:00
Michael Manganiello
9c0df02296
fix: Correctly set up dockerignore file
* Rename file to `Dockerfile.dockerignore`. As the `Dockerfile` is not
  in the root directory, the Docker spec requires the file to be
  named `<dockerfile_name>.dockerignore`.
* Update ignore rules, and include `.mypy_cache/` directory.
2025-08-08 14:38:11 -03:00
Georges-Antoine Assi
de42333f2f
Merge pull request #2232 from rommapp/native-7z-parse
Use native 7z to extract files and calculate hashes
2025-08-08 09:23:29 -04:00
Georges-Antoine Assi
b247a5c5bb
small tweaks 2025-08-07 17:39:57 -04:00
Michael Manganiello
76db0ab98c
feat: Migrate watcher to use watchfiles library
The `watchfiles` library supports event batching, which allows us to
process multiple filesystem changes in a single run.

This change also avoids database calls in the watcher as much as
possible.
2025-08-07 13:28:49 -03:00
Georges-Antoine Assi
836e7358c2
fix issues from code review 2025-08-07 09:34:43 -04:00
Georges-Antoine Assi
4c6c36fa04
fix typo 2025-08-06 23:57:47 -04:00
Georges-Antoine Assi
64493348b9
add ignores for shellcheck 2025-08-06 23:30:32 -04:00
Georges-Antoine Assi
7e0cb2272d
run watchdog as a native task 2025-08-06 23:25:47 -04:00
Georges-Antoine Assi
dd6669ebd5
fix pythonpath 2025-08-06 22:08:28 -04:00
Georges-Antoine Assi
6b307afcd3
Run worker as a native process 2025-08-06 21:57:32 -04:00
Michael Manganiello
5dcc1bd31c
feat: Migrate scheduler to native RQ process
This change replaces our custom `scheduler.py` script with the
`rqscheduler` command, allowing us to run the RQ scheduler as a
separate, low-memory process, by avoiding the need to maintain
the Python app in memory.

* Remove `scheduler.py` script.
* Move initialization of scheduled tasks to `worker.py`.
* Update `docker/init_scripts/init` to start the `rqscheduler`
  command instead of the custom script.
* Fix scheduled tasks' `func` paths to the new project structure.
* Temporarily use a fork of `rq-scheduler` to support
  username and SSL settings in the `rqscheduler` command.
2025-08-06 19:13:12 -03:00
Michael Manganiello
9c8aad6cd6
fix: Run scheduler when only LaunchBox update is enabled
Include the check for `ENABLE_SCHEDULED_UPDATE_LAUNCHBOX_METADATA` to
decide whether to start the scheduler process.
2025-08-06 17:05:03 -03:00
Daniel Koster
2aa0c204b1
Update default.conf.template
Add IPv6 support
2025-08-04 20:16:59 +02:00
zurdi
270758ba69
feat: display version information in the banner 2025-07-21 11:47:12 +00:00
Georges-Antoine Assi
988fa510e5
readd link in dockerfile 2025-07-07 18:05:38 -04:00
Michael Manganiello
87d20b0bb8
fix: Correctly use Python 3.13 in Docker image
The `production-stage` stage was depending on the `python3` package from
Alpine, which at the moment of writing is still Python 3.12.

To avoid relying on Alpine's package and releases, we now copy the
Python installation directly from its official Docker image.

Other options were tested but did not work:
- Trying to install Python 3.13 using `apk`. As mentioned, Alpine does
  not support Python 3.13 yet.
- Installing Python 3.13 using `pyenv`. The installation worked, but the
  generated image was too large. Related `pyenv` discussion:
  https://github.com/orgs/pyenv/discussions/2868
- Installing Python 3.13 using `uv`. Only worked for `amd64`
  architecture, but the installation failed on `arm64`.
2025-07-07 00:17:25 -03:00
Georges-Antoine Assi
d1117a11f3
bump emujs to 4.2.3 2025-07-05 16:18:48 -04:00