Commit Graph

12270 Commits

Author SHA1 Message Date
IgorA100
62faabc5f0 When using ZMS, destroy VolumeSlider if it exists (MonitorStream.js) 2026-02-05 00:30:00 +03:00
IgorA100
534a9ef197 Fix: Eslint (MonitorStream.js) 2026-02-04 19:36:35 +03:00
IgorA100
85d5cbd63a Added the ability to retrieve tracks from a stream, disable Volume Controls if there is no audio track, and improved functionality for RTSP2Web, Janus, and ZMS. (MonitorStream.js) 2026-02-04 19:28:33 +03:00
IgorA100
1bfeb2512d Added "disabled" class to #volumeControls and ".audio-control-mute" (skin.css) 2026-02-04 16:52:24 +03:00
IgorA100
8714f295b7 IDs for #volumeControls, #volumeSlider, #controlMute now include the monitor ID (watch.php)
And also #volumeControls by default has the class "disabled"
2026-02-04 16:40:52 +03:00
Isaac Connor
7592fd933c Fix command injection vulnerability in image.php (CVE-2025-65791)
Add input validation and shell argument escaping to prevent OS command
injection via the 'show' parameter in web/views/image.php. The parameter
is now validated against an allowlist and all values passed to exec()
are wrapped with escapeshellarg().

Also fix PHP operator precedence bug in shutdown.php where 'and' was
used instead of '&&', causing the 'when' parameter validation to not
work as intended.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:39:38 -05:00
Isaac Connor
446b1a563b Define players for montage 2026-02-03 12:17:52 -05:00
Isaac Connor
f17d68cb3d Log when ondata is not defined 2026-02-03 12:11:32 -05:00
copilot-swe-agent[bot]
3d8399bfab fix: Use numeric constant for CURLE_PEER_FAILED_VERIFICATION in PHP
The CURLE_PEER_FAILED_VERIFICATION constant may not be defined in all PHP curl versions. Use the numeric value (51) instead for better compatibility.

refs #TBD

Co-authored-by: connortechnology <925519+connortechnology@users.noreply.github.com>
2026-02-02 14:36:00 +00:00
copilot-swe-agent[bot]
bce080c735 feat: Enable SSL certificate verification with fallback for all components
Enable TLS peer certificate verification by default in all components that communicate over HTTPS. If SSL verification fails, log a warning and retry without verification to maintain backward compatibility with cameras using self-signed certificates.

Changes:
- C++ (zm_monitor_go2rtc.cpp): Enable SSL verification for all curl operations (3 locations)
- C++ (zm_monitor_rtsp2web.cpp): Enable SSL verification for all curl operations (3 locations)
- PHP (monitor_probe.php): Enable SSL verification with fallback logic
- Perl (Dahua.pm): Enable SSL verification with LWP::UserAgent
- Perl (TapoC520WS_ONVIF.pm): Enable SSL verification with retry logic in request methods

refs #TBD

Co-authored-by: connortechnology <925519+connortechnology@users.noreply.github.com>
2026-02-02 14:34:19 +00:00
Isaac Connor
100ffcfef7 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2026-02-01 13:02:27 -05:00
Isaac Connor
ac4585b6b4 fix: use monitor's StreamChannel setting for go2rtc stream selection
Two issues caused monitors to stream from wrong channel:

1. In setChannelStream(), the expression `StreamChannel && SecondPath`
   returned SecondPath (often empty) instead of StreamChannel. Now
   correctly uses the monitor's configured StreamChannel.

2. In MonitorStream.start(), default channel only checked for
   CameraDirectSecondary and defaulted everything else to Restream.
   Now respects the actual StreamChannel setting.

Also improved fallback when selected option is disabled to find first
enabled option rather than always defaulting to Restream.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:01:50 -05:00
Isaac Connor
f05370eb05 fix: add missing Path and Restream fields to monitorData in watch view
The manageChannelStream() function expected Path and Restream fields
in monitorData to enable/disable StreamChannel options, but these
fields were not being populated. This caused CameraDirectPrimary and
Restream options to always be disabled on the watch view.

Also updated SecondPath to use validJsStr() for proper escaping.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 12:26:43 -05:00
Isaac Connor
68add32f9c Merge pull request #4576 from Simpler1/patch-6
Fix(): Find server in database instead of defaulting to port 80
2026-02-01 11:27:50 -05:00
Simpler1
391e9d3097 Merge branch 'master' into patch-6 2026-01-31 21:19:30 -05:00
Simpler1
4355030e73 Update skin.js.php
Revert change to skin.js.php
2026-01-31 21:03:32 -05:00
Simpler1
e922b9e16d Update Server.php
Don't require a database entry for Server.
Use ZM_BASE_URL.
2026-01-31 21:01:00 -05:00
Isaac Connor
eae89025ee refactor: rename RTSP2WebStream to StreamChannel
Rename applies to Go2RTC, Janus, and RTSP2Web streaming options.
Update enum values from Primary/Secondary to Restream/CameraDirectPrimary/CameraDirectSecondary.

