Commit Graph
3296 Commits
Author SHA1 Message Date
Isaac Connor 57bb470e27 Merge pull request #5855 from AJ0070/event-pm-fixes
fix: Perl event video generation, zmvideo options and zmrecover end time
2026-11-14 11:41:44 -05:00
Isaac Connor e9889abf6b Merge pull request #5857 from AJ0070/zmtrigger-fixes
fix: zmtrigger message buffering, timed cancels, monitor reloads and the off wait
2026-11-14 11:40:58 -05:00
Jash f0571e2e55 fix: embed the object detection gif for %EIMODG% in filter messages refs #5876 2026-11-14 20:03:09 +05:30
Jash 88d54cdbdb fix: stop zmtrigger waiting forever for a stuck monitor after an off message refs #5856 2026-11-14 19:13:19 +05:30
Jash 3ffcf6fdfd fix: retry a failed zmtrigger monitor reload every ten seconds instead of four times a second refs #5856 2026-11-14 19:13:19 +05:30
Jash f531d14471 fix: zmtrigger no longer dies when a monitor with unreachable shared memory is deleted refs #5856 2026-11-14 19:13:19 +05:30
Jash 44f13807d5 fix: ignore blank trigger messages instead of reloading every monitor from the database refs #5856 2026-11-14 19:13:19 +05:30
Jash 173cde1a39 fix: drop a pending zmtrigger cancel when a newer on or cancel arrives for the monitor refs #5856 2026-11-14 19:13:17 +05:30
Jash 1759a22afe fix: keep a partial trigger message until its line ends instead of handling both halves refs #5856 2026-11-14 19:13:17 +05:30
Jash f852294067 fix: remove the partial video zmvideo leaves behind when ffmpeg fails refs #5854 2026-11-14 19:10:30 +05:30
Jash 09c12b15af fix: round scaled zmvideo dimensions down to even numbers so libx264 accepts them refs #5854 2026-11-14 19:10:30 +05:30
Jash 5e3a0d6bb6 fix: keep the input size for zmvideo output unless a scale or size is asked for refs #5854 2026-11-14 19:10:30 +05:30
Jash 10faf2ded2 fix: pass zmvideo transforms to ffmpeg as one -vf chain so none are dropped refs #5854 2026-11-14 19:10:30 +05:30
Jash 44ad4945b1 fix: only concatenate zmvideo filter videos when --concat is given refs #5854 2026-11-14 19:10:30 +05:30
Jash 0ace615b41 fix: look the filter up by its id for zmvideo --filter_id refs #5854 2026-11-14 19:10:30 +05:30
Jash 98bed35ea6 fix: compute guess_EndDateTime from the event start and call it by its right name in zmrecover refs #5854 2026-11-14 19:10:30 +05:30
Jash 648e197acb fix: do not divide by a zero FullLength when generating an event video refs #5854 2026-11-14 19:10:30 +05:30
Isaac Connor a6b073c8f5 Merge pull request #5555 from AJ0070/5554-delete-path-no-shell
fix: delete event paths with File::Path instead of an unquoted rm -rf
2026-11-12 19:50:38 -05:00
Isaac Connor 4d474ded4e Merge pull request #5567 from AJ0070/5563-zmaudit-batch-event-rows
perf: load the events zmaudit checks in batches of 1000 instead of one query each
2026-11-12 08:36:25 -05:00
Isaac Connor 600414089d Merge pull request #5542 from AJ0070/5541-zmfilter-object-cache
fix: clear the object cache on every zmfilter pass so handled events are freed
2026-11-11 21:45:12 -05:00
Isaac Connor 06c093c44b Merge pull request #5572 from AJ0070/5568-zmaudit-lazy-start-time
perf: work out a filesystem event's start time in zmaudit only when it is needed
2026-11-11 19:14:48 -05:00
Isaac Connor 7dd72fd1c2 Merge pull request #5576 from AJ0070/5574-upload-failure
fix: stop zmfilter treating a failed FTP or SFTP upload as done
2026-11-11 19:14:20 -05:00
Jash ba59be7c19 fix: remove the upload archive when the FTP or SFTP connection cannot be made refs #5574 2026-11-12 04:24:39 +05:30
Jash eb6890911b fix: stop zmfilter treating a failed FTP or SFTP upload as done fixes #5574 2026-11-12 02:26:49 +05:30
Jash e6597da6be perf: work out a filesystem event's start time in zmaudit only when it is needed fixes #5568 2026-11-12 02:18:34 +05:30
Jash 7266e2717b perf: load the events zmaudit checks in batches of 1000 instead of one query each fixes #5563 2026-11-12 02:02:24 +05:30
Isaac Connor cf0d054f76 Merge pull request #5562 from AJ0070/5560-delete-analysis-jpegs
fix: delete analysis jpegs by file name instead of an absolute glob result
2026-11-11 15:30:14 -05:00
Isaac Connor 467c41ddfa Merge pull request #5559 from AJ0070/5558-zmaudit-object-cache
fix: clear the object cache on every zmaudit pass so looked up events are freed
2026-11-11 15:29:20 -05:00
Jash f31fe09959 fix: delete analysis jpegs by file name instead of an absolute glob result fixes #5560 2026-11-12 01:47:19 +05:30
Jash 7efeaf6809 fix: clear the object cache on every zmaudit pass so looked up events are freed fixes #5558 2026-11-12 01:35:01 +05:30
Isaac ConnorandClaude Opus 5.5 a36a2d239f fix: install only the generated Perl modules from the build tree
After installing the Perl modules from the source tree, the install copied
every .pm in the build tree's lib/ over them, though only Base, Config,
Memory, ConfigData and ONVIF are generated there. Copies of other modules
left in a build directory by an older build replaced current ones on
install: a stale ZoneMinder/Server.pm without systemdRunning() left
zoneminder.service failing in zmpkg.pl. The five generated modules are now
named one by one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:02:59 -05:00
Jash 90993466a4 fix: quote storage paths passed to df, du, ffprobe and AutoExecute refs #5556 2026-11-12 01:07:48 +05:30
Jash 90210ee3cc fix: delete event paths with File::Path instead of an unquoted rm -rf fixes #5554 2026-11-12 00:35:27 +05:30
Jash 43fde1a551 perf: load Data::Dumper when Dump() is called instead of at startup fixes #5547 2026-11-11 23:16:30 +05:30
Jash b9cb8e02de perf: import only the POSIX names zmdc.pl uses and none where nothing is used refs #5547 2026-11-11 23:16:30 +05:30
Jash 24a75775d2 perf: load ConfigData only in the functions that write the Config table refs #5547 2026-11-11 23:16:20 +05:30
Jash 76542990a7 fix: clear the object cache on every zmfilter pass so handled events are freed fixes #5541 2026-11-11 22:49:33 +05:30
Isaac Connor 2660411af1 Merge branch 'master' into remove-fast-delete 2026-11-03 08:32:58 -05:00
Isaac ConnorandClaude Opus 5.5 9e3885e8fd refactor: remove ZM_OPT_FAST_DELETE
With fast deletes on, deleting an event in the web interface removed only
its Events row and left its Frames and Stats rows and its files for
zmaudit, and deleting a monitor left all of its events. zmaudit only runs
when ZM_RUN_AUDIT is on, and both options default to off independently,
so with fast deletes on and the audit off nothing ever removed them and
the Frames table grew without bound. In the Perl Event::delete the option
also kept zmfilter from removing the files of the events it purged.

