From 8440c6816f833e9848bbfd976902af46f49d6ff3 Mon Sep 17 00:00:00 2001 From: Igor Soarez Date: Fri, 20 Nov 2026 10:51:00 +0000 Subject: szecret list: a terminal view worth reading, and --json At a terminal, list shows each bucket this machine reads: its readers by name (hosts from recipients, admins from a "# " line above their key in SZECRET_ADMINS_COMMAND's output, "the admins" once per bucket), its secrets in columns fitted to the width, any problem the file names and headers show with the command that fixes it, and a summary. No key is shown without --keys or --json. --all groups the buckets not read here after the rest. It reads every bucket in one awk pass, never decrypting. Piped output and --names, which scripts read, are unchanged. --- secrets/README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'secrets/README.md') diff --git a/secrets/README.md b/secrets/README.md index a6ae932..5e98f3f 100644 --- a/secrets/README.md +++ b/secrets/README.md @@ -26,7 +26,7 @@ szecret list | `mv ` | Move a secret to another bucket; never copies | | `mv --phone ` | The same, for a secret this machine can't read: an admin elsewhere (`SZECRET_PHONE_COMMAND`) rewraps its file key | | `rekey ` | Re-encrypt a bucket to its readers now; adding a reader needs a yes or `--add-ok` | -| `list` | The secrets this machine reads (`--names`, `--all`) | +| `list` | The secrets this machine reads, by bucket, with who reads each and anything wrong (`--all`, `--keys`, `--json`, `--names`) | | `check [--all]` | Check that the buckets this machine reads (or every bucket) are whole | | `enrol [--tpm\|--se]` | Make this machine's identity and print its public key | | `ready` | Check there is a store and an identity | @@ -59,6 +59,16 @@ buckets// `~/.local/share/szecret/identity`, made by `enrol` and never copied off; its public key is in `identity.pub` beside it. Decrypting passes it and the old key together while both are here. +- **`list`** at a terminal shows each bucket this machine reads: its + readers by name, its secrets in columns, any problem its file names and + headers show (a pending rekey, a file that isn't age, one encrypted to a + different number of keys) with the command that fixes it, and a summary. + Readers are named by the comment above their key in `recipients`; admins by + a `# ` line directly above their key in `SZECRET_ADMINS_COMMAND`'s + output (older szecret ignores such lines). No key is shown without + `--keys` or `--json`. Piped, it prints bare names one a line, and + `--names` prints `/`: both are read by scripts and stay as + they are. - **Names** are `[A-Za-z0-9][A-Za-z0-9._-]*`, buckets lowercase, and a name is unique across every bucket and the old store. - age 1.3 or later is needed to encrypt (it encrypts to `age1tag1` hardware @@ -174,7 +184,8 @@ For testing or custom setups, these environment variables override default paths | `SZECRET_PRIVATE_KEY_DIR` | Directory containing private keys (named by their public key) | `~/.local/share/szecret` | | `SZECRET_BUCKETS` | Buckets directory | `~/.local/share/szecret/buckets` | | `SZECRET_IDENTITY` | This machine's identity (its public key in `.pub`) | `~/.local/share/szecret/identity` | -| `SZECRET_ADMINS_COMMAND` | Prints the admins' public keys, one a line | (none: nothing is encrypted to a bucket) | +| `SZECRET_ADMINS_COMMAND` | Prints the admins' public keys, one a line, each optionally named by a `# ` line above it | (none: nothing is encrypted to a bucket) | +| `SZECRET_FORCE_TTY` | `list` prints its terminal view even when piped; a number sets the width | (none) | * Private keys are stored in `~/.local/share/szecret/` (or `$SZECRET_PRIVATE_KEY_DIR`), with each file named after its public key (e.g. `age1...`). * `id.pub` indicates which public key is current. -- cgit v1.2.3