• v0.0.6 eab9278acc

    ric released this 2025-12-01 20:26:04 +00:00 | 25 commits to main since this release

    Critical Fixes

    Redis Binary Data Corruption (CRITICAL)

    Fixed a critical bug causing data corruption when reading large files from Redis cache:

    • Changed reader.Read() to io.ReadFull() in Redis RESP protocol bulk string reader
    • reader.Read() doesn't guarantee reading all bytes at once, causing partial reads for large files
    • This caused CSS/JS files to be corrupted when served from Redis cache
    • Resulted in Subresource Integrity (SRI) hash mismatches and broken styling
    • Files are now read completely and correctly from Redis cache
    • Action Required: Clear your Redis cache after updating to remove corrupted data

    SVG File Corruption

    Fixed "Char 0x0 out of allowed range" errors when serving SVG files:

    • Replaced custom base64 decoder with Go's standard library encoding/base64
    • Removed buggy custom base64Decode and base64DecodedLen functions
    • Fixes corruption issues with binary files (SVGs, images, fonts)
    • Standard library decoder is more robust and well-tested

    New Features

    Directory Index Support

    Automatic index.html detection for directory URLs:

    • Accessing /pricing/ now automatically tries /pricing/index.html
    • Enables clean URLs without file extensions
    • Only applies to paths without file extensions (directories)
    • Falls back to 404 if neither the directory nor index.html exists
    • Standard web server behavior for improved user experience

    Persistent Custom Domain Storage

    Custom domain mappings now stored without TTL:

    • Changed customDomainCache initialization to use TTL=0 (persistent storage)
    • Modified SetWithTTL() to use SET command instead of SETEX when TTL=0
    • Modified MemoryCache to use expiration=-1 for never-expiring items
    • Enables external reaper scripts to validate and clean up domains via cron
    • Domain mappings persist until explicitly deleted
    • No impact on file content cache (still uses configured TTL)

    HTTP Response Headers

    Added server identification and cache status headers:

    • Added Server: bovine header to all responses (content and error pages)
    • Added X-Cache-Status: HIT header when serving content from cache
    • Added X-Cache-Status: MISS header when fetching content from Forgejo API
    • Enables monitoring and debugging of cache behavior

    Upgrade Instructions

    1. Update the plugin version in your Traefik configuration to v0.0.6
    2. IMPORTANT: Clear your Redis cache to remove corrupted data:
      redis-cli FLUSHDB
      
    3. Restart Traefik to load the updated plugin
    4. Verify the site loads correctly with proper CSS/JS

    Full Changelog

    See CHANGELOG.md for complete details.

    Downloads