Convert setup guard to startup-driven cache and update tests

This commit is contained in:
2026-04-06 20:38:15 +02:00
parent 3ccfc20c64
commit 89ab41cc9e
5 changed files with 109 additions and 59 deletions

View File

@@ -27,7 +27,7 @@ Reference: `Docs/Refactoring.md` for full analysis of each issue.
- Replace it with a deterministic packaging or configuration model so the backend does not depend on repository layout.
- Refactor `Fail2BanClient` so concurrency control is instance-based and not backed by hidden module globals.
- **Improve startup / setup guard behavior.**
- **Improve startup / setup guard behavior.**
- Convert `SetupRedirectMiddleware` from an on-demand DB check into a startup/initialisation guard where possible.
- Cache setup completion in a safe way and provide an explicit invalidation path if the application state changes.
- Reduce middleware responsibility and avoid DB access during normal request dispatch.
@@ -75,6 +75,6 @@ Reference: `Docs/Refactoring.md` for full analysis of each issue.
1. ✅ Fix the global SQLite connection pattern and tests.
2. ✅ Refactor dependency injection / explicit shared resources.
3. ✅ Harden fail2ban client concurrency and packaging.
4. Convert setup guard to a safer startup-driven model.
4. Convert setup guard to a safer startup-driven model.
5. Add deployment-safe configuration and production-ready CORS.
6. Add lifecycle and concurrency regression tests.