Repository navigation
ADFA-4832 (Phase 1): add ZIM on the live system via the in-server socket.io channel - #249
Merged
Merged
Conversation
The in-server dashboard downloaded ZIMs with a leaner aria2 flag set than the app's better-tested downloader, risking divergent behaviour. Mirror the app's flags in kiwix.socket.ts: --continue, --allow-overwrite, --auto-file-renaming=false, -x4 / --split=16 (MetalinkSplit CONNECTIONS_PER_MIRROR / MAX_SPLIT), --follow-metalink=mem, --check-integrity (verify .meta4 SHA-256), --console-log-level=warn, --summary-interval=1, --download-result=hide. Add cross-referencing SYNC notes in both files (Aria2Manager is the reference) listing the intentional divergences: Debian system CA vs bundled cacert; container DNS (--async-dns=false) vs ApplyDnsUseCase + IPv4 profiler; no DHT/BT yet; and the app-only pre-reconcile/resume via MetalinkSplit + DownloadVerifier.
…ket.io channel On a running system, 'Get more -> add ZIM' indexed via a second proot (iiab-make-kiwix-lib) that collided with the live server and broke Kiwix. Route that path through the already-deployed in-server dashboard socket.io channel: the running server downloads + indexes in-process (no new proot). The foreground InstallService owns the connection so UI/config changes don't drop the job. - New LiveContentClient (socket.io): emits start_kiwix_download; maps kiwix_terminal_output/process_status/refresh_kiwix_catalog to progress/done/error. - InstallService.downloadAndIndexKiwix branches on ServerStateRepository.alive: live channel when the server is up; the app-side aria2+proot path stays for fresh installs (server down, exclusive rootfs). - Live path finishes after the ZIM (skips the maps proot) to avoid a fresh collision; maps/books migration + a durable REST job contract are Phase 2. - Adds io.socket:socket.io-client (org.json excluded). ADR in controller/docs. Needs on-device verification (sandbox can't build/run Android).
- LiveContentClient: buffered kiwix_terminal_output events carry many aria2 lines at once; take the LAST '(NN%)...DL:' in each blob so the % reflects reality instead of a stale first match. - InstallService live onProgress: append the localized k2go_rate_per_second to the raw rate (install_status_zim_download no longer bakes '/s' since ADFA-4830), so it reads e.g. '27MiB/s' again. - dashboard kiwix.socket.ts: aria2 --summary-interval=1 so progress prints every second when piped (default 60s) -> real-time in the app and web UI (server-side, reaches installs via provisioning).
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.
Fixes the "Get more → add Wikipedia/ZIM on a running system breaks Kiwix" bug. That path indexed via a second proot (iiab-make-kiwix-lib) over the live rootfs, colliding with the running server. It now goes through the already-deployed in-server dashboard socket.io channel, so the running server downloads + indexes in-process — no second proot.
Changes:
Scope / follow-ups (Phase 2): durable, resumable jobs + a REST start/poll contract (Android-appropriate, survives socket/UI drops); migrate maps/books to the channel; harden the dashboard packaging (compile JS, pdsm supervise); port the IPv4/IPv6 profiler server-side.
Note: the sandbox can't build/run Android — needs on-device verification (add a ZIM on a running system: Kiwix keeps working, no second proot; progress + completion show in the overlay; error surfaces safely).