Commit Graph

89 Commits

Author SHA1 Message Date
Matthieu B
080752b752 fix: default Docker healthcheck port (#1331)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-07-06 10:57:46 +02:00
Matthieu B
7803cfd74c Keep invite form open on errors
Keep form-based invitation screens open on account creation failures so users can see errors without replaying the welcome animation.

Centralize join form template context, preserve theming across invite routes, and add regression coverage for validation and E2E flows.
2026-07-05 18:53:49 +02:00
Matthieu B
04e3b58a82 Fix invite library dropdown interactions (#1324)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-07-05 18:52:22 +02:00
Matthieu B
c10a0e1911 Validate invitation form submissions (#1322)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-07-05 18:37:15 +02:00
Matthieu B
31005dcf87 Fix recent onboarding and media-server bugs (#1318)
* fix: resolve button widget context URLs

Fixes #1280

* fix: return relative invitation API URLs

Fixes #1262

* fix: use modern Jellyfin auth headers

Fixes #1309

* fix: use Emby library GUIDs for access policy

Fixes #1303
2026-07-05 18:14:39 +02:00
Matthieu B
26f99b7532 Merge pull request #1304 from ZRiddle/fix/unlimited-invite-multi-user-tracking
Fix: unlimited invite only shows first user in Latest Accepted Invites
2026-07-05 17:50:20 +02:00
Matthieu B
29934d08f4 Merge pull request #1294 from croax/codex/emby-multiserver-policy
Fix multi-server Emby/Jellyfin invite permissions
2026-07-05 17:50:18 +02:00
zriddle
d30a3bdc23 Fix unlimited invite only recording first user in Latest Accepted Invites
When multiple users accept the same unlimited invite code, the user lookup
after a successful join used `filter_by(code=...).first()`, which always
returned the first user who ever used that code on the server — not the
user who just signed up. Subsequent users were never inserted into
invitation_users, so the home page card only ever showed the first acceptee.

Fix: look up the newly created user by username (unique per server) so each
acceptance is correctly attributed.

Add a regression test that asserts all users appear in invite.users after
multiple acceptances of an unlimited invite.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 19:00:08 -06:00
Danni Croax
62d8934035 Fix multi-server Emby permissions 2026-06-07 10:43:19 +00:00
Danni Croax
8e680388dd fix: handle multi-plex oauth invites 2026-06-06 12:40:31 +00:00
Matthieu B
59e2cb8199 chore: merge main into ldap branch, resolve conflicts 2026-03-29 16:28:20 +02:00
Matthieu B
06d8c94734 Merge pull request #1204 from wizarrrr/fix/tests-linting-types
fix: resolve all test failures, linting errors, and type errors
2026-03-29 16:24:36 +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
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
e5360491be fix: remove corrupt 0-byte session cache files instead of logging forever
Overrides cachelib's _remove_expired to delete empty/truncated session
files that cause endless "Exception raised while handling cache file"
warnings. Also cleans up corrupt files at startup.

Fixes #1180
2026-03-29 15:56:33 +02:00
Erwan Leboucher
5bb51e0cf1 feat(ldap): add LDAP authentication and invitation integration 2025-12-27 17:14:17 +01:00
Matthieu B
89762d96dd feat: add bundle preview functionality and improve token generation tests
- Added a preview link for bundles in the wizard settings page. closes #1048
- Enhanced the wizard steps template to handle bundle preview mode.
- Updated JavaScript to generate URLs for bundle preview and runtime modes.
- Improved test coverage for password reset token generation by asserting token creation.
2025-12-09 14:37:39 +01:00
Matthieu B
ac36e793e1 refactor: improve code formatting and readability across multiple files 2025-12-09 14:12:17 +01:00
Simon
1f2a5baf13 feat: add tests for password reset functionality 2025-11-21 01:00:29 +01:00
Matthieu B
3a294a02f0 feat: enhance username validation and trimming across forms 2025-11-04 19:02:56 +01:00
Matthieu B
704aaddd97 fix: tests 2025-11-03 17:51:45 +01:00
Matthieu B
d8bdc832c9 test: add assertions to ensure WizardStep retrieval after edits 2025-11-03 17:45:10 +01:00
Matthieu B
686d2625f3 feat: implement multi-level session grouping logic with extended time window and fallback matching 2025-10-28 13:08:34 +01:00
Matthieu B
1fb5881495 Refactor test fixtures to include session parameter for improved database handling 2025-10-26 16:06:05 +01:00
Matthieu B
986cf1e163 Refactor wizard bundle ID handling in InvitationFlowManager and InvitationWorkflow to improve readability and maintainability 2025-10-26 15:08:48 +01:00
copilot-swe-agent[bot]
b79b9fa4e8 Fix datetime timezone comparison error in user expiry
Co-authored-by: mtthidoteu <66959271+mtthidoteu@users.noreply.github.com>
2025-10-25 11:52:01 +00:00
Matthieu B
44a9381362 test: add integration tests for invite table route with timezone-aware datetime handling 2025-10-24 12:31:41 +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
5167d00bd7 Fix: pass tests 2025-10-20 12:32:40 +02:00
Matthieu B
986e7cb044 fix: Improve SQLite concurrency handling and testing cleanup for database files 2025-10-19 17:57:00 +02:00
Matthieu B
6ab5e024db Revert "Merge pull request #925 from wizarrrr/chore/python-3.14-upgrade"
This reverts commit 35dde7c19a, reversing
changes made to c8cf9905ba.
2025-10-19 14:05:59 +02:00
Matthieu B
4b2fb99a46 fix: Set multiprocessing start method to 'fork' for compatibility with pytest-flask on Python 3.14 2025-10-19 13:43:56 +02:00
Matthieu B
27399ec886 refactor: Consolidate session management logic into a dedicated fixture for improved test isolation 2025-10-18 16:46:00 +02:00
Matthieu B
42d4b56df1 Merge branch 'main' into plus 2025-10-18 16:07:43 +02:00
engels74
caceccab54 refactor(wizard): improve combo invitation flow consistency
This commit implements two improvements to the combo wizard invitation flow:

1. Badge Display Fix: Added the "pre-invite" / "post-invite" category badge
   above wizard steps in combo invites. This badge was already present in
   single-invite pages but was missing from combo invites.

2. URL Refactoring: Cleaned up combo wizard URLs to match the pattern used
   by single-invite wizards:
   - Before: /wizard/combo/0?category=pre_invite → /j/<code> → /wizard/combo/0?category=post_invite
   - After: /wizard/combo/pre_invite → /j/<code> → /wizard/combo/post_invite

   This makes combo URLs consistent with single-invite URLs
   (/wizard/pre-wizard → /wizard/post-wizard) by removing the step index
   from the path and using path-based category routing.

Changes include:
- Pass step_phase to template for badge display
- Update routes to use path-based categories instead of query parameters
- Update templates and JavaScript to handle new URL structure
- Fix form method attributes and template formatting
2025-10-16 18:24:58 +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
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
Mully
7da75c566d add enable_user implementation to tests 2025-10-10 11:00:42 -04:00
Mully
e4f49c575d fix comment: "user" -> "admin"
fix comment: "user" should say "admin" for this specific test

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-07 11:05:18 -04:00
Mully
f76de788cd test: GET /admins endpoint
+ Added tests for new GET /admins endpoint (basically the same as the users equivalent)
2025-10-06 11:03:56 -04:00
Matthieu B
62a3c10875 refactor: update button ID references in wizard tests to match new naming convention 2025-10-02 23:15:30 +02:00
Matthieu B
9fd4f4ff4b fix: increase performance test thresholds for invitation load testing to accommodate system variance 2025-09-27 19:27:47 +02:00
Matthieu B
587d92086d fix: improve invitation tests by enhancing visibility checks for form elements 2025-09-27 19:25:44 +02:00
Matthieu B
7e75632b42 fix: enhance invitation tests by ensuring visibility of form elements before submission 2025-09-27 19:04:24 +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
03694fc315 fix: test migrations 2025-09-16 13:16:35 +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
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
4a96da1850 fix(code-review): implement changes requested from automated code reviews 2025-09-07 15:54:43 +02:00