Commit Graph
1660 Commits
Author SHA1 Message Date
cedricveandClaude Opus 5.5 33cc8a46ed mqtt: keep commas that are part of a single broker URI
Splitting the MQTT URI on every comma broke previously valid single-broker
URIs with commas in the query string, credentials or path (for example
wss://broker/mqtt?token=a,b). A comma now only separates brokers when the
text after it starts with a URI scheme ("scheme://"); other commas stay in
the current broker URI. Adds regression cases for these URIs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 20:06:08 +00:00
cedricveandClaude Opus 5.5 7d70361870 mqtt: support ActiveMQ failover URIs with multiple brokers
The MQTT URI can now list several brokers, either as an ActiveMQ-style
failover URI (as used by Amazon MQ active/standby brokers) or as a plain
comma-separated list:

  failover:(mqtt+ssl://b-1.example:8883,mqtt+ssl://b-2.example:8883)

Each broker is registered with paho, which tries them in order on
connect and reconnect. Transport options after the closing parenthesis
are ignored. The diagnostics dialer is only installed when every broker
uses a TCP-based scheme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 15:55:47 +00:00
Cédric Verstraeten 9a9b5d051b Merge pull request #363 from kerberos-io/fix/accept-factory-token
http: accept Kerberos Factory tokens when AGENT_JWT_SECRET is shared
v3.14.6
2026-11-22 08:11:00 +01:00
Cédric VerstraetenandClaude Opus 5.5 1492eb6d6c http: accept Kerberos Factory tokens when AGENT_JWT_SECRET is shared
v3.14.4 started authorising only tokens for the configured account. Kerberos
Factory signs its own tokens for agents with the shared AGENT_JWT_SECRET
under the "factory" identity, so every Factory request to a 3.14.4+ agent
was rejected with 403.

When AGENT_JWT_SECRET is explicitly set, also accept the "factory" identity.
Only holders of that secret can sign such tokens. With the generated
per-install secret only the agent's own login issues tokens, so the identity
stays rejected there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:54:29 +00:00
Cédric Verstraeten b9cf130762 Merge pull request #362 from kerberos-io/fix/recording-encryption-kdf
encryption: derive recording keys with PBKDF2 and use AES-GCM
v3.14.5
2026-11-22 07:24:16 +01:00
Cédric VerstraetenandClaude Opus 5.5 88c2166133 encryption: derive recording keys with PBKDF2 and use AES-GCM
Recordings were encrypted in the OpenSSL/CryptoJS "Salted__" format, which
derives the AES key from the configured symmetric key with a single MD5
round. A captured recording therefore allowed fast offline guessing of
weak keys.

New recordings use a versioned format: magic "KRBREC1\0", the PBKDF2
iteration count, a 16-byte salt and a 12-byte nonce, followed by AES-256-GCM
ciphertext. The key is derived with PBKDF2-HMAC-SHA256 (600,000 iterations)
once per process and cached, so cameras do not pay the derivation cost per
recording; each recording still gets a fresh nonce. The header is
authenticated, and decryption caps the iteration count so a crafted file
cannot stall the agent.

DecryptRecording still reads the legacy format, so existing recordings keep
playing through /file and -action decrypt. The legacy decryption now
validates length and padding instead of panicking on truncated input or a
wrong key.

MQTT messages exchanged with Kerberos Hub keep the legacy format, which Hub
expects; their keys are random, so the weak key derivation does not make
them guessable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 05:38:43 +00:00
Cédric Verstraeten d1646457f2 Merge pull request #361 from kerberos-io/fix/security-hardening
security: require authentication everywhere and drop the default JWT key
v3.14.4
2026-11-21 23:26:04 +01:00
Cédric VerstraetenandClaude Opus 5.5 c0baade8fd security: require authentication everywhere and drop the default JWT key
- JWT signing key: without AGENT_JWT_SECRET, generate a random secret on
  first start and keep it in data/config/jwt_secret (0600) instead of
  falling back to a publicly known constant. AGENT_JWT_SECRET still takes
  precedence, so deployments that share a key with Kerberos Factory are
  unchanged.
- Only tokens for the configured account are authorised, and malformed
  token claims are rejected instead of panicking.
- /ws (live view) and /file (recordings) now require a valid token. The UI
  passes it as ?token=, since browsers cannot set headers on WebSocket
  connections or <video src>; it no longer opens the socket before sign-in.
  /file no longer sends its own wildcard CORS header.
- pprof is off by default; AGENT_ENABLE_PPROF=true registers it behind auth.
- Release workflows pass tags to shell steps through quoted environment
  variables and validate them; the shared release-bump workflow is pinned
  to a commit and no longer receives inherited secrets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:17:28 +00:00
Cédric Verstraeten 37ebcfe641 Merge pull request #360 from kerberos-io/chore/yarn-lock-public-registry
ui: resolve yarn.lock packages from the public registry
2026-11-21 23:14:43 +01:00
Cédric Verstraeten de16cb9c83 Merge pull request #359 from kerberos-io/fix/security-alerts
Fix open Dependabot and code scanning alerts
2026-11-21 23:13:48 +01:00
Cédric VerstraetenandClaude Opus 5.5 23c4c932a9 ui: resolve yarn.lock packages from the public registry
158 entries in ui/yarn.lock were resolved from an Azure DevOps feed
(ms-feed-25.pkgs.visualstudio.com) instead of registry.yarnpkg.com. Point them
back at the public registry. Each entry's sha1 was checked against the npm
registry before it was rewritten, so the tarballs are identical. The 96
sha1-only integrity values are replaced with the registry's sha512.

axios is left as is: #359 moves it to 0.34.0 on the public registry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:11:06 +00:00
Cédric VerstraetenandClaude Opus 5.5 58285d1141 ui: bump axios to 0.34.0
Fixes Dependabot alerts #601 (GHSA-x97p-jq2g-jp4f) and #602
(GHSA-9fr6-4gfg-395g). The dependency ranges are unchanged, so only the axios
lockfile entry moves, now resolved from registry.yarnpkg.com.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:08:02 +00:00
Cédric VerstraetenandClaude Opus 5.5 1473c1e4cf cloud: only skip S3 proxy TLS checks when AGENT_TLS_INSECURE is set
The S3 proxy transport always set InsecureSkipVerify. Gate it on
AGENT_TLS_INSECURE like the other HTTP clients in the agent. Deployments that
use an S3 proxy with a self-signed certificate now need AGENT_TLS_INSECURE=true.

Fixes code scanning alert #100 (go/disabled-certificate-check).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:08:02 +00:00
Cédric VerstraetenandClaude Opus 5.5 39d6cf3020 cloud: restrict Vault verification to the saved URI
VerifyPersistence and VerifySecondaryPersistence sent the Vault access and
secret keys to whatever URI the request body named. Apply the same rule the
Hub check already uses: only the saved URI may be contacted, and redirects
are refused so the keys cannot be forwarded to another host.

Fixes code scanning alerts #84, #85, #86 and #87 (go/request-forgery).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:08:02 +00:00
Cédric Verstraeten 81c81f3a76 Merge pull request #358 from kerberos-io/docs/recording-layout
docs: move recording layout into README-FILE-STRUCTURE.md
2026-11-21 22:55:31 +01:00
Cédric Verstraeten 5040e6b32c Merge pull request #357 from kerberos-io/feat/moq-dev-v0.7
machinery: migrate MoQ publishing to moq.dev/moq v0.7
2026-11-21 22:53:04 +01:00
Cédric VerstraetenandClaude Opus 5.5 7e979023ae ui: migrate from Create React App to Vite (#355)
* ui: migrate from Create React App to Vite

react-scripts 5 is unmaintained and pins vulnerable versions of
webpack-dev-server, webpack-dev-middleware, postcss 7 and svgo.

- build and dev server: Vite 8 with @vitejs/plugin-react
- tests: Vitest 4 with jsdom (jest.* -> vi.*; mocked default exports
  now return { default })
- index.html moves to ui/ and loads src/index.jsx as a module
- REACT_APP_ENVIRONMENT is replaced by import.meta.env.PROD/MODE, and
  REACT_APP_AGENT_API_PORT is renamed to VITE_AGENT_API_PORT
- bundled output goes to static/ so it does not mix with public/assets
- package.json is not "type": "module": that would switch CommonJS
  interop to Node semantics and break default imports such as
  @giantmachines/redux-websocket
- sass 1.54 -> 1.108 (Vite needs the modern compiler API); sass-loader
  removed
- requires Node >= 20.19

`yarn build` still writes to machinery/www, so the Dockerfile and CI
workflow are unchanged.

Clears the remaining 9 react-scripts Dependabot alerts. Five alerts for
svgo 1 and decode-uri-component 0.2 remain; they come from build-tool
dependencies of @kerberos-io/ui and are not part of the bundle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ui: vendor @kerberos-io/ui 1.77.1 to clear the last Dependabot alerts

@kerberos-io/ui 1.77.1 moves its build tools (@svgr/webpack,
svg-react-loader, sass-loader, Storybook, Rollup plugins) out of its
runtime dependencies. Those pulled svgo 1 and decode-uri-component 0.2
into the agent's lockfile.

1.77.1 is tagged on GitHub but was never published to npm, so install
it from a tarball built from kerberos-io/ui@ae1faa7 (tag v1.77.1) and
committed under ui/vendor. Compared with the published 1.77.0 the
exports are identical; the only code change is the bundled uuid (8 -> 11).

The Dockerfile copies ui/vendor before `yarn --frozen-lockfile`.
ui/vendor/README.md records the checksum and how to switch back to the
registry once a fixed version is published.

Clears the remaining 5 Dependabot alerts (svgo, decode-uri-component).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ui: install @kerberos-io/ui 1.77.1 from its GitHub release

Replace the vendored tarball with the one attached to the kerberos-io/ui
v1.77.1 GitHub release, as uug-ai/factory already does. That tarball is
built by the ui repo's release workflow and ships with a .sha256 file
(e9f94f44...); yarn.lock pins it by hash.

Its JS is identical to the locally built tarball, and its CSS differs
only in selector order within @extend-generated rules.

This removes ui/vendor and the extra COPY line in the Dockerfile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ui: address lint findings in the Vite migration

- vite.config.mjs: disable import/no-unresolved; eslint-plugin-import 2.x
  cannot resolve packages that only define "exports" (vite, plugin-react)
- ui/README.md: turn the scripts table into a list to keep lines short
- README.md: wrap the edited UI paragraph

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:52:44 +01:00
Cédric Verstraeten 7f4c5dda80 Merge pull request #354 from kerberos-io/fix/dependabot-alerts
fix: resolve Dependabot security alerts in machinery and ui
2026-11-21 22:51:39 +01:00
Cédric VerstraetenandClaude Opus 5.5 b80fc93f22 machinery: migrate MoQ publishing to moq.dev/moq v0.7
github.com/moq-dev/moq-go was renamed to moq.dev/moq. Its native library
(moq.dev/moq-ffi v0.4.27) ships without LLVM bitcode, so `go build -tags moq`
works on Go 1.26.11+, which rejects the bitcode in moq-go-ffi v0.3.x.

- github.com/moq-dev/moq-go v0.5.7 -> moq.dev/moq v0.7.27
  (moq-go-ffi v0.3.7 -> moq.dev/moq-ffi v0.4.27)
- BroadcastProducer.PublishMedia("avc3", nil) ->
  PublishVideo(moq.VideoFormatAvc3, nil); the rest of the API the agent
  uses is unchanged
- unpin Go: the build image goes back to golang:1.26-trixie and the
  devcontainer drops GOTOOLCHAIN=go1.26.10

Compatibility:
- the derived track name is still "0.avc3"
- the relay accepts the new client (wire protocol moq-lite-05 -> moq-lite-07)
- the catalog keeps the same rendition, codec and container; the
  per-rendition "timeline" moves to a top-level "archive" and a "clock"
  object is added. The Hub viewer's schema (@moq/hang 0.2.16, used by
  @moq/watch 0.2.17) accepts it, and timeline is optional and unused for
  live playback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 21:48:58 +00:00
Cédric VerstraetenandClaude Opus 5.5 57055498a2 docs: move recording layout into README-FILE-STRUCTURE.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 21:46:55 +00:00
Cédric VerstraetenandClaude Opus 5.5 9c9db8cca6 build: pin Go 1.26.10 for MoQ builds
golang:1.26-trixie now resolves to Go 1.26.11, which rejects C archives
that contain LLVM bitcode:

  disallowed LTO section ".llvmbc" in #cgo LDFLAGS:
  .../moq-go-ffi@v0.3.7/moq/lib/linux_arm64/libmoq_ffi.a

Every moq-go-ffi v0.3.x release ships such archives, so `go build -tags moq`
fails in the Docker build on amd64 and arm64. There is no opt-out. Only
moq-ffi v0.4.27+ (module moq.dev/moq-ffi, used by moq.dev/moq v0.7) is clean,
which needs a migration of the MoQ code.

Pin the build image to golang:1.26.10-trixie and set GOTOOLCHAIN=go1.26.10
in the devcontainer, where verify-moq-devcontainer.sh builds with -tags moq.
The Go CI workflow builds without the moq tag and stays on 1.26.x.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 21:37:04 +00:00
Cédric Verstraeten 3f27243138 Merge pull request #356 from kerberos-io/fix/rtsp-transport-followups
Harden configurable RTSP transport (follow-up to #351)
2026-11-21 21:43:02 +01:00
Cédric VerstraetenandClaude Opus 5.5 ce9b9a3b54 Drop rtsp_transport from the MQTT verify payload
Hub verify keeps using the configured transport; out of scope for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:39:44 +00:00
Cédric VerstraetenandClaude Opus 5.5 f6575652bc Harden configurable RTSP transport (follow-up to #351)
- MQTT verify: accept rtsp_transport in the verify payload and fall back
  to the configured transport, like the RTSP url already does, so unsaved
  transport choices can be verified from Kerberos Hub.
- RTSPS + forced UDP: fail fast with a clear error when the camera does
  not offer SRTP, instead of every SETUP failing with "unable to setup
  secure UDP" (which Connect only logs). "auto" already picks TCP here.
- Backchannel: always use TCP. gortsplib's auto fallback only triggers
  when no packets are received, which never happens on a send-only
  backchannel, and talk-back over UDP is not validated on hardware.
- UDP read buffer: request 4 MiB, capped at net.core.rmem_max, because
  gortsplib fails the SETUP when it cannot get the exact size requested.
- Logging: route gortsplib's transport-switch messages through the
  structured logger and log the negotiated transport per stream.
- README: document the transport options and their caveats.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:25:48 +00:00
Cédric Verstraeten 1e16a8e27c Merge pull request #351 from officialasishkumar/feature/rtsp-transport-selection
Add configurable RTSP transport (tcp, udp, auto)
2026-11-21 21:22:43 +01:00
Cédric VerstraetenandClaude Opus 5.5 3fc1e49e79 fix: resolve Dependabot security alerts in machinery and ui
machinery (Go):
- google.golang.org/grpc 1.72.1 -> 1.83.2 (incl. critical :path authz bypass)
- go.opentelemetry.io/otel/* 1.36.0 -> 1.47.0
- go.mongodb.org/mongo-driver 1.17.3 -> 1.17.7
- github.com/klauspost/compress 1.16.7 -> 1.20.2
- github.com/eclipse/paho.mqtt.golang 1.5.0 -> 1.5.1 (govulncheck)
- golang.org/x/net 0.57.0 -> 0.62.0 (govulncheck)

otel 1.47 and x/net 0.62 require Go 1.26, so the build image,
devcontainer and CI move from 1.25 to 1.26.

ui:
- axios 0.21.4 -> 0.33.0 (stays on the 0.x API)
- drop unused i18next-http-backend (app uses i18next-xhr-backend)
- replace uuidv4 with uuid 11
- refresh vulnerable transitive packages to the newest in-range versions
  and add resolutions for @tootallnate/once, serialize-javascript, uuid
- refresh @babel/compat-data and helper-compilation-targets so the newer
  browserslist targets are recognised by the build

Remaining alerts (webpack-dev-server 4, webpack-dev-middleware 5,
postcss 7, svgo 1, decode-uri-component 0.2) are pinned by
react-scripts 5 and only affect the dev server and build tooling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:07:10 +00:00
Cédric Verstraeten 33e0a26f1c Merge pull request #353 from kerberos-io/feat/upload-retry-after
Honour 429 + Retry-After on uploads to Kerberos Hub
v3.14.3
2026-11-19 13:29:53 +01:00
Cédric VerstraetenandClaude Opus 5.5 f20d156d86 Stop on 429 only for Kerberos Hub tus uploads
runTusUpload also serves direct Kerberos Vault uploads. A 429 from a vault
now keeps the existing in-cycle retries instead of ending the attempt, so it
does not advance the vault's retry budget or secondary-storage failover
early, and it never sets the Hub upload pause. Hub uploads still stop at
once and pause until Retry-After (review feedback).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 11:36:48 +00:00
Cédric VerstraetenandClaude Opus 5.5 98f1826fe1 Honour 429 + Retry-After on uploads to Kerberos Hub
Kerberos Hub will answer a recording upload with 429 Too Many Requests and
Retry-After (start of the next day or month in the organisation's
timezone) when the organisation is over its upload limit. Until now the
agent kept the recording and retried every 5 seconds all night.

- A shared, mutex-guarded upload pause (upload_pause.go) holds the
  deadline. Retry-After is parsed in both RFC 9110 forms (delay-seconds
  and HTTP-date, the latter measured against the response Date header).
  Values are clamped to [5 s, 32 days]; a 429 without a usable
  Retry-After backs off exponentially from 5 s up to 15 minutes.
- The tus path (create, HEAD, PATCH) and the legacy HEAD/POST on
  /storage/upload report 429; the tus loop stops retrying on 429 and
  keeps its resume state.
- HandleUpload waits for the pause before touching the queue again.
  Recordings and markers stay on disk; the order is unchanged.
- One log line when the pause starts and one when Hub accepts uploads
  again. Heartbeats, live view and MQTT are untouched; other status codes
  and older Hub versions behave as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 07:15:53 +00:00
Cédric Verstraeten bc8bc84cae Merge pull request #352 from kerberos-io/fix/webrtc-keyframe-recovery
Fix WebRTC startup and recovery keyframe requests
v3.14.2
2026-11-18 08:24:23 +01:00
cedricveandCopilot 8c21638ff2 fix: preserve per-viewer RTP time across keyframe recovery
Accumulate gated and discarded sample durations, including previously queued skips, and advance Pion's clock without filler packets before the recovery IDR. Verify exact outgoing RTP timestamp deltas for PLI, FIR, reconnects, and queue overflow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-18 07:14:55 +00:00
cedricveandCopilot ef81ce5b32 fix: request camera keyframes for WebRTC startup and recovery
Gate each video viewer on a fresh IDR after transport connection or recovery, translate viewer PLI/FIR into rate-limited RTSP PLI requests, and preserve keyframe metadata through sample buffering. Add transport, lifecycle, concurrency, and source-routing regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-18 07:04:26 +00:00
Asish Kumar 40c62f74fa Add configurable RTSP transport (tcp, udp, auto)
The agent hard-coded TCP (interleaved) for every camera connection, so
cameras and networks that only work well over UDP could not be used and
there was no way to let the client negotiate the transport.

Add an optional capture.ipcamera.rtsp_transport setting, also available
as AGENT_CAPTURE_IPCAMERA_RTSP_TRANSPORT, with these values:

- tcp (default, also used when unset): unchanged behaviour
- udp: force RTP over UDP
- auto: let gortsplib try UDP first and fall back to TCP

Unknown values log a warning and fall back to TCP so a typo cannot break
an existing deployment. The setting is applied to the main, sub and
backchannel clients and to both camera verification paths (HTTP and
MQTT). The Settings page gets a transport dropdown next to the RTSP URLs
and the verify request forwards the selected value, so unsaved choices
can be tested. The README documents the new variable.

Tests cover the transport-to-protocol mapping and the environment
override.

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
2026-11-12 21:09:25 +05:30
Cédric Verstraeten 8016b3ba93 Merge pull request #349 from kerberos-io/cedricve-fix-v3-13-2-recording-regression
fix: prevent realtime-processing panic without MQTT credentials
v3.14.1
2026-11-04 16:25:24 +01:00
Cédric VerstraetenandCopilot App 4dc6fe7e18 fix: skip realtime processing without MQTT client
Avoid dereferencing the nil client returned when Hub credentials are absent. Log the disabled worker and cover enabled, disabled, and offline configurations.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-04 16:20:30 +01:00
Cédric Verstraeten 553fd8e065 Merge pull request #347 from EpicMouse123/feature/onvif-channel
Add ONVIF channel selection for multi-channel devices
v3.14.0
2026-11-04 15:39:59 +01:00
adam.witwickiandClaude Opus 5.5 e1b886edd8 Add ONVIF channel selection for multi-channel devices
Encoders and NVRs expose several media profiles per video input, so
always using the first profile drives the camera on channel 1. Add a
1-based onvif_channel setting (config file, configmap, MongoDB, env var
AGENT_CAPTURE_IPCAMERA_ONVIF_CHANNEL, and onvif_credentials in the HTTP
API). The channel is resolved by grouping GetProfiles results by video
source; 0/unset keeps the existing first-profile behaviour.

PTZ, zoom, presets, position and focus now use the configured channel,
and the Hub heartbeat reads presets from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 10:11:50 +00:00
Cédric Verstraeten 24bcc296f1 Merge pull request #345 from kerberos-io/fix/preserve-tus-failures
fix/preserve-tus-failures
2026-10-21 21:45:05 +02:00
Cédric Verstraeten 42e67599ab Preserve TUS sessions and latest retry errors
Keep successful upload creation sessions usable when the optional response body is interrupted, while still requiring Location. Preserve the latest failure across retries and add regression coverage and documentation.
2026-10-21 21:34:25 +02:00
Cédric Verstraeten f64b762eee Merge pull request #344 from kerberos-io/fix/tus-minio-upload-empty-region
fix/tus-minio-upload-empty-region?expand=1
v3.13.2
2026-10-21 21:24:03 +02:00
Cédric Verstraeten 9c754b9b91 Preserve resumable upload failure details
Include up to 4 KiB of server error responses and retain the latest failure cause when retries are exhausted. Add coverage for Hub and Vault creation failures and document provider troubleshooting and the temporary ordinary-upload workaround.
2026-10-21 21:19:20 +02:00
Cédric Verstraeten 2f13af62ef Merge pull request #343 from kerberos-io/fix/add-walk-dir
fix/add-walk-dir
v3.13.1
2026-10-21 19:39:40 +02:00
Cédric Verstraeten 64e6901574 Fix legacy metadata and recording scan races
Backfill missing S3 checkpoint descriptions from validated legacy filenames while preserving checkpoint values, timestamp, and device key. Skip recordings deleted during directory scans while continuing to report other errors. Add regression coverage and document the metadata fallback.
2026-10-21 19:34:52 +02:00
Cédric Verstraeten c70253ddef Merge pull request #342 from kerberos-io/feature/update-file-format-user-yyyy-mm-dd-filemp4
feature/update-file-format-user-yyyy-mm-dd-filemp4
v3.13.0
2026-10-21 19:24:53 +02:00
Cédric Verstraeten 04497dd877 Adopt dated, millisecond-based recording paths
Store new recordings in UTC date directories with stable timestamp-device filenames, moving recording attributes into upload checkpoints. Use checkpoint metadata for S3 keys and HTTP/tus uploads, rejecting invalid S3 checkpoints instead of silently falling back.

Support flat and dated layouts across listing, playback, uploads, cleanup, and decryption while retaining legacy filename compatibility.
2026-10-21 19:18:26 +02:00
Cédric Verstraeten 3bd195834b Organize direct S3 recordings by UTC date
Use the filename's recording timestamp to build username/yyyy/mm/dd object keys, keeping retries consistent across midnight. Reject malformed filenames and timestamps, add date-layout coverage, and document compatibility with historical objects.
2026-10-21 16:19:52 +02:00
adam.witwicki 1445789694 Add ONVIF focus control over MQTT and HTTP
Add "focus" and "autofocus" ONVIF actions, sent through navigate-ptz in
the same shape as zoom:

  {"action":"focus","payload":{"focus":0.5}}   positive = near, -1..1
  {"action":"autofocus","payload":{}}

Focus goes through the ONVIF imaging service and is handled before the
PTZ configuration lookup, so it also works on fixed cameras with a
motorised lens. A focus nudge switches the camera to MANUAL focus;
autofocus hands control back.

Cameras differ in which focus moves they support, so the move type is
picked from GetMoveOptions: a continuous move for 500 ms then stop (as
ContinuousZoom), else a relative step, else an absolute step from the
current lens position (Axis only supports absolute moves).

Autofocus toggles MANUAL -> AUTO to force a fresh focus cycle. It
reports an error when the camera does not advertise AUTO, or accepts
AUTO but keeps reporting MANUAL (seen on Dahua).

The imaging requests carry only the focus fields, because the onvif
library's request types serialise every field. Some Axis firmware
rejects a SetImagingSettings that only carries Focus, so that request is
retried once with the current brightness. Rejected requests include the
camera's SOAP fault reason in the error.

Also add POST /api/camera/onvif/focus, mirroring /api/camera/onvif/zoom.

Hub: needs an adjustable focus step. How far one nudge moves the lens
differs a lot between cameras: one full-speed nudge crossed the whole
focus range on an Avigilon, while three barely moved another camera.
The agent uses the focus value (-1..1) as the speed / step size, so Hub
should let users set it (e.g. a focus step or speed control) instead of
sending a fixed value.

Tested against Axis, Dahua, Avigilon and two other ONVIF cameras.
2026-10-19 12:52:32 +01:00
Cédric Verstraeten 949762c91b Merge pull request #340 from kerberos-io/fix/hub-failed-error-messages
fix/hub-failed-error-messages
v3.12.9
2026-10-10 18:47:05 +02:00
Cédric Verstraeten b805b84d0a Align development API port to 8082
Use port 8082 for UI development endpoints, VS Code debugging, and devcontainer forwarding. Allow overriding the UI API port with REACT_APP_AGENT_API_PORT and document the matching backend setup.
2026-10-10 18:18:35 +02:00
Cédric Verstraeten a57b6310b2 Restrict Hub verification to saved endpoints
Require Hub and persistence verification URIs to match the saved configuration and reject redirects to prevent credential leakage. Add regression tests for unsaved URIs and cross-host redirects.
2026-10-10 18:09:53 +02:00