Commit Graph

127 Commits

Author SHA1 Message Date
Matthieu B
d91f4dc431 chore(deps): bulk-bump python and npm deps from open dependabot PRs (#1279)
* chore(deps): bulk-bump python and npm deps from open dependabot PRs

Consolidates the 15 currently-open dependabot PRs into a single change so
the maintenance churn lands in one merge instead of fifteen.

Python (uv.lock):
- idna 3.11 -> 3.15 (#1267)
- urllib3 2.6.3 -> 2.7.0 (#1264)
- flask-wtf 1.2.2 -> 1.3.0, sqlalchemy 2.0.48 -> 2.0.50, wtforms 3.2.1 -> 3.2.2 (#1258)
- pyright 1.1.408 -> 1.1.409, pre-commit 4.5.1 -> 4.6.0, ruff 0.15.8 -> 0.15.14 (#1250)
- wlc 1.17.2 -> 2.0.0 (#1248)
- pytest 9.0.2 -> 9.0.3 (#1239)
- cryptography 46.0.6 -> 46.0.7 (#1235)
- cachetools 7.0.1 -> 7.0.5 (#1233)
- plexapi 4.18.0 -> 4.18.1 (#1232)
- requests 2.33.0 -> 2.33.1 (#1231)

npm (app/static):
- flowbite 4.0.1 -> 4.0.2, @tailwindcss/cli 4.2.2 -> 4.3.0, tailwindcss 4.2.2 -> 4.3.0 (#1265)
- tiny-markdown-editor 0.2.25 -> 0.2.27 (#1263)
- @alpinejs/collapse 3.15.9 -> 3.15.12 (#1256)
- alpinejs 3.15.10 -> 3.15.12 (#1255)
- htmx.org 2.0.8 -> 2.0.10 (#1245)

Verified: full pytest suite passes (504 passed, 1 skipped); ty diagnostic
count unchanged vs baseline.

* style: ruff auto-fix import order (I001)

Pre-existing import-sort issues surfaced by the lint CI job on this PR
(main pushes don't run the lint job so they went uncaught).
2026-05-30 14:02:23 +02:00
RicoUHD
a33d79dd45 fix(assets): implement deterministic build lifecycle and dynamic cache busting
- Added dynamic ?v={{ app_version }} cache-busting query strings to all core stylesheet and script references in base.html.
- Created and registered the inject_app_version context processor in app/context_processors.py and app/__init__.py to inject the APP_VERSION environment variable into all templates dynamically.
- Refactored copy-assets.js to detect production context (NODE_ENV=production or DOCKER_BUILD=true) and fail loudly (process.exit(1)) if assets are missing, avoiding silent failures in the build pipeline.
- Set DOCKER_BUILD=true during the Dockerfile asset compilation step to enforce deterministic production build verification.
2026-05-25 17:33:29 +02:00
Matthieu B
73c29458fe fix: resolve all test failures, linting errors, and type errors
- Fix 55 test failures caused by missing request contexts and incorrect
  session_transaction() usage across 8 test files
- Fix ruff import sorting errors and unused imports
- Fix 122 type errors: rename method override parameters to match base
  classes, add None guards for fetchone()/datetime, widen dict type
  annotations, add type: ignore for SQLAlchemy stub limitations
- Add [tool.ty.rules] config to suppress unsupported-base warnings
- Fix _ variable shadowing gettext in wizard routes
- Add noqa: ARG002 for unused method arguments required by base class
2026-03-29 16:20:23 +02:00
Matthieu B
2283c4de68 fix: prevent startup race condition during migrations
This fixes a critical issue where Gunicorn workers would fail to start
after upgrading to v2025.11.0, causing containers to show as unhealthy
with only the uv wrapper process running and no actual workers.

Root Cause:
-----------
In v2025.11.0, library scanning and session recovery were added to the
create_app() function, which runs during EVERY app creation including:
1. During 'flask db upgrade' (migrations)
2. During Gunicorn master when_ready() hook
3. During each Gunicorn worker spawn

The migration 20251103_properly_fix_foreign_keys recreates 4 database
tables with CASCADE foreign keys using raw SQL. This holds exclusive
database locks during table recreation.

When library scanning and session recovery try to query these tables
during migration, they hit database locks, creating a race condition
that causes workers to timeout and crash during startup.

Fix:
----
- Skip library scanning during migrations (FLASK_SKIP_SCHEDULER=true)
- Skip activity monitoring/session recovery during migrations
- Make Gunicorn log level configurable (GUNICORN_LOG_LEVEL env var)
- Add worker lifecycle hooks for better crash debugging
- Increase healthcheck start period from 10s to 60s
- Increase Gunicorn worker timeout from 30s to 120s

Testing:
--------
- Verified app starts successfully with FLASK_SKIP_SCHEDULER=true
- Verified library scanning runs normally without the flag
- Confirmed 0.38s startup during migrations vs 1.61s normal startup

Closes #976
2025-11-03 20:41:52 +01:00
Matthieu B
0050f4b646 feat: allow user edit 2025-11-03 14:36:04 +01:00
Matthieu B
6a3632ec66 refactor: update type hints for better clarity and consistency across multiple files 2025-10-23 19:49:58 +02:00
Matthieu B
e70263deab refactor: streamline conditional checks and improve logging clarity 2025-10-23 18:44:30 +02:00
Matthieu B
3965444133 refactor: Rename environment variable for enabling Plus features to improve clarity 2025-10-18 16:15:48 +02:00
Matthieu B
0ac98355dd feat(activity): Implement activity ingestion, identity resolution, and maintenance services
- Added `identity_resolution.py` for resolving Wizarr users and identities.
- Created `ingestion.py` to handle recording and updating activity events.
- Introduced `maintenance.py` for cleanup and session management tasks.
- Developed `queries.py` for read-oriented operations on activity sessions.
- Implemented background tasks in `activity.py` for scheduled maintenance.
- Added tests for activity services and blueprint to ensure functionality.
2025-10-16 15:18:31 +02:00
Matthieu B
a072bdf097 feat: add main side plus features 2025-10-09 12:12:02 +02:00
Matthieu B
0da4099670 Enhance application startup logging and scheduler management in create_app and init_extensions functions 2025-08-13 11:09:32 +02:00
Matthieu B
7375ab65d3 Refactor logging behavior to prevent duplicate completion messages in Gunicorn and enhance scheduler initialization logging for better debugging. 2025-08-12 20:53:53 +02:00
Matthieu B
4ec577b0c5 revamp logging 2025-08-12 19:53:27 +02:00
Matthieu B
b3b334357f Refactor startup logging to ensure messages are displayed only once across processes and enhance migration logging visibility in Gunicorn context. 2025-08-12 19:53:12 +02:00
Matthieu B
9fde1d1edf Implement centralized startup logging and enhance application initialization messages 2025-08-12 19:37:13 +02:00
Matthieu B
7b8f64af7d Fix SQLAlchemy model constructors to accept keyword arguments
- Added __init__ constructors to all SQLAlchemy models
- Fixed pyright 'No parameter named' errors across the codebase
- Fixed various ruff linting issues (SIM108, E741, E402, SIM102, B904, SIM105)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 13:52:15 +02:00
Matthieu B
dd8da235ee Enhance media server support by adding Kavita integration and updating existing routes. Refactor Audiobookshelf, Emby, Jellyfin, and Romm blueprints to utilize a common media blueprint factory. Implement unified invitation processing and improve wizard migration handling. Update templates and forms to accommodate new server types and ensure backward compatibility. 2025-07-12 21:29:13 +02:00
Matthieu B
f5b70abef5 matching tags 2025-07-09 16:37:02 +02:00
Matthieu B
5d29465ab2 removed plainstring passwords closes #673 2025-07-08 18:25:15 +02:00
Matthieu B
9ac933ac26 Add wizard step management and enhance asset building 2025-06-25 23:17:46 +02:00
Matthieu B
3bdc16c785 added version logging 2025-06-10 15:57:31 +01:00
Matthieu B
6c8fcec145 fix and close #593 2025-06-10 15:55:29 +01:00
Matthieu B
df61f1402e release checking 2025-06-03 23:40:57 +01:00
Matthieu B
5974e81cab made app_url obsolete 2025-05-24 19:38:33 +01:00
Matthieu B
b7c9a5a223 fix onboarding not being shown 2025-05-23 21:46:01 +01:00
Matthieu B
5e62af2e14 fix startup and database migration 2025-05-21 16:05:59 +01:00
Matthieu B
4889e25d31 Huge rewrite 2025-05-20 13:01:20 +01:00
Matthieu B
4d631eed9c Update __init__.py 2023-05-15 14:45:01 +01:00
Matthieu B
c78266bafe Support Notifications 2023-05-13 15:56:54 +01:00
Matthieu B
9ebc9836da tificationsno 2023-05-07 14:47:20 +01:00
Damien Fajole
86357560d3 Add Plex Home invitation 2023-04-16 16:03:56 +02:00
Matthieu B
6322d71f42 Update __init__.py 2023-03-11 22:00:36 +00:00
Matthieu B
048d77f3d6 Update __init__.py 2023-03-11 21:47:15 +00:00
Matthieu B
c822297bbc Cleanup 2023-03-02 13:37:50 +00:00
Matthieu B
d56986992b Implement #90 2023-03-01 17:54:22 +00:00
Matthieu B
5a2ec941ee Update __init__.py 2023-02-27 19:18:34 +00:00
Matthieu B
0a33b153ec ready for update 2023-02-27 19:18:15 +00:00
Matthieu B
f32c31b29d translations 2023-02-27 18:41:30 +00:00
tuxx
56d6f3f556 Moved ombi functions to app/ombi.py 2023-02-27 04:11:53 +01:00
Matthieu B
504590b9cc General Optimisations and improvements 2023-02-25 15:53:04 +00:00
Matthieu B
6f7837c585 Update __init__.py 2023-02-25 00:20:02 +00:00
Matthieu B
8a28da8781 database backup 2023-02-25 00:19:42 +00:00
cloud
a52fc4d870 chore: remove unused references 2023-02-23 18:01:54 -07:00
Matthieu B
d91c3c6be5 Update __init__.py 2023-02-23 18:17:28 +00:00
Matthieu B
0150f2949d Update __init__.py 2023-02-23 18:16:36 +00:00
Matthieu B
a62f988369 Experimental Jellyfin Support 2023-02-23 17:51:01 +00:00
Matthieu B
5509b60e92 Update __init__.py 2023-02-23 12:08:28 +00:00
Matthieu B
a66c9fb9db Update __init__.py 2023-02-23 00:24:55 +00:00
Matthieu B
f9c5e12f1e logging 2023-02-22 23:33:26 +00:00
Matthieu B
50d4c42a1b Update __init__.py 2023-02-22 15:45:22 +00:00