79 Commits

Author SHA1 Message Date
Matthieu B
ac36e793e1 refactor: improve code formatting and readability across multiple files 2025-12-09 14:12:17 +01:00
Matthieu B
6758372bb3 fix: merge migrations 2025-12-09 14:08:42 +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
0b04a5f520 feat: improve user deletion process and fix foreign key constraints 2025-11-03 14:48:50 +01:00
Matthieu B
eca653b10b fix: kavita api errors closes #952 2025-10-27 15:04:24 +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
42d4b56df1 Merge branch 'main' into plus 2025-10-18 16:07:43 +02:00
Matthieu B
8682d14e6b fix: Update migration revision ID and down_revision for activity audit features 2025-10-18 16:03:49 +02:00
Matthieu B
e2b54efe7b refactor: Remove obsolete migration files for activity identity links and historical import jobs 2025-10-18 16:02:02 +02:00
Matthieu B
92aad82fe1 Update migrations/versions/20251013_add_activity_identity_links.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-18 12:58:51 +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
Matthieu B
8361144972 feat(activity): Enhance activity monitoring with historical data import and management features 2025-10-17 11:00:33 +02:00
engels74
0fb4767457 fix(migrations): reorder wizard category migration and apply pre-rebase formatting
Migration Changes:
- Renamed migration file from 20251004 to 20251005
- Updated down_revision from fd5a34530162 to 08a6c8fb44db
- Ensures migration runs after upstream notification events migration
- Fixes migration chain branching issue
- Removed incorrect merge migration (1e83c67d9785)

Migration chain is now:
fd5a34530162 (disabled attribute) → 08a6c8fb44db (notification events)
→ 20251005_add_category_to_wizard_step (wizard category)

Wizard Refactoring:
- Enhanced uniqueness constraint for WizardStep from (server_type, position)
  to (server_type, category, position)
- Ensures steps in different categories (pre_invite vs post_invite) can have
  the same position indexing without conflict
- Updated wizard state management documentation to explicitly list and
  describe data-* attributes used in steps.html template

Code Quality:
- Applied djlint formatting to 8 template files to minimize rebase conflicts
- Applied ruff format and ruff check --fix (no changes needed)
- Removed redundant requirement comments from spec-driven development
- Fixed case sensitivity in test assertion (POST vs post)
- Updated test references from 20251004 to 20251005 to match corrected
  migration revision ID
2025-10-16 16:57:14 +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
17e5b26703 Add identity links to activity sessions and drop ended_at column
- Added columns `wizarr_user_id` and `wizarr_identity_id` to the `activity_session` table.
- Created foreign key constraints for the new columns linking to `user` and `identity` tables.
- Created indexes for the new columns to improve query performance.
- Dropped the `ended_at` column from the `activity_session` table.
- Added a new `active` column to the `activity_session` table with a default value of true.
- Created an index for the `active` column to enhance query efficiency.
2025-10-15 12:52:06 +02:00
Matthieu B
7eae142e69 update migration 2025-10-13 14:26:25 +02:00
Matthieu B
a072bdf097 feat: add main side plus features 2025-10-09 12:12:02 +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
2f1ee4ef70 fix: added missing admin column closes #842 2025-09-13 13:43:39 +02:00
Matthieu B
3310c2133c feat: revamp user policy handling 2025-09-12 14:11:51 +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
6f28f7dbb0 feat: UI speedup 2025-09-09 22:12:17 +02:00
Matthieu B
22d7e5dcc5 fix: resolve test failures and lint issues
- Fix test database isolation by cleaning WizardStep data before tests run
- Remove unused imports and fix import ordering
- Replace setattr with direct attribute assignment
- Use contextlib.suppress for cleaner exception handling
- Fix nested if statement in wizard_export_import.py

Fixes the failing CI checks for PR #817.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-07 15:58:42 +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
22d307d901 cleanup: remove unnecessary migration scripts and complexity
- Remove all migration helper scripts (over-engineering)
- Revert Docker entrypoint changes (not needed)
- Clean up CLAUDE.md migration strategy section
- Keep only the essential: beautifully renamed migration files

