# Caddyfile for TRI Bootstrap Server # Serves static bootstrap archives over HTTPS (and optionally Tor) ############################################################################### # IMPORTANT: Set these values before using this template: # # 1. Replace {{BOOTSTRAP_DOMAIN}} with your domain # (e.g. bootstrap.cryptographic-triangles.org) # # 2. Replace {{EMAIL}} with your email for Let's Encrypt # (e.g. admin@yourdomain.com) # # 3. Replace {{BOOTSTRAP_DIR}} with your actual bootstrap archive directory # (e.g. /var/www/triangles-bootstrap) # # 4. If serving Tor onion, uncomment the @onion block below ############################################################################### # Global settings { email {{EMAIL}} admin off auto_https off } # Serve the bootstrap archive {{BOOTSTRAP_DOMAIN}}:443 { root * {{BOOTSTRAP_DIR}} # Enable gzip/brotli compression for large files encode gzip zstd # Cache-control for bootstrap files — long TTL since archives don't change often @bootstrap { path /triangles-bootstrap*.tar.gz /tri-bootstrap*.tar.gz } header @bootstrap { Cache-Control "public, max-age=86400, stale-while-revalidate=3600" Content-Type "application/octet-stream" } # Don't cache HTML or index pages (none should exist here, but safety net) @html { path *.html *.htm } respond @html 404 # Serve all files as downloads file_server { download true } # Optional: Log requests log { output file /var/log/tri-bootstrap/access.log } } # Tor hidden service block (uncomment if using Tor) # @onion onion { # v3en # port 80 # } # {{BOOTSTRAP_DOMAIN}}:80 { # respond @onion "Tor is not configured. Please use HTTPS." 400 # }