fix: keep the mirror out of the device root

Proton refuses a file directly in a device's root folder — 422 "Cannot
create file at the root of a device" — so the first real backup died on
RESTORE.txt, before it had written anything. The mirror now lives in a
`data/` folder on the device, which is both what Proton permits and the
honest name for what it holds: the contents of DIARY_DATA_DIR.

Every remote path changed with it, so the bookkeeping describing the old
layout is dropped and rebuilt on the next run. A device root that
already collected an empty `uploads/` folder from the failed attempt
keeps it; it is not ours to guess about, and deleting it is one click.

Also quiet rPGP's packet-header warnings by default. They fire on every
key Proton wrote slightly differently to how rPGP re-serialises it —
cosmetic, once per unlock, and loud enough to bury the backup's own log.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D5Gk8FPkRXu1e6Nj2BCRE1
This commit is contained in:
nvrlandClaude Opus 5 committed 2026-09-05 13:39:41 +02:00
1 parent ca0039400e
commit 7646ecc397
5 files changed
+62 -24

No files matched your search

+8 -1
View File
@@ -36,7 +36,14 @@ async fn main() -> Result<()> {
dotenvy::dotenv().ok();
tracing_subscriber::registry()
.with(EnvFilter::try_from_env("DIARY_LOG").unwrap_or_else(|_| EnvFilter::new("info")))
// rPGP warns on every key it re-serialises differently to how Proton
// wrote it — a cosmetic packet-header difference, once per unlock, that
// otherwise buries the backup's own log lines. `DIARY_LOG` overrides
// all of this when something needs looking at.
.with(
EnvFilter::try_from_env("DIARY_LOG")
.unwrap_or_else(|_| EnvFilter::new("info,pgp=error")),
)
.with(tracing_subscriber::fmt::layer())
.init();