K2GO-394 feat(dashboard): base-map job takes a file id and composes the URL - #560
Merged
Merged
Conversation
…he URL
The basemaps runner now accepts a bare pmtiles file name per item
(POST /api/basemaps/download {ids:["<file>.pmtiles"]}) and composes
https://iiab.switnet.org/maps/2/<file> itself, instead of taking a full URL.
This matches the kiwix split: the app holds the catalog and sends a light id, the
box owns the mirror host, so the switnet host never enters the app. The id is
validated as a plain .pmtiles file name (no path, no traversal); archives (search)
are not delegated here. No other behavior changes (same aria2 flags, reconnect
loop, cancel cleanup). Bumps the dashboard version to 1.3.3.
…elegate Scope the is_proot delegation to non-archive downloads. The maps role downloads the static-search tarball through the same task with expand_archive=true; dash-node downloads pmtiles files, not archives, and does not extract them. So the merged delegate asserted an extracted search directory that dash-node never places, which failed a search-on proot install. Now a pmtiles download is delegated (skipped in-proot, asserted present), and an archive still downloads AND extracts in-proot (the task also does the extract/mv). The search tarball is small, so the in-proot wedge risk is low.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Two follow-ups to the base-map download engine, both in the dashboard / role-patch
area (separate from the controller app):
The
basemapsrunner takes a file id, not a URL. The app POSTs{ids:["<file>.pmtiles"]}; the runner validates it as a plain file name (nopath, no traversal) and composes
https://iiab.switnet.org/maps/2/<file>itself. This matches the kiwix split -- the app holds the catalog and sends a
light id, the box owns the mirror host -- so the switnet host never enters the
app. Dashboard version 1.3.2 -> 1.3.3.
The
is_prootdelegate patch is scoped to pmtiles only. The maps role alsodownloads the static-search tarball through the same task with
expand_archive=true. dash-node downloads files, not archives, and does notextract them, so the previous delegate asserted an extracted search directory
dash-node never places -- which failed a search-on proot install. Now a pmtiles
download is delegated (skipped in-proot, asserted present) and an archive still
downloads AND extracts in-proot.
Why
The app-side integration (a later PR) sends catalog file ids, not URLs, keeping the
mirror host out of the app the way kiwix does. And a search-enabled proot install
must not fail on the
is_prootassert.Verification
tscclean; the role patch applies clean. The search-tarball case was confirmed ondevice:
install_static_search.ymlincludesdownload_from_catalogwithexpand_archive: true.Accepted trade-off: the search tarball still downloads through the in-proot aria2c,
so a network drop during it could wedge -- but it is ~16 MB (a short window), and
dash-node cannot extract archives, so it stays in-proot for now.
Notes
Builds on the merged base-map engine PR. The app-side maps integration (a separate
PR) depends on this one -- it sends file ids that this runner composes into URLs.