Commit Graph
21 Commits
Author SHA1 Message Date
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 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
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
cedricve c825a11b92 Refactor queue packet reading and improve context 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.
2026-09-06 09:55:42 +00:00
cedricve 9c7116a462 Add secondary persistence verification and UI integration 2025-04-23 15:24:24 +00:00
Cedric Verstraeten d2dd3dfa62 add outputconfiguration + change endpoint 2023-06-21 15:55:51 +02:00
Cedric Verstraeten 60e8edc876 add onvif verify option + improve streaming logic + reconnect websocket 2023-06-12 20:33:41 +02:00
Cedric Verstraeten f935360fda add delay when failed uploading, send to different mqtt topic when no hub + fixes responsiveness 2023-03-23 16:19:01 +01:00
Cedric Verstraeten 27b2842481 reimplement onvif ptz (continuous) + added onvif swagger endpoints 2022-12-26 17:17:38 +01:00
Cedric Verstraeten ecc7514d2b low+high res streaming, ptz and ONVIF capibilities tesing 2022-10-17 13:25:07 +02:00
Cedric Verstraeten 3a83ffc7b1 add verifycamera placeholder 2022-09-20 16:17:57 +02:00
Thomas Quandalle 72fefba530 add recordings page 2022-09-01 19:54:42 +02:00
Thomas Quandalle efbf03858e fix live view + add total recordings + offline mode option 2022-08-29 22:33:55 +02:00
Thomas Quandalle 60be32dea3 Update authentication.js 2022-08-27 15:29:09 +02:00
Thomas Quandalle 2fb6625e9a fix prod build 2022-08-26 22:03:45 +02:00
Thomas Quandalle e00b45037c add a random key when empty + add verification for hub and vault 2022-08-26 21:13:43 +02:00
olokos 87f84e993a Eslint: Fix Unexpected unnamed function func-names
This is the proper and correct new way of using anonymous functions.

Reference: https://stackoverflow.com/questions/52735032/warning-unexpected-unnamed-function-func-names-under-eslint-rule
2022-08-17 21:12:01 +02:00
Thomas Quandalle 3debf62975 update settings page 2022-08-15 22:08:08 +02:00
Thomas Quandalle 1f79bcfade integrate kerberos/ui 2022-06-08 16:33:21 +02:00
Thomas Quandalle 7908a4af7f update to kerberos-io/ui 1.58 + increase prettifier linting 2022-06-08 13:38:26 +02:00
Thomas Quandalle 8e9c1abfd3 move to UI repo 2022-06-05 21:36:22 +02:00