feat(qnap): optionally report pending app updates over the web login (#76) #89
No reviewers
Labels
No labels
bug
docs
duplicate
enhancement
help wanted
invalid
nice-to-have
pre-1.0
question
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jfro/lamplighter!89
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/76-qnap-app-updates"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed
Web login only, no SSH. When app updates are turned on (off by default), the QNAP source reuses the firmware web login's sid to list installed apps (appRequest.cgi, apply=10, as in Jeremy's QTS 5.2.11 capture), compares them with QNAP's App Center feed for the matching QTS version and platform, and reports apps with a newer version. New code is in lib/lamplighter/sources/qnap/apps.ex plus qnap.ex; tests and fixtures under test/.
Earlier proofs on this PR from the abandoned SSH build (
0119dfc) and an intermediate commit (e139b06) were removed from this description; none of that code is on the branch.Fixes #76
Red, then green
bash -c 'source ~/.rmenv; export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; MIX_TEST_PARTITION=_76p env -u FORGEJO_TOKEN mix test test/lamplighter/sources/qnap_test.exs test/lamplighter/sources/qnap/apps_test.exs'3dab5ee): exit 17e56dfc): exit 0Checks
bash -lc 'source ~/.rmenv; eval "$(mise activate bash --shims)"; export MIX_TEST_PARTITION=_76; env -u FORGEJO_TOKEN mix format --check-formatted && env -u FORGEJO_TOKEN mix compile --warnings-as-errors && env -u FORGEJO_TOKEN mix test && env -u FORGEJO_TOKEN mix run --no-start -e "Application.ensure_all_started(:req); {:ok, r} = Req.get(\"https://download.qnap.com/Liveupdate/QTS5.2.0/qpkgcenter_eng.xml\"); n = length(Lamplighter.Sources.Qnap.Apps.parse(r.body)); IO.puts(\"feed apps: #{n}\"); if n < 20, do: System.halt(1)"', exit 0bash -lc 'source ~/.rmenv; eval "$(mise activate bash --shims)"; cd /home/peak/work/lamplighter-v1-4/wt-76 && MIX_TEST_PARTITION=_76q env -u FORGEJO_TOKEN mix test test/lamplighter/sources/qnap_test.exs test/lamplighter/sources/qnap/apps_test.exs', exit 0bash -c 'source ~/.rmenv; export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; MIX_TEST_PARTITION=_76 env -u FORGEJO_TOKEN mix run --no-start ../checks/qnap_live_feed.exs', exit 0bash -lc 'source ~/.rmenv; eval "$(mise activate bash --shims)"; cd /home/peak/work/lamplighter-v1-4/wt-76 && MIX_TEST_PARTITION=_76z env -u FORGEJO_TOKEN mix test', exit 0Shipping it
Prover
Passed (Sonnet): I read the diff and ran the full suite (1276 pass): off by default, no SSH, one shared login, empty lists fail loudly, only newer versions on the matching platform count, and merging deploys nothing. Untested: a real NAS, the raw HAR body, QuTS hero feeds, and the displayModelName platformExcl inference.
Every command above was run by Fortysix's Basecamp itself, on the branch named.
e139b06d967e56dfcbee