• Stefy Lanza (nextime / spora )'s avatar
    Add cross-platform persistent directories and authenticated ZIP downloads (v1.2.1) · 034ce1c1
    Stefy Lanza (nextime / spora ) authored
    ## Cross-Platform PyInstaller Support
    - Implemented persistent directory system for Windows (%APPDATA%), macOS (~/Library/Application Support), and Linux (/opt/MBetter)
    - Added PyInstaller environment detection and automatic directory path optimization
    - Created comprehensive directory utilities (app/utils/directories.py) with fallback mechanisms
    - Enhanced configuration system to use persistent mbetterd.conf instead of .env for PyInstaller deployments
    
    ## Configuration System Enhancement
    - Added configuration file migration system (migrate_config.py) for .env to mbetterd.conf transition
    - Enhanced config.py with persistent config file loading and priority system (env vars > config file > defaults)
    - Automatic config file discovery in persistent directories with fallback to local .env
    
    ## Authenticated ZIP Downloads
    - Added new /api/download/zip/<match_id> endpoint with hybrid JWT/API token authentication
    - Enhanced /api/updates endpoint to use authenticated download URLs instead of web routes
    - Implemented access control ensuring users can only download their own match files (or admin access)
    - Updated API routes to use persistent ZIP_UPLOADS_DIR for file serving
    
    ## Upload System Enhancement
    - Modified file upload handlers to use persistent directories (ZIP_UPLOADS_DIR, FIXTURES_DIR, TEMP_DIR)
    - Enhanced upload file paths to use appropriate persistent directories based on file type
    - Updated main routes for ZIP downloads to use persistent directory paths
    - Fixed PyInstaller temporary directory issues ensuring files persist between application restarts
    
    ## Documentation Updates
    - Updated README.md with PyInstaller features, cross-platform compatibility, and authenticated downloads
    - Enhanced CHANGELOG.md with comprehensive v1.2.1 release notes
    - Added migration utility documentation and deployment instructions
    - Updated version numbers and platform compatibility information
    
    ## Technical Improvements
    - Enhanced error handling and logging throughout persistent directory operations
    - Added comprehensive fallback mechanisms for various deployment scenarios
    - Improved path handling with proper cross-platform directory structures
    - Security enhancements for API file downloads with proper authentication validation
    034ce1c1
CHANGELOG.md 7.61 KB