- Add db migration zm_update-1.37.79.sql to rename column and migrate data
- Update C++ enum StreamChannelOption and member stream_channel
- Update PHP getStreamChannelOptions() method
- Update all JavaScript references
- Auto-select CameraDirectPrimary when Restream option becomes disabled

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:37:08 -05:00
Isaac Connor
02685bff7e Pick up missed update for Restream and RTSP_User 2026-01-31 18:54:14 -05:00
Isaac Connor
d89f2e59db refactor: rename Janus_Use_RTSP_Restream to Restream
Rename Janus-specific restream fields to be more generic since they are
now used by Go2RTC and RTSP2Web as well:
- Janus_Use_RTSP_Restream → Restream
- Janus_RTSP_User → RTSP_User

Update visibility logic so the Restream checkbox appears when RTSPServer
is enabled AND any streaming service (Janus, Go2RTC, or RTSP2Web) is
selected, rather than only when Janus is enabled.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:47:37 -05:00
IgorA100
3dee901585 Fix: Removed duplicates (watch.css) 2026-01-30 19:59:56 +03:00
Isaac Connor
cbbdeb2910 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2026-01-30 11:41:09 -05:00
Isaac Connor
b254ea60a8 Remove hard coded scale=32 for the stream image. 2026-01-30 11:40:58 -05:00
Isaac Connor
41d3a25964 Use a smarted calculation to determine an optimal streaming scale. 2026-01-30 11:40:33 -05:00
Isaac Connor
c59bc3678f Add hevc_vaapi as an encoder option 2026-01-30 08:33:49 -05:00
Isaac Connor
df33e75afd Add support for the string NULL is object lookup values 2026-01-30 08:33:49 -05:00
Isaac Connor
59fdffa62b Handle no meminfo. 2026-01-30 08:33:49 -05:00
BHMSD-bdailey
0b2d14d552 Fix Issue when a current recording is occurring and a thumbnail is attempted to be made. 2026-01-29 21:56:40 -05:00
BHMSD-bdailey
faca0a57c5 Add Not Null to ZM_Object 2026-01-29 21:54:04 -05:00
Isaac Connor
53d3f6e32c fix: improve port detection for nginx/reverse proxy setups
The Port() method now tries to extract the port from HTTP_HOST header
before falling back to SERVER_PORT, which can be incorrect with nginx
and PHP-FPM configurations. Also adds a sensible default (80/443) when
no port can be determined.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:48:27 -05:00
Isaac Connor
9502c79d91 feat: add motion analysis frame toggle to watch view
Add ability to view motion analysis frames on the watch view, similar
to the existing functionality in the zone edit view. Includes a toggle
button that switches between raw and analysis frames using the existing
MonitorStream.show_analyse_frames() method.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 14:17:32 -05:00
Isaac Connor
010959c9d4 fix: only show monitor edit button if user has edit permission
The edit button overlay on the montage view stream is now conditionally
displayed based on the user's edit permission for that monitor.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:56:03 -05:00
Isaac Connor
3a5f2cbccb fix: add AddNewRole button handler in options.js
The Add New Role button was not working because the AddNewRole
JavaScript function was missing from options.js. Added the handler
function following the same pattern as AddNewUser.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:37:26 -05:00
Isaac Connor
4e60cb96a7 feat: add User Roles feature for reusable permission templates
Add a User Roles system where roles define reusable permission templates.
When a user has a role assigned, the role provides fallback permissions
(user's direct permissions take precedence; role is used when user has 'None').

Database changes:
- Add User_Roles table with same permission fields as Users
- Add Role_Groups_Permissions table for per-role group overrides
- Add Role_Monitors_Permissions table for per-role monitor overrides
- Add RoleId foreign key to Users table

Permission resolution order:
1. User's direct Monitor/Group permissions (if not 'Inherit')
2. Role's Monitor/Group permissions (if user has role)
3. Role's base permission (if user's is 'None')
4. User's base permission (fallback)

Includes:
- PHP models: User_Role, Role_Group_Permission, Role_Monitor_Permission
- Role management UI in Options > Roles tab
- Role selector in user edit form
- REST API endpoints for roles CRUD
- Translation strings for en_gb

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:34:27 -05:00
Ben Dailey
c80542343a Remove Preview Rate Control. Disable BuiltIn Video controls. 2026-01-29 11:18:30 -05:00
Ben Dailey
d70fc62780 feat: honor zmWatchMuted cookie in thumbnail popup videos
Updated all three video creation functions in thumbnail overlays to
respect the user's mute preference stored in the zmWatchMuted cookie:
- go2rtc streams (video-stream element)
- RTSP2Web HLS streams
- MP4 video playback for recorded events

