Commit Graph

263 Commits

Author SHA1 Message Date
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
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
Danni Croax
62d8934035 Fix multi-server Emby permissions 2026-06-07 10:43:19 +00:00
Matthieu B
6ebafbf328 fix: deduplicate wizard steps in multi-server setups and add bundle selection to API
Default wizard steps were duplicated once per server instance of the same
type (e.g., 2 Plex servers → 6 steps instead of 3). Deduplicate the
server type list before loading steps so each type's steps appear only once.

Also add the missing wizard_bundle_id parameter to the invitation creation
API, matching the existing web UI capability.

Closes #1219
2026-04-01 22:33:27 +02:00
Matthieu B
59e2cb8199 chore: merge main into ldap branch, resolve conflicts 2026-03-29 16:28:20 +02:00
Matthieu B
14df208566 Merge pull request #1201 from wizarrrr/fix/1168-plex-reinvite-update
fix: update existing Plex share on re-invite instead of failing
2026-03-29 16:25:43 +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
b5cc553ee8 Merge pull request #1199 from wizarrrr/fix/1174-api-key-legacy-admin
fix: handle legacy admin user when creating API keys
2026-03-29 16:25:38 +02:00
Matthieu B
000085731f Merge pull request #1198 from wizarrrr/fix/1163-expiry-display
fix: preserve per-server expiry dates in user grouping
2026-03-29 16:25:23 +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
672475469d fix(ldap): security, architecture, and code quality improvements
- Fix SUBTREE→BASE scope in _fetch_user_attributes (security)
- Remove is_ldap_user threading from all 8 media client interfaces;
  set flag after join via workflow-level User.query.update instead
- Use find_user_dn (search-based) instead of build_user_dn (concatenation)
  in delete_user and reset_user_password for robustness
