feat(documents): search and import from Paperless-ngx and Papra on request

A person stores one connection per system (base address, Papra
organization id, API token encrypted at rest) and can search it by
document name with tag and date filters, then import picked documents
one per request through the same ingest path as an upload: source-key
answer before any download, content dedup, deleted stays deleted, quota,
provenance, and the person's own AI reading setting. An import can link
the document to the visit, condition or vaccination it was picked for.

The operator lists the instances in DOCUMENT_SOURCE_ORIGINS; unset, the
feature is off. Only listed origins are contacted, through safeFetch with
the origin pinned, redirects refused, timeouts and byte caps. The routes
are cookie-only and owner-only. The token is registered for rotation,
removed by Delete all data, and not carried in backups.
This commit is contained in:
Marc-André Bombeck committed 2026-09-26 13:02:36 +02:00
1 parent 89b18e001e
commit fdc60f69c2
26 files changed
+2305 -1

No files matched your search

+4
View File
@@ -155,6 +155,10 @@ export const WIPE_MODELS = [
// Further import keys that resolved to a document by content; a child of
// the document, removed before it so the counts are truthful.
"DocumentSourceAlias",
// The person's own connections to Paperless-ngx / Papra (#1038), with their
// encrypted API tokens. A wipe that left them would leave a working
// credential to another system behind an account that erased everything.
"DocumentSourceConnection",
"ExtractedFact",
"ImportJob",