Default behavior remains muted unless user has explicitly set the
cookie to 'false' via the watch page volume controls.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 07:46:26 -05:00
Ben Dailey
8279458edd style: enhance thumbnail overlay status bar visuals
- Increase font size ~28% for better readability
- Add more spacing between video and status bar
- Enlarge LIVE dot with glow effect
- Make pulse animation more pronounced (scale 1.0 to 1.4)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 21:53:51 -05:00
Simpler1
c60c751927 Fix(): Find server in database instead of defaulting to port 80
An empty Server object has no hostname/protocol/port, so JavaScript was filling in the blanks incorrectly as port 80 (even with https).
2026-01-28 21:18:03 -05:00
Ben Dailey
fd5bd63808 feat: add status bar to thumbnail overlay with LIVE indicator and wall clock time
- Add status bar below video with LIVE indicator for live streams
- Show pulsing red dot animation for live streams
- Display wall clock time that updates as recorded video plays
- Add event start time data attribute to console and events pages
- Hide status bar when no content to display

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 21:09:57 -05:00
Ben Dailey
d51790531a feat: add live streaming support to console thumbnail hover overlay
- Support go2rtc, RTSP2Web, and Janus streaming in thumbnail popups
- Separate still thumbnail logic from hover overlay streaming
- Still thumbnails use event snapshot when not decoding
- Hover overlay prioritizes live streaming over recorded video
- Refactor thumbnail JS into focused helper functions
- Fix video-stream.js path for dynamic import

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 20:50:50 -05:00
Ben Dailey
3f69df433b Merge branch 'master' into ChangeThumbnails
Resolved conflict in web/ajax/console.php:
- Incorporated master's improved $streamSrc computation (modifies $options in place)
- Kept our streaming priority logic (go2rtc > rtsp2web > janus > event fallback)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 20:03:36 -05:00
Ben Dailey
7c2dd47c75 fix: prioritize external streaming over event fallback in console thumbnails
Go2rtc, rtsp2web, and janus work independently of ZM's decode/analyze
processes. Check for these external streaming methods before checking
Analysing/Decoding state to ensure live streaming is used when available.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:44:52 -05:00
Ben Dailey
a51b63d072 feat: add PreviewRate translations to all language files
Add 'PreviewRate' translation to 24 language files for the new
Preview Rate dropdown feature on the events page.

Note: Translations were generated via AI and may need review by
native speakers for accuracy.

Languages updated:
- Bosnian, Chinese (Simplified/Traditional/Big5), Czech, Danish
- Dutch, Estonian, French, German, Hebrew, Hungarian, Italian
- Japanese, Norwegian, Polish, Portuguese (BR), Romanian, Russian
- Spanish (ES/LA/AR), Swedish, Turkish

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:19:32 -05:00
Ben Dailey
65373ed8d3 feat: add Preview Rate dropdown to events page filter bar
Add a Preview Rate dropdown control that allows users to adjust the
playback speed of thumbnail hover preview videos on the events page.

- Add previewRateHtml() helper method to Filter class
- Add Preview Rate to simple_widget() filter bar with matching term styling
- Add getPreviewRate() and changePreviewRate() JS functions in skin.js
- Add helper functions in _monitor_filters.php for rate options
- Store selected rate in zmPreviewRate cookie (values: 100-1600 for 1x-16x)
- Add PreviewRate translation to en_gb.php
- Add CSS styling for preview rate control

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:06:03 -05:00
Isaac Connor
b373f44476 Ensure that we have mode=jpeg in the stream-src. Also remove frames option so that it actually streams. Hopefully fixes thumbnails not working 2026-01-28 10:40:08 -05:00
Ben Dailey
ee229d4257 feat: add event thumbnail fallback and go2rtc support for console hover overlay
When a monitor is not analyzing or decoding, the console thumbnail now
shows the most recent event's snapshot instead of attempting a live
stream. The hover overlay plays the event replay (with mp4 support if
available).

For active monitors with go2rtc enabled, the hover overlay now uses
go2rtc WebRTC streaming via the video-stream custom element, with a
3-second fallback to MJPEG if the connection fails.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 10:39:34 -05:00
Isaac Connor
d0358c89bb Merge branch 'master' of github.com:ZoneMinder/zoneminder 2026-01-28 10:03:10 -05:00
Isaac Connor
5162df68dd Make tfoot elements clickable the way they were before 2026-01-28 10:02:58 -05:00
Isaac Connor
d373696fe8 fix: critical bugs in skin.js
- Fix chained assignment creating implicit globals (shifted/ctrled/alted)
- Fix .done() callback executing immediately instead of on success
- Fix XOR operator (^) used instead of exponentiation in human_filesize()
- Fix invalid destructuring assignment in applyChosen()
- Fix implicit global creation in closeMbExtruder() call
- Add missing var declarations for runstate, length, modal variables

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 18:11:40 -05:00
Isaac Connor
87f0970a12 Merge pull request #4572 from BHMSD-bdailey/AddCurrentTimeToPlayback
Add Wall Clock Time to information below video playback of events
2026-01-27 17:29:20 -05:00