• v0.0.6 eab9278acc

    ric released this 2025-12-01 20:26:04 +00:00 | 44 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
  • v0.0.5 593e740ae9

    ric released this 2025-11-29 13:09:50 +00:00 | 52 commits to main since this release

    Release v0.0.5

    Documentation-only release that corrects router configuration examples in README.md to match the actual implementation.

    🔧 Fixed

    Router Configuration Documentation

    • Removed incorrect tls.certResolver from pages-custom-domains-https router example
      • The catch-all router should NOT have a certResolver
      • Individual domains get their own routers dynamically created in Redis with proper SSL configuration
    • Updated custom domain setup instructions:
      • Added step 3: Configure Traefik static config with Redis provider
      • Clarified that plugin writes router configurations to Redis
      • Explained that Traefik Redis provider loads routers and requests SSL certificates automatically
    • Fixed configuration examples to match actual implementation behavior

    📚 Documentation

    • Updated custom domain setup with Redis provider configuration requirement
    • Clarified catch-all router behavior vs. individual Redis routers
    • Added explanatory comments to router configuration examples

    📝 Note

    This is a documentation-only release. No code changes from v0.0.4. The configuration examples in the README were incorrect and could cause confusion. This release corrects those examples to match how the Redis router integration actually works.

    See CHANGELOG.md for full details.

    Downloads
  • v0.0.4 645af5fe57

    ric released this 2025-11-29 13:04:36 +00:00 | 54 commits to main since this release

    Release v0.0.4

    Major improvements for automatic SSL certificate generation and custom domain support.

    🔧 Fixed

    ACME Challenge Passthrough

    • Critical fix: Middleware was redirecting ACME HTTP challenges to HTTPS, preventing SSL certificate generation
    • Added automatic detection of /.well-known/acme-challenge/* paths
    • ACME challenges now pass through to Traefik's handler before HTTPS redirect
    • Enables Let's Encrypt to validate custom domains and generate SSL certificates
    • No configuration changes required - works automatically

    Redis Router Registration

    • Fixed service reference: Changed from pages-noop to noop@internal (Traefik's built-in service)
    • Fixed middleware reference: Changed from pages-server to pages-server@file (fully qualified name)
    • Eliminates "service does not exist" and "middleware does not exist" errors in Traefik dashboard
    • No external service configuration required

    Router Configuration

    • Split HTTP (web) and HTTPS (websecure) routers properly
    • Removed incorrect pattern where both entrypoints were on same router with TLS
    • Updated examples/traefik-config.yml with correct 3-router pattern

    📚 Documentation

    • Added comprehensive "Traefik Redis Provider Integration" section to README.md
    • Added ACME Challenge Handling section explaining automatic passthrough
    • Added troubleshooting section for SSL certificate generation issues
    • Created IMPLEMENTATION_SUMMARY.md documenting the Traefik Redis provider implementation
    • Updated all configuration examples with proper router structure

    🚀 Impact

    • Custom Domains: SSL certificates now generate correctly for custom domains
    • Deployment: Existing deployments must update router configuration to split HTTP/HTTPS
    • Security: HTTPS redirect still works for all non-ACME requests

    See CHANGELOG.md for full details.

    Downloads
  • v0.0.3 eabc6b0930

    ric released this 2025-11-29 00:14:38 +00:00 | 60 commits to main since this release

    Release v0.0.3 - Custom Domain Support

    This release adds full custom domain support with a scalable, registration-based approach.

    Key Features

    Custom Domain Support

    • Users can specify custom domains in .pages file
    • Registration-based activation (visit pages URL to activate)
    • Automatic SSL certificate provisioning via Traefik
    • Cache-only lookups for infinite scalability

    Performance

    • Infinite scalability: Performance independent of user/repository count
    • Fast all requests: <5ms response time with cache-only lookups
    • Efficient caching: Only active custom domains consume cache space

    Configuration

    • enableCustomDomains (bool, default: true) - Enable/disable custom domains
    • customDomainCacheTTL (int, default: 600) - Cache TTL in seconds

    How Custom Domains Work

    1. Add custom_domain: www.example.com to repository's .pages file
    2. Visit https://username.pages.domain.com/repository to activate
    3. Configure DNS (A or CNAME record) pointing to Traefik server
    4. Access site at https://www.example.com

    What's Changed

    Added

    • registerCustomDomain method for automatic domain registration
    • resolveCustomDomain method with cache-only lookup
    • parseCustomDomainPath method for custom domain URL parsing
    • Comprehensive test suite in custom_domain_test.go
    • CUSTOM_DOMAINS.md technical documentation
    • Configuration options: enableCustomDomains, customDomainCacheTTL

    Changed

    • ServeHTTP automatically registers custom domains when serving pages
    • Custom domains require activation via pages URL visit
    • Enhanced Traefik router examples with priority-based routing

    Improved

    • Test coverage: 78.2% (up from 74.9%)
    • Simplified architecture: Registration-based approach
    • Better UX: Clear activation steps and helpful error messages

    Installation

    experimental:
      plugins:
        pages-server:
          moduleName: code.squarecows.com/SquareCows/pages-server
          version: v0.0.3
    

    Documentation

    Full Changelog: https://code.squarecows.com/SquareCows/pages-server/compare/v0.0.2...v0.0.3

    Downloads
  • v0.0.2 fbf9d7a6cb

    ric released this 2025-11-27 22:57:48 +00:00 | 61 commits to main since this release

    Version 0.0.2 Release

    This release adds GPLv3 licensing and simplifies the plugin architecture by removing external dependencies and letting Traefik handle what it does best.

    🎉 Added

    • GPLv3 License with full compliance
      • Complete GPLv3 license text in LICENSE file
      • License headers on all Go source files
      • License headers on YAML configuration files
      • Copyright (C) 2025 SquareCows

    🗑️ Removed

    • Cloudflare DNS management - Users now manually configure DNS with any DNS provider

      • Removed cloudflareAPIKey and cloudflareZoneID configuration
      • Removed cloudflare_dns.go and cloudflare_dns_test.go
      • More flexible: works with any DNS provider (Cloudflare, Route53, etc.)
    • Let's Encrypt certificate management - Traefik handles all SSL certificates

      • Removed letsEncryptEndpoint and letsEncryptEmail configuration
      • Removed cert_manager.go and cert_manager_test.go
      • Clearer separation: plugin serves files, Traefik manages SSL

    🔧 Changed

    • Simplified configuration - Only 2 required parameters:
      • pagesDomain - Base domain for pages
      • forgejoHost - Forgejo instance URL
    • Updated module path from github.com/SquareCows/pages-server to code.squarecows.com/SquareCows/pages-server
    • Custom domains require manual DNS A/CNAME record creation

    📈 Improved

    • Test coverage increased from 56.3% to 74.9%
    • Reduced codebase by 741 lines
    • Clearer architecture - plugin focuses on serving static files
    • More flexible DNS - works with any DNS provider

    📚 Documentation

    All documentation updated to reflect new architecture and DNS approach.

    Downloads