github sassanix/Warracker 1.0.8

2 hours ago

⚙️ Release 1.0.8: Team Notes, Expiry History, and Fixes

Version 1.0.8 adds team notes on warranties and a full expiration change history, fixes Paperless-ngx 3.x uploads and duplicate notification emails, closes a DNS rebinding gap in product photo fetching, and carries two security hardening passes across file access, proxy headers, Paperless ownership, JWT transport, and account cleanup. It also polishes desktop, tablet, and mobile layouts, completes localization across all 20 supported languages, speeds up warranty and dashboard loading, refreshes the OIDC redirect page, shrinks the Docker image, and carries dependency, Docker base image, and CI updates. Two new database tables are added by migrations that run automatically on startup.


✨ New Features

  • Team notes on warranties: anyone who can view a warranty can now add a note to it, and each entry shows the username of the person who added it and the time it was added. Team notes default to newest first by posted date, with a sort control in the notes modal to switch between Newest first and Oldest first. Warranty cards always show the Notes link, with a team-note count when entries exist, so notes can be added even when the warranty's own notes field is blank. Entries live in a new table, so the warranty's own notes field is untouched and stays editable only by the owner or an admin. An entry can be deleted by its author, the warranty owner, or an admin, using the trash icon beside the entry. With global view off, or restricted to admins, non-owners can neither view nor add entries.

