Commit Graph

65 Commits

Author SHA1 Message Date
Matthieu B
59e2cb8199 chore: merge main into ldap branch, resolve conflicts 2026-03-29 16:28:20 +02:00
Matthieu B
b642d9100b Merge pull request #1200 from wizarrrr/fix/1182-user-created-at
fix: add missing created_at column to User model
2026-03-29 16:25:40 +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
41ca8856f0 fix: add missing created_at column to User model (#1182)
Add created_at column to the User model, an Alembic migration to
backfill existing rows via server_default, and update the API
serialization and OpenAPI spec from the stale `created` field to
`created_at` so the joined/created date is no longer returned as null.
2026-03-29 16:11:05 +02:00
Matthieu B
498886c06a fix(ldap): address security, correctness, and code quality issues
Security:
- Fix XSS in HTMX responses by replacing f-string HTML with Jinja partials
- Fix TLS verify_cert not being applied (add Tls config to ldap3 Server)
- Fix password_hash NOT NULL conflict for LDAP-only admin accounts
- Fix should_create_ldap_user defaulting to True for existing invitations

Correctness:
- Fix DN reconstruction fragility using escape_rdn for special characters
- Fix connection leaks with try/finally in all LDAPClient methods
- Fix sync interval logic (check FLASK_ENV not WIZARR_ENABLE_SCHEDULER)
- Only register LDAP sync job when LDAP is actually configured
- Make find_user_dn and service_connection public API methods

Cleanup:
- Squash 5 incremental LDAP migrations into single 20251226_add_ldap_support
- Remove duplicate imports/queries in auth routes
- Replace f-string logging with %s formatting
- Extract inline HTML to Jinja template partials
2026-03-29 15:58:09 +02:00
Matthieu B
e992873e4d Merge origin/main into ldap branch
Resolve conflicts in auth/routes.py (incorporate media_server_url),
login.html (combine admin page text + LDAP error guard), and uv.lock.
2026-03-29 15:49:50 +02:00
Jacob Swanson
7f64f558dc Add Telegram notification support
Introduces Telegram as a notification agent, including backend logic, form fields, and database columns for bot token and chat ID. Updates creation and editing flows, notification service, and UI to support Telegram integration. Includes a migration to add the new fields to the Notification model.
2026-01-23 22:03:05 -06:00
Erwan Leboucher
5bb51e0cf1 feat(ldap): add LDAP authentication and invitation integration 2025-12-27 17:14:17 +01:00
Matthieu B
ac36e793e1 refactor: improve code formatting and readability across multiple files 2025-12-09 14:12:17 +01:00
Matthieu B
0b2c90fee2 Merge pull request #1020 from 6im0n/feature/reset-password
Feat/Adds password reset functionality for Jellyfin user
2025-12-04 12:02:08 +00:00
Simon
b2cb69a8d5 feat: Add max_active_sessions column to Invitation model 2025-11-21 23:49:34 +01:00
Simon
42d286eee6 Fix: password reset token cascade delete 2025-11-21 01:38:43 +01:00
Simon
00f3ef95c3 feat: Implement link password reset functionality 2025-11-21 00:16:24 +01:00
Matthieu B
816398876c fix: Enhance Media Server deletion process to clear dependent records and update invitation associations 2025-11-17 13:21:49 +01:00
Matthieu B
533f972b55 Fixes Media Server deletion closes #1003 2025-11-17 12:29:42 +01:00
Matthieu B
eca653b10b fix: kavita api errors closes #952 2025-10-27 15:04:24 +01:00
Matthieu B
3d97dda0fb fix: error in nwo playing cards 2025-10-23 20:10:04 +02: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
9b5aa0972a refactor: remove slop from media and new linting rules 2025-10-23 18:33:50 +02:00
Matthieu B
1618ce7791 feat: enhance session management with Tautulli-inspired enrichment and validation for statistics 2025-10-22 12:49:57 +02:00
Matthieu B
42d4b56df1 Merge branch 'main' into plus 2025-10-18 16:07:43 +02:00
Matthieu B
77a1112d62 feat: Add historical import job functionality
- Introduced the HistoricalImportJob model to track historical data import jobs.
- Implemented asynchronous job processing for importing historical activity data from media servers.
- Enhanced the activity settings page to allow users to specify the number of days back for historical imports.
- Added a new route to display recent historical import jobs.
- Updated the import_historical_activity function to create and manage import jobs.
- Improved UI components for displaying success and error messages related to historical imports.
- Added migration script to create the historical_import_job table in the database.
2025-10-17 13:14:37 +02:00
engels74
d0df4c6d5d feat: wizard step refactor into pre/post wizard steps
Changes:
  - Pre/post invitation wizard phases
  - Phase-aware routing (/pre-wizard/*, /post-wizard/*)
  - Phase indicator badges (visual categorization)
  - Dynamic completion button behavior
  - Two-column admin layout with category drag-and-drop
  - Invite code management service
  - Enhanced wizard export/import
  - Comprehensive test coverage (17 new test files)
2025-10-16 15:28: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
e38a699d5e fix: enhance library access resolution for Plex users and update user details structure closes #892. Remove dev dependencies by default closes #905 2025-10-08 11:11:47 +02:00
Matthieu B
b682967ed2 feat: add notification events handling and UI updates for user notifications 2025-10-04 14:46:01 +02:00
Matthieu B
f295a345a1 feat: add user disable functionality and update user management settings
- Introduced `is_disabled` attribute to the User model.
- Added `expiry_action` selection in the GeneralSettingsForm for user management.
- Implemented `disable_user` methods for various media clients (Audiobookshelf, Jellyfin, Kavita, etc.) to handle user disabling.
- Updated `check_expiring` task to process expired users based on the new settings.
- Enhanced user interface to reflect disabled status in user cards.
- Added migration for the new `is_disabled` column in the user table.
2025-09-27 12:19:48 +02:00
Matthieu B
f67e3b72d4 fix: resolve circular import issue in User model and update exception handling in server checks
test: update invitation page assertion to reflect new account creation wording
2025-09-21 15:16:09 +02:00
Matthieu B
3310c2133c feat: revamp user policy handling 2025-09-12 14:11:51 +02:00
Matthieu B
319d4ab188 fix: restore allow_downloads and allow_live_tv fields to Invitation model
The recent migration removed these fields from User model (correctly) but they
were accidentally removed from the Invitation model definition as well. These
fields are required on invitations to specify what permissions to grant when
creating users on media servers.

Fixes TypeError: 'allow_downloads' is an invalid keyword argument for Invitation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 19:21:26 +02:00
Matthieu B
95b72160da fix: remove conflicting allow_downloads and allow_live_tv columns from User model 2025-09-10 15:09:05 +02:00
Matthieu B
3d61903f93 fix: SQLite database lock errors in media server user sync
- Replace raw SQL UPDATE statements with metadata caching system
- Add smart User model properties for allow_downloads/allow_live_tv
- Properties check server-specific keys (allowSync, EnableContentDownloading, etc.)
- Fix all media server clients: Plex, Jellyfin, Emby, AudiobookShelf, Navidrome, RomM, Kavita, Komga
- Remove problematic raw SQL from admin routes
- Eliminates concurrent transaction conflicts causing "database is locked" errors

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 14:26:28 +02:00
Matthieu B
6f28f7dbb0 feat: UI speedup 2025-09-09 22:12:17 +02:00
engels74
0f0dedde0a feat: implement wizard step interaction requirement system
Add comprehensive "require interaction" functionality for wizard steps that prevents users from proceeding until they engage with step content.

## Key Features:
- **Database Integration**: New `require_interaction` boolean field in WizardStep model with migration
- **Frontend Gating**: Robust JavaScript system that disables "Next" button until user clicks links/buttons in step content
- **UI Enhancement**: Improved checkbox forms with clear descriptions and visual indicators
- **Event Handling**: Advanced interaction detection with proper HTMX disabling and event capture
- **Admin Interface**: Full integration with wizard configuration forms (main and simple)
- **Export/Import**: Support for require_interaction field in wizard step data operations

## Technical Implementation:
- Disabled button state management with pointer-events and tabindex control
- HTMX attribute manipulation to prevent premature navigation
- Event listener capture phase handling for reliable interaction blocking
- Comprehensive test coverage for interaction scenarios
- Form validation and user experience improvements

## Files Modified:
- Backend: models, routes, forms, services, migration
- Frontend: JavaScript interaction logic, templates, UI components
- Testing: Complete test suite for interaction requirements

This feature ensures users engage with critical wizard content before proceeding, improving onboarding experience and preventing accidental step skipping.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-07 14:46:50 +02:00
Matthieu B
2dee2aa7af feat: add notes to users 2025-09-05 11:52:32 +02:00
Matthieu B
368aeaddeb fix invite table bugs 2025-08-14 15:38:42 +02:00
Matthieu B
2422cb1702 Add many-to-many relationship between invitations and users with tracking for invitation usage 2025-08-14 15:38:31 +02:00
Matthieu B
b27167e4eb Merge latest changes from main
Resolved conflicts in:
- app/models.py: Combined ApiKey and ExpiredUser models
- app/logging_config.py: Combined API logger and alembic logger configurations
- app/blueprints/public/routes.py: Combined server resolution approaches with fallback
2025-08-13 20:15:05 +02:00
Matthieu B
3422e224fc Enhance database integrity and improve versioning logic
- Updated the tag fetching logic in the GitHub Actions workflow to prioritize 2025.x.x format over v4.x.x for latest version retrieval.
- Modified the invitation deletion logic to use SQLAlchemy's delete method for better integrity and cascading behavior.
- Added CASCADE constraints to foreign key relationships in the database models to ensure proper deletion behavior.
- Improved the invitation flow manager to handle potential non-iterable server relationships gracefully.
- Updated notification service to ensure boolean return values for notification results.
- Adjusted migration scripts to use timezone-aware datetime for created_at fields.
- Added comprehensive tests for migration upgrades from the latest release to ensure stability and integrity.
- Enhanced WebAuthn security checks to allow localhost in testing environments.
- Refactored pre-commit configuration to remove unused hooks and streamline testing processes.
- Added new agents for backend logic, HTMX frontend, integration orchestration, QA test automation, and Tailwind UI styling to improve development workflows.
2025-08-10 15:19:11 +02:00
Matthieu B
d4dd57ee1e feat: Add comprehensive connections and expiry management system
- Add new connections management system with MediaConnection and DiscordWebhook models
- Implement dynamic server configuration with URL field support
- Add expiry management system with automatic user cleanup
- Create wizard preset system for streamlined server setup
- Add dedicated connections interface in settings with CRUD operations
- Integrate expiry functionality with connection management
- Add proper form validation and error handling
- Update templates and routes for new connection workflow

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 22:21:10 +02:00
copilot-swe-agent[bot]
60cb5d8972 Implement comprehensive API system with key management
Co-authored-by: Tomat0r <68383702+Tomat0r@users.noreply.github.com>
2025-07-28 12:02:42 +00:00
Matthieu B
d8cb5193c3 invitation workflow overall for more stability 2025-07-17 15:13:00 +02:00
snowfudge
5867f7e7b9 feat: add notifiarr support as notification agent 2025-07-16 13:19:57 +07:00
Matthieu B
8393345fc6 fix invite creation 2025-07-15 23:23:26 +02:00
Matthieu B
02126de7b8 Add ty dependency and pre-push hook for type checking
- Added `ty` version 0.0.1a14 to dependencies in `pyproject.toml`.
- Updated `.pre-commit-config.yaml` to include a pre-push hook for type checking using `ty`.
- Made minor adjustments in various files to ensure compatibility with type checking.
2025-07-15 21:32:43 +02:00
Matthieu B
f08e02386c fix and closes #708 2025-07-15 15:13:40 +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
d6dbd94826 migrate 2025-07-14 15:22:58 +02:00
Matthieu B
d721c3c480 added exterimental passkey support 2025-07-13 22:33:49 +02:00
Matthieu B
c86cc75e32 Added Multi-Admin Accounts 2025-07-08 19:14:07 +02:00