Commit Graph

33 Commits

Author SHA1 Message Date
5462c9222c Add pure Go image processor with resize and format conversion
Implements the Processor interface using disintegration/imaging library.
Supports JPEG, PNG, GIF, WebP decoding and JPEG, PNG, GIF encoding.
Includes all fit modes: cover, contain, fill, inside, outside.
2026-01-08 03:54:50 -08:00
9629139989 Add tests for cache service
Tests cover: lookup miss/hit, store source/output, negative caching,
negative cache expiry, hot cache, output retrieval, stats, and cleanup.
2026-01-08 03:39:23 -08:00
6d32b7ee23 Fix formatting in fetcher and signature tests 2026-01-08 03:36:00 -08:00
30c5c077e5 Add cache service with hot cache and negative caching
Implements cache lookup with in-memory hot path, source/output storage,
negative caching for failed fetches, TTL expiration, and statistics tracking.
2026-01-08 03:35:55 -08:00
2f20c71da0 Add content-addressable storage and cache key generation
ContentStorage stores blobs at <dir>/<ab>/<cd>/<sha256> paths.
MetadataStorage stores JSON at <dir>/<host>/<path_hash>.json.
CacheKey generates unique keys from request parameters.
2026-01-08 03:35:50 -08:00
4595929275 Add embedded SQL migrations system
Migrations are stored in schema/*.sql and embedded via go:embed.
Applied migrations are tracked in schema_migrations table.
Initial schema includes source_content, source_metadata, output_content,
request_cache, negative_cache, and cache_stats tables.
2026-01-08 03:35:43 -08:00
30d63e80dc Add magic byte detection for image format validation
Implements format detection by checking file magic bytes for JPEG, PNG,
GIF, WebP, AVIF, and SVG. Includes validation against declared Content-Type.
2026-01-08 03:35:29 -08:00
cc2c40bfbf Implement HMAC-SHA256 signature generation and verification 2026-01-08 03:02:09 -08:00
2b0ccd6052 Implement host whitelist for source domains 2026-01-08 03:00:53 -08:00
018c280267 Add ParseImagePath for chi wildcard and upstream fetcher with SSRF protection 2026-01-08 02:59:48 -08:00
c69ddf6f61 Implement URL parser for image proxy routes 2026-01-08 02:55:05 -08:00
09a0e6f039 Fix formatting alignment in server constants 2026-01-08 02:31:01 -08:00
1ac16bcfb4 Remove unused respondError function 2026-01-08 02:30:13 -08:00
837c91e0dd Rename unused ctx parameters in server hooks 2026-01-08 02:29:48 -08:00
827f9743b8 Add package and const block comments to imgcache 2026-01-08 02:29:25 -08:00
453fd22ce2 Add doc comment to HandleHealthCheck method 2026-01-08 02:28:30 -08:00
eb2ba92745 Add comment to SQLite blank import 2026-01-08 02:28:05 -08:00
29adb6ee47 Rename unused parameters to _ to satisfy linter 2026-01-08 02:27:45 -08:00
146eeee070 Use bit shift for HTTPMaxHeaderBytes constant 2026-01-08 02:26:47 -08:00
31df1a4a03 Rename LoggerParams to Params to avoid stuttering 2026-01-08 02:26:15 -08:00
1824d99f55 Rename ServerParams to Params to avoid stuttering 2026-01-08 02:25:56 -08:00
3f6328766c Rename MiddlewareParams to Params to avoid stuttering 2026-01-08 02:25:42 -08:00
ad89bd9232 Rename HealthcheckParams and HealthcheckResponse to avoid stuttering 2026-01-08 02:25:28 -08:00
43e4172fb3 Rename HandlersParams to Params to avoid stuttering 2026-01-08 02:25:00 -08:00
c68c8909f7 Rename DatabaseParams to Params to avoid stuttering 2026-01-08 02:24:40 -08:00
d95d31df25 Rename ConfigParams to Params to avoid stuttering 2026-01-08 02:24:20 -08:00
ef6e67e786 Add blank line before return in SourceURL 2026-01-08 02:23:23 -08:00
751e557884 Define ShutdownTimeout and SentryFlushTimeout constants 2026-01-08 02:22:58 -08:00
0eb6193431 Use HTTPWriteTimeout constant for request timeout 2026-01-08 02:22:25 -08:00
bf24a310bc Define HTTP server timeout and header size constants 2026-01-08 02:21:54 -08:00
115f92660d Define CORSMaxAgeSeconds constant 2026-01-08 02:21:30 -08:00
ce25ea8f6f Define DefaultPort and DefaultStateDir constants 2026-01-08 02:21:00 -08:00
516853626d Add basic webserver skeleton with healthcheck 2026-01-08 02:20:23 -08:00