chore(polish): refine secrets documentation phrasing and simplify pdf_dc contract
This commit is contained in:
1 parent
7c5e14c905
commit
e789903c53
2 files changed
+5
-11
No files matched your search
@@ -41,9 +41,7 @@ From your laptop, open the encrypted secrets file:
|
|||||||
```bash
|
```bash
|
||||||
sops ~/Projects/active/homelab/Core/nixos/secrets.yaml
|
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`:
|
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.
|
||||||
- `*server` (for server boot decryption)
|
|
||||||
- `*laptop` (for operator editing)
|
|
||||||
|
|
||||||
### 2. Commit and Deploy
|
### 2. Commit and Deploy
|
||||||
Commit the newly encrypted ciphertext and push to your git remote:
|
Commit the newly encrypted ciphertext and push to your git remote:
|
||||||
|
|||||||
+4
-8
@@ -3,20 +3,16 @@
|
|||||||
|
|
||||||
# 1. pdf_dc: Decrypts a password-protected PDF document.
|
# 1. pdf_dc: Decrypts a password-protected PDF document.
|
||||||
# Uses 'qpdf' under the hood. Automatically searches for a default password
|
# 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.
|
# if no password argument is supplied.
|
||||||
pdf_dc() {
|
pdf_dc() {
|
||||||
local secret_file="${PDF_PASSWORD_FILE:-$HOME/.config/pdf_decrypt_password}"
|
local secret_file="${PDF_PASSWORD_FILE:-$HOME/.config/pdf_decrypt_password}"
|
||||||
local input_file="$1"
|
local input_file="$1"
|
||||||
local password="$2"
|
local password="$2"
|
||||||
|
|
||||||
# Attempt to auto-load password from config file if none was provided on the CLI
|
# Attempt to auto-load password from local config file if none was provided on the CLI
|
||||||
if [[ -z "$password" ]]; then
|
if [[ -z "$password" && -f "$secret_file" ]]; then
|
||||||
if [[ -f "$secret_file" ]]; then
|
password=$(cat "$secret_file")
|
||||||
password=$(cat "$secret_file")
|
|
||||||
elif [[ -f "/run/secrets/pdf_decrypt_password" ]]; then
|
|
||||||
password=$(cat "/run/secrets/pdf_decrypt_password")
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$password" ]]; then
|
if [[ -z "$password" ]]; then
|
||||||
|
|||||||
Reference in new issue
Block a user