Commit Graph
29 Commits
Author SHA1 Message Date
Nic Boet 8dbc2d977e fix(api): create the API's log files readable by owner and group only
cake_error.log, error.log, cake_debug.log and debug.log in ZM_LOGDIR
were created 0644 under the usual umask of 022, so any local
account could read them. Before the redaction in this series they held
the token, auth hash or password of any API request that failed.

The three FileLog configs now set 'mask' => 0640. Cake applies it only
when it creates a file: on the first write, and after its own 10 MB
rotation. An existing file keeps its mode.

Behaviour change: new files are 0640, owned by the user PHP runs as and
its primary group (www-data:www-data on Debian/Ubuntu, apache:apache on
Red Hat/Fedora), so only that user, members of that group and root can
read them. The Debian packages chown /var/log/zm to www-data:root, which
does not change the group of the files PHP creates in it. Nothing in
ZoneMinder reads these files: the web log view and zmaudit use the Logs
table. The distros' logrotate configs run as root; with the usual
global "create" a rotated file is recreated with the same mode and
owner, otherwise Cake recreates it with the mask.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 48d5fad41d)
2026-10-30 18:53:27 -04:00
Isaac Connor edb105bb32 Update bootstrap.php.in to use zm_config instead of zm_configvals 2026-01-05 11:14:21 -05:00
Isaac Connor 5929ccce8d Fix the rename of configvals to zm_configvals 2025-07-09 17:24:19 -04:00
Andrew Bauer b59e911c43 Allow cakephp cache engine to be set during build 2021-06-18 12:12:01 -05:00
Isaac Connor bbee6b4f58 Whitespace, delete dead code 2020-07-20 16:23:55 -04:00
Mitch Capper 04c17283ec need to prefix with _dir_ otherwise relative to initial script (#2531) 2019-02-17 11:31:10 -05:00
Isaac Connor fdd8be5daf brackets and spaces 2018-04-06 14:52:56 -04:00
Isaac Connor 2c02a479d6 remove duplicated config code from bootstrap and just include config.php 2018-04-06 14:38:32 -04:00
Isaac Connor 87f5204c46 rename process_configfile to remove namesspace colision 2018-04-05 11:44:21 -04:00
Isaac Connor fb392b2765 put back process_configfile 2018-04-05 11:33:24 -04:00
Isaac Connor 8fee795fb4 don't duplicate declaration of process_configfile, because we include our version from ZM 2018-04-05 11:24:17 -04:00
Isaac Connor a4fee5c91c further merges from cakephp 2.10.8 2018-03-21 13:09:55 -04:00
Isaac Connor 1b1b93f811 use CakePHP-Enum-Behavior to add support for ENUMs to the Monitor model. This should fix #48 2018-01-01 14:43:02 -05:00
Isaac Connor 1cd69c69b9 add defining ZM_SERVER_ID after loading config 2018-01-01 13:10:39 -05:00
Isaac Connor cfbfc0dd44 Merge branch 'master' into storageareas 2017-07-21 11:04:32 -04:00
Isaac Connor efb02f3368 fix indent 2017-07-21 10:54:48 -04:00
Andrew Bauer 5cf2be528a Merge pull request #1950 from connortechnology/fix_api_logs
fix path to logs for api
2017-07-14 13:19:12 -05:00
Isaac Connor 240a990c7f fix writing to config 2017-07-14 12:19:43 -04:00
Isaac Connor e203064bf7 updates bootstrap.php.in to match config.php's conf.d loading 2017-07-14 12:03:00 -04:00
Isaac Connor 13a72b7a99 fix path to logs for api 2017-07-14 11:58:15 -04:00
Isaac Connor 9824049c0c fix conf.d loading in api 2017-07-14 11:46:36 -04:00
Isaac Connor 84fd80b242 undo cake log path changes 2017-06-08 12:21:51 -04:00
Isaac Connor c7b52bd998 fix logging dirs 2017-05-30 13:14:43 -04:00
Isaac Connor ab4b5e6b69 Merge pull request #1853 from knnniggett/cakecache
change cake cache engine from File -> Apc
2017-04-14 21:10:23 -04:00
Andrew Bauer 48a73f7e78 change cache engine from File -> Apc 2017-04-14 14:31:42 -05:00
Andrew Bauer 3cbd32cd41 move cake log to zoneminder log folder 2017-04-14 14:24:29 -05:00
Isaac Connor 532fb77ecb As well as writing zm.conf contents into the Configure object, define them, like we do in the regular UI. Also remove unneeded quotes 2016-04-30 08:09:56 -04:00
pliablepixels 12ba217de0 Added API version in addition to ZM version, also added loadConfig code that was there in the angular-ui branch but not merged to master 2015-06-13 16:32:37 +00:00
Isaac Connor bda35ed4d6 fix bootstrap.ini substitution 2015-06-12 11:12:58 -04:00