Skip to content

webadmin: link raw thermal streams to the live flight viewer - #52

Merged
tridge merged 3 commits into
ArduPilot:mainfrom
tridge:pr-video-link
Nov 27, 2026
Merged

tridge merged 3 commits into
ArduPilot:mainfrom
tridge:pr-video-link

Conversation

@tridge

@tridge tridge commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

The video page could only point a raw thermal (Matroska) slot at desktop tools. This adds an Open live in the flight viewer link for each slot with an active raw thermal publisher. It opens a web viewer that plays the stream from the video port's TLS WebSocket (wss://HOST:PORT/), with the flight path on a map and seek back over what it has received.

  • The viewer defaults to https://plot.ardupilot.org/video-live/. Set WEBADMIN_LIVE_VIEWER_URL, or "live_viewer" in webui.json, to use another; an empty string removes the link. A value that is not an http(s) URL also gives no link.
  • The link carries only the address. With a viewer password set, the page says to enter it in the viewer.
  • MPEG-TS slots are unchanged: the viewer does not play them.

The viewer is added by ArduPilot/AP_CameraGimbal#84. It needs TLS on the video port, and its Content-Security-Policy must list the proxy's host, so on a proxy it does not list the link opens the viewer and the viewer reports the refusal.

Testing

  • tests/webadmin/test_video_page.py: the link appears once, on the raw thermal slot only, with the slot's port; the configured viewer is used; an empty or non-http value removes it. The web UI tests pass (339).
  • Deployed on a proxy with a looping raw thermal test stream, where the link shows on the video page and opens the viewer.

The video page could only point a raw thermal (Matroska) slot at
desktop tools. Link it to a web viewer that plays the stream from the
video port's TLS WebSocket, with the flight path on a map.

The viewer defaults to plot.ardupilot.org/video-live/ and is set with
WEBADMIN_LIVE_VIEWER_URL or "live_viewer" in webui.json; empty
removes the link. The link carries only the address: a viewer password
is entered in the viewer.
@tridge tridge added the AIReview Request an automated AI review; picked up by the reviewprs sweep label Nov 25, 2026
@AP-Review

AP-Review commented Nov 25, 2026 •

Copy link
Copy Markdown

Deprecated — see below for the updated review.

Previous review (2026-11-25)

Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting.
Verdict: COMMENT

Reviewed at head 7b0e0806eb.
Full report: https://firmware.ardupilot.org/Tools/APReview/DevCallReviews/PRReviews/ardupilot/supportproxy/52/1.html#prSupportProxy-52

This adds a live-viewer link for raw thermal slots. It works and is tested, with two non-blocking points about the default viewer and URL construction.

Should fix

  • webadmin/config.py:62: the on-by-default viewer at plot.ardupilot.org currently allows wss only to firevps.tridgell.net in its CSP connect-src, so on support.ardupilot.org or neon the link opens a viewer that cannot connect. Default to "" or widen the viewer's connect-src before deploying.

Low

  • webadmin/routes_video.py:60: a configured viewer URL with a #fragment gets live= appended inside the fragment, so the viewer sees no stream. Add it to urlsplit(viewer).query and rebuild with urlunsplit.

Not fully reviewed: the link was not opened in a real browser against a TLS video port, so CSP enforcement and live playback are untested.

The live viewer has to allow a proxy's host in its Content-Security-Policy,
so a default viewer gave other proxies a link to a page that could not
connect. The link now appears only when a viewer is configured.

A configured viewer URL with a fragment had live= appended inside the
fragment, where the viewer does not read it; it is now added to the query.
@AP-Review

AP-Review commented Nov 27, 2026 •

Copy link
Copy Markdown

Deprecated — see below for the updated review.

Previous review (2026-11-27)

Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting.
Verdict: COMMENT

Reviewed at head 5612847000.
Full report: https://firmware.ardupilot.org/Tools/APReview/DevCallReviews/PRReviews/ardupilot/supportproxy/52/2.html#prSupportProxy-52

This adds a live-viewer link for raw thermal slots and is close to ready, with one low-severity robustness point.

Since the last review both earlier points are fixed: there is no default viewer now, and a configured URL keeps its #fragment after the new live= query.

Low

  • webadmin/routes_video.py:58: a malformed LIVE_VIEWER_URL such as https://[bad/ makes urlsplit() raise ValueError, so /video/ returns 500 whenever a raw thermal slot is active. Catch ValueError and return None so it fails closed like the scheme check.

Not fully reviewed: the link was not opened in a real browser against a TLS video port, so CSP enforcement, live playback and the viewer password dialog are untested.

urlsplit() raises on a URL such as https://[bad/, which made the video
page fail whenever a raw thermal slot was active.
@AP-Review

Copy link
Copy Markdown

Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting.
Verdict: ACCEPT

Reviewed at head 7718ba27c0.
Full report: https://firmware.ardupilot.org/Tools/APReview/DevCallReviews/PRReviews/ardupilot/supportproxy/52/3.html#prSupportProxy-52

This adds a live-viewer link for raw thermal slots and has no open findings at head 7718ba2.

Since the last review the one Low point is fixed: a malformed LIVE_VIEWER_URL such as https://[bad/ now gives no link instead of a 500 (webadmin/routes_video.py:58), and the test covers it.

Not fully reviewed: the link was not opened in a real browser against a TLS video port, so CSP enforcement, live playback and the viewer password dialog are untested.

@tridge
tridge merged commit 88f6bdf into ArduPilot:main Nov 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIReview Request an automated AI review; picked up by the reviewprs sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants