Skip to content

K2GO-394 feat(dashboard): base-map job takes a file id and composes the URL - #560

Merged
luisguzman-adfa merged 2 commits into
mainfrom
feat/K2GO-394-dashnode-basemaps-ids
Sep 7, 2026
Merged

K2GO-394 feat(dashboard): base-map job takes a file id and composes the URL#560
luisguzman-adfa merged 2 commits into
mainfrom
feat/K2GO-394-dashnode-basemaps-ids

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

What this changes

Two follow-ups to the base-map download engine, both in the dashboard / role-patch
area (separate from the controller app):

  1. The basemaps runner takes a file id, not a URL. The app POSTs
    {ids:["<file>.pmtiles"]}; the runner validates it as a plain file name (no
    path, 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.

  2. The is_proot delegate patch is scoped to pmtiles only. The maps role also
    downloads the static-search tarball through the same task with
    expand_archive=true. dash-node downloads files, not archives, and does not
    extract 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_proot assert.

Verification

tsc clean; the role patch applies clean. The search-tarball case was confirmed on
device: install_static_search.yml includes download_from_catalog with
expand_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.

…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.
@luisguzman-adfa
luisguzman-adfa merged commit 434b157 into main Sep 7, 2026
4 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/K2GO-394-dashnode-basemaps-ids branch September 7, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant