mirror of
https://github.com/sassanix/Warracker.git
synced 2025-12-30 18:19:57 -06:00
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
94 lines
2.4 KiB
Plaintext
94 lines
2.4 KiB
Plaintext
# Warracker Environment Configuration Example
|
|
# Copy this file to .env and modify the values as needed
|
|
|
|
# Database Configuration
|
|
DB_PASSWORD=your_secure_database_password
|
|
DB_ADMIN_PASSWORD=your_secure_admin_password
|
|
|
|
# Application Security
|
|
SECRET_KEY=your_very_secure_flask_secret_key_change_this_in_production
|
|
|
|
# Email Configuration (for password resets and notifications)
|
|
SMTP_HOST=smtp.gmail.com
|
|
SMTP_PORT=587
|
|
SMTP_USERNAME=your-email-username
|
|
SMTP_PASSWORD=your-app-password
|
|
SMTP_FROM_ADDRESS=your-email@somewhere.com
|
|
SMTP_USE_TLS=true
|
|
|
|
# Application URLs
|
|
FRONTEND_URL=http://localhost:8005
|
|
APP_BASE_URL=http://localhost:8005
|
|
|
|
# OIDC SSO Configuration (Optional)
|
|
OIDC_PROVIDER_NAME=oidc
|
|
OIDC_CLIENT_ID=your_oidc_client_id
|
|
OIDC_CLIENT_SECRET=your_oidc_client_secret
|
|
OIDC_ISSUER_URL=https://your-oidc-provider.com/auth/realms/your-realm
|
|
OIDC_SCOPE=openid email profile
|
|
|
|
# Memory and Performance Settings
|
|
WARRACKER_MEMORY_MODE=optimized
|
|
MAX_UPLOAD_MB=16
|
|
NGINX_MAX_BODY_SIZE_VALUE=16M
|
|
|
|
# =====================
|
|
# APPRISE NOTIFICATIONS
|
|
# =====================
|
|
|
|
# Enable/disable Apprise notifications
|
|
APPRISE_ENABLED=false
|
|
|
|
# Notification URLs (comma-separated)
|
|
# Examples:
|
|
# Email: mailto://user:password@gmail.com
|
|
# Discord: discord://webhook_id/webhook_token
|
|
# Slack: slack://TokenA/TokenB/TokenC/Channel
|
|
# Telegram: telegram://BotToken/ChatID
|
|
# Microsoft Teams: msteams://TokenA/TokenB/TokenC/
|
|
# Webhooks: json://webhook.site/your-unique-id
|
|
APPRISE_URLS=
|
|
|
|
# Days before expiration to send notifications (comma-separated)
|
|
APPRISE_EXPIRATION_DAYS=7,30
|
|
|
|
# Time of day to send notifications (HH:MM format, 24-hour)
|
|
APPRISE_NOTIFICATION_TIME=09:00
|
|
|
|
# Prefix for notification titles
|
|
APPRISE_TITLE_PREFIX=[Warracker]
|
|
|
|
# =====================
|
|
# APPRISE URL EXAMPLES
|
|
# =====================
|
|
|
|
# Gmail (using app password)
|
|
# APPRISE_URLS=mailto://username:app-password@gmail.com
|
|
|
|
# Discord Webhook
|
|
# APPRISE_URLS=discord://webhook_id/webhook_token
|
|
|
|
# Slack
|
|
# APPRISE_URLS=slack://TokenA/TokenB/TokenC/Channel
|
|
|
|
# Telegram Bot
|
|
# APPRISE_URLS=telegram://BotToken/ChatID
|
|
|
|
# Microsoft Teams
|
|
# APPRISE_URLS=msteams://TokenA/TokenB/TokenC/
|
|
|
|
# Multiple services (comma-separated)
|
|
# APPRISE_URLS=mailto://user:pass@gmail.com,discord://webhook_id/webhook_token,telegram://BotToken/ChatID
|
|
|
|
# Pushover
|
|
# APPRISE_URLS=pover://user@token
|
|
|
|
# Ntfy
|
|
# APPRISE_URLS=ntfy://topic
|
|
|
|
# Generic Webhook
|
|
# APPRISE_URLS=json://webhook.site/your-unique-id
|
|
|
|
# For more services and URL formats, visit:
|
|
# https://github.com/caronc/apprise/wiki
|