* The map can choose a 1:24,000 quadrangle to export (#971)
The first part of exporting a map as a PDF: a grid of 7.5-minute quadrangles is drawn over the
map, and a click chooses one. The grid is arithmetic, so it needs no data. Exporting itself is
not here yet; the button is disabled.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* A quadrangle of the map is exported as a PDF with a layer for each map layer (#972)
* A quadrangle of the map is exported as a PDF with a layer for each map layer
The browser draws the quadrangle off the screen at the size of a 1:24,000 sheet, once for each
layer which is on, and the API puts the images in a PDF, each in a layer of its own which a
reader can show and hide. A layer in which nothing is drawn is left out.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* The exported map's canvas keeps what was drawn, and an export's memory is bounded
- The drawing buffer is asked for where this MapLibre reads it (canvasContextAttributes); as an
option of the map it was ignored, so the canvas could be read after it was cleared.
- Each layer's pixels are compressed in the PDF as the layer is added. PyMuPDF kept them
uncompressed until the PDF was written: about 90 MB a layer of a quadrangle, all at once.
- The pixels of all the layers together are limited, before any image is decoded.
- pymupdf is imported when a PDF is made, not when the API starts.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map says where on the Earth it is (#973)
* An exported map says where on the Earth it is
The PDF's page has a geospatial viewport (ISO 32000-2): the page is the map in Web Mercator,
with the latitude and longitude of each corner. The corners are the edges of the picture the
browser drew, read from the map which drew it.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A map whose edge is the antimeridian can be exported
The map's arithmetic puts the east edge of the last quadrangle before the antimeridian a rounding error past
180 degrees, and the export was refused. An edge within 1e-8 of a degree of 180 is at 180 (it is not wrapped
to -180); a map which is really across the antimeridian is still refused.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map is on a sheet: a margin, a grid, scale bars and notes (#974)
* An exported map is on a sheet: a margin, a grid, scale bars and notes
The map is put on a larger page with what a topographic map has around it: a title, the latitude and longitude
of its corners and of ticks between them, scale bars (kilometers, miles, feet), and notes of the projection, the
grid and where the map's data is from. Over the map is a 1,000 meter UTM grid, each line named in the margin.
The grid and the margin are PDF layers of their own. The PDF says where the map is, not where the page is. The
picker has a box to export the map alone.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* The scale of a narrow map is written under its name, not over it
A quadrangle near a pole is two inches wide, which is not room for its name and its scale on one line.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map says where a compass points (#975)
* An exported map says where a compass points
The sheet has a diagram of the three norths (true, grid and magnetic) beside its scale bars, and a note of how
far magnetic north is from true north on the day the map was made, and how fast it moves.
The declination is from the World Magnetic Model 2025 (NOAA NCEI and the British Geological Survey; public
domain), whose coefficient file is shipped: nothing is downloaded. The model is good until 2030; outside its
years nothing is said of a compass.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A corner of an exported map is not also a tick
The edges of the picture the browser draws are a hair outside the quadrangle's, so the quadrangle's own edges
were taken for ticks inside the map, and each was written over the coordinate of its corner.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A compass which passes due south has moved a little, not most of the way around
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* A map can be exported at 400 DPI (#976)
The picker has a choice of 300 or 400 DPI. A map is drawn less sharp than was asked for, rather than refused,
when it would be more pixels than the API makes a PDF of: a quadrangle near the equator, or one with many layers
on. The picker says so while it draws.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported quadrangle goes by the name the USGS gives it (#977)
* An exported quadrangle goes by the name the USGS gives it
The picker says what the chosen quadrangle is called, and the sheet's title, the PDF's title and the file's
name have it. Where the USGS has no name, which is most of the world, a quadrangle goes by where it is, as
before.
The names are an index of the 65,600 7.5 minute quadrangles of The National Map (U.S. Geological Survey; public
domain), which is shipped: nothing is downloaded. In Alaska a USGS quadrangle is wider than 7.5 minutes, so a
quadrangle of the picker's grid there is "Part of" the one which has its middle.
The places the tests of the map export are of are changed for others.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* An area half of which is the last quadrangle of the land is a part of it
The middle of such an area is on the quadrangle's east or north edge, with no quadrangle beyond it, and it was
given no name.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* The PDF of a map is made by a Job, which the browser watches (#978)
* The PDF of a map is made by a Job, which the browser watches
A PDF of a quadrangle is a minute or two of work on a Raspberry Pi 4, and the request which waited for it was
cut off after a minute: only the smallest quadrangles could be exported there.
Now the browser describes the map, sends the image of each layer in a request of its own, and starts a Job; it
watches the Job, shows how far along it is, and fetches the PDF when the Job is done. Cancel stops the Job.
The images are kept on disk until the PDF is made of them, and an export is removed when it is an hour old.
The credits on the sheet are no longer cut off: an attribution which names many sources is each of them.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A cancelled map export stops, and is removed
- A cancelled Job is not over until the thread making the PDF has stopped, so the next Job does not start beside
it; the work can also be stopped while the sheet is drawn and the PDF written.
- DELETE /api/map/export/<id> stops an export at any step and removes what was sent; the browser calls it when
the person exporting cancels, while layers are sent as well as while the PDF is made.
- An export whose Job is waiting or running is not removed for being old; one whose Job was cancelled is removed
at once.
- Cancel while the map is drawn stops the drawing between two layers.
- Exports are kept in a directory made for this user alone, which is refused when it is a link or is another
user's; only what is an export there is removed.
- A request for the finished PDF which is lost is made again.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An overlay's areas and lines go under the map's labels, and its own labels over them (#979)
An overlay was drawn whole over the basemap, so an area it filled covered the names of what is in it. Labels are
now always on top: the areas, lines and pictures of every overlay are under the basemap's labels, and the text,
icons and points of every overlay are over them. It is so in the map, the standalone viewer, and an exported PDF,
where an overlay with both is two layers ("Towers" and "Towers (labels)").
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An overlay's ground is over the ground of every basemap file (#980)
* An overlay's ground is over the ground of every basemap file
On a map of several basemap files, the ground of an overlay was put before the first label of the first file,
which is under the land, water and roads of every file after it: an overlay's areas and lines were hidden, and
in an exported PDF its layer was just above the background. It goes where the basemap's labels begin: the first
of the labels which are over all of the basemap's ground.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* The labels of every basemap file are over the ground of every file
A map of several basemap files was their layers one file after another, so only the labels of the last file were
on top: the labels of the others were under the land, water and roads of the files after them, and under the
ground of an overlay. Both viewers now draw the ground of every file and then the labels of every file.
The contour lines are drawn after the basemap's labels and are not of the basemap: an overlay's ground goes under
the basemap's labels, not under the contours instead.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* Contours are drawn from as deep as the terrain file goes (#981)
The map read a terrain file to zoom 8, which is how deep the terrain WROLPi offers goes, however deep the file
was. It now reads a file as deep as the file says it goes, in both viewers, and draws finer contour lines from a
deeper file: every 40 feet (or 20 meters) from zoom 11, as a 1:24,000 sheet has. A file which goes to zoom 8 is
drawn as it was.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map names its small roads (#982)
* An exported map names its small roads
A quadrangle is drawn at about zoom 13. The basemap's style names small roads
from zoom 15, and its tiles have no names for them below zoom 14, so the streets
of a town were printed as lines with no names.
Before the map is drawn, the tiles of zoom 14 which the quadrangle is in are
read, and the roads in them which have a name are given to the export map as a
source of its own. The layer which names small roads draws from that source, as
its style says to.
At the scale of a sheet most streets are shorter than their names, and a map
writes a name along a line only where the line is longer. Such a road is named
over its middle, turned as the road goes; a road in pieces is named once.
A source whose tiles can not be read is exported as before.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* The names of small roads are placed by the export, at every latitude
A quadrangle nearer the equator is drawn at a little over zoom 14, where the
names were not read and the style still kept them for zoom 15: such a map had
no names of small roads. They are now read wherever a layer would not name
roads.
Every name of a small road is now a point: over the middle of its road, turned
as the road goes under it, again every 400 pixels of a long road. Before, a
road long enough was left for the map to name along its line, which the map
often does not (the line bends, or is in pieces), and a short piece beside it
was named too. One place decides where a road is named, so a road in pieces is
named once, and a piece of another kind of road does not take the name.
Reading the names can be cancelled.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* A sheet has a bar of meters, its norths in mils, and how far apart its contour lines are (#983)
Under the map are bars of kilometers, meters, miles and feet.
How far the grid's north and a compass's north are from true north is written in
mils as well as in degrees, in the diagram and in the notes: a compass may be
marked in either.
A map which is exported with its contour lines says how far apart they are
(CONTOUR INTERVAL 40 FEET), under the bars. The browser knows: it is the
interval of the tiles the lines are made for at the zoom of the sheet, in the
unit the map measures in. It says so with the sheet, and what is not an
interval is not written.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* A sheet says what the quadrangles around it are called (#984)
* A sheet says what the quadrangles around it are called
Under the scale bars is a diagram of nine squares, the map the middle one, and
beside it what the USGS calls each of the eight around it: the sheets to print
to carry on off the edge of this one.
The names are from the index of quadrangles which names the sheet itself. A
quadrangle with no name (out to sea, or over a border) has no number; a map of
where the USGS names nothing, and a map too narrow for the diagram, go without.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A sheet is never beside itself
Where a quadrangle of the USGS is wider than the map (Alaska), the area the
size of the map to its east or west is often more of the quadrangle the map is
in, and the diagram named the sheet as its own neighbor. The quadrangle on a
side is now the next one which is not the map's own.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* A sheet has a legend of the lines of its map (#985)
* A sheet has a legend of the lines of its map
Under the scale bars is what each kind of line of the map is: highway, major
road, minor road, path, railway, boundary, contour and index contour, each a
piece of the line as the map draws it, on the color of the map's land.
The map's style says how a line is drawn at each zoom, and a sheet is drawn at
one. The browser, which has the style, says what each line's color, width,
dashes and edges are at that zoom; the API draws them. A line is in the legend
when its layer is exported and draws something at that zoom.
What the browser sends is made into lines before it is kept: what is not a line
is left out, and the map is exported.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A legend has no line too thin to see, and no name longer than its room
A style brings a line in from nothing as the map is zoomed in: a path is a few
hundredths of a point wide on a quadrangle near the equator. It was in the
legend, drawn several times wider than on the map. A line under a tenth of a
point is now left out, by the browser and by the API.
What a line is called is cut to the room beside its line, as the name of an
adjoining quadrangle is.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* Fixes to the map PDF export: wrong neighbors, leftover exports, exports which outlive the map (#989)
* A sheet names what is around it, and its edges, by where they are and not a hair from there
The edges the browser gives of a map are a hair outside its quadrangle. The quadrangles around a map whose
middle is on the edge two share (every other map of Alaska) were those around the map west of it, and one of
them was the map itself. An edge a hair south of the equator was 0 degrees south, a map which ended where the
UTM zones do had no grid, and a sheet dated in the last year there is could not be made.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* An export is removed when it is over, and its work stops when the API does
The images and the PDF of an export were kept until the next export began, however long that was. The browser
now has the export removed however it ends, and old exports are removed when a PDF is made too. The work of a
Job which ended because the API was stopping went on to the end of the PDF, with the API waiting for it. What
is said of an export, and each image, is written whole. Text which is no text is taken out when an export
begins, not found by the Job.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* An export stops with its map, and waits for a page which can not be seen
Leaving the map while it was exported left the export going, to fail or to hand a PDF to another page; so did
closing the picker, which is now left open. A PDF which arrives after the export was stopped is not saved.
The time a page is behind another tab is not counted against a map which is drawing. The name of a road is
one line. A photograph which ends a little inside the map is not made a JPEG with a black strip. An accent
in the name of a quadrangle is not a gap in the name of its file.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A PDF is not kept from who made it by a server slow to remove the export
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map has its water over its parks (#990)
* A sheet names what is around it, and its edges, by where they are and not a hair from there
The edges the browser gives of a map are a hair outside its quadrangle. The quadrangles around a map whose
middle is on the edge two share (every other map of Alaska) were those around the map west of it, and one of
them was the map itself. An edge a hair south of the equator was 0 degrees south, a map which ended where the
UTM zones do had no grid, and a sheet dated in the last year there is could not be made.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* An export is removed when it is over, and its work stops when the API does
The images and the PDF of an export were kept until the next export began, however long that was. The browser
now has the export removed however it ends, and old exports are removed when a PDF is made too. The work of a
Job which ended because the API was stopping went on to the end of the PDF, with the API waiting for it. What
is said of an export, and each image, is written whole. Text which is no text is taken out when an export
begins, not found by the Job.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* An export stops with its map, and waits for a page which can not be seen
Leaving the map while it was exported left the export going, to fail or to hand a PDF to another page; so did
closing the picker, which is now left open. A PDF which arrives after the export was stopped is not saved.
The time a page is behind another tab is not counted against a map which is drawing. The name of a road is
one line. A photograph which ends a little inside the map is not made a JPEG with a black strip. An accent
in the name of a quadrangle is not a gap in the name of its file.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map has its water over its parks
A layer of the PDF was one image, drawn where the topmost of its layers is. The parks of Land Cover are under
the water on the map and its piers are over it, so all of Land Cover was drawn over the water: a lake in a
park, or among houses, was not on the PDF. A second basemap file put its water over the first's buildings.
A layer is now as many images as it must be, each where it is on the map, in one layer of the PDF: a part
which fills an area stays where it is, and a part which is only lines is drawn with the next.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A PDF is not kept from who made it by a server slow to remove the export
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A map file which is of somewhere else is not drawn when a map is exported
Each basemap file is several images of an exported map, and most files of a library are of other places: each
was an image of nothing, counted against how many images an export may be and how sharp it may be. A file
whose own edges are outside the quadrangle is now left out before the layers are counted.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map has its streams (#991)
A basemap draws streams from zoom 14, and service roads and taxiways from 13. A quadrangle is drawn a little
short of that (zoom 13.8 at 40 degrees, 13.2 at 61), from tiles which have them: none were on the PDF. What
is drawn from a zoom no deeper than a quadrangle's detail is drawn. Names are left as they are.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An export which is cancelled stops at once, in the middle of a request (#993)
* An export which is cancelled stops at once, in the middle of a request
An export was stopped between two requests. The image of a layer is tens of megabytes, which is a long request
on a slow connection, and a request to a server which has stopped answering never ends: the export said it was
stopping until then. Cancel, and leaving the map, now end the request.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* The requests an export makes after its layers are sent are seen to be stopped too
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* A map is exported as it is printed: on white, in dark lines (#996)
* A map is exported as it is printed: on white, in dark lines
The light and dark maps are made for a screen. On paper their roads are white on pale gray and their streams
half a pixel of pale blue. The printed map is a third look, of the map's own: white ground, dark road edges
and names, blue streams wide enough to see, paths drawn, brown contours.
It is what a map is exported in unless Light or Dark is chosen where the quadrangle is, and the choice is
remembered in the browser. While a quadrangle is chosen the map is shown in the look it will be exported in.
The light and dark maps are as they were.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* Changing the look of the map does not move it
What is done when a new style is in place was asked for after the style was set. A style which only differs
from the one the map has is in place before that, so it was done at the next change of style instead, with
where the map had been at this one: the map went back there when a quadrangle was chosen, and again when it was
not. It is asked for first, and the map is not moved at all. An export no longer waits for the map to be
still, which it need not and which nothing ended.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* The colors of the printed map are chosen where its layers are (#997)
* The colors of the printed map are chosen where its layers are
While a quadrangle is chosen and the map is shown as it is printed, each layer of the layer control has its
color beside it, to be changed: one for most, three for the land (what grows, what was built, sand and ice)
and two for names (the name, and what is around it). A basemap has several colors where one is chosen, which
are shades of it. The edge of a road stays dark. What is chosen is remembered in the browser, and can be put
back. The map on the screen is as it was.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A ramp on a bridge is the color of a major road, as it is off one
A basemap draws a ramp on a bridge in the color of a minor road on a bridge: on the printed map it was white
where the rest of the ramp is yellow, and followed the color chosen for minor roads. What puts the colors
back is a button, which a keyboard reaches.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* A layer with nothing in it does not make an exported map less sharp (#1001)
* A layer with nothing in it does not make an exported map less sharp
How sharp a map may be depends on how many images it is, and every group of layers was counted: a basemap
file with no runway, highway or boundary in the quadrangle was images of nothing, drawn, sent, and counted
against the rest. A map of 23 images asked for at 400 DPI was made at 330. The groups are now looked at
first, on a small map, and only those with something in them are drawn, as sharp as that many may be.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* An image which arrives after its export was removed is not kept, and one mil is a mil
Stopping an export while an image was on its way left the image behind it, in a directory nothing would
remove for an hour. An angle of one mil was "1 mils" on the sheet.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* The map which is exported from is made as sharp as it is to be (#1002)
* The map which is exported from is made as sharp as it is to be
The groups of a map are looked at on a small map, which was then made larger to draw them. A browser lets
a canvas be larger when it is made than it lets one be made larger afterwards: a quadrangle asked for at
400 DPI was 33 million pixels, 288 DPI at 40 degrees, less than before the groups were looked at first. The
small map is now removed, and the map which is exported from is made in its place.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A canvas the browser stopped drawing on is not a layer with nothing in it
A canvas whose drawing was taken away by the browser reads as clear, and a group looked at then was left out
of the PDF without a word: the export fails instead. An export stopped as the last group is looked at does
not make the map it would have been drawn on.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map says where it is in a projection Adobe Acrobat knows (#1003)
* An exported map says where it is in a projection Adobe Acrobat knows
The page was said to be in Web Mercator, which it is drawn in. Acrobat does not know Web Mercator, in the
words of the standard or in Esri's: it took the page for a map, and put every place on it at 0, 0. The page
is now said to be Mercator on the WGS 84 ellipsoid, which it reads, with the same corners. Between the corners
the two differ by under three centimeters on the ground.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* How well a page is said to be where it is, is measured from what the PDF says
The test of it measured two formulas of its own. It now reads the corners and the projection from the PDF and
does a reader's sum with them. The few centimeters are of a quadrangle: a taller page is less well said, by
the square of how tall it is, which the comment now says and a test measures.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* The help says how a map is exported as a PDF (#1004)
The help of the map is five pages, one of them the PDF export.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
The final part of replacing the sync: the help documents it. A new Sync page; Backup rewritten around the backup
drive and its delayed delete (it taught a hand-made rsync job over SSH); sync.yaml and sync_state.yaml in How
Configs Work.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A file of features often carries a basemap's layers too (roads, water, buildings, place names).
Drawn over the basemap they double every road and label. Those layers, by the names of the
Protomaps and OpenMapTiles schemas, are now off until they are checked; every other layer is on
as before, and a choice already made is kept.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Bump the help docs to document overlays, the style which can sit beside a
map file, the map's own overlay icons, the Type and Visible columns of the
Map's Manage tab, and maps.yaml.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
The toggle was only the zim.auto_search column, which defaults to on. The
database is rebuilt from files and configs, and a Zim's newer version is a new
row, so every rebuild and every subscription update turned search back on for
every Zim. On a large library the global search then searched all of them.
zims.yaml records auto_search for each Zim, keyed by the Zim's name without
its date, so a newer version of a Zim is the same Zim. A Zim the file does not
name is searched (the default stays on). The config is imported on startup
with the usual version gating, saved when the toggle changes, and a newly
modeled Zim takes its setting from it.
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Nothing started the hotspot since hotspot_on_startup moved out of the
API, and NetworkManager does not autoconnect the Hotspot connection.
The Controller now starts it once per boot unless hotspot.on_startup is
false; a legacy wrolpi.yaml hotspot_on_startup: false is migrated.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Bumps the help docs for the new "Resume Where You Left Off" page and the
recently_viewed.yaml config.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Repos keeps local mirrors of git repositories, cloned over https and kept up to date on a schedule.
- A Repo is a Collection (kind='repo') plus a `repository` row. The new `git` downloader clones it, then updates it
(weekly by default, or Never: the clone is kept as it is and only updated on request).
- Repos are saved in `repos/<tag>/<name>` (the Repos Directory, ignored by default) or a directory the user chooses.
An existing clone can be imported where it is. repos.yaml is the source of truth.
- A GitHub-like page shows each repo's README, files, and history, with a ZIP download. READMEs are searchable
under the global search's Other tab.
- git is hardened against hostile repos and configs: https only, pinned addresses with no private addresses (for the
repo and its submodules), sanitized configs, no hooks or links, and only clones WROLPi made or imported are
updated.
- Tagging a Repo moves its clone as one directory. Repo changes wait for repos.yaml to be imported at startup.
- The file mover groups unindexed files with no primary file as one FileGroup, and never replaces a file at the
destination. A failed tag move restores the Collection's tag. A Collection's directory cannot leave the media
directory.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Add a Solar calculator with offline NASA POWER data
Estimates a solar array's typical-year production from a location and the
panels; everything else has defaults under an optional "Fine-tune" section.
The model works from 12 monthly averages: Klein's average day per month, the
Erbs monthly diffuse fraction, Collares-Pereira & Rabl / Liu & Jordan hourly
split, HDKR transposition for fixed, single-axis and dual-axis arrays, then
PVWatts' ASHRAE incidence loss, SAPM cell temperature, DC power, system
losses and optional inverter. "Best for the year" and "Best for winter" sweep
the tilt.
Sunlight, diffuse, albedo and temperature come from NASA POWER's 2001-2020
climatology on a 1 degree grid, packed into app/public/data (3.1 MB, ~1 MB
gzipped) by scripts/build_solar_climatology.py and fetched only when the
calculator opens. Users can replace it with their own monthly values.
Every setting lives in the URL, with defaults left out, so the Share button
shares the whole configuration.
Against PVWatts v8 for a 1 kW fixed array: Phoenix +0.6%, Seattle +8.8%,
Anchorage +8.0% annually; these are recorded as tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Open the Solar calculator from the map, pins and current location
The map's right-click (or long-press) menu gains "Calculate Solar
Performance", and each saved pin a sun button; both open the calculator at
that location. A button beside Latitude fills in the browser's current
location. Locations are rounded to 4 decimals, and longitudes from a map
panned around the world are wrapped back to -180..180.
The map removed lat/lon/z from the URL when it closed, even after navigating
to another page, which stripped the calculator's location from its URL (and
from links shared with the Share button). It now only cleans up while the
URL is still a map page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Add off-grid sizing to the Solar calculator
A new "Off-grid sizing" tab sizes a battery system for the darkest month
from a list of devices (watts x hours per day):
- Battery bank for a number of days without sun, for LiFePO4 or lead-acid,
at 12, 24 or 48 V. Outdoor lead-acid is enlarged for the cold; outdoor
lithium warns against charging below 0 C.
- Panels needed, from the worst month's DC production per kW at the chosen
angle, with a button to apply the count. A PWM controller's loss (battery
voltage over the panel's Vmp) raises the count.
- Charge controller current, and the string voltage on the coldest morning
against the controller's limit, since cold panels exceed their rated Voc.
The coldest morning defaults to 25 C below the coldest monthly average.
All inputs live in the URL like the rest of the calculator.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Bump wrolpi-help for the Solar calculator help page
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Credit NASA POWER as it asks, and say how the data was changed
- The calculator gains a "Data attribution" link under the location with
NASA POWER's requested acknowledgment, the data reference (Climatology API
v2.10.0, downloaded 2026/10/04), the CC BY 4.0 license, and how WROLPi
modified the data (rounded to one byte per value, temperature averaged
into 1 degree cells, interpolated between cells), which CC BY 4.0 requires.
- The build script writes the same text to solar-climatology.LICENSE.txt
beside the data, with the API version taken from NASA's responses and the
date the tiles were downloaded. A test keeps the page and file in step.
- Bumps wrolpi-help for the updated attribution in the help page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Solar: fix PWM sizing, Voc sign, unit switching and loading on review
- PWM usable power now uses the string's voltage (Vmp x panels in series),
delivers nothing when the charging voltage is at or above the string's Voc,
and falls off between Vmp and Voc. The "too little voltage" warning covers
PWM as well as MPPT. Previously two panels in series counted double, and a
panel that could not charge a 48 V bank counted as fully usable.
- A Voc temperature coefficient entered without its minus sign is treated as
negative, in the math, the URL and the input, so the cold-morning check
cannot be made too generous.
- Switching Fahrenheit on or off converts the entered temperatures instead
of reinterpreting them.
- While the sunlight data downloads, the off-grid tab shows a loader rather
than asking for a location, and holds the cold-morning verdict until the
site's temperatures are known or one has been entered.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Solar: move the data attribution to the bottom of the page
The full NASA POWER acknowledgment, license and changes now sit in a small
"Data attribution" section at the end of the calculator, always visible,
instead of behind a link under the location. The source line under the
location points to it. Bumps wrolpi-help to match.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Solar: drop the data source line under the location
The attribution at the bottom of the page is enough. The line under the
location now only appears to report the data's state: loading, failed to
load, or replaced by the user's own values. Bumps wrolpi-help for the
refreshed screenshot.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* bookmarks: user bookmarks in the navigation bar, stored in bookmarks.yaml
A "Bookmarks" tab between Calculators and Flasher opens on hover or click and
lists the user's bookmarks, with directories as flyout submenus (Menu.Sub).
The mobile hamburger shows directories as labelled groups instead. The tab
always shows, with an "Edit bookmarks" item, so the feature can be found
before any bookmark exists.
Bookmarks live in a new config-only bookmarks.yaml: a nested tree where a
node with `children` is a directory and a node with `url` is a bookmark.
Every node carries an integer id so the API can rename, move and delete
without relying on names. A URL may be a path on this WROLPi, a port on this
host (`:8096/` or `http://:8096/`, resolved against whatever hostname the
browser used, so it works over LAN IP, mDNS and the hotspot alike), or an
absolute URL. Each bookmark chooses whether to open in a new tab.
The editor at /more/bookmarks follows the playlist items table: numbered rows,
up/down/edit/delete, and inline "Add a bookmark" / "Add a directory" forms
with a Location picker. Deleting a directory asks first, since its contents
go with it. The menu and the editor are in the component gallery.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* bookmarks: mark More current when the editor is folded inside it; rem indents in the mobile menu
Found on the QA Pi at a width where Bookmarks overflows into More: the More
button carried no mark on /more/bookmarks, because the bookmarks link has no
`to` for isLinkActive to match. isLinkActive now knows the bookmarks link owns
its editor page, and the Bookmarks tab uses the same rule.
The mobile menu's directory labels sat a few pixels left of the labels around
them: the indent was in em, and a Menu.Label is set smaller than a Menu.Item.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* bookmarks: parse URLs instead of matching a prefix; validate the whole tree on every write
The URL contract was checked by prefix on both sides, and a prefix is not a
form: `//evil.com` starts like a path and `:8096@evil.com` starts like a port,
and a browser takes both off this host. A path is now a single leading slash
that resolves to this origin, a port form is an optional scheme, `:`, digits
and then only a path, query or fragment (no `@`, no backslash, no control
characters), and anything else must parse as http(s). The same rules live in
wrolpi/bookmarks.py and BookmarksContext.js, with the same bypass strings in
both test suites.
The config's dataclass validator only saw that `bookmarks` was a list, so a
hand-edited file or the generic config API could store a `javascript:` URL
that the bookmarks API would refuse, and the nav rendered it. The config now
validates the tree itself on every write and import: URL forms, exactly one of
url/children, unique integer ids, boolean new_tab, and no cycles (a YAML
anchor can build one). An invalid file is not imported and, since it was never
successfully imported, is never overwritten.
On the page, a stored URL that does not resolve is rendered as text, never as
an href. A refused add keeps what was typed instead of clearing the form, and
an edit whose move is refused still refreshes the nav (the rename was
committed) and keeps the modal open. An IPv6 host is bracketed before a port.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* help: document Bookmarks
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
* Hotspot captive portal: welcome page with the WROLPi's address
Devices that join the hotspot probe a fixed plain-HTTP URL to check for
Internet access. NetworkManager's shared-mode dnsmasq now resolves those
probe hostnames (and `wrolpi`) to the hotspot address via an include the
Controller writes when the hotspot starts, the probes land on the Controller
(port 80), and are redirected to /portal: "This is your WROLPi, its address is
10.42.0.1, open WROLPi / open the Controller".
Only the probe hostnames are hijacked so the hotspot keeps forwarding
everything else when the WROLPi has an uplink. The include is corrected and
the connection re-activated once if NetworkManager picked a non-default
subnet. Writing the include is best-effort; the hotspot starts regardless.
`hotspot.captive_portal` (controller.yaml, default true) toggles the probe
redirects and the include; like the other hotspot settings it applies on the
next hotspot start, so saving while the hotspot is up reports
restart_required and both Controller UIs say so. The status endpoint gains
the hotspot address and portal URL, shown in both UIs. repair.sh only
creates the include directory so a disabled setting survives upgrades.
Native only: Docker has no hotspot.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* captive portal: address review
* React: re-read the hotspot address whenever the HotspotToggle starts or
stops the hotspot, matching the fallback UI's refresh-on-status.
* A WPA3 start that reverts to WPA2 leaves the hotspot up, so it now gets
the captive portal address correction too.
* The corrective `nmcli connection up` logs a warning on a non-zero exit;
dnsmasq would otherwise keep the old address silently.
* HotspotStatusResponse.captive_portal defaults to true like everywhere else.
* Trim design narrative from the module docstring and React comments.
* The include-before-activate test now observes the include at the moment
of the `nmcli ... hotspot` call instead of inferring from call order.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* captive portal: never forward any record type for probe hosts
`address=` only synthesizes A/AAAA answers. iOS also asks for the HTTPS
record type; dnsmasq forwarded that upstream, Apple's answer aliased to
captive.g.aaplimg.com, and the phone fetched the genuine "Success" from
Apple instead of the portal. Each probe host now also gets `local=`, so
dnsmasq answers every type itself, and the CDN alias is a probe host too.
Observed with dnsmasq query logging on a hotspot with an eth0 uplink.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* captive portal: let acknowledged clients finish so the OS offers "Done"
A phone's sign-in sheet only shows "Done" once the OS re-probes and gets
the genuine success reply. The Controller now remembers each client (by
hotspot IP) that has loaded the portal page and answers its later probes
with the reply each OS expects (Apple "Success" HTML, Android 204, Windows
"Microsoft Connect Test", ...). The set is cleared when the hotspot
starts so a new session shows the page again.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* captive portal: acknowledge on Continue, not on view
iOS fetches the portal page in the background before opening the sheet,
then re-probes after the sheet's own navigation. Acknowledging on view
made that re-probe return "Success" as the sheet's content. Phones only
re-check the network (and offer "Done") after a full-page navigation, so
the welcome page now has a Continue button leading to /portal/continue,
which is the only place a client is acknowledged. The Continue page says
to tap Done and links to WROLPi and the Controller.
Also hijack clients3.google.com (older Android probe host).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* help: bump wrolpi-help to the captive portal and Speed Test docs
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* captive portal: comments describe the Continue design; clear acks on stop
Three comments still described acknowledging on view, which c72a7f7b
removed. Acknowledged clients are now also cleared when the hotspot
stops, so a lease reused in a later session sees the portal page.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
All three build targets move from Debian 12/bookworm to Debian 13/trixie
for fresh installs; existing Debian 12 systems remain supported in place.
Docker: api/help on python:3.13-trixie, controller on 3.13-slim-trixie,
app on node:20-trixie (matches trixie's nodejs 20), samba/zim on
debian:13. Full backend suite passes on Python 3.13 in the api container.
debian-live-config: --distribution trixie; postgres teardown for the
SQLite cutover (pg_dropcluster hook block removed, wrolpi-bootstrap.sh no
longer creates a cluster or calls the deleted initialize_api_db.sh — the
API creates wrolpi.db itself on first start). README documents the
SQLite layout and drops Etcher recommendations.
pi-gen: upstream has no trixie branch — the arm64 branch now defaults to
RELEASE=trixie; KEYBOARD_KEYMAP=en_US is rejected by trixie's
console-setup (ckbcomp validates), use 'us'; stop stamping a Postgres
.pgpass into /etc/skel.
Package lists (both targets): postgresql-15/postgresql-doc/libpq-dev
deleted; libtiff5-dev renamed to libtiff-dev; software-properties-common
and cpufrequtils removed from trixie (Controller CPU throttle falls back
to sysfs, dead cpufreq-set sudoers rule removed); locales and gnupg added
(no longer arrive transitively under --apt-recommends false); sqlite3 CLI
added for reset_tags.sh.
help.sh: replace the Postgres service/port/socket/cluster/psql checks
(all false FAILEDs after the SQLite cutover) with SQLite checks:
wrolpi.db exists, PRAGMA quick_check, file_group table + row count, run
as the wrolpi user so root never creates the -shm sidecar.
Both build scripts take a WROLPI_BUILD_DIR override so development builds
can run beside the release pipeline's build trees; the sudo re-exec
passes it through explicitly (a plain sudo would drop it).
test_common.py: the truncate tests hard-coded sys.getsizeof results from
the 3.11 object layout (str/list shrank in 3.12); assert the contract
(fits budget, prefix, monotonic in budget) so they pass on 3.11 and 3.13.
Verified: trixie ISO (3.7G) and pi-gen desktop image (4.3G) both built
from scratch and passed their sanity checks.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds Tags, Configs, FileGroups, Downloads, and Upgrade docs, the
WROLPi Portable section in Getting Started, and a synced TOC.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PR #494 re-pointed the submodule at 80648d3 to preserve the previously-pinned
snapshot, but that commit predates the Inventory documentation, so the Docker
help image had no Inventory pages. Bump to 002e747 (current help master tip),
which includes the Inventory docs and the Restore section.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The wrolpi-help history was rewritten to correct the author email
(rolobio@rolobio.com -> roland@learningselfreliance.com) and GPG-sign all
commits, which changed every SHA from the affected commits onward and orphaned
the previously-pinned 2c75fbb. Re-point the submodule at 80648d3, the
content-identical (same tree), signed equivalent of the old pin, so
`git submodule update --init` and the Docker help build keep working.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Replace nginx with Caddy as the web server for both Docker and native
(RPi/Debian) deployments. Caddy handles HTTPS termination, reverse
proxying to all services (API, React app, Controller, Kiwix, Help, Map),
and serves the media/download file browsers.
- Generate a Root CA and signed leaf certificates for HTTPS. The Root CA
uses Name Constraints to restrict signing to local addresses only
(.local, localhost, and RFC 1918 private IP ranges), mitigating MITM
risk if the CA key is compromised.
- Add an HTTP landing page that guides users through one-time CA
certificate installation on iOS, Android, macOS, Windows, Linux, and
Firefox, with auto-redirect when the cert is already trusted.
- Add trailing-slash redirects for /controller, /docs, /media, and
/download so bare paths don't fall through to the React catch-all.
- Add a Root CA download link on the Settings page under Configs.
- Update help.sh diagnostics for IPv6 listener detection and HTTP/2
status codes.
- Remove all nginx config files and the https_proxy Docker container.
- Bump wrolpi-help submodule with certificate documentation.