No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-08 11:27:43 +02:00
bin Latest version 2026-09-08 11:27:43 +02:00
README.md Initial commit 2026-09-08 11:26:46 +02:00

doc

Browse, upload and open the documents stored on the Pi. Files never live on the local machines: ls and put go through ssh, and pdf decrypts into a tmpfs, opens the viewer, and cleans up when it exits.

Installation

tpm install doc

Create ~/.tpm/config/doc/env:

DOC_HOST='pi'
DOC_ROOT='/data/hdd/docs'
DOC_PASSAGE_KEY='thomas/key/pdf'
DOC_VIEWER='evince'             # optional, default: evince

DOC_HOST is an ssh alias; the key must be in the agent (non-interactive ssh). DOC_PASSAGE_KEY is the passage entry holding the password shared by all the PDFs. Requires qpdf and passage.

Usage

doc ls                            # top-level directories
doc ls paie/2026                  # one level, directories end with /
doc put facture.pdf factures/2026 # upload (remote directory is created)
doc pdf paie/2026/08.pdf          # decrypt into tmpfs and open

Notes

  • Every ls and put refreshes a local index of the remote tree in ~/.tpm/cache/doc/index.
  • pdf works in $XDG_RUNTIME_DIR (a per-user tmpfs, 0700, wiped at logout), not in /tmp, which is not a tmpfs on every distro. The decrypted file is removed as soon as the viewer exits, even on Ctrl-C.
  • The password is passed to qpdf through --password-file and a process substitution, so it never appears in ps or in the shell history.
  • Nothing here is a backup: the documents are only on the Pi, and their redundancy is the Pi's own replication/restic setup.