Skip to content

v0.3.1

Choose a tag to compare

@github-actions github-actions released this 11 Jan 10:09
· 133 commits to main since this release

What's New in v0.3.1

This release includes all changes from v0.2.2 and v0.3.0.

Self-Contained Type Generation

  • Eliminated external caddy-json-types dependency - types now generated directly from local Caddy Go source
  • Uses tygo (Go → TypeScript) + ts-to-zod (TypeScript → Zod)
  • Generated TypeScript types across 16 modules (core, http, tls + 13 handler modules)
  • npm run generate:types / npm run sync:caddy to regenerate

100% Handler Schema Coverage (20/20)

All built-in Caddy handlers now have Zod schemas:

  • Core: ReverseProxyHandler, Headers, StaticResponse, Authentication, Rewrite, Encode, Subroute
  • File/template: FileServer, Templates
  • Request manipulation: Map, Push, RequestBody, Vars
  • Response handling: Intercept, CopyResponse, CopyResponseHeaders, Error
  • Observability: Tracing, LogAppend, Invoke
  • KnownCaddyHandlerSchema discriminated union for strict validation
  • CaddyHandlerSchema with fallback for custom/plugin handlers

Config File Loading

  • loadConfig(path, adapter?, options?) - Load and adapt config files with auto-detection
  • loadCaddyfile(path, options?) - Convenience function for Caddyfile format
  • detectAdapter(path) - Auto-detect adapter from file extension

New applyConfig() Method

  • Apply full configuration to running Caddy via /load endpoint
  • Enables full workflow: load → modify → apply

API Response Validation with Zod

All client methods now validate responses at runtime:

  • getConfig(), getRoutes(), getServers(), getServerConfig(), getVersion(), getUpstreams(), adapt()

Consistent Error Handling

  • All user-facing validation now throws ValidationError instead of raw ZodError
  • Contextual error messages (e.g., "buildHostRoute options: dial: Invalid format")
  • CaddyApiError includes url and method for debugging

MITMproxy Traffic Inspection Demo

  • Interactive dashboard with real-time traffic interception toggle
  • Elasticsearch debugging challenges (5 automated + 1 guided)
  • Response manipulation challenges (theme hacking, feature flags, admin mode)
  • Docker Compose stack with Caddy, Elasticsearch, MITMproxy

Full Changelog: v0.2.0...v0.3.1