Commit Graph

9 Commits

Author SHA1 Message Date
TEC
d1e7080847 Add OIDC admin group to site_settings 2025-09-30 20:58:34 +08:00
TEC
220c9c89c5 Support reading secrets from files
This makes it easier to integrate Warracker with modern secret
management workflows like Docker secrets and Systemd service
credentials.
2025-09-30 20:58:34 +08:00
TEC
6f5081d27b Sync OIDC attribute on login 2025-09-30 20:58:34 +08:00
TEC
d887aadc3b Allow determining admin status from OIDC groups 2025-09-30 20:58:34 +08:00
TEC
bb886a5ff3 Have OIDC first name fallback to name
If given/family names are unset, it seems reasonable to default to the
first name.
2025-09-30 20:58:34 +08:00
TEC
f29b1b5784 Token userinfo is no substitute for the endpoint
It is not appropriate to (ab)use OIDC authentication claims for user
information, there is a dedicated userinfo endpoint that should always
be used. If the information we want is in the token claims, great, but
the endpoint info should always be available too.
2025-09-30 20:58:34 +08:00
TEC
88b02bbdc2 Fix OIDC reload by moving init_oidc_client
In 60239bd637 the assumption that init_oidc_client could be imported
from oidc_handler was introduced into admin_routes.py.

However, init_oidc_client was defined in __init__.py, leaving us with
the options of:
1. Importing from .
2. Moving the implementation to oidc_handler, and importing in
   __init__.py

I've gone with option 2.
2025-09-30 20:58:34 +08:00
TEC
ee96ba5311 Update deprecated utcnow() usage
DeprecationWarning: datetime.datetime.utcnow() is deprecated and
scheduled for removal in a future version. Use timezone-aware objects to
represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
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