Commit Graph

3 Commits

Author SHA1 Message Date
sassanix
286aa2b88a Introduced a new Administrator Audit Trail system for enhanced accountability and visibility of administrative changes.
- Added new `audit_log` table with supporting migration (048)
- Implemented centralized `create_audit_log` helper to record key admin actions
- Logged events include:
  - Site setting changes (sensitive data masked)
  - User updates and deletions
- Added API endpoint `GET /api/admin/audit-trail` for viewing recent audit entries
- Created new frontend section in Settings for viewing the Audit Trail
  - Displays timestamp, user, action, and details with safe HTML escaping
- Updated backend structure for better modularity and security

Files:
`backend/migrations/048_create_audit_log_table.sql`,
`backend/audit_logger.py`,
`backend/admin_routes.py`,
`frontend/settings-new.html`,
`frontend/settings-new.js`
2025-10-19 22:28:16 -03:00
TEC
d1e7080847 Add OIDC admin group to site_settings 2025-09-30 20:58:34 +08:00
sassanix
60239bd637 Fix Apprise notification system, scheduler stability, and email configuration
Fixes & Enhancements

* Resolved five critical Apprise notification issues:
  • Ensured configuration reload during scheduled jobs
  • Fixed warranty data fetching for Apprise-only users
  • Refactored notification dispatch logic with dedicated helpers
  • Corrected handler scoping via Flask app context
  • Wrapped scheduler jobs with Flask app context to prevent context errors
  → Verified: Scheduled Apprise notifications now work reliably for "Apprise only" and "Both" channels.

* Added support for SMTP\_FROM\_ADDRESS environment variable, allowing sender address customization independent of SMTP username. (PR #115)

* Fixed duplicate scheduled notifications in multi-worker environments:
  • Strengthened should\_run\_scheduler() logic
  • Now guarantees exactly one scheduler instance across all Gunicorn modes.

* Fixed stale database connection handling in scheduled jobs:
  • Fresh connection acquired each run, properly released via try/finally
  • Eliminates "server closed the connection" errors.

* Definitive scheduler logic fix for all memory modes (ultra-light, optimized, performance):
  • Single-worker runs scheduler if GUNICORN\_WORKER\_ID is unset
  • Multi-worker: only worker 0 runs scheduler.

Impact

* Apprise and Email notifications are now stable, reliable, and production-ready
* No more duplicate or missed notifications across all memory modes
* Improved system efficiency and robustness
2025-08-24 12:34:40 -03:00