feat(qnap): optionally report pending app updates over the web login (#76) #89

Merged
jfro merged 1 commit from feat/76-qnap-app-updates into main 2026-11-28 17:39:29 +00:00
Owner

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

  • The QNAP app-update tests (apply=10 call, exact-version feed, platform matching, newer-only comparison, skip rules, one shared login) fail on main and pass on the branch.: 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'
    • fails on the base (3dab5ee): exit 1
    • passes on the branch (7e56dfc): exit 0

Checks

  • On the #76 branch the whole suite passes, along with the format check and warnings-as-errors, and QNAP's real App Center feed parses into more than 20 apps. (Upper Wolfjaw): 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 0
  • Off by default, no SSH, empty installed list or feed fails loudly; full suite (1276) passes and version/parse edge probes behaved. Untested: a real QNAP's appRequest.cgi answer and QuTS hero feeds. (Prover): bash -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 0
  • QNAP's live QTS 5.2.11 App Center feed parses (118 items) and the platform pick finds Container Station's TS-NASX86 entry with its release-notes link. (Upper Wolfjaw): bash -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 0
  • 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. (Prover): bash -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 0

Shipping it

  • Goes live when it merges: no. Merging to main deploys nothing; releases are Jeremy's own mise run release, and the feature is off by default.
  • Undo: a revert puts it back.
  • Not tried on the real thing: Not run against a real NAS; the installed-apps fixture is shaped from Jeremy's capture notes, not the raw HAR body. Matching platformExcl on displayModelName too is an inference (exclusions name products like TS-262A).
  • For later: Option 1 (firmware from the apply=10 block plus the firmware feed) and third-party store feeds are out of #76's scope; have_to_update's meaning is still unknown.

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.

## 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 - The QNAP app-update tests (apply=10 call, exact-version feed, platform matching, newer-only comparison, skip rules, one shared login) fail on main and pass on the branch.: `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'` - fails on the base (3dab5ee): exit 1 - passes on the branch (7e56dfc): exit 0 ## Checks - On the #76 branch the whole suite passes, along with the format check and warnings-as-errors, and QNAP's real App Center feed parses into more than 20 apps. (Upper Wolfjaw): `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 0 - Off by default, no SSH, empty installed list or feed fails loudly; full suite (1276) passes and version/parse edge probes behaved. Untested: a real QNAP's appRequest.cgi answer and QuTS hero feeds. (Prover): `bash -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 0 - QNAP's live QTS 5.2.11 App Center feed parses (118 items) and the platform pick finds Container Station's TS-NASX86 entry with its release-notes link. (Upper Wolfjaw): `bash -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 0 - 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. (Prover): `bash -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 0 ## Shipping it - Goes live when it merges: no. Merging to main deploys nothing; releases are Jeremy's own mise run release, and the feature is off by default. - Undo: a revert puts it back. - Not tried on the real thing: Not run against a real NAS; the installed-apps fixture is shaped from Jeremy's capture notes, not the raw HAR body. Matching platformExcl on displayModelName too is an inference (exclusions name products like TS-262A). - For later: Option 1 (firmware from the apply=10 block plus the firmware feed) and third-party store feeds are out of #76's scope; have_to_update's meaning is still unknown. ## 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.
jfro added this to the v1.4 milestone 2026-11-28 17:11:24 +00:00
feat(qnap): optionally report pending app updates over the web login (#76)
All checks were successful
CI / test (pull_request) Successful in 1m18s
e139b06d96
Lists installed QPKGs with the firmware check's administrator sid
(appRequest.cgi?subfunc=qpkg) and compares them with QNAP's public App
Center feed. Off by default; no SSH (D12).
jfro force-pushed feat/76-qnap-app-updates from e139b06d96
All checks were successful
CI / test (pull_request) Successful in 1m18s
to 7e56dfcbee
All checks were successful
CI / test (pull_request) Successful in 1m15s
2026-11-28 17:21:14 +00:00
Compare
jfro merged commit b43f616490 into main 2026-11-28 17:39:29 +00:00
Sign in to join this conversation.
No description provided.