feature/backoff-moq-relay-session - #317
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves TLS trust handling for RTSPS camera connections, hardens Cloud heartbeat logging for failed Hub requests, and adds MoQ relay session monitoring/backoff-related behavior.
Changes:
- Introduce
AGENT_CAPTURE_IPCAMERA_RTSPS_CA_FILEto append a private camera CA bundle to the system roots only for gortsplib (without changing process-wide TLS roots). - Enhance heartbeat failure logs by capturing status, duration, and (bounded) response bodies, with accompanying unit tests.
- Add MoQ relay session-closure detection during publish loop; update dev launch config to include the
moqbuild tag.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README-RTSPS-TLS.md | Documents the new camera-specific CA env var and warns against process-wide SSL_CERT_* for production. |
| machinery/src/cloud/livemoq_enabled.go | Adds a session-closure watcher to stop publishing when the relay session closes. |
| machinery/src/cloud/cloud.go | Adds bounded response-body capture and structured logging for heartbeat failures. |
| machinery/src/cloud/cloud_test.go | Adds tests for heartbeat failure logging and response-body truncation. |
| machinery/src/capture/gortsplib.go | Implements RTSPS TLS config that appends camera CA PEM to system cert pool. |
| machinery/src/capture/gortsplib_test.go | Adds tests for the new RTSPS TLS behavior (default, insecure, CA append, invalid CA). |
| machinery/data/tus/1786715908_3-737_encrypted_0-0-0-0_-1_25498.mp4.primary.json | Adds a tus upload-state JSON file (appears to be generated/runtime state). |
| .vscode/launch.json | Adds moq build tag for the Go launch configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+190
to
+194
| select { | ||
| case err := <-sessionClosed: | ||
| return fmt.Errorf("relay session closed: %w", err) | ||
| default: | ||
| } |
| @@ -0,0 +1 @@ | |||
| {"upload_url":"https://vault.kerberos.io/api/storage/tus/19e42fbc666a38064904caf8c46d182a","vault_uri":"https://vault.kerberos.io/api/storage/tus/","size":1591581} No newline at end of file | |||
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.
Description
Motivation
MoQ relay sessions could close without being detected promptly, while RTSPS camera trust configuration relied on process-wide certificate settings that could interfere with public services. Heartbeat failures also provided too little diagnostic information to identify the cause.
Changes
AGENT_CAPTURE_IPCAMERA_RTSPS_CA_FILE, extending the system CA pool only for camera RTSPS connections.moqbuild tag in the VS Code launch configuration.This improves relay reliability, prevents silent session failures, avoids unintended process-wide TLS changes, and makes Hub connectivity issues easier to diagnose.