mirror of
https://github.com/sassanix/Warracker.git
synced 2026-04-28 04:21:36 -05:00
60239bd637
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
58 lines
2.2 KiB
YAML
58 lines
2.2 KiB
YAML
services:
|
|
warracker:
|
|
image: ghcr.io/sassanix/warracker/main:latest
|
|
ports:
|
|
- "8005:80"
|
|
volumes:
|
|
- warracker_uploads:/data/uploads
|
|
environment:
|
|
- DB_HOST=warrackerdb
|
|
- DB_NAME=warranty_db
|
|
- DB_USER=warranty_user
|
|
- DB_PASSWORD=${DB_PASSWORD:-warranty_password}
|
|
- SMTP_HOST=smtp.email.com
|
|
- SMTP_PORT=465
|
|
- SMTP_USERNAME=youremail@email.com
|
|
- SMTP_PASSWORD=password
|
|
- SECRET_KEY=${APP_SECRET_KEY:-your_strong_default_secret_key_here}
|
|
- MAX_UPLOAD_MB=32 # Example: Set max upload size to 32MB
|
|
- NGINX_MAX_BODY_SIZE_VALUE=32M # For Nginx, ensure this matches MAX_UPLOAD_MB in concept (e.g., 32M)
|
|
# OIDC SSO Configuration (User needs to set these based on their OIDC provider)
|
|
- OIDC_PROVIDER_NAME=${OIDC_PROVIDER_NAME:-oidc}
|
|
- OIDC_CLIENT_ID=${OIDC_CLIENT_ID:-} # e.g., your_oidc_client_id_from_provider
|
|
- OIDC_CLIENT_SECRET=${OIDC_CLIENT_SECRET:-} # e.g., your_oidc_client_secret_from_provider
|
|
- OIDC_ISSUER_URL=${OIDC_ISSUER_URL:-} # e.g., https://your-oidc-provider.com/auth/realms/your-realm
|
|
- OIDC_SCOPE=${OIDC_SCOPE:-openid email profile}
|
|
# URL settings (Important for OIDC redirects and email links)
|
|
# Ensure these point to the public-facing URL of your application
|
|
- FRONTEND_URL=${FRONTEND_URL:-http://localhost:8005}
|
|
- APP_BASE_URL=${APP_BASE_URL:-http://localhost:8005}
|
|
# Memory optimization settings
|
|
- WARRACKER_MEMORY_MODE=${WARRACKER_MEMORY_MODE:-optimized} # Options: optimized (default), ultra-light
|
|
- PYTHONUNBUFFERED=1
|
|
# - FLASK_DEBUG=0
|
|
depends_on:
|
|
warrackerdb:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
warrackerdb:
|
|
image: postgres:15-alpine
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_DB=warranty_db
|
|
- POSTGRES_USER=warranty_user
|
|
- POSTGRES_PASSWORD=${DB_PASSWORD:-warranty_password}
|
|
restart: unless-stopped
|
|
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
volumes:
|
|
postgres_data:
|
|
warracker_uploads:
|