Remove the option. ZM\Event::delete() always removes the Stats and Frames
rows and the files in one transaction with the Events row,
ZM\Monitor::destroy() always deletes the monitor's events, and the Perl
Event::delete deletes the files unless the storage area has DoDelete off.
zmupdate.pl rebuilds the Config table from ConfigData, so the option's row
goes away on upgrade without a migration. Drop the option from the docs,
from the zmaudit option help, and from the es_la, ro_ro and ru_ru
translations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 22:50:01 -05:00
Isaac ConnorandClaude Opus 5.5 f47033ec27 fix: warn at start when fast deletes are on and zmaudit is off
With ZM_OPT_FAST_DELETE on, deleting an event in the web interface
removes only its Events row and leaves its Frames and Stats rows and its
files for zmaudit to remove. zmaudit only runs when ZM_RUN_AUDIT is on,
and both options default to off independently, so with fast deletes on
and the audit off nothing ever removes them and the Frames table grows
without bound.

Have zmpkg.pl log one Warning at start for that combination, naming both
options, next to the ZM_AUTH_RELAY=plain warning. Say in the fast delete
option's help that it depends on ZM_RUN_AUDIT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 18:23:03 -05:00
Isaac ConnorandClaude Opus 5.5 960d8feef7 fix: make Current Weekday filter terms run in the web UI and zmfilter.pl refs #5418
FilterTerm::sql_attr() returned 'weekday(NOW()' without its closing
parenthesis, so any filter with a Current Weekday term failed with
"Database query failed". FilterTerm::valid() treated the value 0 (Monday) as
missing, so a Monday term was dropped and the filter matched every event.

