Check upload authorization without uploading a test video. Guard against missing S3 configuration, strip credentials on cross-host redirects, and clarify rejection errors. Add coverage for HEAD requests and status-specific messages.
Drop dependent H264/H265 frames after RTP gaps or decode errors until random access restores the reference chain. Detect H264 frame_num gaps and evict complete GOPs so lagging queue readers resume at keyframes. Add regression coverage.
Reduce the build job's contents permission to read and remove DockerHub authentication, since pull request builds only need to build the image locally.
v1.2.3 includes:
- kerberos-io/onvif#13: send WS-Security first in "both" auth mode, so
authenticated calls work again on WS-Security-only cameras.
- kerberos-io/onvif#14: register DeviceIO endpoints listed only in
GetServices, declare the tmd namespace, and marshal Unsubscribe as
wsnt:Unsubscribe.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Digital inputs and relay outputs were never reported for cameras that
accept the pull-point subscription but reject the pulls:
- PullMessages and Unsubscribe are now sent with WS-Addressing Action and
To headers. Some devices identify the subscription from wsa:To rather
than the request URL, and reject requests without it as NotAuthorized.
- The heartbeat now queries the relay outputs and digital inputs directly
whenever the subscriptions produce no I/O events, not only when no
subscription could be created. Pulls that fail, and devices that never
publish the initial I/O state, previously left the I/O list empty.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the old AbsolutePanTiltMoveFake logic, which zoomed out and then moved one axis at a time with fixed speeds, with a new MoveToPosition implementation.
The new flow:
- Tries a native AbsoluteMove when the camera advertises absolute position spaces.
- Polls the position to confirm the move, with overall and no-progress timeouts.
- Falls back to a closed-loop ContinuousMove that drives pan, tilt and zoom at the same time. Velocity is proportional to the remaining error, clamped between min and max limits.
- Always stops the camera after a failed or finished move and returns combined errors instead of dropping them.
- Validates the target (NaN/Inf) and rejects incomplete position responses.
AbsolutePanTiltMoveFake is kept as a continuous-only wrapper. AbsolutePanTiltMove and GetPTZFunctionsFromDevice now guard against an empty PTZConfiguration. Movement failures are now logged at error level.
Adds unit tests that use a fake PTZ client to cover the native path, the fallback paths, timeouts, stop cleanup and XML encoding of combined ContinuousMove velocities.
- Reject JSON null values and every Upload-* header.
- Reject tabs and all other control characters in values.
- Preserve configured header name casing on the wire.
- Strip custom headers, their manifest, Upload-Metadata and Vault
credentials on cross-host redirects for legacy and tus uploads.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Introduced a new `/health` endpoint to report the health status of the Agent, including camera stream and hub connection diagnostics.
- Enhanced the Swagger documentation to include definitions for health-related responses.
- Implemented telemetry for main and sub camera streams, tracking their configuration, connection status, packages processed, and last packet timestamps.
- Added functionality to record hub heartbeat attempts and successes, along with connection status.
- Updated the communication model to support new telemetry structures for streams and hub health.
- Added tests for the health check response and operational telemetry to ensure correctness.
- Refactored existing code to integrate new health monitoring features and improve logging for health checks.
- Replaced the existing logging mechanism with logrus for improved logging capabilities.
- Introduced a custom logging configuration with support for different log levels and output formats (text and JSON).
- Added structured logging with component context for better traceability.
- Implemented tests for logging configuration and structured log entries.
- Updated WebRTC module to utilize the new logging system, ensuring consistent logging practices across the application.
- Added tests to verify that sensitive information is not logged in ONVIF responses and that HTTP request logs include structured fields.
- Introduced the AgentRun struct to encapsulate the lifecycle of an agent run, including context management and resource handling.
- Added methods for activating, shutting down, and managing resources associated with an agent run.
- Refactored Communication struct to support the new AgentRun model, including methods for attaching and detaching runs.
- Updated tests to validate the behavior of the new AgentRun implementation, ensuring proper resource management and shutdown behavior.
- Enhanced existing tests to utilize the new AgentRun structure for better isolation and concurrency handling.
- Updated QueueCursor to manage context cancellation more effectively in ReadPacketContext.
- Added tests to ensure ReadPacketContext does not allocate when packets are available.
- Simplified ImageToBytes function by removing unnecessary buffer writer.
- Enhanced ImageCanvas component to handle image updates and editor data changes more efficiently.
- Implemented websocket client ID generation for consistent identification across components.
- Improved Settings component to manage live view subscriptions based on tab visibility.
- Added unit tests for new and modified functionalities across various components and utilities.
- Introduced atomic types for CameraConnected, MainStreamConnected, SubStreamConnected, and HasBackChannel in the Communication struct to ensure thread-safe access.
- Added methods to record and retrieve recovery telemetry related to MoQ reconnects, write timeouts, and dropped events.
- Updated motion and ONVIF action handling to use TrySend methods for non-blocking channel operations, logging warnings when channels are full or unavailable.
- Refactored ReadPacket and ReadPacketContext methods in QueueCursor to improve context cancellation handling.
- Added tests for communication channel lifecycle, ensuring proper behavior during concurrent access and after channel closure.
- Implemented tests for MoQ client behavior and stream restart watchdog functionality to ensure reliability under various conditions.
Report live HLS upload startup failures over MQTT with safe reason codes, include bounded Hub error details in upload failures, avoid MQTT startup without required keys, and skip empty ICE server URLs when creating WebRTC peer connections.