Proactive audit release. After the homarr deletion (v1.23.0), we swept the codebase for the same classes of bug — destructive operations without recovery, and concurrency on shared state — and fixed the two highest-risk findings before anyone hit them.
Fixed
Rollback could strand a container or destroy your only copy
All three rollback paths in the recreate flow (run-failed, unhealthy, exception handler) did docker rm <name> (no -f) then docker rename <old> <name>. Two failure modes:
- If the broken new container wouldn't stop, the non-forced
docker rmsilently failed and the rename collided — leaving you with the broken container and the old one orphaned as<name>_old. - The exception handler blindly renamed
<name>_oldback even when no such backup existed.
New single _rollback_to_old() helper, used by all three sites. "Don't make it worse" first: if no backup exists it leaves your container completely alone (never destroys what might be your only copy); otherwise it force-removes the broken new container and restores the backup. Verified on a test host including the critical no-backup case.
Scheduler auto-update could race a manual update
The manual update paths guarded on a plain update_running bool, but the scheduler's auto-update pass ignored it entirely — so a cron tick could recreate the very container you were mid-updating from Telegram, two recreate flows racing on the same container. Replaced with a single threading.Lock claimed atomically by all four update entry points; the scheduler skips its pass when a manual update holds the lock (retries next tick).
Bonus: the lock is released in try/finally everywhere. The old update_running = False only ran at the end, so an exception outside the loop would have left the flag stuck True and blocked every future update — that latent bug is gone too.
Still open (confirmed, next)
- "Update all" stale-snapshot (updates current pending, not the notification's set)
- Slow SIGTERM response via long-poll block
Upgrade
docker pull amayer1983/docksentry:latest
docker compose up -d