ZoneMinder::Filter had no CurrentWeekday case at all and emitted
E.CurrentWeekday, a column Events does not have, so zmfilter.pl could not run
such a filter either. Emit weekday(NOW()) there as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 17:29:02 -05:00
Nic BoetandClaude Opus 5.5 2625b53108 fix: let the PSIA control module compile
PSIA.pm has not compiled since it was added: move() built an unused
command string from undeclared $panSteps/$tiltSteps, and the PUT and
DELETE error paths logged an undeclared $cmd. zmcontrol.pl loads the
module when a PSIA camera is moved, so every PSIA PTZ command died.

Drop the unused line and log the request path on failure. A new test
compiles every control module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 10:27:39 -05:00
Nic BoetandClaude Opus 5.5 6beb62c9ee fix: stop logging camera passwords in the PTZ control modules
Control.pm's get(), put() and credential parsing, and the HikVision,
Netcat, PSIA, Serial_HEX_PelcoD, TapoC520WS_ONVIF, Instar720p,
Vivotek_ePTZ, Keekoon, M8640, FI8908W, IPCC7210W, DericamP2,
WanscamHW0025, Dahua and Grandstream modules logged the camera's
password: as a separate field ("username X password Y", which no
pattern in the logger can recognise), or inside the ControlAddress, Path
or request URL. Some of these are Info or Error lines, which reach the
Logs table at the default settings (Instar720p, IPCC7210W, DericamP2,
WanscamHW0025 on every command; FI8908W, M8640, Vivotek_ePTZ,
Grandstream on failures). Reolink_HTTP logged its API session token.

Log the user name without the password, URLs through urlForLog() (host,
port and path kept), and the Reolink token as a fingerprint. The test
scans the Perl modules for log calls that interpolate a password.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 10:27:39 -05:00
Nic BoetandClaude Opus 5.5 9a1fab7514 fix: stop logging the S3 secret key when parsing a storage URL
ZoneMinder::Storage::s3() logged the parsed S3 access key id, secret
key, host and bucket, and the URL they came from, at Debug level 1 in
every process that deletes or uploads events (zmfilter, zmaudit). Log
the key id, host, bucket and subpath, and the URL through urlForLog().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 10:27:39 -05:00
Nic BoetandClaude Opus 5.5 2db3d24d62 fix: redact credentials from every line the Perl logger writes
The PTZ control modules build camera URLs with user:password@ from the
ControlAddress or Path, or pwd= from the ControlDevice, and log them at
Debug, Info or Error. Info and Error reach the Logs table at the default
settings, which every System=View user can read. There are over fifty
modules, most written for one camera and not testable here.

ZoneMinder::Logger gets redactCredentials(), urlForLog() and
logFingerprint() (the same fp: tag as the web and C++ logs), and
logPrint() passes every message through redactCredentials(): userinfo is
removed from URLs and from scheme-less host specs, pass/pwd/secret
parameters are replaced, token= and auth= are fingerprinted, WS-Security
password digests and JSON password fields are replaced. Host, port, path
and the other parameters stay in the line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 10:27:39 -05:00
Isaac Connor 9b3caa20b0 Merge branch '5395-xml-libxml-dep' 2026-10-31 18:09:34 -04:00
Isaac ConnorandClaude Opus 5.5 21d2c26127 fix: load XML::LibXML explicitly in HikVision control module refs #5395
HikVision.pm calls XML::LibXML->load_xml and XML::LibXML::Element->new but
never loaded the module, so it only worked when another module had already
pulled it in. Add the missing use line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 18:06:50 -04:00
Isaac Connor ac1e167e6e Merge pull request #5382 from connortechnology/fix/ghsa-2pgc-session-fixation
fix: reject client-chosen session ids and regenerate on auth= / stateful API login (GHSA-2pgc)
2026-10-31 09:34:50 -04:00
Nic Boet b7f9c7631c chore: deprecate ZM_AUTH_RELAY=plain with a warning at start
The plain relay keeps the user's password in the web session and puts
user= and pass= in every stream, video and HLS URL the web UI builds,
in multi-server requests and in zmu command lines. hashed has been the
default for a long time and does none of that.

Mark plain as deprecated in the option's description and help, and
have zmpkg.pl log one Warning at start when authentication is on and
the relay is plain, pointing at hashed with ZM_AUTH_HASH_SECRET set.
The warning is logged once per start rather than per web request so it
does not flood the log. The option's values and behaviour are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 9ccb904bca)
2026-10-31 09:04:37 -04:00
Isaac Connor 2e50bdc431 Merge pull request #5360 from connortechnology/8g63-config-secret-oracle
fix: stop the Config API leaking secret values (GHSA-8g63-hqg8-82cv)
2026-10-30 08:51:27 -04:00