Commit Graph
4482 Commits
Author SHA1 Message Date
Trenton HandClaude Sonnet 5.5 72402ff9eb Chore: Drop the sample duplicate guard test
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 15:17:57 -07:00
Trenton HandClaude Sonnet 5.5 16994187c6 Chore: Use shared samples in tests that arrived from dev
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 15:17:57 -07:00
Trenton HandClaude Sonnet 5.5 577691a445 Chore: Tidy leftover parentheses and the samples module docstring
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 15:17:57 -07:00
Trenton HandClaude Sonnet 5.5 3b9f252f47 Chore: Remove duplicate and unreferenced test sample files
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 15:17:57 -07:00
Trenton HandClaude Sonnet 5.5 e396fce5ec Chore: Materialise duplicated media-tree samples from the shared copies
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 15:17:57 -07:00
Trenton HandClaude Sonnet 5.5 014231b88f Chore: Use the shared simple-digital.pdf in documents tests and drop the unreferenced simple.txt
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 15:17:57 -07:00
Trenton HandClaude Sonnet 5.5 64ca9caaf2 Chore: Move the four duplicated parser sample PDFs into a shared paperless_testing location
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 15:17:57 -07:00
GitHub Actions 5f17b1a310 Auto translate strings 2026-10-24 21:12:29 +00:00
shamoon 63eca7b427 Enhancement: skip local 2FA for trusted OIDC AMR (#14403) 2026-10-24 21:11:10 +00:00
GitHub Actions c88d02ab42 Auto translate strings 2026-10-24 20:30:00 +00:00
Trenton H 4299e9b12e Chore: consolidate direct permission grant lookups into one helper (#14456)
* Chore: drop get_groups_with_only_permission

It worked around get_groups_with_perms lacking only_with_perms_in, which
django-guardian added in 3.1.0. The pinned version is newer.

* Chore: consolidate direct grant lookups into get_permission_grantees

Six places listed who holds a permission on an object, each with its own
query and result shape, and one had already drifted into expanding group
members.

* Chore: drop the unreachable empty viewer grant default

get_permission_grantees returns an entry for every requested document.
2026-10-24 13:28:25 -07:00
Trenton H 10a1a9eae8 Chore: drop get_groups_with_only_permission (#14454)
It worked around get_groups_with_perms lacking only_with_perms_in, which
django-guardian added in 3.1.0. The pinned version is newer.
2026-10-24 13:28:25 -07:00
Trenton H e7d70497c2 Chore: Consolidate to a single way to set permission on an object (#14453)
* Chore: drop set_permissions_for_object in favor of the bulk helper

The same grant rules were implemented twice, and only the bulk version
validated every action before writing, so the single-object one could leave
a partial change behind.

* Chore: type the set-permissions dict

Callers passed whatever they had, including querysets of User and Group
objects that only worked because id__in accepts a subquery.
2026-10-24 13:28:25 -07:00
shamoon f71a9a6eda Merge branch 'main' into dev 2026-10-22 15:38:13 -07:00
shamoon 558cb01a1d Bump version to 3.3.4 2026-10-22 14:58:47 -07:00
GitHub Actions 35ba0b36a8 Auto translate strings 2026-10-22 19:30:17 +00:00
Trenton H 7bdbcca051 Chore: Refactor bulk edit to remove PDF knowledge (#14445)
* Refactor: add pure pdf_ops module with real-PDF tests
* Drops tests we don't relly need + adds the typing annotation
* Now that I'm sure it works, re-work these tests to mock pdf_ops, rather than pikepdf
* Validates pages ahead of time in build_pdfs rather than during the building
* Adds the given/when/then and some additional cleanups of pytest style
* This is redundant now
2026-10-22 19:25:39 +00:00
Ben Petty 9b56dc2f61 Fix: folder export with --delete fails on a stale manifest.json.tmp (#14526) 2026-10-22 11:50:31 -07:00
GitHub Actions e2b884d353 Auto translate strings 2026-10-22 12:55:09 +00:00
shamoon 97c98ee44c Fix: fix list type for api schema document object filters (#14524) 2026-10-22 05:53:17 -07:00
GitHub Actions f25fd5365f Auto translate strings 2026-10-21 15:47:44 +00:00
Trenton H a3b358bad7 Chore: drop get_objects_for_user_owner_aware (#14457)
Drops get_objects_for_user_owner_aware. Callers now use restrict_queryset_to_visible.

The same question was answered two ways, and the guardian path did not deny
deactivated users the way permitted_object_ids does.
2026-10-21 15:46:23 +00:00
Trenton H b904881472 Chore: share one base class for the method-mapped permission classes (#14458)
* Chore: share one base class for the method-mapped permission classes

ViewDocumentsPermissions, TrashPermissions, PaperlessNotePermissions and
AcknowledgeTasksPermissions each repeated the same has_permission body and
disagreed on HTTP methods missing from their perms_map.

GlobalPermissionsByMethod now holds that logic once. HEAD is checked
against the GET entry and a method missing from the map is denied. The
task acknowledge map gains OPTIONS, now requiring change_paperlesstask
like POST instead of being open to any authenticated user. The global
statistics and system status checks also share their active and
authenticated preamble.

* Chore: type GlobalPermissionsByMethod.perms_map keys as HTTP methods

perms_map accepted any string key, so a misspelled method or a HEAD entry
would never match. Keys are now a Literal of the mappable methods, without
HEAD, and the map is typed read-only.
2026-10-20 20:32:13 -07:00
Trenton HandClaude Sonnet 5.5 c089bba32c Chore: Drop ImageMagik as a dependency (#14440)
* Mark the thumbnail constants Final

* Comment each pdftoppm option

* Feature/Chore: Replaces all usages of ImageMagik's convert binary with a simple Pillow based helper

This removes ImageMagik as a dependency entirly and all documentation is cleaned up from it.
We no longer need to install it, have a policy for it to allow PDFs and no longer shell
out to it either.

* Fix: Save WebP images losslessly when removing the alpha channel

Pillow's default WebP save is lossy, so a WebP with an alpha channel came
back from remove_alpha_channel with slightly shifted pixel values before
it reached OCR. Save WebP lossless; other formats are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 11:22:43 -07:00
Trenton HandClaude Sonnet 5.5 a05afd654c Feature: Generate PDF thumbnails via poppler utils (#14420)
* Chore: Generate PDF thumbnails with pdftoppm and Pillow instead of ImageMagick

Replace the ImageMagick convert based PDF thumbnail path with pdftoppm and
Pillow. Keeps thumbnails at 500px wide for small and odd sized pages, covers
the qpdf repair and double failure paths, removes the unused run_convert
helper, hardens thumbnail encoding, deprecates PAPERLESS_CONVERT_MEMORY_LIMIT
and PAPERLESS_CONVERT_TMPDIR, and corrects the related docs and CI.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Chore: Supersample the PDF thumbnail render 2x

Render the PDF page at twice the target size and downsample, with edge case
handling for small and odd sized pages, simplified helpers and tests, and
trimmed comments.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Fix: use a fractional thumbnail DPI so oversized pages render a bounded raster

* Deprecate the unused PAPERLESS_GS_BINARY setting too

* Warn at startup when pdftoppm is missing

* Resample PDF thumbnails once instead of twice with LANCZOS, still never enlarging

* Read PDF page size from pdfinfo so it matches pdftoppm

* Mark the thumbnail constants Final

* Comment each pdftoppm option
2026-10-20 11:22:42 -07:00
GitHub Actions f730513e79 Auto translate strings 2026-10-20 05:27:06 +00:00
shamoon d4826f50c9 Fix: prevent doc permissions queries on schema view (#14503) 2026-10-19 22:25:52 -07:00
shamoon 20b7a116fd Fix: dont defer tag assignment when barcode will not result in a split (#14497) 2026-10-19 15:37:04 -07:00
shamoon 31caf01ae5 Bump version to 3.3.3 2026-10-19 10:06:39 -07:00
shamoon e756f5985f Merge branch 'dev' 2026-10-19 10:05:59 -07:00
github-actions[bot]andCrowdin Bot ce1dee7549 New Crowdin translations by GitHub Action (#14474)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-10-19 16:58:46 +00:00
GitHub Actions 814b208280 Auto translate strings 2026-10-19 15:41:29 +00:00
shamoon 11c32d352e Fix: dont include doc content on global search results (#14488) 2026-10-19 08:40:05 -07:00
Trenton H a8b835fcd0 Fix: use float parsing for importer manifest records with a passphrase (#14483) 2026-10-18 15:16:13 -07:00
GitHub Actions 41498113d3 Auto translate strings 2026-10-18 14:29:34 +00:00
309a4b004d Fix: respect subpath in logout, share link and auto-login redirects (#14476)
---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
2026-10-18 14:28:15 +00:00
Trenton H 0cb2cdbfdd Fix: handle single-class classifier in threshold prediction (#14471) (#14473)
scikit-learn treats a single-class fit as binary, so predict_proba returns
[1 - p, p] for one class and argmax could index past classes_. Use only
column 0, the real class, so the confidence threshold still applies.
2026-10-16 10:47:58 -07:00
GitHub Actions 1f3d451a3a Auto translate strings 2026-10-16 17:12:50 +00:00
Trenton H 183cfd2da4 Fix: keep counter and extension when shortening long public filenames (#14472)
get_public_filename relied on sanitize_filename to truncate, which cuts
from the end and so dropped the counter and extension of long titles.
Multi-byte titles could also exceed the 255 byte filesystem limit.

Shorten the title by UTF-8 bytes before appending the counter and
extension. The exporter reserves room for its longer derived thumbnail
and archive suffixes.
2026-10-16 10:11:34 -07:00
shamoon 04a927c25f Bump version to 3.3.2 2026-10-15 22:52:43 -07:00
github-actions[bot]andCrowdin Bot 1943c99b27 New Crowdin translations by GitHub Action (#14449)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-10-15 22:51:00 -07:00
shamoon 8b26ecafb6 Fix: prevent ownerless docs leaking others in to LLM prompts 2026-10-15 22:42:34 -07:00
Trenton H d4a57204eb Fix: copy only direct user grants in DocumentMetadataOverrides.from_document (#14452)
get_users_with_perms includes group members by default, so PDF actions such
as merge and split gave them direct grants on the new documents, which
outlived their group membership.
2026-10-15 15:11:28 -07:00
GitHub Actions 34a6c718fa Auto translate strings 2026-10-14 15:18:54 +00:00
shamoon 14aaa42777 Fix: support combined text/query searches (#14443) 2026-10-14 08:17:22 -07:00
Trenton H 6e717817c6 Fix: make exporter derived file names unique when originals differ only by extension (#14429) 2026-10-12 15:14:08 -07:00
shamoon c4d1b0c732 Bump version to 3.3.1 2026-10-12 13:01:03 -07:00
github-actions[bot]andCrowdin Bot 49a298894e New Crowdin translations by GitHub Action (#14368)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-10-12 12:59:46 -07:00
GitHub Actions 551ebad6f1 Auto translate strings 2026-10-12 19:13:03 +00:00
Trenton H 4171ecf166 Chore: share the authorizing owner rule between the id sets and the trash filter (#14425)
The trash list needs to show a version to whoever owns its root document, but
it deliberately shows only owned and unowned documents and ignores explicit
shares, so it cannot use permitted_object_ids. #14384 gave it its own
filter_queryset with a hand-built condition through the root, which describes
the same rule as the annotations in permitted_object_ids a second time.

Move those annotations into annotate_authorizing_fields. PermittedObjectsFilter
gains a parent_field attribute that its owner-only and granted paths both use,
and the trash filter shrinks to setting include_granted and parent_field.
2026-10-12 12:11:42 -07:00