Repository navigation
K2GO-593 feat(install): Forgejo binary download before the install - #823
Merged
Merged
Conversation
The module -> OnlineAllowance kind rule lives in ModuleDownload.allowanceKind.
aria2 ignores out= with -Z (the canonical flags), so the file kept the URL's name and the job ended 'did not complete' (seen on the A16). The runner now downloads into bin/.k2go-download, checks the sha-256, then moves the file to forgejo-<ver>.
The card showed the last poll before the pause (2% for a job paused at 23%, seen on the A16). onPaused now posts the box's percent again.
Maps and Forgejo now show the same panel: the install bar over the download card (view_k2go_module_progress + ModuleProgressPanel). The two copies of the install bar are gone. Each bar has one source (ModuleQueueRepository, ModuleDownloadRepository) and the screens keep no download flag. InstallService.postModuleStart is the one rule: a role with a task table starts at 0% before its download, so Forgejo shows both bars during the download, as maps does.
…flow The progress panel, the two repositories, the start rule and the dash-node download before pdsm stop, as the pattern for new modules.
The table has the role task names in run order, from a full run on the OnePlus 7T (forgejo 17.0.2). Names that contain the version or the architecture are not in it, because they change on each release.
A new durable job type. The box resolves the latest release (the codeberg API, as the forgejo role) and downloads the binary with the canonical aria2 flags and the withRetry loop to /library/forgejo/bin/forgejo-<ver>. aria2 writes forgejo-<ver>.part, and the runner renames it at the end, so the final name exists only for a complete file. Pause keeps the partial, Cancel removes it. The job result gives the version, so the app can pin forgejo_version and the role skips its own download. dash-node 1.6.5.
When the binary is already there, a partial of the same version from an earlier error is removed too, so it does not stay on disk.
The Forgejo install downloads its ~100 MB binary through the dash-node job forgejo-bin while the server is still up, before pdsm stop. The runrole then pins forgejo_version for that run, so the role's get_url skips the download and its GPG check verifies the file. A failed download fails only Forgejo, and Retry is offered. One download type and one card for every module download (maps base maps and the Forgejo binary): percent, speed, time left, Pause/Resume, "Reconnecting n of 5". MapsDownloadProgress and MapsDownloadRepository become ModuleDownloadProgress and ModuleDownloadRepository. The box downloads on the phone's default network, and aria2 continues on mobile data after a Wi-Fi drop. DownloadHold (the start gate's NetworkPolicy rule) holds the job on mobile data with no consent and with Keep offline, and continues it on Wi-Fi or after the user allows it on the card. A user pause is never continued by a network event. Forgejo needs dash-node 1.6.5 (DashNodeRequirement).
Machine translation of the six new strings into the 33 locales, for a later human review. Each locale uses its own words for mobile data, Wi-Fi and the per-second unit.
…he sha-256 Forgejo goes first in the batch and its row runs during the download, so the row opens the card and the install can be canceled. The box checks the file against the release sha-256: a wrong file is downloaded again, not kept for the GPG check to fail on every Retry. An owner pin of forgejo_version in local_vars skips the download. The job detail is logged only when it changes.
java.nio.file is API 26, and minSdk is 24: on Android 7 the read threw NoSuchMethodError and the install service stopped.
…l-download K2GO-593 feat(install): Forgejo binary download before the install
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.
This PR brings the work of #822 to
main. #822 was stacked on the K2GO-593 module install progress branch (#821). #821 merged intomainfirst, and #822 then merged into its base branch, not intomain. This branch now holds the merged #822 (6fff974). It merges intomainwith no conflicts. The code is the same as the reviewed #822, plus two commits after that review: one progress panel for proot module installs (3882426) and the design map in CLAUDE.md (00858c4). Both were reviewed.What changes
assets/runrole/forgejo.txt): the Forgejo install shows a percent and the time left for the Ansible steps, like the other modules.forgejo-bin: the box resolves the latest Forgejo release (the codeberg API, as the role) and downloads the binary with aria2 to/library/forgejo/bin/forgejo-<ver>. Percent, speed, time left, pause, resume, "Reconnecting n/5". Cancel removes the partial. The file is checked against the release sha-256; a wrong file is downloaded again. The app sends no URL.pdsm stop(the stop also stops dash-node). The runrole then pinsforgejo_versionfor that run only, so the role'sget_urlskips the download and its GPG check verifies the file. Forgejo goes first in the batch, and its row runs during the download (tap opens the card, Cancel works). A failed download fails only Forgejo (Retry is offered). An owner pin offorgejo_versionin local_vars skips the download.MapsDownloadProgressbecomesModuleDownloadProgress.DashNodeRequirement); an older box asks for the dashboard update first.Why
The Forgejo install showed only a spinner for about 10 minutes while Ansible downloaded ~100 MB with no percent, no pause and no resume. A cancel or a stall restarted the download from 0.
Steps to QA
Baseline (main): Settings > Module management > Code hosting > Install. The screen shows "Installing..." and a spinner during the binary download, with no bar.
Change (rebuild dash-node from this branch on the box first):
/library/forgejo/bin/(no.part). Retry downloads again./library/forgejo/bin/: the download step ends at once.Verifications
DownloadHoldTest,ForgejoBinaryPinTest,ModuleDownloadProgressTest; dash-nodeforgejo-bin.test.ts(npm run test:db).main; this PR brings K2GO-593 feat(install): Forgejo binary download before the install #822 tomain.UI changes
New strings (all 33 locales, machine translation for a later human review):
k2go_dl_program_title: "Downloading the program"k2go_dl_speed: "%1$s/s"k2go_dl_speed_eta: "%1$s/s, %2$s"k2go_dl_held_metered: "Waiting for Wi-Fi. The download does not use mobile data until you allow it."k2go_dl_held_offline: "Waiting. The app is kept offline, so the download does not connect until you allow it."k2go_mod_phase_downloading: "Downloading..."The maps download card now also shows the time left. Light and dark: checked on the device before merge (K2GO-593).
Notes