Files
Warracker/Docker/.env.example
sassanix 7535e8d1ef Public Global View, Apprise Integration, Filtering, and Major Fixes
### Major Features
- **Public Global Warranty View:** All authenticated users can now view global warranties. Admins retain full control; regular users get read-only access to others’ warranties.
- **Global View Admin Controls:** Admins can now toggle global view availability and limit it to admins only via site settings.
- **Global Status Dashboard View:** Extended global view to warranty statistics and dashboards with full permissions enforcement.
- **Apprise Push Notifications:** Integrated Apprise for multi-platform warranty alerts with extensive backend and frontend support (80+ services).
- **Warranty Type Filtering/Sorting:** Introduced dynamic, case-insensitive filtering and sorting by warranty type on the main page.
- **Admin Global Warranty View:** Dedicated admin tools and UI for viewing all warranties with enhanced styling and user info.

### UX/UI Enhancements
- **Product Photo Thumbnails:** Added interactive, responsive photo previews on warranty cards across all views.
- **Updated Footer Links:** All "Powered by Warracker" footers now link to the official website (`https://warracker.com`).

### Fixes and Stability Improvements
- **Status Dashboard Chart Fixes:** Resolved canvas reuse errors and chart switching issues.
- **CSS Cache Busting:** Ensured consistent styling across domain/IP access by versioning CSS/JS and updating service worker.
- **Settings Access Fixes:** Regular users can now access the settings page without triggering admin-only API calls.
- **Settings Persistence Fixes:** Addressed major frontend/backend issues preventing correct saving/loading of user preferences.
- **Notification Timing Overhaul:** Rewrote logic for precise notification delivery and implemented duplicate prevention.

### Security and Technical Enhancements
- Global view maintains secure ownership enforcement.
- Improved permission checks, graceful degradation, and responsive design across all new features.
2025-06-10 21:59:17 -03:00

152 lines
4.1 KiB
Plaintext

# Warracker Environment Variables Configuration
# Copy this file to .env and customize the values for your deployment
### ** Database Configuration**
# Database connection settings
DB_HOST=warrackerdb
DB_NAME=warranty_db
DB_USER=warranty_user
DB_PASSWORD=warranty_password
# Database admin credentials (used for migrations and setup)
DB_ADMIN_USER=warracker_admin
DB_ADMIN_PASSWORD=change_this_password_in_production
# PostgreSQL-specific settings (for the database container)
POSTGRES_DB=warranty_db
POSTGRES_USER=warranty_user
POSTGRES_PASSWORD=warranty_password
### Security Configuration**
# Application secret key for JWT tokens and Flask sessions
# IMPORTANT: Generate a strong, unique secret key for production!
SECRET_KEY=your_very_secret_flask_key_change_me
# JWT token expiration time (in hours)
JWT_EXPIRATION_HOURS=24
### Email/SMTP Configuration**
# SMTP server settings for sending notifications and password resets
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=youremail@gmail.com
SMTP_PASSWORD=your_email_password
# Optional SMTP settings
SMTP_USE_TLS=true
SMTP_USE_SSL=false
SMTP_SENDER_EMAIL=noreply@warracker.com
### **URL Configuration**
# Frontend URL (used for redirects and email links)
# IMPORTANT: Must match your public-facing URL for OIDC and email links to work
FRONTEND_URL=http://localhost:8005
# Application base URL (used for links in emails and redirects)
APP_BASE_URL=http://localhost:8005
### **File Upload Configuration**
# Maximum file upload size in megabytes
MAX_UPLOAD_MB=32
# Nginx maximum body size (should match or exceed MAX_UPLOAD_MB)
NGINX_MAX_BODY_SIZE_VALUE=32M
### **Performance & Memory Configuration**
# Memory optimization mode
# Options: optimized (default), ultra-light, performance
# - optimized: 2 workers, ~60-80MB RAM usage (recommended for most deployments)
# - ultra-light: 1 worker, ~40-50MB RAM usage (for very limited resources)
# - performance: 4 workers, ~150-200MB RAM usage (for high-traffic deployments)
WARRACKER_MEMORY_MODE=optimized
### **OIDC/SSO Configuration (Optional)**
# Enable/disable OIDC SSO functionality
OIDC_ENABLED=false
# OIDC Provider settings
# Provider name (affects button branding: google, github, microsoft, keycloak, etc.)
OIDC_PROVIDER_NAME=oidc
# OIDC client credentials (obtain from your OIDC provider)
OIDC_CLIENT_ID=
OIDC_CLIENT_SECRET=
# OIDC issuer URL (e.g., https://accounts.google.com)
OIDC_ISSUER_URL=
# OIDC scope (space-separated list of scopes)
OIDC_SCOPE=openid email profile
### **Development/Debugging Configuration (Optional)**
# Flask environment (development/production)
FLASK_ENV=production
# Flask debug mode (true/false)
FLASK_DEBUG=false
# Flask run port (for development)
FLASK_RUN_PORT=5000
# Python unbuffered output (helpful for Docker logs)
PYTHONUNBUFFERED=1
### **Example Configurations**
**Gmail SMTP:**
```bash
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=youremail@gmail.com
SMTP_PASSWORD=your_app_password
SMTP_USE_TLS=true
```
**Google OIDC:**
```bash
OIDC_ENABLED=true
OIDC_PROVIDER_NAME=google
OIDC_CLIENT_ID=your_google_client_id.apps.googleusercontent.com
OIDC_CLIENT_SECRET=your_google_client_secret
OIDC_ISSUER_URL=https://accounts.google.com
OIDC_SCOPE=openid email profile
```
**Production deployment:**
```bash
SECRET_KEY=super_long_random_string_generated_securely
DB_PASSWORD=strong_database_password_123
DB_ADMIN_PASSWORD=different_strong_admin_password_456
FRONTEND_URL=https://warracker.yourdomain.com
APP_BASE_URL=https://warracker.yourdomain.com
SMTP_HOST=smtp.yourdomain.com
SMTP_USERNAME=warracker@yourdomain.com
MAX_UPLOAD_MB=64
NGINX_MAX_BODY_SIZE_VALUE=64M
WARRACKER_MEMORY_MODE=performance
```
## **How to Use**
1. **Copy this configuration** into a file named `.env` in your Docker folder
2. **Customize the values** according to your specific deployment needs
3. **Generate strong passwords** for production use, especially for `SECRET_KEY`, `DB_PASSWORD`, and `DB_ADMIN_PASSWORD`
4. **Set your domain URLs** correctly for `FRONTEND_URL` and `APP_BASE_URL` if deploying publicly
5. **Configure SMTP** if you want email functionality for password resets and notifications
6. **Set up OIDC/SSO** if you want single sign-on capabilities