- Wrap all user-facing strings in _() for i18n in ldap_auth.py
- Fix username fallback from hardcoded "wizarr" to unique per-user
- Return failure from _update_existing_user when password update fails
- Replace dynamic Tailwind classes with explicit conditionals in alert
- Add stale group cleanup and upsert in sync_ldap_groups
- Remove fake @ldap.local email fallback in user_sync
2026-03-29 16:18:41 +02:00
Matthieu B
751bfb67dd fix: update existing Plex share on re-invite instead of failing (#1168)
When a user who already has a Plex share uses a new invite link, the
"already sharing" error from the Plex API is now handled gracefully by
calling update_user_libraries() and update_user_permissions() instead of
propagating the error to the end-user. The route layer also switches to
a generic, translatable user-facing error message backed by structlog for
admin-visible diagnostics.
2026-03-29 16:15:24 +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
09b79b5e0d fix: handle legacy admin user when creating API keys (#1174)
When the legacy AdminUser (id="admin", a string) is logged in and tries
to create an API key, the string id was being passed to the Integer FK
column created_by_id on ApiKey, causing a DB type mismatch error. Resolve
the id by looking up the first AdminAccount row instead. Also adds a
try/except with session rollback around the DB write so failures surface
as a flash message rather than a 500.
2026-03-29 16:10:35 +02:00
Matthieu B
9f3d66e4fe fix: preserve per-server expiry dates in user grouping (#1163)
Stop mutating primary.expires in _group_users_for_display(); store the
computed earliest date in primary.earliest_expires instead so each
account's individual expires value remains intact for the mixed-expiry
detection logic in user_card.html.
2026-03-29 16:10:19 +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
Matthieu B
b0856b7473 Merge pull request #1113 from JSWANS0N/main
Add Telegram notification support
2026-03-29 15:32:36 +02:00
Matthieu B
9d6e0406d0 feat: help lost user find thier way closes #1063
On accepting an invite, we store a cookie. On the login page a little banner will be shown letting a user know this is an admin page
2026-02-25 02:05:08 +01:00
Matthieu B
0902f4ba93 feat(invites): streamline invite expiry handling and update UI for expiration display 2026-02-25 02:02:08 +01:00
Matthieu B
ad7f07319d feat(invites): implement per-server expiry handling and update invite modal closes #1138 2026-02-23 12:33:29 +01:00
lostpolaris
260165bc2a Change library deletes to upserts
This fixes a long-standing issue where scanning a library would cause an
unintended cascade delete of the invite_library table and would reset
the associated invite's permissions.
2026-02-09 17:08:30 -06: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
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
4af196f0b8 feat: add manual cleanup route for expired users in settings closes #1047 2025-12-09 14:24:21 +01:00
Matthieu B
ac36e793e1 refactor: improve code formatting and readability across multiple files 2025-12-09 14:12:17 +01:00
Matthieu B
2b2e289133 Update app/blueprints/admin/routes.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-04 13:00:17 +01:00
Matthieu B
a2259f7baf Update app/blueprints/admin/routes.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-04 12:58:35 +01:00
Matthieu B
9651cd0268 Update app/blueprints/api/api_routes.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-04 12:57:25 +01:00
Matthieu B
df6181a8c6 Update app/blueprints/admin/routes.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-02 20:04:20 +01:00
Simon
1f748c37b2 feat: improve the password reset functionality for jellyfin 2025-11-21 00:49:05 +01:00
Simon
930b1c1a2c feat: Implements password reset functionality.
- A new API endpoint for requesting a password reset token, which can be accessed either through an API key or an authenticated session.
- A public route for handling the password reset process using the generated token.
- Updates media client to allow password resets.
2025-11-21 00:15:09 +01:00
Matthieu B
f9ae61e1b4 fix: Refactor invitation handling to use individual user's acceptance timestamp and update package-lock.json for peer dependency closes #1015 2025-11-19 15:25:19 +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
fca67912fe feat: implement server-specific color theming for invitations and wizards closes #982 2025-11-06 12:59:57 +01:00
Matthieu B
64d0c69457 refactor: update user detail handling to only modify fields present in the form closes #980 2025-11-04 18:07:49 +01:00
Matthieu B
a8fe651c51 fix: update redirects from public.index to public.root for consistency 2025-11-03 14:53:39 +01:00
Matthieu B
0050f4b646 feat: allow user edit 2025-11-03 14:36:04 +01:00
Matthieu B
eca653b10b fix: kavita api errors closes #952 2025-10-27 15:04:24 +01:00
Matthieu B
325239fd62 Refactor media server deletion logic to improve clarity and ensure proper cleanup of related records 2025-10-26 15:14:12 +01:00
Matthieu B
5feaf51337 Enhance wizard step management and UI
- Updated the sub-navigation for the wizard to conditionally display step creation options based on the default state and available bundles.
- Improved the bundles page layout by categorizing steps into pre-invite, post-invite, and additional categories, enhancing user experience.
- Added orphaned step handling to allow users to remove steps that no longer have an associated entry.
- Displayed the associated wizard bundle name in the invite card if applicable.
- Adjusted JavaScript routing for bundle steps in the wizard.
- Modified the development script to set the NODE_ENV to development when installing npm dependencies, ensuring proper handling of devDependencies.
- Updated the subproject reference in the plus directory to indicate a dirty state.
2025-10-26 12:26:26 +01:00
Matthieu B
faa8a40305 fix: ensure timezone-aware datetime handling for invitations and user expiry 2025-10-23 22:16:55 +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
e70263deab refactor: streamline conditional checks and improve logging clarity 2025-10-23 18:44:30 +02:00
Matthieu B
9b5aa0972a refactor: remove slop from media and new linting rules 2025-10-23 18:33:50 +02:00
Matthieu B
47f57e0ca7 refactor: update library grouping by server ID and adjust template rendering for invitations closes #938 2025-10-22 12:19:53 +02:00
AlexWhitehouse
7d96e92243 feat: Discord notifications now use rich embeds with Wizarr branding
- Convert Discord notifications from plaintext to rich embeds
- Add Wizarr application icon and branding to all notifications
- Include structured version fields for update notifications
- Update test notifications to use proper titles

Closes #935
2025-10-21 15:30:41 +01:00
Matthieu B
07166a1a80 refactor: update Emby collector to use Sessions API polling instead of WebSocket
fix: correct key for transcoding info in admin routes
feat: enhance Jellyfin client to extract additional session and media details
fix: update template to reflect changes in transcoding info structure
chore: update submodule reference for plus
2025-10-21 11:48:07 +02:00
Matthieu B
3e84e68f8b fix: remove deprecated Plus audit route and update Plus settings tab link 2025-10-20 15:49:17 +02:00