124 Commits

Author SHA1 Message Date
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
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
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
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
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
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
zurdi
270758ba69 feat: display version information in the banner 2025-07-21 11:47:12 +00:00
Michael Manganiello
ea9def4b85 misc: Replace deprecated uvicorn.workers with uvicorn-worker
According to the `uvicorn` docs [1], the `uvicorn.workers.UvicornWorker`
class is deprecated and replaced by the `uvicorn-worker` package [2].

[1] https://www.uvicorn.org/deployment/#gunicorn
[2] https://github.com/Kludex/uvicorn-worker
2025-07-05 12:59:49 -03:00
Michael Manganiello
c532f177ad misc: Remove support for deprecated GUNICORN_WORKERS variable
The `GUNICORN_WORKERS` environment variable has been deprecated in favor
of `WEB_CONCURRENCY`.
2025-06-19 10:19:40 -03:00
zurdi
2aa6f1251b fix: set default ROMM_BASE_URL in nginx startup log message 2025-05-23 00:11:12 +00:00
zurdi
d27f4d626b feat: Reset forgotten password added 2025-05-13 09:35:53 +00:00
Zurdi
5c6d35b141 Update docker/init_scripts/init
Co-authored-by: Georges-Antoine Assi <3247106+gantoine@users.noreply.github.com>
2025-05-11 09:17:34 +02:00
zurdi
693f3e038b refactor: add ASCII art banner to init script and improve debug log output 2025-05-09 15:55:58 +00:00
zurdi
1b38607eab refactor: update Alembic logging configuration and add ASCII art banner to init script 2025-05-09 15:23:32 +00:00
zurdi
22f5134fbb refactor: add Gunicorn logging configuration and update startup script 2025-05-09 10:25:02 +00:00
zurdi
e6c4a43c1e refactor: improve logging messages and formatting for clarity and consistency across multiple modules 2025-05-09 09:35:13 +00:00
zurdi
53f9386208 refactor: enhance logging messages and formatting for improved clarity and consistency 2025-05-08 23:35:33 +00:00
zurdi
b3d341bc11 refactor: add TODO comment to check on database disconnection in init script 2025-05-08 17:59:50 +00:00
zurdi
c5033d9967 refactor: enhance logging output with color formatting for improved readability 2025-05-08 17:59:01 +00:00
zurdi
cac9602974 refactor: streamline logging setup and improve log formatting across multiple modules 2025-05-08 17:57:40 +00:00
zurdi
5bc820d3ee refactor: enhance logging and user agent mapping in nginx configuration for improved monitoring 2025-05-08 17:22:30 +00:00
zurdi
d5bb63c06f refactor: improve logging in redis_handler and init scripts for better debugging and process management 2025-05-08 16:34:23 +00:00
zurdi
0f1c29be73 refactor: enhance logging format in init script with color coding for better visibility 2025-05-08 14:17:03 +00:00
zurdi
c0f33545b1 refactor: enhance initialization script with improved logging and process management 2025-05-08 14:04:21 +00:00
zurdi
ad1cd9e0c6 refactor: replace info_debug with debug_log for consistency in logging 2025-05-08 11:31:46 +00:00
zurdi
5d1114b832 refactor: set default web concurrency to reduce resource usage 2025-05-08 10:44:58 +00:00
zurdi
82c265e7d3 refactor: update log messages for consistency and clarity 2025-05-08 10:40:08 +00:00
zurdi
3bd9382b12 refactor: enable scheduled tasks in scheduler and init scripts 2025-05-08 08:59:56 +00:00
Michael Manganiello
c05593db14 fix: Support for assets when using custom ROMM_BASE_PATH
When using a custom ROMM_BASE_PATH, the symbolic links used by nginx to
serve assets were not being updated to point to the correct location,
and always used the default `/romm` base path.

This change introduces a fix in the `docker-entrypoint.sh` script, so
those symbolic links are updated to point to the correct location set by
the `ROMM_BASE_PATH` environment variable.

Fixes #1626.
2025-02-20 00:21:32 -03:00
Michael Manganiello
fbff92403f feat: Allow configuring app port using ROMM_PORT environment variable
By using the `ROMM_PORT` environment variable, users can now configure
the port on which the application listens, which defaults to `8080`.
2025-02-19 01:02:25 -03:00