You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. List tilesets: `GET ${REGISTRY_URL}/api/v1/artefacts?category=tileset&format=file&size=${ARTEFACTS_PAGE_SIZE}&skip=…` until pagination is exhausted.
98
-
4. List styles: `GET ${REGISTRY_URL}/api/v1/artefacts?category=style&size=…&skip=…` (npm-packaged artefacts).
95
+
3. List tilesets: `GET ${REGISTRY_URL}/api/v1/artefacts?category=tileset&format=file&size=1000` (single request — we never expect more than that many).
96
+
4. List styles: `GET ${REGISTRY_URL}/api/v1/artefacts?category=style&size=1000` (npm-packaged artefacts).
99
97
5. For each tileset: `ensureArtefact({ artefactId: t._id, cacheDir })` → yields a local `.mbtiles` path.
100
98
6. For each style: resolve the latest version via `GET /api/v1/artefacts/:id/versions/latest` (or equivalent), then `ensureArtefact({ artefactId, version, cacheDir })`. The helper extracts the tarball atomically.
101
99
7. Normalize each extracted style: parse its `style.json`, rewrite `glyphs` / `sprite` / `sources` entries to point at the locally cached files (see §7), and write the normalized copy next to the original.
102
100
8. Build the tileserver config in memory (see §8). Also serialize it to `${DATA_DIR}/config.json` for debuggability — tileserver-gl-light is still fed the in-memory object, the on-disk copy is purely informational.
103
-
9.`require('tileserver-gl-light')` → obtain the Express app factory, instantiate it with the in-memory config (and resolved `publicUrl` / `port`options), then `app.listen(PORT)`. The wrapper stays PID 1 and handles `SIGTERM`/`SIGINT` by closing the HTTP server cleanly.
101
+
9.`require('tileserver-gl-light')` → obtain the Express app factory, instantiate it with the in-memory config (and resolved `port`option), then `app.listen(PORT)`. Absolute URLs in TileJSON / style responses are derived per-request from `X-Forwarded-Host` and `X-Forwarded-Proto`, matching the data-fair multi-domain convention (cf. `@data-fair/lib-express/req-origin`). The wrapper stays PID 1 and handles `SIGTERM`/`SIGINT` by closing the HTTP server cleanly.
104
102
105
103
If any fetch fails, the service logs the offending artefact and exits non-zero — the container is expected to be restarted by its orchestrator, or redeployed once the registry state is fixed.
0 commit comments