Log hash/name and reason of removal for removed files #65

Manually merged
heiko merged 4 commits from fix/44-log-removal-details into master 2026-07-21 11:55:45 +02:00
Owner

Log key (UUID), filename, and reason whenever a file is removed.

  • remove.go: log key=<uuid> name="<filename>" by=<user> reason=manual on manual removal; properly handle FindFile errors (return 404)
  • store.go Clean(): promote debug-only messages to log.Printf with structured fields: key, name, reason (info-expired / upload-expired)

Fixes #44

Log key (UUID), filename, and reason whenever a file is removed. - `remove.go`: log `key=<uuid> name="<filename>" by=<user> reason=manual` on manual removal; properly handle FindFile errors (return 404) - `store.go` Clean(): promote debug-only messages to `log.Printf` with structured fields: key, name, reason (info-expired / upload-expired) Fixes #44
- remove.go: log key, filename, user, and reason=manual on manual removal;
  handle FindFile errors properly (return 404)
- store.go Clean(): promote debug messages to log.Printf with structured
  fields: key, name, reason (info-expired / upload-expired)

Fixes #44
heiko requested review from mf 2026-05-27 17:49:50 +02:00
- remove.go: use %q for by= field (safe if username contains spaces)
- store.go Clean(): add area= field so expired-file logs identify the owner
Address review findings for PR #65:

- log manual and cleanup removals only after they succeed
- return HTTP 500 when manual purge fails instead of redirecting as success
- log successful download claims with reason=download
- handle corrupt or unreadable metadata during cleanup instead of acting on a zero-value File
- quote all structured fields and errors to prevent forged log lines
- add regression coverage for manual/download logs, invalid metadata, both cleanup expiry paths, and failed cleanup removal
heiko self-assigned this 2026-07-21 11:46:07 +02:00
heiko force-pushed fix/44-log-removal-details from 39f35da03c to 03e8465149
All checks were successful
nagonag (Push) / nagonag (push) Successful in 3m36s
2026-07-21 11:52:49 +02:00
Compare
heiko manually merged commit 03e8465149 into master 2026-07-21 11:55:45 +02:00
heiko deleted branch fix/44-log-removal-details 2026-07-21 11:57:31 +02:00
Sign in to join this conversation.
No description provided.