The photo proxies answer public, max-age, so a proxy or CDN in front of
TREK could hand a password-protected link's photo to somebody who never
unlocked it. For a link with a password every Cache-Control the proxy
sets is turned private.
The REST route let everyone on a journey comment, but MCP could only
list, hide and delete. The tool runs through the same service and
checks. The in-app assistant is not offered it, since a comment speaks
in the user's name to the journey's people and the link's readers.
The confirm and unsubscribe pages lived at /journey-follow/, which the
client does not treat as a public path, so a reader without an account
could be sent into the proxy re-auth flow. They now sit under
/public/journey-follow/ beside the shared journey itself.
The data side of journey comments and following a link by email (#1702,
#1669), for the views to draw on, online only like the journey itself:
- api/journeySocial and repo/journeySocialRepo, parsed against the shared
contracts.
- useJourneyComments: a journey's comments grouped by entry, add, hide and
delete, read again on journey:entry:commented.
- useJourneySubscribers: the owner's list of followers and their removal.
- useJourneyPublicSocial: the comments a share link shows, a reader's
comment and follow request, each answering what it came to.
- useJourneyFollow: the confirm and unsubscribe pages a follower's mail
links open, posting the token once.
- useJourneyShareLink switches allow_comments and allow_subscriptions on
their own, like the map extras.
The people on a journey can now talk about its entries, and a reader of its
share link can comment there too and follow the journey by email (#1702,
- journey_entry_comments holds a comment under an entry: by an account or
signed with a name through the link, plain text up to 2000 characters. It
goes with its entry and journey; a deleted account leaves it as unknown.
Everyone on the journey reads and writes them, the author or an editor
deletes one, an editor hides one from everyone but the editors.
- The share link gains allow_comments and allow_subscriptions (default 0,
kept when a save leaves them out). Readers comment under the entries the
link shows, behind the link's password gate, with a honeypot field and a
limit per address and link. The public payload says what a reader may do.
- journey_share_subscribers holds an address following a link, with double
opt-in: one mail asks to confirm it, nothing else is sent before. The mail
links open app pages that post the token, so a scanner changes nothing.
The owner lists and removes the addresses; they go with the link.
- A daily job (journey-digest) tells everyone on a journey about entries
published since the last run (journey_entry_published, their settings
apply, not about their own), mails each confirmed follower once a day in
their language with an unsubscribe link and a List-Unsubscribe header, and
forgets addresses unconfirmed for a week. journey_entries.announced marks
what was told; existing published entries start as told.
- The owner hears about a new comment (journey_comment). Both events are
translated in every locale, as are the follower mails.
- journey:entry:commented pings the journey's people; the journal page
leaves it to the comments reader instead of reloading.
- MCP: list_journey_comments, set_journey_comment_hidden,
delete_journey_comment, list_journey_subscribers, remove_journey_subscriber,
and create_journey_share_link takes both switches like the REST route. The
assistant is not offered the follower tools.
The data side of the protected journey link (#2553), without markup yet:
- journeyApi.unlockPublicJourney posts a reader's password; the answer sets
the link's unlock cookie.
- useJourneyPublic tells a locked link (access 'locked') and an expired one
('expired') apart from a broken one, and unlock() reports 'ok', 'wrong',
'rate_limited', 'expired' or 'failed', reloading the journey on success.
- useJourneyShareLink carries has_password, expires_at, view_count and
last_viewed_at, and setProtection() sets or clears the password and the
expiry, shown only once the server took it.
Adding somebody to a journey was silent (#1669). The new journey_invite
event goes to the person added, in-app with a button to the journey and on
every channel they use, once: posting the same person again only changes
their role. The REST route and the MCP tool both go through
JourneyService.addContributor, so both send it; the send is fire and forget
like the trip and collection invites.
The event is listed while the Journey addon is on, with its label in the
notification settings, and its texts are translated in every locale.
A journey's share link can now ask readers for a password, stop working on
a date its owner picks, and count how often it was opened (#2553, #1702,
no password, no expiry and no views.
- journey_share_tokens gains password_hash, password_version, expires_at,
view_count and last_viewed_at (append-only migration, SQLite and
Postgres, added only where missing).
- The password is hashed with bcrypt at the account cost. POST
/api/public/journey/:token/unlock checks it, rate limited per address
and link (only refusals count), and sets an httpOnly cookie scoped to
the link's API path holding an HMAC over the token and the password
version. Secure follows the request, so plain-HTTP installs keep working.
Changing or removing the password raises the version and locks every
old cookie out.
- Every public route, the photo proxies included, first checks the link:
404 unknown, 410 expired (JOURNEY_LINK_EXPIRED), 401 locked
(JOURNEY_PASSWORD_REQUIRED).
- Saving the share switches keeps the password and the expiry; the owner's
read returns has_password, expires_at, view_count and last_viewed_at,
never the hash, and none of it reaches the public payload.
- A reader is counted once a day per address and browser, in an in-memory
store behind an injectable port; a restart may count them again.
- create_journey_share_link takes password and expires_at like the REST
route; get_journey_share_link reports has_password.
The trip PDF writes an outline's d into an SVG string as it stands. A detail
file that carries anything but moves, lines and closes in numbers (a stale
cache, a proxy in between) is now refused, and the coarse outline is drawn.
A map without the revision 12 scope fields is read as one saved before them,
and its scope is guessed off what it holds. New whole-journey and trip maps
wrote none of the fields, so a map placed on a one-country journey was taken
for a map of that country once the journey reached a second one, and never
widened again. bookTravelMap and the auto layout's journey map now write
country, dayDate and stop as null, and a refresh writes the scope of an old
map down once it is plain (its trip, a recorded track, several countries).
Applying a template drops what a page's map is of and its own view; they now
travel with its stops. Saving a page as a template strips them, like the
stops themselves.
Parity digests regenerated for the pages that hold a journey map: 2 in
auto-layout.parity.json, 12 in design-templated.parity.json.
The vector map draws a hand-framed view as given, widened to the frame's
proportions as the fit always was, and the tile grid takes the same
extent. A view east of 180 lifts the stops, tracks, roads and outlines
west of it by a turn, so Fiji is one map rather than two halves of the
world. The fit, the bows and the route's extent move to travel/mapFit.ts,
which takes TravelElements.tsx from 1559 to 1332 lines.
Hawaii and other small islands vanished because the bundled outlines
drop every ring below 1.2 % of the mainland (#3056). A finer set, built
from the same admin-0 boundaries by scripts/build-country-detail.mjs, is
served as one static file per country under country-detail/ and loaded
when a map's route (or its own view) is regional, or when coastDetail
asks for it; the coarse outline stays the fallback offline and until a
file arrives. The decision reads the route, not the fitted window, since
fitted to its countries a Hawaii trip falls back to the whole United
States. The export waits for the files before the sheets render, the
trip PDF's outline map loads them for a regional route, and the service
worker keeps them once fetched without precaching them.
The scope of a new map is one object (tripId, country, date or entryId)
rather than a union of five, and style's view is four numbers checked
against the document's bounds, so edit_book_page and revise_book_design
grow by about 800 characters instead of 1400. Their ceiling moves from
45 000 to 46 000 with the measured size noted beside it.
Book schema revision 12 adds five optional fields to the map element:
view (a hand-framed box, east up to 540 for the antimeridian), stop,
country, dayDate and coastDetail. Absent means a map saved before them,
null means not narrowed that way.
routeFor, isStale and refreshPatch honour every scope and never widen a
narrowed map to the whole journey. Country maps from the travel looks
and the entry-page map of the auto layout carried tripId null like a
journey map, so refreshing one from the inspector turned it into the
whole route; maps saved before revision 12 are now read off what they
hold and refresh writes their scope down. The looks and the auto layout
write the scope from now on, so the parity digests of those pages move.
The book engine's add takes a country, a date or an entry as the map's
scope, style takes view and coastDetail, and describe-spread says what a
map is of. Pasting a style never copies a map's view.
The in-app assistant would be offered import_journey_gpx_days, whose only
input is GPX text the model would have to write itself; a recorded route has
to come from a real file, so the tool is denied there like upload_trip_file.
External MCP clients keep it.
JourneyRecordedDaysRepository.upsertDays had no repository test: add one for
the empty list, a multi-row insert and a replace that keeps the id and the
first time and leaves the other source's day alone.
The recordings api and repo send a GPX file to the journey and drop a day
of one source. useJourneyRecordings keeps the days of both sources: the map
and byDate show one day per date, the GPX one first, bySource holds each
source's own, and the Dawarich dialog and day import compare only with
what Dawarich kept. useJourneyGpxImport reads a file, shows its days at
once and says why a file gave none, in every language.
A GPX file is a second source of a journey's recorded days (#3085). The
new route POST /api/journeys/:id/recordings/import-gpx (multipart, 15 MB,
edit access, no Dawarich needed) and the MCP tool import_journey_gpx_days
read the file's track segments through the place import's GPX reader,
place every timed point on its local day in the zone of where it was
recorded (or in one zone the caller fixes), cut the pieces at gaps, thin
them like a Dawarich day and keep one day per date with source gpx in one
transaction. Reading the file again replaces only its GPX days and leaves
an unchanged day and every Dawarich day alone; a day that changed pings
journey:recording:updated.
A GPX day is stored with source_kind tracks, so the existing contract
still reads it. DELETE :date and delete_journey_recorded_day take an
optional source, Dawarich's when left out. The shared map shows a GPX day
also without a published entry and prefers it over a Dawarich day of the
same date; the list of kept days carries both, ordered by date and source.
No migration: source and source_kind are text columns already.
Ramer-Douglas-Peucker and the even-stride cap move from the Dawarich
helpers into @trek/shared as thinRecordedLine and capLinePoints, so a
second source of recorded days thins its lines the same way. The Dawarich
helpers keep their names for them.
delete_journey_photos removes uploaded files for good and has no undo; its
generic approval card could only list ids, so the assistant is not offered it.
External MCP clients keep the tool.
A HEIC upload no longer fails when the lazily loaded capture reader cannot be
loaded: the photo goes up without its capture, as before. The upload schema's
doc comment is back on the schema it describes.
The browser converts a HEIC to a JPEG before it uploads it, and that
JPEG carries no EXIF, so iPhone photos arrived without their capture
time and GPS. A small lazily loaded reader now takes DateTimeOriginal
with its offset and the GPS pair from the HEIC's Exif item before the
conversion, and journey photo uploads (gallery, entry, Studio) send them
as optional taken_at, lat and lng fields.
The server reads those fields leniently (an ISO instant between 1900
and tomorrow, a pair inside the globe that is not 0,0) and hands them to
the capture backfill only when the request carried one file. They fill
in only what the file's own EXIF lacks and go through the existing
COALESCE write, so a stored value is never replaced. Covers and place
images keep the plain conversion and never carry a location.
Entry cards and the entry photo grid loaded the provider thumbnail (about
250 px for Immich) and drew it blurry. Photos now have a medium "preview"
rendition: Immich's preview, Synology's xl and a local photo's 800 px
thumbnail. GET /api/photos/:id/preview serves it behind the same access
check, and both share link photo routes now hand a preview on instead of
reading every size but thumbnail as the original. The entry grid, the
entry covers, the phone feed cards and the share page's large tiles ask
for it; small tiles keep the thumbnail.
The Synology picker named no size and got the 240 px rendition; its
tiles now ask for the medium one.
Deleting a gallery photo ignored the journey id in its path and told no
other tab. JourneyGalleryService now holds every photo delete: it checks
the edit right and that each photo belongs to the journey named, queues
the files for release once the rows are gone and broadcasts
journey:updated. The REST routes and the new MCP tool
delete_journey_photos (up to 100 ids, all or nothing) go through it.
The contributor routes cast the role without checking it, so a raw body
could write role 'owner'. The shared contract now takes only editor or
viewer, the service refuses any other role, and the role update never
touches the owner's own row.
Write both defaults in one guarded statement so a SQLite source imported by the Postgres suite needs no Postgres lock. Release a failed speculative chunk promise so opening the map can retry it.
Use the engine write lock for map defaults and clean the metadata-free test snapshot with Kysely. Model the Leaflet bridge option, keep the renderer failure state below the settings store, and make the tile tests independent of the transpiler quote style.
The MapLibre style picker offers two more entries after the OpenFreeMap
styles: OpenFreeMap that follows the light or dark theme (trek:ofm-auto),
and the user's own map template (trek:template), which brings the template
field under the picker, and the CARTO key for a CARTO template. Where the
trip map will draw the template with the classic 2D map (Amap, a host the
CSP does not name) the form says so and the preview shows that map. The
preview draws exactly what the trip map will.
Every place the forms load or save a MapLibre style keeps a keyword now,
where it used to turn it into Liberty on the first unchanged save: the
user form on desktop and phone (load, save, the phone's mirrored field,
a provider switch there and back) and the admin defaults (provider switch,
preset pick, typed style). The rules live in mapSettingsModel, so both
shells render from one decision:
- the template keyword with an empty template saves Liberty;
- switching from Leaflet with a template and an empty MapLibre slot
preselects the template, shown and not saved until Save;
- Leaflet never writes a keyword into the Mapbox slot, and Mapbox shows its
default for one.
New strings in all locales.
Leaflet loads a tile as an image without CORS and the prefetch fetches it
no-cors, so map-tiles holds opaque answers. A GL map reads tiles with a
CORS fetch and cannot use one: once Leaflet had drawn an OpenTopoMap tile,
the GL tour layer failed on the same URL, and a MapLibre template would
fail the same way on every prefetched tile.
A CORS request for a raster preset's tile now goes to map-tiles-gl, which
keeps only readable answers, ahead of the Leaflet rules; images and the
no-cors prefetch stay in map-tiles. The matcher is written into the
service worker by its source text, so its host list is inline, and a test
holds it to the hosts the CSP lets a GL map fetch. OpenHikingMap and
CyclOSM stay out, their usage policies allow no offline copy.
The prefetch takes exactly one way per user: a template MapLibre draws on
such a host is fetched with CORS into map-tiles-gl, at the density the map
asks for, everything else as before. Clearing offline maps drops both
caches, and the iOS trim keeps both within its budget.
A MapLibre user could only draw OpenFreeMap styles; a raster template was
Leaflet's alone. With maplibre_style set to trek:template, MapLibre now
draws the template the trip map already resolves for Leaflet (CARTO key,
keyless fallback and dark default included), so both renderers show the
same map. No stored row holds the keyword, so every existing user sees
exactly the map they saw before, and Mapbox is untouched.
- glBasemap turns the basemap spec into a raster style document (256px
tiles as Leaflet requests them, the provider's deepest zoom, the credit,
OpenFreeMap glyphs for the map's own labels) and resolves trek:ofm-auto
to Liberty or OpenFreeMap Dark with the colour scheme.
- glCanFetch decides whether a GL map may fetch a basemap here: https on a
host the CSP names, the shipped ones or MAP_EXTRA_CONNECT_HOSTS from the
app config. GCJ-02 tiles (Amap) and other hosts are drawn by Leaflet for
that render, the setting untouched.
- rasterHealth watches the first tiles of a template map: a CSP refusal or
twelve failures without a success move every map drawing that template
to Leaflet for the session, with a pill that says so.
- useEffectiveMapEngine decides this on the engine that actually draws and
runs the offline checks after it; a stored raster template keeps drawing
offline where Leaflet would keep the same tiles.
- The journey map uses the same hook: the same template, the same fallback
and now the offline basemap with its pill as the trip map has it.
- A MapLibre raster style stops at zoom 19 like Leaflet; the Mapbox options
stay as they were.
The offline pill moves to BasemapPill for both maps. Dropping the unused
imports there lowers the eslint baseline.
The maplibre_style slot gains two values that name no style document:
trek:template, which has MapLibre draw the user's map template the way
Leaflet does, and trek:ofm-auto, OpenFreeMap Liberty in the light theme
and OpenFreeMap Dark in the dark one. No stored row holds either, so no
saved setting changes its meaning, and a client that predates them reads
them as a foreign style and draws the default.
mapConnectHostAllows reads a host-source entry the way the browser reads
the policy (a wildcard never covers its apex, no port means the default
one), so the client can ask whether a GL map may fetch a tile before it
tries.
BasemapSpec and EffectiveMapEngine are only named inside their own
modules so far, so they stay unexported until a caller needs the name.
The basemap spec reads the Tours raster zoom limits from mapDefaults, so
one export there is no longer unused; the knip baseline follows.
/api/settings is never cached, so an app started offline ran on
DEFAULT_SETTINGS until the server answered: Leaflet instead of the map
the user chose, and the default units. The answer the server gave last
time now stands in until the next one arrives.
- Dexie v18 adds accountSettings, one row in the signed-in user's own
database, so another account on the device never reads it and logout
deletes it with the database. The anonymous database never holds one.
A new table only; the upgrade test covers it.
- loadSettings lays the kept answer over the defaults while nothing newer
arrived and keeps every server answer. A key the server then leaves out
goes back to its default, so the server stays the source of truth.
- A setting the server accepted is laid over the kept answer, so a change
made online is what the next offline start shows. A refused save keeps
nothing.
Keeping is best effort: where IndexedDB is refused the app starts on the
defaults as before.
MapViewAuto chose the renderer and the offline fallback inline, so the
journey map, which needs the same choice, could only copy it.
useEffectiveMapEngine now holds it: the user's provider where it can run
(Mapbox needs a token, both GL engines WebGL2), Leaflet where it cannot,
and offline the stored basemap with its pill, checked on the engine that
actually draws. It returns what to draw and never writes a setting.
The logic is the one MapViewAuto ran, moved and not changed, and the hook
is tested on the same cases as the trip map's offline suite. The header
comment no longer claims the Atlas uses Leaflet.
The trip map, the journey map and the settings preview each assembled
their own constructor options and their own 3D setup on load, and the
copies had drifted: the preview laid terrain under every style outside
the Standard family, while the trip map only under the satellite and
outdoor styles, so the preview showed a map the trip never drew.
glMapOptions builds the options for all three and applyGl3d sets up
terrain, buildings and the flattened Standard DEM. For Mapbox the options
are exactly the ones each map built before, key for key and in the same
order, which a test pins; the preview now follows the trip map's terrain
rule. The next steps tune MapLibre in this one place.
MapViewGL.tsx shrinks, and its size baseline follows.
The Leaflet map read the resolved template and sniffed it again for the
datum and the credit, and a GL raster source would need the same template
with its placeholders decided. resolveBasemapSpec wraps resolveBasemap and
adds what a renderer needs: the template Leaflet takes as before, the tile
URLs a GL source takes ({s} as Leaflet's a/b/c shards, {r} as @2x on any
screen denser than one, {-y} as a TMS scheme), the tile size, the
provider's deepest zoom, the credit, the datum and the host.
The Leaflet map draws from the spec now, with the same template, credit
and datum as before, so nothing on screen changes. The tests cover every
template a user can have saved today.
A GL map fetches its style and its tiles, so it can only draw from a host
the server's connect-src names. The raster presets and OpenFreeMap were
written out in the middleware while the client kept its own idea of them,
and nothing held the two together.
The hosts, their reasons and the default OpenFreeMap style now live in
shared/src/maps/map-defaults.ts. The middleware builds those sources from
the list, and the client takes the default style from it, so the renderer
choice the next steps add reads the same hosts the policy allows.
The policy an install sends stays byte for byte the same: a test pins the
whole connect-src in its order.
The app-config README lists every variable as boot-stable or runtime-toggled;
the new one was missing. The CSP takes it when the app is built, so it is
boot-stable. The wiki section also lacked the rule that separates it from
Storage & Paths like every other section.
With the operator's Mapbox token a managed install replaced every empty or
Leaflet provider with Mapbox, including a Leaflet the user picked and a
Leaflet default the admin set. A plain "only when empty" would switch
everyone whose Leaflet row only exists because the settings form writes
every field (#1634), so the choice is recorded instead, by the server alone:
- map_provider_chosen on the user's settings, set when a write changes the
provider the user is shown (so saving the form unchanged is no choice,
and leaving the Mapbox a managed install shows is one). A client patch
naming the key is dropped on both routes, false included, so no client
can set or clear it.
- map_provider_default_chosen in app_settings, set when the admin saves a
map_provider default and removed when it is reset.
Mapbox now replaces an empty provider, or a Leaflet without the mark of
where it came from. No stored row is rewritten: rows without a mark read
exactly as before. The client Settings type gains the read-only field.
A GL map fetches its tiles and its style, so a template on a host of the
operator's own (a self-hosted tile server) was refused by connect-src while
Leaflet drew it as images. The new variable lists such hosts; each entry
becomes an https source in connect-src and the same list reaches the client
as map_extra_connect_hosts in the app config, so the renderer choice and the
policy can never disagree.
The variable is owned by readEnv() like the rest of the maps namespace and
read once when the middleware is applied. The boot refuses an entry outside
the shared grammar; a path that skips the boot check drops it, so a bad
value never widens the policy. Unset, the CSP and the app config are as
before apart from an empty list.
Documented in .env.example, docker-compose.yml, the Helm values and
ConfigMap and the wiki. Making room for the app config field shrinks
auth.service.ts by one line, and its size baseline follows.
MAP_EXTRA_CONNECT_HOSTS lets an operator name tile and style hosts beyond
the ones TREK ships. The server adds them to the CSP connect-src and the
client will only ask a GL renderer to draw what that list names, so both
sides read entries through one grammar: a lower-case host name with at
least two labels, an optional port and an optional leading wildcard over
two or more labels. No scheme, path or user, so an entry can never widen
the policy past a single host family.
The parser returns the accepted hosts and the refused entries, for the
boot check, and the app config field gets a Zod contract.
The scan ran out of memory since the places work: the analyser keeps every
file it parsed until the end, finds only files named tsconfig.json, and
server/tsconfig.json leaves out tests/, so the server tests landed in a
catch-all program that parsed server/src and shared/src a second time,
about 9,400 files and some 2 GB. Naming the tsconfigs, with the server's
tsconfig.tests.json in place of tsconfig.json, keeps them in the program
that already parsed those files. No file leaves the analysis.
All saved shows a place kept in several lists once, but deleting that row
removed only the copy shown, so the next copy took its place, and the
status filter and counts read only that copy. The filters now look at
every copy before the places are shown once, the counts count a place
under each status its copies hold, and deleting or setting the status of
the row reaches every copy.
A test title held an unescaped apostrophe, so the file did not parse. The
inspector maps a provider's week through one helper again, which keeps it
at its size baseline, and the counts type of the rail stays inside its file.
The +N chip after the visited countries' flags sat on the last flag with a
see-through white, so that flag showed through it. It is now the same tone,
solid.
OSM tags a closed day as off ("Mo off"), which the tag parser hands on
as "Monday: off", and the place view showed that word as the day's hours
and as today's line. A day the provider wrote as off or closed now reads
in the reader's own word for closed, in the place view and in the details
column of the place dialog.
An OSM or index place with a reviewed TREK Community picture showed it in
its gallery but only a category pin in the lists and on the map: the
marker photo asked Google and Wikimedia, never the community's pictures.
It now asks them first, the order the gallery shows them in, and only
while the TREK Places API is on.
The count beside All places in the place dialog's picker appeared only
once All places was chosen and read. It is now read with the picker,
with one entry, the way the rail reads it.
All lists in the place dialog's picker now shows a place kept in several
lists once, as All saved does, and All places keeps the places of the
trip being planned, so it always holds at least what All lists holds and
its count matches the rail.
A place saved into several lists from the same trip place showed once per
list in All saved and counted that often, while All places groups the
copies as one place. All saved now shows such a place once, the first
copy read standing for it, and the rail counts All saved and All places
the way All places groups them, on the desktop and the phone.