The simple solution won: just rename the files, Alembic doesn't care about filenames!

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-06 19:06:39 +02:00
Matthieu B
0cc94971b6 feat: complete migration chaos solution with full renaming
BREAKING CHANGE: Migration files renamed to clean YYYYMMDD format

- Renamed 17 migrations from chaotic hash-based to clean date-based names
- Maintained all revision IDs and dependency chains
- Updated Docker entrypoint to check/log migration mappings
- All tests pass, migration chain validated and healthy
- 28/30 migrations now follow YYYYMMDD_description.py format
- Added comprehensive migration management tooling

Changes:
- migrations/versions/*: 17 files renamed to YYYYMMDD format using real creation dates
- docker-entrypoint.sh: Added migration name checker before DB migrations
- Complete 4-phase renaming strategy implemented and executed

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-06 18:55:59 +02:00
Matthieu B
0757ca8fe0 fix: resolve remaining linting issues in migration scripts
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-06 18:54:05 +02:00
Matthieu B
8875cfb066 fix: fix allow download / live tv icons 2025-09-05 12:53:48 +02:00
Matthieu B
2dee2aa7af feat: add notes to users 2025-09-05 11:52:32 +02:00
Matthieu B
c11e5d5326 Enhance user display logic in invite and user modals to show usernames for multiple users and improve server type tagging in user cards 2025-08-14 15:53:25 +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
5f95b788b5 Add external integration fields to GeneralSettingsForm and update settings template 2025-08-13 21:33:39 +02:00
Matthieu B
1723e876b6 Refactor API models and invitation flow; add comprehensive tests
- Updated `InvitationCreateRequest` model to change `server_ids` from required to optional with improved description.
- Enhanced `library_model` to include `external_id`, `server_name`, and `enabled` fields.
- Modified `InvitationFlowManager` to prioritize new many-to-many relationship checks for invitations.
- Created a new migration file to merge branches related to API key and foreign key improvements.
- Added comprehensive tests for API endpoints, including status, users, invitations, libraries, servers, and API key management.
- Implemented error handling tests for malformed JSON and inactive API keys.
2025-08-13 20:58:11 +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
SourceDiver42
5146f266f4 Modify last migration to use 'name' instead of 'server_name' in SQL query, making migration pass 2025-08-04 15:44:40 +02:00
Matthieu B
de4e70b13b fix: Handle interrupted migrations from Watchtower auto-updates
Adds existence checks to migration to handle edge case where:
1. Watchtower starts container update during migration
2. Migration creates tables but gets interrupted before completion
3. New container tries to run same migration again → table exists error

Fixes #747

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 20:16:47 +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]
c43787d7e9 Fix Alembic migration error by replacing constraint dropping with table recreation
Co-authored-by: Tomat0r <68383702+Tomat0r@users.noreply.github.com>
2025-07-28 12:29:19 +00:00
copilot-swe-agent[bot]
36b5555fd5 Add database migration for ApiKey model and complete API testing
Co-authored-by: Tomat0r <68383702+Tomat0r@users.noreply.github.com>
2025-07-28 12:08:06 +00:00
Matthieu B
6de36caa57 fix migration 2025-07-18 15:13:39 +02:00
Matthieu B
948474d13c fix: combine nested with statements in WebAuthn security tests
- Fixed SIM117 ruff linting errors by combining nested with statements
- All WebAuthn security tests still pass after refactoring
- Code is now more readable and follows modern Python patterns
- Applied ruff formatting to WebAuthn routes file

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18 15:04:43 +02:00
Matthieu B
d8cb5193c3 invitation workflow overall for more stability 2025-07-17 15:13:00 +02:00
snowfudge
3887afbe67 ruff check 2025-07-16 13:38:21 +07:00
snowfudge
b0e6813345 fixed linting 2025-07-16 13:34:50 +07:00
snowfudge
5867f7e7b9 feat: add notifiarr support as notification agent 2025-07-16 13:19:57 +07:00