Make a fresh clone servable after `git lfs pull` alone, and rebuildable with `tools/build.py` without re-rendering unchanged PSDs: - Track build/ (rendered base PNGs, previews, world composites), web/tiles/, web/tiles-trimmed/, web/data/world.json and web/data/markers/. Large PNGs and the tile pyramids go through Git LFS (.gitattributes); JSON stays plain. - build.py: decide PSD re-export from build/<id>/base.stamp.json (PSD size, mtime, SHA-256 recorded at export time) instead of file mtimes, which are meaningless after an LFS checkout. Same size + new mtime hashes once and refreshes the stamp; --stamp-only writes stamps for existing base.pngs. - Ignore .DS_Store and .env files; track sources/**/*.jpg through LFS. Viewer: - Right-click (long-press) the map for a category menu that drops a draft marker under the pointer and enters marker edit mode for that map. - Marker editing moves out of the side panel into a box anchored next to the marker: Enter or a left click anywhere else saves, Esc cancels, Delete inside the box; drags save position plus the box contents. - Maps panel expands on hover, header click pins/unpins (status shown in the header), unpinned collapses 2 s after the pointer leaves; Overview is the first list entry instead of a separate button. Only the panel scrolls; the page never grows past the viewport. Hover tooltips render above markers. Also includes the pending source additions (overall square base, skirt textures, AI regeneration tooling and notes), service worker, Caddyfile and map config updates. Co-Authored-By: Claude Fable 5 <[email protected]>
44 lines
1.4 KiB
Caddyfile
44 lines
1.4 KiB
Caddyfile
# Production-ish static server for the built site.
|
|
#
|
|
# server/caddy.exe run --config server/Caddyfile
|
|
#
|
|
# Get caddy.exe with server/get-caddy.ps1 (it is gitignored -- 47 MB binary).
|
|
#
|
|
# Compared with serve.py this adds ETags, compression, and concurrency that
|
|
# scales instead of collapsing. Everything here is static files; there is no
|
|
# application server.
|
|
#
|
|
# Note: this is plain HTTP, so HTTP/2 is NOT active -- browsers only negotiate
|
|
# h2 over TLS. The speedup over serve.py is Go's I/O, not h2. Turning on
|
|
# `tls internal` would enable h2/h3 but every phone would need Caddy's local
|
|
# CA installed, which is not worth it on a LAN.
|
|
{
|
|
admin off
|
|
auto_https off
|
|
}
|
|
|
|
:{$TARKOVMAP_PORT:8080} {
|
|
root * ../web
|
|
|
|
encode zstd gzip
|
|
|
|
# Tiles are rewritten wholesale by tools/build.py and never edited in
|
|
# place, so a long lifetime is safe. `immutable` stops the browser
|
|
# revalidating them on every pan.
|
|
@tiles path /tiles/* /tiles-trimmed/*
|
|
header @tiles Cache-Control "public, max-age=31536000, immutable"
|
|
|
|
# The shell and the manifest must never be stale, or the app can end up
|
|
# pointing at tiles that no longer exist.
|
|
@shell path / /index.html /app.js /style.css /sw.js /data/*
|
|
header @shell Cache-Control "no-cache"
|
|
|
|
# Leaflet skips a tile that 404s; without this an out-of-bounds request
|
|
# logs an error page instead of failing quietly.
|
|
handle_errors {
|
|
respond "" {http.error.status_code}
|
|
}
|
|
|
|
file_server
|
|
}
|