feat(logging): implémenter la suppression des fichiers de log obsolètes et ajuster la configuration des logs
feat(settings): modifier la structure des paramètres de configuration et ajouter un niveau de log TRACE
feat(admin): fusionner les pages de configuration TMDB et Indexeurs, et mettre à jour les titres et descriptions
fix(system): corriger les messages d'alerte concernant le redémarrage des paramètres système
- add TMDB orphan matcher backend (orphan_matcher.py) and search client (tmdb_search.py)
- introduce Redis-backed run history tracker (history.py) for matcher runs
- extend TorrentItemModel with tmdb_match_attempted_at and index
- add Alembic migration to create tmdb_match_attempted_at and its index
- integrate new tmdb_orphan_matching job into scheduler; expose in UI
- add admin UI: tmdb_matcher.html, history/revert endpoints, and nav entry
- wire settings: scheduler_tmdb_match_interval_hours and batch size
- enhance title normalizer: strip possessive s and remove technical brackets/tokens
- update admin docs to reflect new matcher and deprecation of old cleanup
- update admin base navigation and scheduled tasks page accordingly
introduce initial torrent grouping: add torrent_groups table and
group_id on torrent_items. include migrations, ORM models, and DAOs.
expose admin/web endpoints to group by info_hash and by title/size.
propagate tmdb_id across grouped items. non-destructive and backwards
compatible with existing data
Introduce a comprehensive settings management system that allows runtime
configuration through a new admin interface. The system includes:
- Database-backed settings with Redis caching for performance
- Settings registry defining types, defaults, and categories
- New admin UI with navigation cards and dedicated sub-pages for each category
(general, cache, indexers, proxy, system, TMDB)
- Shared view logic for consistent GET/POST handling across sub-pages
- Automatic seeding of defaults and application of overrides at startup
- Validation and type coercion for setting values
The previous static configuration page has been replaced with a modular,
category-based interface that provides better organization and extensibility
for future configuration needs.
- Implemented a new HTML page for managing scheduled tasks in the admin panel.
- Added JavaScript functionality for auto-refreshing job statuses and triggering jobs manually.
- Enhanced job result display with relative time and duration formatting.
- Introduced a toast notification system for user feedback on job actions.
fix: update Redis cache key generation to include a prefix
- Modified the Redis cache key generation to prepend "search:" to the hashed key for better organization.
refactor: improve Yggflix API search functionality
- Added an optional parameter to the search_movie method to specify the search type.
- Implemented a fallback mechanism to broaden search if initial results are insufficient.
chore: enhance Yggflix service with improved result handling
- Introduced a threshold for retrying searches with a broader query type based on result ratios.
- Increased the limit for sorted results from 50 to 100.
feat: add maintenance endpoints for managing expired API and peer keys
- Created endpoints to disable expired API keys and peer keys in the admin panel.
- Added functionality to clean orphan torrent items based on a specified age.
feat: integrate scheduler into the application lifecycle
- Initialized a database cleanup scheduler during application startup.
- Ensured proper shutdown of the scheduler during application termination.
- Implemented a new admin page for managing TMDB mismatches, including listing, creating, and deleting mismatches.
- Added functionality to search for unmatched torrents with filters for language and type.
- Enhanced UI with improved filtering options and group toggling for better user experience.
- Introduced toast notifications for user actions such as creating mismatches and assigning TMDB IDs.
- Updated backend routes to handle mismatch creation, deletion, and assignment of TMDB IDs to selected torrents.
- Refactored title filtering logic in `filter_results.py` to utilize a new title matching module.
- Introduced normalization functions for search queries in `jackett_service.py` and `yggflix_service.py`.
- Added new endpoints for managing title and language normalization rules in the admin views.
- Implemented loading and reloading of title matching and language rules in the application lifecycle.
- Enhanced release group extraction and language detection in `parser_utils.py` using the new title matching module.
Introduce a 4-phase search system where private indexers are grouped by priority:
- Phase 1 (priority_private): always queried first
- Phase 2 (intermediary_private): queried only if private results < minCachedResults
- Phase 3 (fallback_private): queried only if still insufficient
- Phase 4 (public): Yggflix relay position controlled by yggflixPriority toggle
Add rdMinCachedBeforeCheck setting to skip RealDebrid if prior services already found enough cached results, since RD API is slow (~3s) and rate-limited. Default to 3.
Non-blocking magnet cleanup in AllDebrid availability checks via background task. G3MINI now computes info_hash from .torrent files when API omits it. Public indexer results are excluded from final matches unless already cached by a debrid service.
Remove deprecated Sharewood tracker integration and add three new private trackers:
- ABN (Abnormal): keyword-based search with name filtering
- G3MINI (Gemini Tracker): TMDB/IMDB ID-based filtering
- TheOldSchool: TMDB/IMDB ID-based filtering
Includes new API clients, result parsers, and service layers. Updates frontend UI, settings configuration, and credential handling to support the new indexers with proper passkey management.
Implement POST /encode endpoint for encrypting user configuration tokens.
Uses Fernet encryption with automatic Base64 fallback when CONFIG_SECRET_KEY
is not set. Protected by signed CSRF token validation to prevent cross-site
attacks.
- Replace inline HTML templates with Jinja2 templates from static directory
- Add Redis client for rate limiting public registration endpoint
- Implement rate limiting of 5 requests per IP per hour
- Improve API key naming with date-based suffix for better traceability
- Add utility functions for IP hashing and rate limit enforcement
- Implement Fernet encryption for configuration URLs to protect sensitive user settings
- Add CONFIG_SECRET_KEY environment variable for key derivation
- Add server-side /api/config/encode endpoint for secure config token generation
- Add CSRF token generation and validation for all admin POST routes
- Auto-inject CSRF tokens into admin forms and AJAX requests via JavaScript
- Update frontend to use async server encoding instead of client-side Base64
- Add localStorage fallback for config restoration on /configure pages
- Maintain backward compatibility with existing Base64-encoded URLs
- Log warning at startup if CONFIG_SECRET_KEY is not configured
- Convert debug logs to trace level in TorrentSmartContainer for reduced noise
Introduce a metadata_mappings table with DAO/model layers for admin-managed
IMDB→TMDB/title overrides, and overhaul the admin panel with a modern
Bootstrap 5 sidebar UI.
- Add metadata_mappings table with migrations (search_titles, year_override)
- Add MetadataMappingDAO with standalone session helpers for use outside FastAPI
- Add new admin pages: dashboard, mappings CRUD, maintenance, config, hash/TMDB search
- Integrate DB mapping lookups into Cinemeta and TMDB metadata providers
- Update catalog views to use DB mappings before hitting external APIs
- Rewrite all admin templates with Bootstrap 5, sidebar navigation, French labels
- Add session-based auth for admin routes with Redis session store
Add `allow_debrid_download` setting to control whether non-cached download streams are visible in Stremio results. When disabled, only instantly available streams are shown. Additionally, automatically prefer TorBox for downloads from special French indexers (C411, Torr9, LaCale, GenerationFree) when TorBox is configured, overriding the user's default debrid service selection.
Introduces a secure peer-to-peer cache sharing system using HMAC-SHA256 request signatures and Fernet (AES-128-CBC) response encryption.
- New peer_keys table for per-peer credential management (key_id, secret)
- New /api/peer/check endpoint returns encrypted debrid availability data
- New /api/peer/items endpoint returns encrypted torrent metadata
- Rate limiting per peer key with configurable limits and windows
- Admin UI for creating, viewing, revoking, and deleting peer keys
- Peer cache enrichment integrated into BaseDebrid L2.5 lookup pipeline
- StremThruDebrid override with cross-service PG L2 check + peer cache
- Removed old /api/share/cache endpoint (replaced by /api/peer/*)
- Added cryptography package dependency
BREAKING CHANGE: The /api/share/cache endpoint has been removed and replaced with /api/peer/check. Clients must update to use HMAC authentication with X-Peer-Key-Id, X-Peer-Timestamp, and X-Peer-Signature headers.
Add new `/share/cache` API endpoint that returns which info-hashes are confirmed cached on a given debrid service. Uses hash-only projection to avoid leaking file metadata. Includes API key auth and Redis-based rate limiting.
Add a two-level caching architecture for debrid service availability lookups:
- L1: Redis (existing) with 10-day TTL for fast in-memory access
- L2: PostgreSQL with 30-day TTL for persistent caching across Redis restarts
Changes:
- Add `debrid_cache` table with unique constraint on (info_hash, service) and indexes for efficient queries
- Create `DebridCacheDAO` with batch get/upsert and invalidation methods
- Add pgCron job to periodically clean up expired cache entries
- Extend `get_availability_bulk_cached` to check PG on Redis miss, warm Redis from PG hits, and write confirmed-cached results to PG
- Add `invalidate_availability_cache` method to remove false positives from both caches when NO_CACHE_VIDEO_URL is returned during playback
- Integrate `db_session` dependency into playback and search views
- Add retry handling to Yggflix API (3 retries, ignore Retry-After headers) and rate-limiting delay (0.3s) between consecutive queries
Lower log verbosity across the codebase by converting info-level logs to debug
and debug-level logs to trace. This reduces noise in production while keeping
detailed information available for debugging when needed.
Affected modules: API key DAO, Real Debrid token manager, C411/Torr9/YGG
indexers, debrid services, torrent container, playback/stream handlers,
search views, and utility modules.
Refactor playback stream caching to use deterministic hash-based keys for user and content identifiers, removing plain-text API keys and query data from Redis keys.
Key changes:
- Add fixed-window rate limiting (60 requests per 60 seconds per user)
- Replace cache keys using hashed user/content identifiers instead of raw API keys
- Extend TTLs from 20 minutes to 6 hours for stream links and direct links
- Fix tracker credential leak by skipping credentials when file is cached on debrid service
- Simplify get_stream_link by removing series-specific caching logic
Convert verbose debug messages to trace level for cleaner production logs, improve secret redaction patterns to handle JWT tokens and API key parameters while preserving parameter names, and standardize log messages to English for consistency across the codebase.
Async correctness:
- Wrap blocking time.sleep/requests.get calls with asyncio.to_thread()
in torrent_service.py and torr9_service.py
- Run cache_container_items() as fire-and-forget background task via
asyncio.create_task(asyncio.to_thread(...)) in search/views.py
- Make RDTokenManager.get_access_token() and new_access_token() async,
replace requests.post with aiohttp (token_manager.py)
- Make RealDebrid.get_headers() async, await all callers (realdebrid.py)
Security:
- Remove API key, device code, and PIN values from log output
(auth/views.py, admin/views.py)
- Add WARNING on startup when SESSION_KEY uses the insecure default
value (settings.py)
- Make admin template dir configurable via settings.admin_template_dir
Performance:
- Parallelize TMDB metadata fetches with asyncio.gather() (catalog/views.py)
- Add tmdb_language setting instead of hardcoded "fr-FR"
Deduplication:
- Extract ensure_uuid() to stream_fusion/web/api/utils.py
- Extract get_client_ip() to stream_fusion/web/utils.py
- Replace 8-way if/elif debrid factory with _SERVICE_MAP dict +
_build_service() helper (get_debrid_service.py)
- Extract _model_to_schema() in APIKeyDAO to remove 6 repeated blocks
- Simplify ProxyStreamer: remove manual BytesIO buffer, stream directly
via iter_any() (stream/views.py)
Inspired by commits 823bc77 and e306eb5 from limedrive/develop.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The allow_anonymous_access setting introduced in a previous branch was
partially implemented and breaking: it was only checked in the
/{config}/manifest.json route but ignored entirely in the stream search
route, which always returned 401 anyway. This created an inconsistent
and misleading security posture. The flag has been removed from settings
and the manifest route now unconditionally returns 401 when no API key
is present, consistent with the rest of the API.
Additionally, the SERVER-SIDE INDEXER ENABLE FLAGS (sharewood_enable,
c411_enable, torr9_enable, lacale_enable) were incorrectly tied to the
presence of server-side credentials via check_env_variable(). This was
a breaking regression: users with their own tracker credentials in their
Stremio config were silently blocked from using those indexers whenever
no server-level key was configured. These flags are now True by default
and can be explicitly set to False via environment variable to disable
an indexer server-wide.
A new generationfree_enable flag (True by default) has been added for
consistency. The config page (index.html) now conditionally renders
indexer checkboxes and credential fields based on these enable flags,
mirroring the existing jackett_enable pattern.
Prevents Sharewood passkeys, C411 API keys and Torr9 API keys from
leaking between users via the shared Redis (media: key) and PostgreSQL
(torrent_items table).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>