Team notes sorted newest first

  • Warranty expiration change history (#209): editing a warranty's expiration date, duration, or lifetime status now records the transition (previous value, new value, timestamp, editor, and an optional reason up to 255 characters) in a new warranty_expiry_history table, without automatically mutating dates from claims. Warranties with recorded changes show a subtle clickable history badge next to the expiration date across the dashboard and Status page, opening an Expiry History modal. The Status page detail row and the Edit Warranty modal also display the change history, and the Edit Warranty modal dynamically reveals the optional reason field only when expiration inputs are modified.

🔐 Security

  • Security hardening, file containment and owner protection (#302): local file routes now require a matching warranty or claim database reference even for admins, reject dotfiles and symlinks or paths escaping the upload folder, and serve active or unrecognized document types as downloads with sandboxing headers. Admin user updates require strict boolean types, non-owner admins cannot edit Application Owner accounts, email uniqueness checks are case-insensitive, remaining frontend XSS sinks are escaped, OIDC code exchange and password-reset token redemption are atomic, Paperless title search no longer leaks whether another user's document exists, Global View responses redact other users' emails and private other-document metadata for non-admins, and container file ownership is tightened.
  • Security hardening, proxy headers, Paperless strict ownership, JWT transport, and account cleanup (#303): bundled Nginx trusts forwarded proto headers only from loopback, LAN, or Docker proxy ranges unless TRUST_PROXY_HEADERS says otherwise, strips forwarded host and prefix headers, removes duplicate CORS headers and debug surfaces, and Gunicorn forwarded IP trust is scoped and configurable. OIDC login derives redirect_uri from FRONTEND_URL or APP_BASE_URL, preferring a non-localhost URL if the other is left at the Compose localhost default, instead of trusting spoofable request headers. The About page no longer loads the remote Buy Me a Coffee script. Paperless settings gain an opt-in Restrict Pre-Existing Documents to Admins toggle, off by default. Backend JWT auth accepts tokens only in the Authorization: Bearer header, local accounts confirm their current password before self-deleting, unreferenced uploaded files are cleaned up when users or accounts are deleted, password-reset emails dispatch asynchronously, and warranty or document web URLs are validated to http or https.
  • Product photo fetch pins the connection to the validated address (GHSA-7rwc-pg49-r48w): the photo-by-URL fetch used to validate a hostname and then let the HTTP client resolve it again at connect time, so a DNS answer that changed between the two lookups could steer the connection to a private address the guard never saw. The fetch now resolves each hop hostname exactly once, validates every returned address, and connects to a validated public address, preferring IPv4 on dual-stack hosts so IPv4-only Docker containers can still connect and falling back to IPv6 for IPv6-only hosts. There is no second lookup and no failover. For https the connection still presents the original hostname as SNI and verifies the certificate against it, and the Host header still carries the original hostname. The fetch also no longer follows environment proxy settings, since a proxy would resolve the hostname itself. Reported by Batuhan Yilmaz (abyilmaz-BatuhanYILMAZ).

🐛 Fixes

  • Paperless-ngx 3.x uploads resolve again (#298): the task poll only understood the Paperless API v9 shapes, so against Paperless-ngx 3.x (API v10) it never recognized a finished task: the detail lookup 404s, the list reply is a paginated page object, the status is lower case, and the document arrives in related_document_ids. The poll now remembers the list-endpoint fallback after the first 404, unwraps paginated pages, compares the status case-insensitively, and reads related_document_ids[0] (with the result_data text as a fallback), so uploads resolve in seconds again instead of timing out after 10 minutes and saving with no document link. The v9 shapes keep working unchanged. The upload route also releases its database connection before the poll starts instead of holding it idle in transaction for the whole wait, and takes a fresh one only for the ownership claim afterwards.
  • One notification scheduler, no duplicate emails (#299): with preload_app the app was built in the gunicorn master, where no worker id is set, so the scheduler started there and every forked worker inherited a running copy; each copy sent the same notification. The scheduler now starts exactly once, in the master from the gunicorn when_ready hook, using GeventScheduler in gevent modes so forked workers do not trip threading cleanup errors. create_app never starts it under gunicorn, and each worker discards the copy it inherits before serving. The master publishes a live scheduler status snapshot so the admin scheduler status still reports accurate status and next run time when served by a worker. Apprise threshold sends are also claimed up front, so even if two copies of the job ever run at once only the one that inserted the claim row sends, and a failed send releases its claim so the threshold stays due and retries. Forked workers no longer close the database pool they inherit; the pool reference is dropped instead and a fresh pool is created per worker.
  • Status page expiry-history badge now shows (#209): the Status page rebuilt each warranty into a new object without carrying expiry_change_count through, so the history badge never rendered on a row and the expanded-row history section never appeared, even though the API returned the count. The count is now carried through.
  • Localization completeness and i18n fixes across all 20 languages: broken placeholder translation keys are fixed, missing Polish plural forms are added, and the i18n loader no longer overwrites fallback text with raw keys. Previously hardcoded labels, tooltips, modals, toasts, confirms, and alerts are localized across the main pages and scripts, untranslated English strings are translated, and 153 newly wired keys are added across all 20 supported languages with full key and placeholder parity. Automated i18n regression tests now guard key, placeholder, and plural coverage.
  • Desktop, tablet, and mobile QA fixes: the Edit Warranty modal now preserves existing invoice, manual, and other document URLs when saving unrelated fields, Notes modal saves use the target warranty's vendor and model number instead of stale hidden inputs, and Tag Management no longer double-submits on the home dashboard. Password reset errors now display cleanly and re-enable the submit button, Home CSV export filtering matches the visible warranty list, Settings dropdown defaults load correctly, and the Status Dashboard and Claims views exclude archived or voided warranties where they should. Mobile and tablet layouts are fixed across Home, Status, Settings, and auth pages, including search wrapping, popover placement, table headers, modal layouts, empty states, and broken background image URLs.
  • Settings profile fields no longer revert to Loading: asynchronous translation passes could overwrite loaded Settings profile fields back to Loading... after JavaScript had populated them. Dynamic elements now clear their translation attributes when populated, so the current user name, email, Apprise status, and related dynamic status fields stay correct after translations load.
  • Global-to-Personal scope switching no longer shows other users' warranties as editable: switching from Global view back to Personal view could briefly leave other users' warranties rendered with editable controls while stale requests finished. Scope changes now cancel or ignore stale responses, clear stale warranty state on errors, and enforce owner or admin checks in the renderer regardless of the current view scope, so non-owner warranties and private documents do not render as editable or accessible during scope changes.
  • Faster warranty and dashboard loading: warranty list endpoints now batch serial number, tag, expiry history, team note, and claim lookups instead of running per-warranty query loops, statistics use single-pass aggregate queries, and token validation combines user and session checks into one database round trip. The frontend also removes duplicate startup requests, loads the All view in one request where possible, and limits thumbnail fetches so dashboard loading does less repeated work.
  • OIDC SSO redirect page fixed and redesigned: the redirect page layout no longer squeezes the status card beside the footer on desktop or mobile. It now matches Warracker's light and dark themes, shows clearer loading, success, and error states, re-translates dynamic messages after locale files load, scrubs single-use code parameters from browser history, uses fetch timeouts, and includes localized OIDC error messages across all 20 languages.

📦 Dependencies and Build

  • Security and Python dependency updates (#295): Apprise moves from 2.2.0 to 2.3.0, carrying upstream security fix GHSA-rmjg-h4cf-m74j along with OAuth token redaction in debug logs, slow-attachment timeout protection, and new notification services. Authlib moves from 1.9.5 to 1.9.10.
  • Smaller Docker image, dependency cleanup, and dead-code removal: unused Python dependencies are removed, backend timezone handling moves from pytz to Python's standard library zoneinfo, the container healthcheck uses a standard library Python probe instead of curl, and dead frontend and localization files are removed. The built Docker image drops from 376 MB to 262 MB, with unchanged runtime behavior.
  • Docker base image and BuildKit syntax refreshed (#290, #296): the pinned python:3.15-slim-trixie base image digest was refreshed in both Dockerfile stages to pick up upstream Python and Debian Trixie security updates, and the BuildKit Dockerfile syntax moves from 1.28.0 to 1.29.0.
  • CI workflow pinning and Renovate action update (#279, #282): pinned actions/checkout, actions/setup-python, the CI postgres:15 service image, and Python version in the test and Docker workflows by commit SHA/digest for supply-chain safety, and updated renovatebot/github-action from v46.3.10 to v46.3.14.

Upgrading: back up (database + uploads volume), pull the new image, recreate the container. Migrations run automatically on startup, including migration 056 (warranty note entries) and migration 057 (warranty expiry history). Behavior changes to know about:

  • Product photo fetching no longer follows environment proxy settings. The fetch connects directly to the validated address so a proxy cannot resolve the hostname itself. Installs that relied on an environment proxy for outbound photo fetches will fetch directly instead.
  • API tokens must use the Authorization header. Query-string and form-field JWT fallbacks are rejected. The web UI already uses the header; scripts or integrations that put tokens in URLs must switch.
  • Local account self-deletion asks for the current password. Passwordless OIDC accounts are unaffected.
  • Proxy header trust is stricter by default. Deployments behind a public-address proxy should set TRUST_PROXY_HEADERS=true or GUNICORN_FORWARDED_ALLOW_IPS as appropriate so forwarded proto and client IP handling stays correct.
  • OIDC redirect URIs now follow the configured public URL. If your OIDC provider registered an http://<your-domain>/api/oidc/callback redirect URI while FRONTEND_URL or APP_BASE_URL uses https://, update the provider's Authorized Redirect URI to https://<your-domain>/api/oidc/callback to avoid redirect_uri_mismatch.
  • Paperless strict ownership is opt-in. The new Restrict Pre-Existing Documents to Admins toggle is off by default, so existing Paperless claiming behavior does not change unless an admin turns it on.

Don't miss a new Warracker release

NewReleases is sending notifications on new releases.