014c144d73
Add 'Never' expiry option for encrypted URLs
...
- Make ExpiresAt optional in CBOR (omitempty) for smaller tokens
- Treat ExpiresAt=0 as 'never expires' in parser
- URL-encode token with url.PathEscape() for safety
- Add 'Never' as default TTL option in generator form
2026-01-08 11:08:11 -08:00
1f809a6fc9
Implement ETag, HEAD requests, and conditional requests
...
- Add ETag generation based on output content hash (first 16 chars)
- Add ContentLength to ImageResponse from cache
- Add LoadWithSize method to ContentStorage
- Add GetOutputWithSize method to Cache
- Handle HEAD requests returning headers only
- Handle If-None-Match conditional requests returning 304
- Register HEAD route for image proxy endpoint
2026-01-08 10:08:38 -08:00
4df3e44eff
Add failing tests for ETag, HEAD requests, and conditional requests
...
TDD: Write tests first before implementation for:
- ETag generation and consistency in service layer
- HEAD request support (headers only, no body)
- Conditional requests with If-None-Match header (304 responses)
2026-01-08 10:06:18 -08:00
1f0ec59eb5
Wire up auth routes and encrypted URL endpoint
...
Add session manager and encurl generator to handlers.
Register /, /logout, /generate, /v1/e/{token}, /static/* routes.
2026-01-08 07:38:44 -08:00
08d6e264ed
Add auth and encrypted image handlers
...
Login page, logout, URL generator form, and /v1/e/{token}
endpoint for serving images from encrypted URLs.
2026-01-08 07:38:15 -08:00
f244d9c7e0
Add per-host connection limits for upstream fetching
...
- Add upstream_connections_per_host config option (default: 20)
- Implement per-host semaphores to limit concurrent connections
- Semaphore released when response body is closed
- Prevents overwhelming origin servers with parallel requests
2026-01-08 05:19:20 -08:00
6304556837
Refactor to serve all responses from cached files on disk
...
- StoreOutput now returns output hash for immediate retrieval
- Cache misses now serve from disk file after storing (same as hits)
- Log served_bytes from actual io.Copy result (avoids stat calls)
- Remove ContentLength field usage for cache hits (stream from file)
- Fix tests to properly check all return values
2026-01-08 05:11:55 -08:00
1a97f42cd8
Add detailed logging for image requests with cache status and timing
2026-01-08 05:04:08 -08:00
fd2d108f9c
Wire up image handler endpoint with service orchestration
...
- Add image proxy config options (signing_key, whitelist_hosts, allow_http)
- Create Service to orchestrate cache, fetcher, and processor
- Initialize image service in handlers OnStart hook
- Implement HandleImage with URL parsing, signature validation, cache
- Implement HandleRobotsTxt for search engine prevention
- Parse query params for signature, quality, and fit mode
2026-01-08 04:01:53 -08:00
1ac16bcfb4
Remove unused respondError function
2026-01-08 02:30:13 -08:00
453fd22ce2
Add doc comment to HandleHealthCheck method
2026-01-08 02:28:30 -08:00
29adb6ee47
Rename unused parameters to _ to satisfy linter
2026-01-08 02:27:45 -08:00
43e4172fb3
Rename HandlersParams to Params to avoid stuttering
2026-01-08 02:25:00 -08:00
516853626d
Add basic webserver skeleton with healthcheck
2026-01-08 02:20:23 -08:00