chore(polish): refine secrets documentation phrasing and simplify pdf_dc contract

This commit is contained in:
kiskaadee committed 2026-09-13 01:25:41 -05:00
1 parent 7c5e14c905
commit e789903c53
2 files changed
+4 -10

No files matched your search

+1 -3
View File
@@ -41,9 +41,7 @@ From your laptop, open the encrypted secrets file:
```bash
sops ~/Projects/active/homelab/Core/nixos/secrets.yaml
```
SOPS reads your local `~/.config/sops/age/keys.txt`, decrypts the file in `$EDITOR`, and automatically re-encrypts the ciphertext using the public recipient keys configured in `Core/.sops.yaml`:
- `*server` (for server boot decryption)
- `*laptop` (for operator editing)
SOPS uses your local age identity to decrypt the file and re-encrypts it for the recipients configured in `Core/.sops.yaml`, including the workstation operator and server runtime identities.
### 2. Commit and Deploy
Commit the newly encrypted ciphertext and push to your git remote:
+3 -7
View File
@@ -3,20 +3,16 @@
# 1. pdf_dc: Decrypts a password-protected PDF document.
# Uses 'qpdf' under the hood. Automatically searches for a default password
# in `$HOME/.config/pdf_decrypt_password` (or `/run/secrets/pdf_decrypt_password`)
# in `$HOME/.config/pdf_decrypt_password` (or via $PDF_PASSWORD_FILE)
# if no password argument is supplied.
pdf_dc() {
local secret_file="${PDF_PASSWORD_FILE:-$HOME/.config/pdf_decrypt_password}"
local input_file="$1"
local password="$2"
# Attempt to auto-load password from config file if none was provided on the CLI
if [[ -z "$password" ]]; then
if [[ -f "$secret_file" ]]; then
# Attempt to auto-load password from local config file if none was provided on the CLI
if [[ -z "$password" && -f "$secret_file" ]]; then
password=$(cat "$secret_file")
elif [[ -f "/run/secrets/pdf_decrypt_password" ]]; then
password=$(cat "/run/secrets/pdf_decrypt_password")
fi
fi
if [[ -z "$password" ]]; then