Repository navigation
v0.10.0
Breaking Changes
Layer names now replace special characters in certain areas. A layer name containing ../ could write outside the configured directory when using the disk cache. Similarly, long or unusual names could smuggle separators into S3 object keys, or break telemetry metrics. Keys are now sanitized by special characters being replaced with an underscore (_). This does mean some layer names can overlap if differing only by special characters. It's now documented that layer names should only be alphanumeric plus underscore, though for now that's not enforced.
Configuration validation is now stricter. Unknown keys were previously ignored entirely, which meant a typo could be dangerous. Unknown keys, invalid error.mode, invalid logging levels and formats, duplicate layer IDs and datastore ID collisions are now errors. A config that started before may now fail at startup; run tilegroxy config check before upgrading.
Highlights
New usage analytics entity. Where telemetry aggregates counters for operating the service, analytics records an individual event for every tile successfully served, attributed to a layer, a coordinate and optionally a user, written to a destination you own and can query. Useful for understanding which layers are actually consumed, attributing usage to tenants, or tracking consumption of a metered upstream provider. Events can be written to PostgreSQL, ClickHouse, or a custom destination via an interpreted Go script. Recording happens after the response is written and is best-effort, so a slow or failing destination never adds latency to a request or degrades tile serving. Analytics is off by default.
Support for ETag header Saves sending tiles over the wire when unchanged. Repeat requests for unchanged tiles now return 304. This is automatic, no configuration for it.
What's Changed
Features
- Analytics support by @Michad in #738
- ETag and
If-None-Matchconditional request support by @Michad in #740 - Allow vector tile content types by default so proxied MVT works without extending the allowlist by @Michad in #740
Fixes
- Reject ref cycles and dangling ref targets at startup and cap ref recursion depth by @Michad in #740
- Fix a data race on
Layer.providerContexton the normal request path by @Michad in #740 - Cache the full authorization result in the JWT cache instead of only the expiry by @Michad in #740
- Sanitize user-controlled layer names used in disk, S3 and memcache keys by @Michad in #740
- Percent-encode layer parameters interpolated into upstream URLs by @Michad in #740
- Error on unknown config keys and validate
error.mode, logging levels and formats by @Michad in #740 - Catch duplicate layer IDs and datastore ID collisions in
config checkby @Michad in #740 - Substitute
env.andsecret.values in string maps and lists by @Michad in #740 - Register config defaults so environment variables resolve for keys absent from the file by @Michad in #740
- Fix the
ProviderAuthErrormatch that made the documented re-authentication path dead code by @Michad in #740 - Sanitize layer IDs used in OTEL metric names so IDs with spaces or non-ASCII characters no longer prevent startup by @Michad in #740
- Rebuild health checks on hot reload instead of pinning the original generation by @Michad in #740
- Guard the entity registries with a mutex by @Michad in #740
- Bound in-flight cache writes instead of spawning an unbounded goroutine per miss by @Michad in #740
- Recover from panics in background cache writes and seed threads by @Michad in #740
- Set
Content-TypeandCache-Control: no-storeon error responses so a CDN can't cache "tile unavailable" by @Michad in #740 - Inherit
unknownLengthinClientConfig.MergeDefaultsFromby @Michad in #740 - Stop treating every memcache miss as an error by @Michad in #740
- Fix a panic in
CheckConfigon a nil writer, and inRenderTileon a plaincontext.Background()by @Michad in #740 - Split long ServeHTTP method by @Michad in #738
Documentation
- Add example app for analytics functionality by @Michad in #741
- Correct the extensibility provider example, which did not compile, and cover it with a compiled test by @Michad in #740
- Remove retired badge by @Michad in #742
Full Changelog: v0.9.2...v0.10.0