1# ==========================================================================
2#
3# ZoneMinder Config Data Module
4# Copyright (C) 2001-2008  Philip Coombes
5#
6# This program is free software; you can redistribute it and/or
7# modify it under the terms of the GNU General Public License
8# as published by the Free Software Foundation; either version 2
9# of the License, or (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19#
20# ==========================================================================
21#
22# This module contains the debug definitions and functions used by the rest
23# of the ZoneMinder scripts
24#
25package ZoneMinder::ConfigData;
26
27use 5.006;
28use strict;
29use warnings;
30
31require Exporter;
32require ZoneMinder::Base;
33
34our @ISA = qw(Exporter ZoneMinder::Base);
35
36# Items to export into callers namespace by default. Note: do not export
37# names by default without a very good reason. Use EXPORT_OK instead.
38# Do not simply export all your public functions/methods/constants.
39
40# This allows declaration   use ZoneMinder ':all';
41# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
42# will save memory.
43our %EXPORT_TAGS = (
44    data => [ qw(
45      %types
46      @options
47      %options_hash
48      ) ]
49    );
50push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS;
51
52our @EXPORT_OK = ( @{ $EXPORT_TAGS{data} } );
53
54our @EXPORT = qw();
55
56our $VERSION = $ZoneMinder::Base::VERSION;
57
58# ==========================================================================
59#
60# Configuration Data
61#
62# ==========================================================================
63
64use Carp;
65
66our $configInitialised = 0;
67
68sub INIT {
69  initialiseConfig();
70}
71
72# Types
73our %types = (
74  string => {
75    db_type     => 'string',
76    hint        => 'string',
77    pattern     => qr|^(.+)$|,
78    format      => q( $1 )
79  },
80  alphanum => {
81    db_type     => 'string',
82    hint        => 'alphanumeric',
83    pattern     => qr|^([a-zA-Z0-9-_]+)$|,
84    format      => q( $1 )
85  },
86  text => {
87    db_type     => 'text',
88    hint        => 'free text',
89    pattern     => qr|^(.+)$|,
90    format      => q( $1 )
91  },
92  boolean => {
93    db_type     => 'boolean',
94    hint        => 'yes|no',
95    pattern     => qr|^([yn])|i,
96    check       => q( $1 ),
97    format      => q( ($1 =~ /^y/) ? 'yes' : 'no' )
98  },
99  integer => {
100    db_type     => 'integer',
101    hint        => 'integer',
102    pattern     => qr|^(\d+)$|,
103    format      => q( $1 )
104  },
105  decimal => {
106    db_type     => 'decimal',
107    hint        => 'decimal',
108    pattern     => qr|^(\d+(?:\.\d+)?)$|,
109    format      => q( $1 )
110  },
111  hexadecimal => {
112    db_type     => 'hexadecimal',
113    hint        => 'hexadecimal',
114    pattern     => qr|^(?:0x)?([0-9a-f]{1,8})$|,
115    format      => q( '0x'.$1 )
116  },
117  tristate => {
118    db_type     => 'string',
119    hint        => 'auto|yes|no',
120    pattern     => qr|^([ayn])|i, check=>q( $1 ),
121    format      => q( ($1 =~ /^y/) ? 'yes' : ($1 =~ /^n/ ? 'no' : 'auto' ) )
122  },
123  abs_path => {
124    db_type     => 'string',
125    hint        => '/absolute/path/to/somewhere',
126    pattern     => qr|^((?:/[^/]*)+?)/?$|,
127    format      => q( $1 )
128  },
129  rel_path => {
130    db_type     => 'string',
131    hint        => 'relative/path/to/somewhere',
132    pattern     => qr|^((?:[^/].*)?)/?$|,
133    format      => q( $1 )
134  },
135  directory => {
136    db_type     => 'string',
137    hint        => 'directory',
138    pattern     => qr|^([a-zA-Z0-9-_.]+)$|,
139    format      => q( $1 )
140  },
141  file => {
142    db_type     => 'string',
143    hint        => 'filename',
144    pattern     => qr|^([a-zA-Z0-9-_.]+)$|,
145    format      => q( $1 )
146  },
147  hostname => {
148    db_type     => 'string',
149    hint        => 'host.your.domain',
150    pattern     => qr|^([a-zA-Z0-9_.-]+)$|,
151    format      => q( $1 )
152  },
153  url => {
154    db_type     => 'string',
155    hint        => 'http://host.your.domain/',
156    pattern     => qr|^(?:http://)?(.+)$|,
157    format      => q( 'http://'.$1 )
158  },
159  email => {
160    db_type     => 'string',
161    hint        => 'your.name@your.domain',
162    pattern     => qr|^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$|,
163    format      => q( $1\@$2 )
164  },
165  timezone => {
166    db_type     => 'string',
167    hint        => 'America/Toronto',
168    pattern      => qr|^(.+)$|,
169    format      => q($1)
170  }
171);
172
173our @options = (
174  {
175    name        => 'ZM_SKIN_DEFAULT',
176    default     => 'classic',
177    description => 'Default skin used by web interface',
178
179    help        => q`
180      ZoneMinder allows the use of many different web interfaces.
181      This option allows you to set the default skin used by the
182      website. Users can change their skin later, this merely sets
183      the default.
184      `,
185    type        => $types{string},
186    category    => 'system',
187  },
188  {
189    name        => 'ZM_CSS_DEFAULT',
190    default     => 'base',
191    description => 'Default set of css files used by web interface',
192    help        => q`
193      ZoneMinder allows the use of many different web interfaces, and
194      some skins allow the use of different set of CSS files to
195      control the appearance. This option allows you to set the
196      default set of css files used by the website.  Users can change
197      their css later, this merely sets the default.
198      `,
199    type        => $types{string},
200    category    => 'system',
201  },
202  {
203    name        => 'ZM_BANDWIDTH_DEFAULT',
204    default     => 'high',
205    description => 'Default setting for bandwidth profile used by web interface',
206    help        => q`The classic skin for ZoneMinder has different
207      profiles to use for low, medium, or high bandwidth connections.
208      `,
209    type        => $types{string},
210    category    => 'system',
211  },
212  {
213    name        => 'ZM_LANG_DEFAULT',
214    default     => 'en_gb',
215    description => 'Default language used by web interface',
216    help        => q`
217      ZoneMinder allows the web interface to use languages other than
218      English if the appropriate language file has been created and
219      is present. This option allows you to change the default
220      language that is used from the shipped language, British
221      English, to another language
222      `,
223    type        => $types{string},
224    category    => 'system',
225  },
226  {
227    name        => 'ZM_OPT_USE_AUTH',
228    default     => 'no',
229    description => 'Authenticate user logins to ZoneMinder',
230    help        => q`
231      ZoneMinder can run in two modes. The simplest is an entirely
232      unauthenticated mode where anyone can access ZoneMinder and
233      perform all tasks. This is most suitable for installations
234      where the web server access is limited in other ways. The other
235      mode enables user accounts with varying sets of permissions.
236      Users must login or authenticate to access ZoneMinder and are
237      limited by their defined permissions.
238      `,
239    type        => $types{boolean},
240    category    => 'system',
241  },
242  {
243    name        => 'ZM_AUTH_TYPE',
244    default     => 'builtin',
245    description => 'What is used to authenticate ZoneMinder users',
246    help        => q`
247      ZoneMinder can use two methods to authenticate users when
248      running in authenticated mode. The first is a builtin method
249      where ZoneMinder provides facilities for users to log in and
250      maintains track of their identity. The second method allows
251      interworking with other methods such as http basic
252      authentication which passes an independently authentication
253      'remote' user via http. In this case ZoneMinder would use the
254      supplied user without additional authentication provided such a
255      user is configured in ZoneMinder.
256      `,
257    requires    => [ { name=>'ZM_OPT_USE_AUTH', value=>'yes' } ],
258    type        => {
259      db_type     => 'string',
260      hint        => 'builtin|remote',
261      pattern     => qr|^([br])|i,
262      format      => q( $1 =~ /^b/ ? 'builtin' : 'remote' )
263    },
264    category    => 'system',
265  },
266  {
267    name        => 'ZM_AUTH_RELAY',
268    default     => 'hashed',
269    description => 'Method used to relay authentication information',
270    help        => q`
271      When ZoneMinder is running in authenticated mode it can pass
272      user details between the web pages and the back end processes.
273      There are two methods for doing this. This first is to use a
274      time limited hashed string which contains no direct username or
275      password details, the second method is to pass the username and
276      passwords around in plaintext. This method is not recommend
277      except where you do not have the md5 libraries available on
278      your system or you have a completely isolated system with no
279      external access. You can also switch off authentication
280      relaying if your system is isolated in other ways.
281      `,
282    requires    => [ { name=>'ZM_OPT_USE_AUTH', value=>'yes' } ],
283    type        => {
284      db_type     => 'string',
285      hint        => 'hashed|plain|none',
286      pattern     => qr|^([hpn])|i,
287      format      => q( ($1 =~ /^h/) ? 'hashed' : ($1 =~ /^p/ ? 'plain' : 'none' ) )
288    },
289    category    => 'system',
290  },
291  {
292    name        => 'ZM_AUTH_HASH_SECRET',
293    default     => '...Change me to something unique...',
294    description => 'Secret for encoding hashed authentication information',
295    help        => q`
296      When ZoneMinder is running in hashed authenticated mode it is
297      necessary to generate hashed strings containing encrypted
298      sensitive information such as usernames and password. Although
299      these string are reasonably secure the addition of a random
300      secret increases security substantially.
301      `,
302    requires    => [
303      { name=>'ZM_OPT_USE_AUTH', value=>'yes' },
304      { name=>'ZM_AUTH_RELAY', value=>'hashed' }
305    ],
306    type        => $types{string},
307    category    => 'system',
308  },
309  {
310    name        => 'ZM_AUTH_HASH_IPS',
311    default     => 'yes',
312    description => 'Include IP addresses in the authentication hash',
313    help        => q`
314      When ZoneMinder is running in hashed authenticated mode it can
315      optionally include the requesting IP address in the resultant
316      hash. This adds an extra level of security as only requests
317      from that address may use that authentication key. However in
318      some circumstances, such as access over mobile networks, the
319      requesting address can change for each request which will cause
320      most requests to fail. This option allows you to control
321      whether IP addresses are included in the authentication hash on
322      your system. If you experience intermitent problems with
323      authentication, switching this option off may help.
324      `,
325    requires    => [
326      { name=>'ZM_OPT_USE_AUTH', value=>'yes' },
327      { name=>'ZM_AUTH_RELAY', value=>'hashed' }
328    ],
329    type        => $types{boolean},
330    category    => 'system',
331  },
332  {
333    name        => 'ZM_AUTH_HASH_TTL',
334    default     => '2',
335    description => 'The number of hours that an authentication hash is valid for.',
336    help        => q`
337      The default has traditionally been 2 hours. A new hash will
338      automatically be regenerated at half this value.
339      `,
340    requires    => [
341      { name=>'ZM_OPT_USE_AUTH', value=>'yes' },
342      { name=>'ZM_AUTH_RELAY', value=>'hashed' }
343    ],
344    type        => $types{integer},
345    category    => 'system',
346  },
347  {
348    name        => 'ZM_AUTH_HASH_LOGINS',
349    default     => 'no',
350    description => 'Allow login by authentication hash',
351    help        => q`
352      The normal process for logging into ZoneMinder is via the login
353      screen with username and password. In some circumstances it may
354      be desirable to allow access directly to one or more pages, for
355      instance from a third party application. If this option is
356      enabled then adding an 'auth' parameter to any request will
357      include a shortcut login bypassing the login screen, if not
358      already logged in. As authentication hashes are time and,
359      optionally, IP limited this can allow short-term access to
360      ZoneMinder screens from other web pages etc. In order to use
361      this the calling application will have to generate the
362      authentication hash itself and ensure it is valid. If you use
363      this option you should ensure that you have modified the
364      ZM_AUTH_HASH_SECRET to something unique to your system.
365      `,
366    requires    => [
367      { name=>'ZM_OPT_USE_AUTH', value=>'yes' },
368      { name=>'ZM_AUTH_RELAY', value=>'hashed' }
369    ],
370    type        => $types{boolean},
371    category    => 'system',
372  },
373  {
374    name        => 'ZM_ENABLE_CSRF_MAGIC',
375    default     => 'yes',
376    description => 'Enable csrf-magic library',
377    help        => q`
378      CSRF stands for Cross-Site Request Forgery which, under specific
379      circumstances, can allow an attacker to perform any task your
380      ZoneMinder user account has permission to perform. To accomplish
381      this, the attacker must write a very specific web page and get
382      you to navigate to it, while you are logged into the ZoneMinder
383      web console at the same time. Enabling ZM_ENABLE_CSRF_MAGIC will
384      help mitigate these kinds of attacks.
385      `,
386    type        => $types{boolean},
387    category    => 'system',
388  },
389  {
390    name        => 'ZM_OPT_USE_API',
391    default     => 'yes',
392    description => 'Enable ZoneMinder APIs',
393    help        => q`
394      ZoneMinder now features a new API using which 3rd party
395      applications can interact with ZoneMinder data. It is
396      STRONGLY recommended that you enable authentication along
397      with APIs. Note that the APIs return sensitive data like
398      Monitor access details which are configured as JSON objects.
399      Which is why we recommend you enabling authentication, especially
400      if you are exposing your ZM instance on the Internet.
401      `,
402    type        => $types{boolean},
403    category    => 'system',
404  },
405  {
406    name        => 'ZM_OPT_USE_LEGACY_API_AUTH',
407    default     => 'yes',
408    description => 'Enable legacy API authentication',
409    help        => q`
410      Starting version 1.34.0, ZoneMinder uses a more secure
411      Authentication mechanism using JWT tokens. Older versions used a less secure MD5 based auth hash. It is recommended you turn this off after you are sure you don't need it. If you are using a 3rd party app that relies on the older API auth mechanisms, you will have to update that app if you turn this off. Note that zmNinja 1.3.057 onwards supports the new token system
412      `,
413    type        => $types{boolean},
414    category    => 'system',
415  },
416  {
417    name        => 'ZM_OPT_USE_EVENTNOTIFICATION',
418    default     => 'no',
419    description => 'Enable 3rd party Event Notification Server',
420    help        => q`
421      zmeventnotification is a 3rd party event notification server
422      that is used to get notifications for alarms detected by ZoneMinder
423      in real time. zmNinja requires this server for push notifications to
424      mobile phones. This option only enables the server if its already installed.
425      Please visit the [zmeventserver project site](https://github.com/pliablepixels/zmeventserver)
426      for installation instructions.
427      `,
428    type        => $types{boolean},
429    category    => 'system',
430  },
431  # Google reCaptcha settings
432  {
433    name        => 'ZM_OPT_USE_GOOG_RECAPTCHA',
434    default     => 'no',
435    description => 'Add Google reCaptcha to login page',
436    help        => q`
437      This option allows you to include a google
438      reCaptcha validation at login. This means in addition to providing
439      a valid usernane and password, you will also have to
440      pass the reCaptcha test. Please note that enabling this
441      option results in the zoneminder login page reach out
442      to google servers for captcha validation. Also please note
443      that enabling this option will break 3rd party clients
444      like zmNinja and zmView as they also need to login to ZoneMinder
445      and they will fail the reCaptcha test.
446      `,
447    requires    => [
448                     {name=>'ZM_OPT_USE_AUTH', value=>'yes'}
449                   ],
450    type        => $types{boolean},
451    category    => 'system',
452  },
453  {
454    name        => 'ZM_OPT_GOOG_RECAPTCHA_SITEKEY',
455    description => 'Your recaptcha site-key',
456    help        => q`You need to generate your keys from
457      the Google reCaptcha website.
458      Please refer to the [recaptcha project site](https://www.google.com/recaptcha/)
459      for more details.
460      `,
461    requires    => [
462                     {name=>'ZM_OPT_USE_GOOG_RECAPTCHA', value=>'yes'}
463                   ],
464    type        => $types{string},
465    category    => 'system',
466  },
467  {
468    name        => 'ZM_OPT_GOOG_RECAPTCHA_SECRETKEY',
469    default     => '...Insert your recaptcha secret-key here...',
470    description => 'Your recaptcha secret-key',
471    help        => q`You need to generate your keys from
472      the Google reCaptcha website.
473      Please refer to the [recaptcha project site](https://www.google.com/recaptcha/)
474      for more details.
475      `,
476    requires    => [
477                     {name=>'ZM_OPT_USE_GOOG_RECAPTCHA', value=>'yes'}
478                   ],
479    type        => $types{string},
480    category    => 'system',
481  },
482  {
483    name        =>  'ZM_OPT_USE_GEOLOCATION',
484    description =>  'Add geolocation features to ZoneMinder.',
485    help        =>  'Whether or not to enable Latitude/Longitude settings on Monitors and enable mapping options.',
486    type        =>  $types{boolean},
487    category    =>  'system',
488  },
489  {
490    name        =>  'ZM_OPT_GEOLOCATION_TILE_PROVIDER',
491    description =>  'Tile provider to use for maps.',
492    help        =>  'OpenStreetMaps does not itself provide the images to use in the map. There are many to choose from.  Mapbox.com is one example that offers free tiles and has been tested during development of this feature.',
493    requires    =>  [
494                     {name=>'ZM_OPT_USE_GEOLOCATION', value=>'yes'}
495                   ],
496    type        => $types{string},
497    category    => 'system',
498  },
499  {
500    name        =>  'ZM_OPT_GEOLOCATION_ACCESS_TOKEN',
501    description =>  'Access Token for the tile provider used for maps.',
502    help        =>  'OpenStreetMaps does not itself provide the images to use in the map. There are many to choose from.  Mapbox.com is one example that offers free tiles and has been tested during development of this feature. You must go to mapbox.com and sign up and get an access token and cutnpaste it here.',
503    requires    =>  [
504                     {name=>'ZM_OPT_USE_GEOLOCATION', value=>'yes'}
505                   ],
506    type        => $types{string},
507    category    => 'system',
508  },
509  {
510    name        =>  'ZM_SYSTEM_SHUTDOWN',
511    default     =>  'yes',
512    description =>  'Allow Admin users to power off or restart the system from the ZoneMinder UI.',
513    help        =>  'The system will need to have sudo installed and the following added to /etc/sudoers~~
514    ~~
515    @ZM_WEB_USER@ ALL=NOPASSWD: /sbin/shutdown~~
516    ~~
517      to perform the shutdown or reboot',
518    type      =>  $types{boolean},
519    category  =>  'system',
520  },
521  {
522    name        =>  'ZM_FEATURES_SNAPSHOTS',
523    default     =>  'no',
524    description =>  'Enable snapshot functionality.',
525    help        =>  'Snapshots are a collection of events.  They can be created using the snapshot button in montage view.  All visible monitors will have a short event created, archived and added to the Snapshot.',
526    type      =>  $types{boolean},
527    category  =>  'hidden',
528  },
529  {
530    name        => 'ZM_USE_DEEP_STORAGE',
531    default     => 'yes',
532    description => 'Use a deep filesystem hierarchy for events',
533    help        => q`
534      This option is now the default for new ZoneMinder systems and
535      should not be changed. Previous versions of ZoneMinder stored
536      all events for a monitor under one folder. Enabling
537      USE_DEEP_STORAGE causes ZoneMinder to store events under a
538      folder structure that follows year/month/day/hour/min/second.
539      Storing events this way avoids the limitation of storing more
540      than 32k files in a single folder inherent in some filesystems.
541      It is important to note that you cannot simply change this
542      option. You must stop zoneminder, enable USE_DEEP_STORAGE, and
543      then run "sudo zmupdate.pl --migrate-events". FAILURE TO DO
544      SO WILL RESULT IN LOSS OF YOUR DATA! Consult the ZoneMinder
545      WiKi for further details.
546      `,
547    type        => $types{boolean},
548    category    => 'hidden',
549  },
550  {
551    name        => 'ZM_COLOUR_JPEG_FILES',
552    default     => 'no',
553    description => 'Colourise greyscale JPEG files',
554    help        => q`
555      Cameras that capture in greyscale can write their captured
556      images to jpeg files with a corresponding greyscale colour
557      space. This saves a small amount of disk space over colour
558      ones. However some tools such as ffmpeg either fail to work
559      with this colour space or have to convert it beforehand.
560      Setting this option to yes uses up a little more space but
561      makes creation of MPEG files much faster.
562      `,
563    type        => $types{boolean},
564    category    => 'images',
565  },
566  {
567    name        => 'ZM_ADD_JPEG_COMMENTS',
568    default     => 'no',
569    description => 'Add jpeg timestamp annotations as file header comments',
570    help        => q`
571      JPEG files may have a number of extra fields added to the file
572      header. The comment field may have any kind of text added. This
573      options allows you to have the same text that is used to
574      annotate the image additionally included as a file header
575      comment. If you archive event images to other locations this
576      may help you locate images for particular events or times if
577      you use software that can read comment headers.
578      `,
579    type        => $types{boolean},
580    category    => 'images',
581  },
582  {
583    name        => 'ZM_JPEG_FILE_QUALITY',
584    default     => '70',
585    description => 'Set the JPEG quality setting for the saved event files (1-100)',
586    help        => q`
587      When ZoneMinder detects an event it will save the images
588      associated with that event to files. These files are in the
589      JPEG format and can be viewed or streamed later. This option
590      specifies what image quality should be used to save these
591      files. A higher number means better quality but less
592      compression so will take up more disk space and take longer to
593      view over a slow connection. By contrast a low number means
594      smaller, quicker to view, files but at the price of lower
595      quality images. This setting applies to all images written
596      except if the capture image has caused an alarm and the alarm
597      file quality option is set at a higher value when that is used
598      instead.
599      `,
600    type        => $types{integer},
601    category    => 'images',
602  },
603  {
604    name        => 'ZM_JPEG_ALARM_FILE_QUALITY',
605    default     => '0',
606    description => 'Set the JPEG quality setting for the saved event files during an alarm (1-100)',
607    help        => q`
608      This value is equivalent to the regular jpeg file quality
609      setting above except that it only applies to images saved while
610      in an alarm state and then only if this value is set to a
611      higher quality setting than the ordinary file setting. If set
612      to a lower value then it is ignored. Thus leaving it at the
613      default of 0 effectively means to use the regular file quality
614      setting for all saved images. This is to prevent accidentally
615      saving important images at a worse quality setting.
616      `,
617    type        => $types{integer},
618    category    => 'images',
619  },
620  {
621    name        => 'ZM_JPEG_STREAM_QUALITY',
622    default     => '70',
623    description => q`Set the JPEG quality setting for the streamed 'live' images (1-100)`,
624    help        => q`
625      When viewing a 'live' stream for a monitor ZoneMinder will grab
626      an image from the buffer and encode it into JPEG format before
627      sending it. This option specifies what image quality should be
628      used to encode these images. A higher number means better
629      quality but less compression so will take longer to view over a
630      slow connection. By contrast a low number means quicker to view
631      images but at the price of lower quality images. This option
632      does not apply when viewing events or still images as these are
633      usually just read from disk and so will be encoded at the
634      quality specified by the previous options.
635      `,
636    type        => $types{integer},
637    category    => 'images',
638  },
639  {
640    name        => 'ZM_MPEG_TIMED_FRAMES',
641    default     => 'yes',
642    description => 'Tag video frames with a timestamp for more realistic streaming',
643    help        => q`
644      When using streamed MPEG based video, either for live monitor
645      streams or events, ZoneMinder can send the streams in two ways.
646      If this option is selected then the timestamp for each frame,
647      taken from it's capture time, is included in the stream. This
648      means that where the frame rate varies, for instance around an
649      alarm, the stream will still maintain it's 'real' timing. If
650      this option is not selected then an approximate frame rate is
651      calculated and that is used to schedule frames instead. This
652      option should be selected unless you encounter problems with
653      your preferred streaming method.
654      `,
655    type        => $types{boolean},
656    category    => 'images',
657  },
658  {
659    name        => 'ZM_MPEG_LIVE_FORMAT',
660    default     => 'swf',
661    description => q`What format 'live' video streams are played in`,
662    help        => q`
663      When using MPEG mode ZoneMinder can output live video. However
664      what formats are handled by the browser varies greatly between
665      machines. This option allows you to specify a video format
666      using a file extension format, so you would just enter the
667      extension of the file type you would like and the rest is
668      determined from that. The default of 'asf' works well under
669      Windows with Windows Media Player but I'm currently not sure
670      what, if anything, works on a Linux platform. If you find out
671      please let me know! If this option is left blank then live
672      streams will revert to being in motion jpeg format
673      `,
674    type        => $types{string},
675    category    => 'images',
676  },
677  {
678    name        => 'ZM_MPEG_REPLAY_FORMAT',
679    default     => 'swf',
680    description => q`What format 'replay' video streams are played in`,
681    help        => q`
682      When using MPEG mode ZoneMinder can replay events in encoded
683      video format. However what formats are handled by the browser
684      varies greatly between machines. This option allows you to
685      specify a video format using a file extension format, so you
686      would just enter the extension of the file type you would like
687      and the rest is determined from that. The default of 'asf'
688      works well under Windows with Windows Media Player and 'mpg',
689      or 'avi' etc should work under Linux. If you know any more then
690      please let me know! If this option is left blank then live
691      streams will revert to being in motion jpeg format
692      `,
693    type        => $types{string},
694    category    => 'images',
695  },
696  {
697    name        => 'ZM_RAND_STREAM',
698    default     => 'yes',
699    description => 'Add a random string to prevent caching of streams',
700    help        => q`
701      Some browsers can cache the streams used by ZoneMinder. In
702      order to prevent this a harmless random string can be appended
703      to the url to make each invocation of the stream appear unique.
704      `,
705    type        => $types{boolean},
706    category    => 'images',
707  },
708  {
709    name        => 'ZM_OPT_CAMBOZOLA',
710    default     => 'no',
711    description => 'Is the (optional) cambozola java streaming client installed',
712    help        => q`
713      Cambozola is a handy low fat cheese flavoured Java applet that
714      ZoneMinder uses to view image streams on browsers such as
715      Internet Explorer that don't natively support this format. If
716      you use this browser it is highly recommended to install this
717      from the [cambozola project site](http://www.charliemouse.com/code/cambozola/).
718      However, if it is not installed still images at a lower refresh rate can
719      still be viewed.
720      `,
721    type        => $types{boolean},
722    category    => 'images',
723  },
724  {
725    name        => 'ZM_PATH_CAMBOZOLA',
726    default     => 'cambozola.jar',
727    description => 'Web path to (optional) cambozola java streaming client',
728    help        => q`
729      Cambozola is a handy low fat cheese flavoured Java applet that
730      ZoneMinder uses to view image streams on browsers such as
731      Internet Explorer that don't natively support this format. If
732      you use this browser it is highly recommended to install this
733      from the [cambozola project site](http://www.charliemouse.com/code/cambozola/).
734      However if it is not installed still images at a lower refresh rate can
735      still be viewed. Leave this as 'cambozola.jar' if cambozola is
736      installed in the same directory as the ZoneMinder web client
737      files.
738      `,
739    requires    => [ { name=>'ZM_OPT_CAMBOZOLA', value=>'yes' } ],
740    type        => $types{rel_path},
741    category    => 'images',
742  },
743  {
744    name        => 'ZM_RELOAD_CAMBOZOLA',
745    default     => '0',
746    description => 'After how many seconds should Cambozola be reloaded in live view',
747    help        => q`
748      Cambozola allows for the viewing of streaming MJPEG however it
749      caches the entire stream into cache space on the computer,
750      setting this to a number > 0 will cause it to automatically
751      reload after that many seconds to avoid filling up a hard
752      drive.
753      `,
754    type        => $types{integer},
755    category    => 'images',
756  },
757  {
758    name        => 'ZM_TIMESTAMP_ON_CAPTURE',
759    default     => 'yes',
760    description => 'Timestamp images as soon as they are captured',
761    help        => q`
762      ZoneMinder can add a timestamp to images in two ways. The
763      default method, when this option is set, is that each image is
764      timestamped immediately when captured and so the image held in
765      memory is marked right away. The second method does not
766      timestamp the images until they are either saved as part of an
767      event or accessed over the web. The timestamp used in both
768      methods will contain the same time as this is preserved along
769      with the image. The first method ensures that an image is
770      timestamped regardless of any other circumstances but will
771      result in all images being timestamped even those never saved
772      or viewed. The second method necessitates that saved images are
773      copied before being saved otherwise two timestamps perhaps at
774      different scales may be applied. This has the (perhaps)
775      desirable side effect that the timestamp is always applied at
776      the same resolution so an image that has scaling applied will
777      still have a legible and correctly scaled timestamp.
778      `,
779    type        => $types{boolean},
780    category    => 'config',
781  },
782  {
783    name        => 'ZM_TIMESTAMP_CODE_CHAR',
784    default     => '%',
785    description => 'Character to used to identify timestamp codes',
786    help        => q`
787      There are a few codes one can use to tell ZoneMinder to insert
788      data into the timestamp of each image. Traditionally, the
789      percent (%) character has been used to identify these codes since
790      the current character codes do not conflict with the strftime
791      codes, which can also be used in the timestamp. While this works
792      well for Linux, this does not work well for BSD operating systems.
793      Changing the default character to something else, such as an
794      exclamation point (!), resolves the issue. Note this only affects
795      the timestamp codes built into ZoneMinder. It has no effect on
796      the family of strftime codes one can use.
797      `,
798    type        => $types{string},
799    category    => 'config',
800  },
801  {
802    name        => 'ZM_TIMEZONE',
803    default     =>  '',
804    description => 'The timezone that php should use.',
805    help        => q`
806      This should be set equal to the system timezone of the mysql server`,
807    type  =>  $types{timezone},
808    category => 'system',
809  },
810  {
811    name        => 'ZM_CPU_EXTENSIONS',
812    default     => 'yes',
813    description => 'Use advanced CPU extensions to increase performance',
814    help        => q`
815      When advanced processor extensions such as SSE2 or SSSE3 are
816      available, ZoneMinder can use them, which should increase
817      performance and reduce system load. Enabling this option on
818      processors that do not support the advanced processors
819      extensions used by ZoneMinder is harmless and will have no
820      effect.
821      `,
822    type        => $types{boolean},
823    category    => 'config',
824  },
825  {
826    name        => 'ZM_FAST_IMAGE_BLENDS',
827    default     => 'yes',
828    description => 'Use a fast algorithm to blend the reference image',
829    help        => q`
830      To detect alarms ZoneMinder needs to blend the captured image
831      with the stored reference image to update it for comparison
832      with the next image. The reference blend percentage specified
833      for the monitor controls how much the new image affects the
834      reference image. There are two methods that are available for
835      this. If this option is set then fast calculation which does
836      not use any multiplication or division is used. This
837      calculation is extremely fast, however it limits the possible
838      blend percentages to 50%, 25%, 12.5%, 6.25%, 3.25% and 1.5%.
839      Any other blend percentage will be rounded to the nearest
840      possible one. The alternative is to switch this option off
841      and use standard blending instead, which is slower.
842      `,
843    type        => $types{boolean},
844    category    => 'config',
845  },
846  {
847    name        => 'ZM_OPT_ADAPTIVE_SKIP',
848    default     => 'yes',
849    description => 'Should frame analysis try and be efficient in skipping frames',
850    help        => q`
851      In previous versions of ZoneMinder the analysis daemon would
852      attempt to keep up with the capture daemon by processing the
853      last captured frame on each pass. This would sometimes have the
854      undesirable side-effect of missing a chunk of the initial
855      activity that caused the alarm because the pre-alarm frames
856      would all have to be written to disk and the database before
857      processing the next frame, leading to some delay between the
858      first and second event frames. Setting this option enables a
859      newer adaptive algorithm where the analysis daemon attempts to
860      process as many captured frames as possible, only skipping
861      frames when in danger of the capture daemon overwriting yet to
862      be processed frames. This skip is variable depending on the
863      size of the ring buffer and the amount of space left in it.
864      Enabling this option will give you much better coverage of the
865      beginning of alarms whilst biasing out any skipped frames
866      towards the middle or end of the event. However you should be
867      aware that this will have the effect of making the analysis
868      daemon run somewhat behind the capture daemon during events and
869      for particularly fast rates of capture it is possible for the
870      adaptive algorithm to be overwhelmed and not have time to react
871      to a rapid build up of pending frames and thus for a buffer
872      overrun condition to occur.
873      `,
874    type        => $types{boolean},
875    category    => 'config',
876  },
877  {
878    name        => 'ZM_MAX_SUSPEND_TIME',
879    default     => '30',
880    description => 'Maximum time that a monitor may have motion detection suspended',
881    help        => q`
882      ZoneMinder allows monitors to have motion detection to be
883      suspended, for instance while panning a camera. Ordinarily this
884      relies on the operator resuming motion detection afterwards as
885      failure to do so can leave a monitor in a permanently suspended
886      state. This setting allows you to set a maximum time which a
887      camera may be suspended for before it automatically resumes
888      motion detection. This time can be extended by subsequent
889      suspend indications after the first so continuous camera
890      movement will also occur while the monitor is suspended.
891      `,
892    type        => $types{integer},
893    category    => 'config',
894  },
895  {
896    name        => 'ZM_HTTP_VERSION',
897    default     => '1.0',
898    description => 'The version of HTTP that ZoneMinder will use to connect',
899    help        => q`
900      ZoneMinder can communicate with network cameras using either of
901      the HTTP/1.1 or HTTP/1.0 standard. A server will normally fall
902      back to the version it supports with no problem so this should
903      usually by left at the default. However it can be changed to
904      HTTP/1.0 if necessary to resolve particular issues.
905      `,
906    type        => {
907      db_type     => 'string',
908      hint        => '1.1|1.0',
909      pattern     => qr|^(1\.[01])$|,
910      format      => q( $1?$1:'' )
911    },
912    category    => 'network',
913  },
914  {
915    name        => 'ZM_HTTP_UA',
916    default     => 'ZoneMinder',
917    description => 'The user agent that ZoneMinder uses to identify itself',
918    help        => q`
919      When ZoneMinder communicates with remote cameras it will
920      identify itself using this string and it's version number. This
921      is normally sufficient, however if a particular cameras expects
922      only to communicate with certain browsers then this can be
923      changed to a different string identifying ZoneMinder as
924      Internet Explorer or Netscape etc.
925      `,
926    type        => $types{string},
927    category    => 'network',
928  },
929  {
930    name        => 'ZM_HTTP_TIMEOUT',
931    default     => '2500',
932    description => 'How long ZoneMinder waits before giving up on images (milliseconds)',
933    help        => q`
934      When retrieving remote images ZoneMinder will wait for this
935      length of time before deciding that an image is not going to
936      arrive and taking steps to retry. This timeout is in
937      milliseconds (1000 per second) and will apply to each part of
938      an image if it is not sent in one whole chunk.
939      `,
940    type        => $types{integer},
941    category    => 'network',
942  },
943  {
944    name        =>  'ZM_MIN_STREAMING_PORT',
945    default     =>  '',
946    description =>  'Alternate port range to contact for streaming video.',
947    help        =>  q`
948    Due to browsers only wanting to open 6 connections, if you have more
949    than 6 monitors, you can have trouble viewing more than 6.  This setting
950    specified the beginning of a port range that will be used to contact ZM
951    on.  Each monitor will use this value plus the Monitor Id to stream
952    content.  So a value of 2000 here will cause a stream for Monitor 1 to
953    hit port 2001.  Please ensure that you configure apache appropriately
954    to respond on these ports.`,
955    type  =>  $types{integer},
956    category  => 'network',
957  },
958  {
959    name        =>  'ZM_MIN_RTSP_PORT',
960    default     =>  '',
961    description =>  'Start of port range to contact for RTSP streaming video.',
962    help        =>  q`
963      The beginng of a port range that will be used to offer
964      RTSP streaming of live captured video.
965      Each monitor will use this value plus the Monitor Id to stream
966      content.  So a value of 2000 here will cause a stream for Monitor 1 to
967      hit port 2001.`,
968    type  =>  $types{integer},
969    category  => 'network',
970  },
971  {
972    name        => 'ZM_MIN_RTP_PORT',
973    default     => '40200',
974    description => 'Minimum port that ZoneMinder will listen for RTP traffic on',
975    help        => q`
976      When ZoneMinder communicates with MPEG4 capable cameras using
977      RTP with the unicast method it must open ports for the camera
978      to connect back to for control and streaming purposes. This
979      setting specifies the minimum port number that ZoneMinder will
980      use. Ordinarily two adjacent ports are used for each camera,
981      one for control packets and one for data packets. This port
982      should be set to an even number, you may also need to open up a
983      hole in your firewall to allow cameras to connect back if you
984      wish to use unicasting.
985      `,
986    type        => $types{integer},
987    category    => 'network',
988  },
989  {
990    name        => 'ZM_MAX_RTP_PORT',
991    default     => '40499',
992    description => 'Maximum port that ZoneMinder will listen for RTP traffic on',
993    help        => q`
994      When ZoneMinder communicates with MPEG4 capable cameras using
995      RTP with the unicast method it must open ports for the camera
996      to connect back to for control and streaming purposes. This
997      setting specifies the maximum port number that ZoneMinder will
998      use. Ordinarily two adjacent ports are used for each camera,
999      one for control packets and one for data packets. This port
1000      should be set to an even number, you may also need to open up a
1001      hole in your firewall to allow cameras to connect back if you
1002      wish to use unicasting. You should also ensure that you have
1003      opened up at least two ports for each monitor that will be
1004      connecting to unicasting network cameras.
1005      `,
1006    type        => $types{integer},
1007    category    => 'network',
1008  },
1009  {
1010    name        => 'ZM_OPT_FFMPEG',
1011    default     => '@OPT_FFMPEG@',
1012    description => 'Is the ffmpeg video encoder/decoder installed',
1013    help        => q`
1014      ZoneMinder can optionally encode a series of video images into
1015      an MPEG encoded movie file for viewing, downloading or storage.
1016      This option allows you to specify whether you have the ffmpeg
1017      tools installed. Note that creating MPEG files can be fairly
1018      CPU and disk intensive and is not a required option as events
1019      can still be reviewed as video streams without it.
1020      `,
1021    type        => $types{boolean},
1022    category    => 'images',
1023  },
1024  {
1025    name        => 'ZM_PATH_FFMPEG',
1026    default     => '@PATH_FFMPEG@',
1027    description => 'Path to (optional) ffmpeg mpeg encoder',
1028    help        => 'This path should point to where ffmpeg has been installed.',
1029    requires    => [ { name=>'ZM_OPT_FFMPEG', value=>'yes' } ],
1030    type        => $types{abs_path},
1031    category    => 'images',
1032  },
1033  {
1034    name        => 'ZM_FFMPEG_INPUT_OPTIONS',
1035    default     => '',
1036    description => 'Additional input options to ffmpeg',
1037    help        => q`
1038      Ffmpeg can take many options on the command line to control the
1039      quality of video produced. This option allows you to specify
1040      your own set that apply to the input to ffmpeg (options that
1041      are given before the -i option). Check the ffmpeg documentation
1042      for a full list of options which may be used here.
1043      `,
1044    requires    => [ { name=>'ZM_OPT_FFMPEG', value=>'yes' } ],
1045    type        => $types{string},
1046    category    => 'images',
1047  },
1048  {
1049    name        => 'ZM_FFMPEG_OUTPUT_OPTIONS',
1050    default     => '-r 25',
1051    description => 'Additional output options to ffmpeg',
1052    help        => q`
1053      Ffmpeg can take many options on the command line to control the
1054      quality of video produced. This option allows you to specify
1055      your own set that apply to the output from ffmpeg (options that
1056      are given after the -i option). Check the ffmpeg documentation
1057      for a full list of options which may be used here. The most
1058      common one will often be to force an output frame rate
1059      supported by the video encoder.
1060      `,
1061    requires    => [ { name=>'ZM_OPT_FFMPEG', value=>'yes' } ],
1062    type        => $types{string},
1063    category    => 'images',
1064  },
1065  {
1066    name        => 'ZM_FFMPEG_FORMATS',
1067    default     => 'mpg mpeg wmv asf avi* mov swf 3gp**',
1068    description => 'Formats to allow for ffmpeg video generation',
1069    help        => q`
1070      Ffmpeg can generate video in many different formats. This
1071      option allows you to list the ones you want to be able to
1072      select. As new formats are supported by ffmpeg you can add them
1073      here and be able to use them immediately. Adding a '*' after a
1074      format indicates that this will be the default format used for
1075      web video, adding '**' defines the default format for phone
1076      video.
1077      `,
1078    requires    => [ { name=>'ZM_OPT_FFMPEG', value=>'yes' } ],
1079    type        => $types{string},
1080    category    => 'images',
1081  },
1082  {
1083    name        => 'ZM_FFMPEG_OPEN_TIMEOUT',
1084    default     => '10',
1085    description => 'Timeout in seconds when opening a stream.',
1086    help        => q`
1087      When Ffmpeg is opening a stream, it can take a long time before
1088      failing; certain circumstances even seem to be able to lock
1089      indefinitely. This option allows you to set a maximum time in
1090      seconds to pass before closing the stream and trying to reopen
1091      it again.
1092      `,
1093    requires    => [ { name=>'ZM_OPT_FFMPEG', value=>'yes' } ],
1094    type        => $types{integer},
1095    category    => 'images',
1096  },
1097  {
1098    name        => 'ZM_LOG_LEVEL_SYSLOG',
1099    default     => '0',
1100    description => 'Save logging output to the system log',
1101    help        => q`
1102      ZoneMinder logging is now more integrated between
1103      components and allows you to specify the destination for
1104      logging output and the individual levels for each. This option
1105      lets you control the level of logging output that goes to the
1106      system log. ZoneMinder binaries have always logged to the
1107      system log but script and web logging is now included. To
1108      preserve the previous behaviour you should ensure this value is
1109      set to Info or Warning. This option controls the maximum level
1110      of logging that will be written, so Info includes Warnings and
1111      Errors etc. To disable entirely, set this option to None. You
1112      should use caution when setting this option to Debug as it can
1113      affect severely affect system performance. If you want debug
1114      you will also need to set a level and component below
1115      `,
1116    type        => {
1117      db_type     => 'integer',
1118      hint        => 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1',
1119      pattern     => qr|^(\d+)$|,
1120      format      => q( $1 )
1121    },
1122    category    => 'logging',
1123  },
1124  {
1125    name        => 'ZM_LOG_LEVEL_FILE',
1126    default     => '1',
1127    description => 'Save logging output to component files',
1128    help        => q`
1129      ZoneMinder logging is now more integrated between
1130      components and allows you to specify the destination for
1131      logging output and the individual levels for each. This option
1132      lets you control the level of logging output that goes to
1133      individual log files written by specific components. This is
1134      how logging worked previously and although useful for tracking
1135      down issues in specific components it also resulted in many
1136      disparate log files. To preserve this behaviour you should
1137      ensure this value is set to Info or Warning. This option
1138      controls the maximum level of logging that will be written, so
1139      Info includes Warnings and Errors etc. To disable entirely, set
1140      this option to None. You should use caution when setting this
1141      option to Debug as it can affect severely affect system
1142      performance though file output has less impact than the other
1143      options. If you want debug you will also need to set a level
1144      and component below
1145      `,
1146    type        => {
1147      db_type     => 'integer',
1148      hint        => 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1',
1149      pattern     => qr|^(\d+)$|,
1150      format      => q( $1 )
1151    },
1152    category    => 'logging',
1153  },
1154  {
1155    name        => 'ZM_LOG_LEVEL_WEBLOG',
1156    default     => '-5',
1157    description => 'Save logging output to the weblog',
1158    help        => q`
1159      ZoneMinder logging is now more integrated between
1160      components and allows you to specify the destination for
1161      logging output and the individual levels for each. This option
1162      lets you control the level of logging output from the web
1163      interface that goes to the httpd error log. Note that only web
1164      logging from PHP and JavaScript files is included and so this
1165      option is really only useful for investigating specific issues
1166      with those components. This option controls the maximum level
1167      of logging that will be written, so Info includes Warnings and
1168      Errors etc. To disable entirely, set this option to None. You
1169      should use caution when setting this option to Debug as it can
1170      affect severely affect system performance. If you want debug
1171      you will also need to set a level and component below
1172      `,
1173    type        => {
1174      db_type     => 'integer',
1175      hint        => 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1',
1176      pattern     => qr|^(\d+)$|,
1177      format      => q( $1 )
1178    },
1179    category    => 'logging',
1180  },
1181  {
1182    name        => 'ZM_LOG_LEVEL_DATABASE',
1183    default     => '0',
1184    description => 'Save logging output to the database',
1185    help        => q`
1186      ZoneMinder logging is now more integrated between
1187      components and allows you to specify the destination for
1188      logging output and the individual levels for each. This option
1189      lets you control the level of logging output that is written to
1190      the database. This is a new option which can make viewing
1191      logging output easier and more intuitive and also makes it
1192      easier to get an overall impression of how the system is
1193      performing. If you have a large or very busy system then it is
1194      possible that use of this option may slow your system down if
1195      the table becomes very large. Ensure you use the
1196      LOG_DATABASE_LIMIT option to keep the table to a manageable
1197      size. This option controls the maximum level of logging that
1198      will be written, so Info includes Warnings and Errors etc. To
1199      disable entirely, set this option to None. You should use
1200      caution when setting this option to Debug as it can affect
1201      severely affect system performance. If you want debug you will
1202      also need to set a level and component below
1203      `,
1204    type        => {
1205      db_type     => 'integer',
1206      hint        => 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1',
1207      pattern     => qr|^(\d+)$|,
1208      format      => q( $1 )
1209    },
1210    category    => 'logging',
1211  },
1212  {
1213    name        => 'ZM_LOG_DATABASE_LIMIT',
1214    default     => '7 day',
1215    description => 'Maximum number of log entries to retain',
1216    help        => q`
1217      If you are using database logging then it is possible to
1218      quickly build up a large number of entries in the Logs table.
1219      This option allows you to specify how many of these entries are
1220      kept. If you set this option to a number greater than zero then
1221      that number is used to determine the maximum number of rows,
1222      less than or equal to zero indicates no limit and is not
1223      recommended. You can also set this value to time values such as
1224      '<n> day' which will limit the log entries to those newer than
1225      that time. You can specify 'hour', 'day', 'week', 'month' and
1226      'year', note that the values should be singular (no 's' at the
1227      end). The Logs table is pruned periodically so it is possible
1228      for more than the expected number of rows to be present briefly
1229      in the meantime.
1230      `,
1231    type        => $types{string},
1232    category    => 'logging',
1233  },
1234  {
1235    name        => 'ZM_LOG_FFMPEG',
1236    default     => 'yes',
1237    description => 'Log FFMPEG messages',
1238    help        => q`
1239       When enabled (default is on), this option will log FFMPEG messages.
1240       FFMPEG messages can be useful when debugging streaming issues. However,
1241       depending on your distro and FFMPEG version, this may also result in
1242       more logs than you'd typically like to see. If all your streams are working
1243       well, you may choose to turn this off.
1244      `,
1245    type        => $types{boolean},
1246    category    => 'logging',
1247  },
1248{
1249    name        => 'ZM_LOG_DEBUG',
1250    default     => 'no',
1251    description => 'Switch debugging on',
1252    help        => q`
1253      ZoneMinder components usually support debug logging available
1254      to help with diagnosing problems. Binary components have
1255      several levels of debug whereas more other components have only
1256      one. Normally this is disabled to minimize performance
1257      penalties and avoid filling logs too quickly. This option lets
1258      you switch on other options that allow you to configure
1259      additional debug information to be output. Components will pick
1260      up this instruction when they are restarted.
1261      `,
1262    type        => $types{boolean},
1263    category    => 'logging',
1264  },
1265  {
1266    name        => 'ZM_LOG_DEBUG_TARGET',
1267    default     => '',
1268    description => 'What components should have extra debug enabled',
1269    help        => q`
1270      There are three scopes of debug available. Leaving this option
1271      blank means that all components will use extra debug (not
1272      recommended). Setting this option to '_<component>', e.g. _zmc,
1273      will limit extra debug to that component only. Setting this
1274      option to '_<component>_<identity>', e.g. '_zmc_m1' will limit
1275      extra debug to that instance of the component only. This is
1276      ordinarily what you probably want to do. To debug scripts use
1277      their names without the .pl extension, e.g. '_zmvideo' and to
1278      debug issues with the web interface use '_web'. You can specify
1279      multiple targets by separating them with '|' characters.
1280      `,
1281    requires    => [ { name => 'ZM_LOG_DEBUG', value => 'yes' } ],
1282    type        => $types{string},
1283    category    => 'logging',
1284  },
1285  {
1286    name        => 'ZM_LOG_DEBUG_LEVEL',
1287    default     => 1,
1288    description => 'What level of extra debug should be enabled',
1289    help        => q`
1290      There are 9 levels of debug available, with higher numbers
1291      being more debug and level 0 being no debug. However not all
1292      levels are used by all components. Also if there is debug at a
1293      high level it is usually likely to be output at such a volume
1294      that it may obstruct normal operation. For this reason you
1295      should set the level carefully and cautiously until the degree
1296      of debug you wish to see is present. Scripts and the web
1297      interface only have one level so this is an on/off type option
1298      for them.
1299      `,
1300    requires    => [ { name => 'ZM_LOG_DEBUG', value => 'yes' } ],
1301    type        => {
1302      db_type     => 'integer',
1303      hint        => '1|2|3|4|5|6|7|8|9',
1304      pattern     => qr|^(\d+)$|,
1305      format      => q( $1 )
1306    },
1307    category    => 'logging',
1308  },
1309  {
1310    name        => 'ZM_LOG_DEBUG_FILE',
1311    default     => '',
1312    description => 'Where extra debug is output to',
1313    help        => q`
1314      This option allows you to specify a different target for debug
1315      output. All components have a default log file which will
1316      norally be in /tmp or /var/log and this is where debug will be
1317      written to if this value is empty. Adding a path here will
1318      temporarily redirect debug, and other logging output, to this
1319      file. This option is a simple filename and you are debugging
1320      several components then they will all try and write to the same
1321      file with undesirable consequences. Appending a '+' to the
1322      filename will cause the file to be created with a '.<pid>'
1323      suffix containing your process id. In this way debug from each
1324      run of a component is kept separate. This is the recommended
1325      setting as it will also prevent subsequent runs from
1326      overwriting the same log. You should ensure that permissions
1327      are set up to allow writing to the file and directory specified
1328      here.
1329      `,
1330    requires    => [ { name => 'ZM_LOG_DEBUG', value => 'yes' } ],
1331    type        => $types{string},
1332    category    => 'logging',
1333  },
1334  {
1335    name        => 'ZM_LOG_CHECK_PERIOD',
1336    default     => '900',
1337    description => 'Time period used when calculating overall system health',
1338    help        => q`
1339      When ZoneMinder is logging events to the database it can
1340      retrospectively examine the number of warnings and errors that
1341      have occurred to calculate an overall state of system health.
1342      This option allows you to indicate what period of historical
1343      events are used in this calculation. This value is expressed in
1344      seconds and is ignored if LOG_LEVEL_DATABASE is set to None.
1345      `,
1346    type        => $types{integer},
1347    category    => 'logging',
1348  },
1349  {
1350    name        => 'ZM_LOG_ALERT_WAR_COUNT',
1351    default     => '1',
1352    description => 'Number of warnings indicating system alert state',
1353    help        => q`
1354      When ZoneMinder is logging events to the database it can
1355      retrospectively examine the number of warnings and errors that
1356      have occurred to calculate an overall state of system health.
1357      This option allows you to specify how many warnings must have
1358      occurred within the defined time period to generate an overall
1359      system alert state. A value of zero means warnings are not
1360      considered. This value is ignored if LOG_LEVEL_DATABASE is set
1361      to None.
1362      `,
1363    type        => $types{integer},
1364    category    => 'logging',
1365  },
1366  {
1367    name        => 'ZM_LOG_ALERT_ERR_COUNT',
1368    default     => '1',
1369    description => 'Number of errors indicating system alert state',
1370    help        => q`
1371      When ZoneMinder is logging events to the database it can
1372      retrospectively examine the number of warnings and errors that
1373      have occurred to calculate an overall state of system health.
1374      This option allows you to specify how many errors must have
1375      occurred within the defined time period to generate an overall
1376      system alert state. A value of zero means errors are not
1377      considered. This value is ignored if LOG_LEVEL_DATABASE is set
1378      to None.
1379      `,
1380    type        => $types{integer},
1381    category    => 'logging',
1382  },
1383  {
1384    name        => 'ZM_LOG_ALERT_FAT_COUNT',
1385    default     => '0',
1386    description => 'Number of fatal error indicating system alert state',
1387    help        => q`
1388      When ZoneMinder is logging events to the database it can
1389      retrospectively examine the number of warnings and errors that
1390      have occurred to calculate an overall state of system health.
1391      This option allows you to specify how many fatal errors
1392      (including panics) must have occurred within the defined time
1393      period to generate an overall system alert state. A value of
1394      zero means fatal errors are not considered. This value is
1395      ignored if LOG_LEVEL_DATABASE is set to None.
1396      `,
1397    type        => $types{integer},
1398    category    => 'logging',
1399  },
1400  {
1401    name        => 'ZM_LOG_ALARM_WAR_COUNT',
1402    default     => '100',
1403    description => 'Number of warnings indicating system alarm state',
1404    help        => q`
1405      When ZoneMinder is logging events to the database it can
1406      retrospectively examine the number of warnings and errors that
1407      have occurred to calculate an overall state of system health.
1408      This option allows you to specify how many warnings must have
1409      occurred within the defined time period to generate an overall
1410      system alarm state. A value of zero means warnings are not
1411      considered. This value is ignored if LOG_LEVEL_DATABASE is set
1412      to None.
1413      `,
1414    type        => $types{integer},
1415    category    => 'logging',
1416  },
1417  {
1418    name        => 'ZM_LOG_ALARM_ERR_COUNT',
1419    default     => '10',
1420    description => 'Number of errors indicating system alarm state',
1421    help        => q`
1422      When ZoneMinder is logging events to the database it can
1423      retrospectively examine the number of warnings and errors that
1424      have occurred to calculate an overall state of system health.
1425      This option allows you to specify how many errors must have
1426      occurred within the defined time period to generate an overall
1427      system alarm state. A value of zero means errors are not
1428      considered. This value is ignored if LOG_LEVEL_DATABASE is set
1429      to None.
1430      `,
1431    type        => $types{integer},
1432    category    => 'logging',
1433  },
1434  {
1435    name        => 'ZM_LOG_ALARM_FAT_COUNT',
1436    default     => '1',
1437    description => 'Number of fatal error indicating system alarm state',
1438    help        => q`
1439      When ZoneMinder is logging events to the database it can
1440      retrospectively examine the number of warnings and errors that
1441      have occurred to calculate an overall state of system health.
1442      This option allows you to specify how many fatal errors
1443      (including panics) must have occurred within the defined time
1444      period to generate an overall system alarm state. A value of
1445      zero means fatal errors are not considered. This value is
1446      ignored if LOG_LEVEL_DATABASE is set to None.
1447      `,
1448    type        => $types{integer},
1449    category    => 'logging',
1450  },
1451  {
1452    name        => 'ZM_RECORD_EVENT_STATS',
1453    default     => 'yes',
1454    description => 'Record event statistical information, switch off if too slow',
1455    help        => q`
1456      This version of ZoneMinder records detailed information about
1457      events in the Stats table. This can help in profiling what the
1458      optimum settings are for Zones though this is tricky at
1459      present. However in future releases this will be done more
1460      easily and intuitively, especially with a large sample of
1461      events. The default option of 'yes' allows this information to
1462      be collected now in readiness for this but if you are concerned
1463      about performance you can switch this off in which case no
1464      Stats information will be saved.
1465      `,
1466    type        => $types{boolean},
1467    category    => 'logging',
1468  },
1469  {
1470    name        => 'ZM_RECORD_DIAG_IMAGES',
1471    default     => 'no',
1472    description => 'Record intermediate alarm diagnostic images, can be very slow',
1473    help        => q`
1474      In addition to recording event statistics you can also record
1475      the intermediate diagnostic images that display the results of
1476      the various checks and processing that occur when trying to
1477      determine if an alarm event has taken place. There are several
1478      of these images generated for each frame and zone for each
1479      alarm or alert frame so this can have a massive impact on
1480      performance. Only switch this setting on for debug or analysis
1481      purposes and remember to switch it off again once no longer
1482      required.
1483      `,
1484    type        => $types{boolean},
1485    category    => 'logging',
1486  },
1487  {
1488    name        => 'ZM_DUMP_CORES',
1489    default     => 'no',
1490    description => 'Create core files on unexpected process failure.',
1491    help        => q`
1492      When an unrecoverable error occurs in a ZoneMinder binary
1493      process is has traditionally been trapped and the details
1494      written to logs to aid in remote analysis. However in some
1495      cases it is easier to diagnose the error if a core file, which
1496      is a memory dump of the process at the time of the error, is
1497      created. This can be interactively analysed in the debugger and
1498      may reveal more or better information than that available from
1499      the logs. This option is recommended for advanced users only
1500      otherwise leave at the default. Note using this option to
1501      trigger core files will mean that there will be no indication
1502      in the binary logs that a process has died, they will just
1503      stop, however the zmdc log will still contain an entry. Also
1504      note that you may have to explicitly enable core file creation
1505      on your system via the 'ulimit -c' command or other means
1506      otherwise no file will be created regardless of the value of
1507      this option.
1508      `,
1509    type        => $types{boolean},
1510    category    => 'logging',
1511  },
1512  {
1513    name        => 'ZM_WEB_NAVBAR_TYPE',
1514    default     => 'normal',
1515    description => 'Style of the web console navigation bar',
1516    help        => q`
1517      Choose between different navigation bar styles for the web
1518      console. The "normal" style has a menu across the top, which
1519      collapses to a pull down menu on small screens. The "collapsed"
1520      style is collapsed all the time. Instead of a menu across the
1521      top, menu items are accessed from the drop down menu on the
1522      right.
1523      `,
1524    type        => {
1525      db_type     => 'string',
1526      hint        => 'normal|collapsed',
1527      pattern     => qr|^([nc])|i,
1528      format      => q( ($1 =~ /^n/) ? 'normal' : 'collapsed' )
1529    },
1530    category    => 'web',
1531  },
1532  {
1533    name        => 'ZM_WEB_TITLE',
1534    default     => 'ZoneMinder',
1535    description => 'The title displayed wherever the site references itself.',
1536    help        => q`
1537      If you want the site to identify as something other than ZoneMinder, change this here.
1538      It can be used to more accurately identify this installation from others.
1539      `,
1540    type        => $types{string},
1541    category    => 'web',
1542  },
1543  {
1544    name        => 'ZM_WEB_TITLE_PREFIX',
1545    default     => 'ZM',
1546    description => 'The title prefix displayed on each window',
1547    help        => q`
1548      If you have more than one installation of ZoneMinder it can be
1549      helpful to display different titles for each one. Changing this
1550      option allows you to customise the window titles to include
1551      further information to aid identification.
1552      `,
1553    type        => $types{string},
1554    category    => 'web',
1555  },
1556  {
1557    name        => 'ZM_HOME_URL',
1558    default     => 'http://zoneminder.com',
1559    description => 'The url used in the home/logo area of the navigation bar.',
1560    help        => q`
1561      By default this takes you to the zoneminder.com website,
1562      but perhaps you would prefer it to take you somewhere else.
1563      `,
1564    type        => $types{string},
1565    category    => 'web',
1566  },
1567  {
1568    name        => 'ZM_HOME_CONTENT',
1569    default     => 'ZoneMinder',
1570    description => 'The content of the home button.',
1571    help        => q`
1572      You may wish to set this to empty if you are using css to put a background image on it.
1573      `,
1574    type        => $types{string},
1575    category    => 'web',
1576  },
1577  {
1578    name        => 'ZM_HOME_ABOUT',
1579    default     => 'yes',
1580    description => 'Whether to enable the ZoneMinder About menu.',
1581    help        => q`
1582      When enabled, the ZoneMinder logo in the top left corner of the
1583      navigation bar becomes a menu with links to: the ZoneMinder
1584      website, ZoneMinder Documentation, and the ZoneMinder forum.
1585      End users wishing to rebrand their system may want to disable this
1586      as the menu items are currently hard coded.
1587      `,
1588    type        => $types{boolean},
1589    category    => 'web',
1590  },
1591  {
1592    name        => 'ZM_WEB_CONSOLE_BANNER',
1593    default     => '',
1594    description => 'Arbitrary text message near the top of the console',
1595    help        => q`
1596      Allows the administrator to place an arbitrary text message
1597      near the top of the web console. This is useful for the developers
1598      to display a message which indicates the running instance of
1599      ZoneMinder is a development snapshot, but it can also be used for
1600      any other purpose as well.
1601      `,
1602    type        => $types{string},
1603    category    => 'web',
1604  },
1605  {
1606    name        => 'ZM_WEB_EVENT_DISK_SPACE',
1607    default     => 'no',
1608    description => 'Whether to show disk space used by each event.',
1609    help        => q`
1610      Adds another column to the listing of events
1611      showing the disk space used by the event.  This will impart a small
1612      overhead as it will call du on the event directory.  In practice
1613      this overhead is fairly small but may be noticeable on IO-constrained
1614      systems.
1615      `,
1616    type        => $types{boolean},
1617    category    => 'web',
1618  },
1619  {
1620    name        => 'ZM_WEB_RESIZE_CONSOLE',
1621    default     => 'yes',
1622    description => 'Should the console window resize itself to fit',
1623    help        => q`
1624      Traditionally the main ZoneMinder web console window has
1625      resized itself to shrink to a size small enough to list only
1626      the monitors that are actually present. This is intended to
1627      make the window more unobtrusize but may not be to everyone's
1628      tastes, especially if opened in a tab in browsers which support
1629      this kind if layout. Switch this option off to have the console
1630      window size left to the users preference
1631      `,
1632    type        => $types{boolean},
1633    category    => 'web',
1634  },
1635  {
1636    name        => 'ZM_WEB_ID_ON_CONSOLE',
1637    default     => 'no',
1638    description => 'Should the console list the monitor id',
1639    help        => q`
1640      Some find it useful to have the id always visible
1641      on the console. This option will add a column listing it.
1642      `,
1643    type        => $types{boolean},
1644    category    => 'web',
1645  },
1646  {
1647    name        => 'ZM_WEB_POPUP_ON_ALARM',
1648    default     => 'yes',
1649    description => 'Should the monitor window jump to the top if an alarm occurs',
1650    help        => q`
1651      When viewing a live monitor stream you can specify whether you
1652      want the window to pop to the front if an alarm occurs when the
1653      window is minimised or behind another window. This is most
1654      useful if your monitors are over doors for example when they
1655      can pop up if someone comes to the doorway.
1656      `,
1657    type        => $types{boolean},
1658    category    => 'web',
1659  },
1660  {
1661    name        => 'ZM_OPT_X10',
1662    default     => 'no',
1663    description => 'Support interfacing with X10 devices',
1664    help        => q`
1665      If you have an X10 Home Automation setup in your home you can
1666      use ZoneMinder to initiate or react to X10 signals if your
1667      computer has the appropriate interface controller. This option
1668      indicates whether X10 options will be available in the browser
1669      client.
1670      `,
1671    type        => $types{boolean},
1672    category    => 'x10',
1673  },
1674  {
1675    name        => 'ZM_X10_DEVICE',
1676    default     => '/dev/ttyS0',
1677    description => 'What device is your X10 controller connected on',
1678    requires    => [ { name => 'ZM_OPT_X10', value => 'yes' } ],
1679    help        => q`
1680      If you have an X10 controller device (e.g. XM10U) connected to
1681      your computer this option details which port it is connected on,
1682      the default of /dev/ttyS0 maps to serial or com port 1.
1683      `,
1684    type        => $types{abs_path},
1685    category    => 'x10',
1686  },
1687  {
1688    name        => 'ZM_X10_HOUSE_CODE',
1689    default     => 'A',
1690    description => 'What X10 house code should be used',
1691    requires    => [ { name => 'ZM_OPT_X10', value => 'yes' } ],
1692    help        => q`
1693      X10 devices are grouped together by identifying them as all
1694      belonging to one House Code. This option details what that is.
1695      It should be a single letter between A and P.
1696      `,
1697    type        => { db_type=>'string', hint=>'A-P', pattern=>qr|^([A-P])|i, format=>q( uc($1) ) },
1698    category    => 'x10',
1699  },
1700  {
1701    name        => 'ZM_X10_DB_RELOAD_INTERVAL',
1702    default     => '60',
1703    description => 'How often (in seconds) the X10 daemon reloads the monitors from the database',
1704    requires    => [ { name => 'ZM_OPT_X10', value => 'yes' } ],
1705    help        => q`
1706      The zmx10 daemon periodically checks the database to find out
1707      what X10 events trigger, or result from, alarms. This option
1708      determines how frequently this check occurs, unless you change
1709      this area frequently this can be a fairly large value.
1710      `,
1711    type        => $types{integer},
1712    category    => 'x10',
1713  },
1714  {
1715    name        => 'ZM_WEB_SOUND_ON_ALARM',
1716    default     => 'no',
1717    description => 'Should the monitor window play a sound if an alarm occurs',
1718    help        => q`
1719      When viewing a live monitor stream you can specify whether you
1720      want the window to play a sound to alert you if an alarm
1721      occurs.
1722      `,
1723    type        => $types{boolean},
1724    category    => 'web',
1725  },
1726  {
1727    name        => 'ZM_WEB_ALARM_SOUND',
1728    default     => '',
1729    description => 'The sound to play on alarm, put this in the sounds directory',
1730    help        => q`
1731      You can specify a sound file to play if an alarm occurs whilst
1732      you are watching a live monitor stream. So long as your browser
1733      understands the format it does not need to be any particular
1734      type. This file should be placed in the sounds directory
1735      defined earlier.
1736      `,
1737    type        => $types{file},
1738    requires    => [ { name => 'ZM_WEB_SOUND_ON_ALARM', value => 'yes' } ],
1739    category    => 'web',
1740  },
1741  {
1742    name        => 'ZM_WEB_COMPACT_MONTAGE',
1743    default     => 'no',
1744    description => 'Compact the montage view by removing extra detail',
1745    help        => q`
1746      The montage view shows the output of all of your active
1747      monitors in one window. This include a small menu and status
1748      information for each one. This can increase the web traffic and
1749      make the window larger than may be desired. Setting this option
1750      on removes all this extraneous information and just displays
1751      the images.
1752      `,
1753    type        => $types{boolean},
1754    category    => 'web',
1755  },
1756  {
1757    name        => 'ZM_OPT_FAST_DELETE',
1758    default     => 'no',
1759    description => 'Delete only event database records for speed',
1760    help        => q`
1761      Normally an event created as the result of an alarm consists of
1762      entries in one or more database tables plus the various files
1763      associated with it. When deleting events in the browser it can
1764      take a long time to remove all of this if your are trying to do
1765      a lot of events at once. It is recommended that you set this
1766      option which means that the browser client only deletes the key
1767      entries in the events table, which means the events will no
1768      longer appear in the listing, and leaves the zmaudit daemon to
1769      clear up the rest later. Note that this feature is less relevant
1770      with modern hardware. Recommend this feature be left off.
1771      `,
1772    type        => $types{boolean},
1773    category    => 'system',
1774  },
1775  {
1776    name        => 'ZM_STRICT_VIDEO_CONFIG',
1777    default     => 'yes',
1778    description => 'Allow errors in setting video config to be fatal',
1779    help        => q`
1780      With some video devices errors can be reported in setting the
1781      various video attributes when in fact the operation was
1782      successful. Switching this option off will still allow these
1783      errors to be reported but will not cause them to kill the video
1784      capture daemon. Note however that doing this will cause all
1785      errors to be ignored including those which are genuine and
1786      which may cause the video capture to not function correctly.
1787      Use this option with caution.
1788      `,
1789    type        => $types{boolean},
1790    category    => 'config',
1791  },
1792  {
1793    name          =>  'ZM_LD_PRELOAD',
1794    default       =>  '',
1795    description   =>  "Path to library to preload before launching daemons",
1796    help          => q`
1797      Some older cameras require the use of the v4l1 compat
1798      library. This setting allows the setting of the path
1799      to the library, so that it can be loaded by zmdc.pl
1800      before launching zmc.
1801      `,
1802    type          =>  $types{abs_path},
1803    category      =>  'config',
1804  },
1805  {
1806    name        => 'ZM_V4L_MULTI_BUFFER',
1807    default     => 'yes',
1808    description => 'Use more than one buffer for Video 4 Linux devices',
1809    help        => q`
1810      Performance when using Video 4 Linux devices is usually best if
1811      multiple buffers are used allowing the next image to be
1812      captured while the previous one is being processed. If you have
1813      multiple devices on a card sharing one input that requires
1814      switching then this approach can sometimes cause frames from
1815      one source to be mixed up with frames from another. Switching
1816      this option off prevents multi buffering resulting in slower
1817      but more stable image capture. This option is ignored for
1818      non-local cameras or if only one input is present on a capture
1819      chip. This option addresses a similar problem to the
1820      ZM_CAPTURES_PER_FRAME option and you should normally change the
1821      value of only one of the options at a time.  If you have
1822      different capture cards that need different values you can
1823      override them in each individual monitor on the source page.
1824      `,
1825    type        => $types{boolean},
1826    category    => 'config',
1827  },
1828  {
1829    name        => 'ZM_CAPTURES_PER_FRAME',
1830    default     => '1',
1831    description => 'How many images are captured per returned frame, for shared local cameras',
1832    help        => q`
1833      If you are using cameras attached to a video capture card which
1834      forces multiple inputs to share one capture chip, it can
1835      sometimes produce images with interlaced frames reversed
1836      resulting in poor image quality and a distinctive comb edge
1837      appearance. Increasing this setting allows you to force
1838      additional image captures before one is selected as the
1839      captured frame. This allows the capture hardware to 'settle
1840      down' and produce better quality images at the price of lesser
1841      capture rates. This option has no effect on (a) network
1842      cameras, or (b) where multiple inputs do not share a capture
1843      chip. This option addresses a similar problem to the
1844      ZM_V4L_MULTI_BUFFER option and you should normally change the
1845      value of only one of the options at a time.  If you have
1846      different capture cards that need different values you can
1847      override them in each individual monitor on the source page.
1848      `,
1849    type        => $types{integer},
1850    category    => 'config',
1851  },
1852  {
1853    name        => 'ZM_FILTER_RELOAD_DELAY',
1854    default     => '300',
1855    description => 'How often (in seconds) filters are reloaded in zmfilter',
1856    help        => q`
1857      ZoneMinder allows you to save filters to the database which
1858      allow events that match certain criteria to be emailed, deleted
1859      or uploaded to a remote machine etc. The zmfilter daemon loads
1860      these and does the actual operation. This option determines how
1861      often the filters are reloaded from the database to get the
1862      latest versions or new filters. If you don't change filters
1863      very often this value can be set to a large value.
1864      `,
1865    type        => $types{integer},
1866    category    => 'system',
1867  },
1868  {
1869    name        => 'ZM_FILTER_EXECUTE_INTERVAL',
1870    default     => '60',
1871    description => 'How often (in seconds) to run automatic saved filters',
1872    help        => q`
1873      ZoneMinder allows you to save filters to the database which
1874      allow events that match certain criteria to be emailed, deleted
1875      or uploaded to a remote machine etc. The zmfilter daemon loads
1876      these and does the actual operation. This option determines how
1877      often the filters are executed on the saved event in the
1878      database. If you want a rapid response to new events this
1879      should be a smaller value, however this may increase the
1880      overall load on the system and affect performance of other
1881      elements.
1882      `,
1883    type        => $types{integer},
1884    category    => 'system',
1885  },
1886  {
1887    name        => 'ZM_OPT_UPLOAD',
1888    default     => 'no',
1889    description => 'Should ZoneMinder support uploading events from filters',
1890    help        => q`
1891      In ZoneMinder you can create event filters that specify whether
1892      events that match certain criteria should be uploaded to a
1893      remote server for archiving. This option specifies whether this
1894      functionality should be available
1895      `,
1896    type        => $types{boolean},
1897    category    => 'upload',
1898  },
1899  {
1900    name        => 'ZM_UPLOAD_ARCH_FORMAT',
1901    default     => 'tar',
1902    description => 'What format the uploaded events should be created in.',
1903    requires    => [ { name => 'ZM_OPT_UPLOAD', value => 'yes' } ],
1904    help        => q`
1905      Uploaded events may be stored in either .tar or .zip format,
1906      this option specifies which. Note that to use this you will
1907      need to have the Archive::Tar and/or Archive::Zip perl modules
1908      installed.
1909      `,
1910    type        => {
1911      db_type     =>'string',
1912      hint        =>'tar|zip',
1913      pattern     =>qr|^([tz])|i,
1914      format      =>q( $1 =~ /^t/ ? 'tar' : 'zip' )
1915    },
1916    category    => 'upload',
1917  },
1918  {
1919    name        => 'ZM_UPLOAD_ARCH_COMPRESS',
1920    default     => 'no',
1921    description => 'Should archive files be compressed',
1922    help        => q`
1923      When the archive files are created they can be compressed.
1924      However in general since the images are compressed already this
1925      saves only a minimal amount of space versus utilising more CPU
1926      in their creation. Only enable if you have CPU to waste and are
1927      limited in disk space on your remote server or bandwidth.
1928      `,
1929    requires    => [ { name => 'ZM_OPT_UPLOAD', value => 'yes' } ],
1930    type        => $types{boolean},
1931    category    => 'upload',
1932  },
1933  {
1934    name        => 'ZM_UPLOAD_ARCH_ANALYSE',
1935    default     => 'no',
1936    description => 'Include the analysis files in the archive',
1937    help        => q`
1938      When the archive files are created they can contain either just
1939      the captured frames or both the captured frames and, for frames
1940      that caused an alarm, the analysed image with the changed area
1941      highlighted. This option controls files are included. Only
1942      include analysed frames if you have a high bandwidth connection
1943      to the remote server or if you need help in figuring out what
1944      caused an alarm in the first place as archives with these files
1945      in can be considerably larger.
1946      `,
1947    requires    => [ { name => 'ZM_OPT_UPLOAD', value => 'yes' } ],
1948    type        => $types{boolean},
1949    category    => 'upload',
1950  },
1951  {
1952    name        => 'ZM_UPLOAD_PROTOCOL',
1953    default     => 'ftp',
1954    description => 'What protocol to use to upload events',
1955    requires    => [ { name => 'ZM_OPT_UPLOAD', value => 'yes' } ],
1956    help        => q`
1957      ZoneMinder can upload events to a remote server using either
1958      FTP or SFTP. Regular FTP is widely supported but not
1959      necessarily very secure whereas SFTP (Secure FTP) runs over an
1960      ssh connection and so is encrypted and uses regular ssh ports.
1961      Note that to use this you will need to have the appropriate
1962      perl module, either Net::FTP or Net::SFTP installed depending
1963      on your choice.
1964      `,
1965    type        => {
1966      db_type     =>'string',
1967      hint        =>'ftp|sftp',
1968      pattern     =>qr|^([tz])|i,
1969      format      =>q( $1 =~ /^f/ ? 'ftp' : 'sftp' )
1970    },
1971    category    => 'upload',
1972  },
1973  {
1974    name        => 'ZM_UPLOAD_HOST',
1975    default     => '',
1976    description => 'The remote server to upload events to',
1977    help        => q`
1978      You can use filters to instruct ZoneMinder to upload events to
1979      a remote server. This option indicates the name, or ip address,
1980      of the server to use.
1981      `,
1982    requires    => [ { name => 'ZM_OPT_UPLOAD', value => 'yes' } ],
1983    type        => $types{hostname},
1984    category    => 'upload',
1985  },
1986  {
1987    name        => 'ZM_UPLOAD_PORT',
1988    default     => '',
1989    description => 'The port on the remote upload server, if not the default (SFTP only)',
1990    help        => q`
1991      You can use filters to instruct ZoneMinder to upload events to
1992      a remote server. If you are using the SFTP protocol then this
1993      option allows you to specify a particular port to use for
1994      connection. If this option is left blank then the default, port
1995      22, is used. This option is ignored for FTP uploads.
1996      `,
1997    requires    => [ { name => 'ZM_OPT_UPLOAD', value => 'yes' } ],
1998    type        => $types{integer},
1999    category    => 'upload',
2000  },
2001  {
2002    name        => 'ZM_UPLOAD_USER',
2003    default     => '',
2004    description => 'Remote server username',
2005    help        => q`
2006      You can use filters to instruct ZoneMinder to upload events to
2007      a remote server. This option indicates the username that
2008      ZoneMinder should use to log in for transfer.
2009      `,
2010    requires    => [ { name => 'ZM_OPT_UPLOAD', value => 'yes' } ],
2011    type        => $types{alphanum},
2012    category    => 'upload',
2013  },
2014  {
2015    name        => 'ZM_UPLOAD_PASS',
2016    default     => '',
2017    description => 'Remote server password',
2018    help        => q`
2019      You can use filters to instruct ZoneMinder to upload events to
2020      a remote server. This option indicates the password that
2021      ZoneMinder should use to log in for transfer. If you are using
2022      certificate based logins for SFTP servers you can leave this
2023      option blank.
2024      `,
2025    requires    => [ { name => 'ZM_OPT_UPLOAD', value => 'yes' } ],
2026    type        => $types{string},
2027    category    => 'upload',
2028  },
2029  {
2030    name        => 'ZM_UPLOAD_LOC_DIR',
2031    default     => '@ZM_TMPDIR@',
2032    description => 'The local directory in which to create upload files',
2033    help        => q`
2034      You can use filters to instruct ZoneMinder to upload events to
2035      a remote server. This option indicates the local directory that
2036      ZoneMinder should use for temporary upload files. These are
2037      files that are created from events, uploaded and then deleted.
2038      `,
2039    requires    => [ { name => 'ZM_OPT_UPLOAD', value => 'yes' } ],
2040    type        => $types{abs_path},
2041    category    => 'upload',
2042  },
2043  {
2044    name        => 'ZM_UPLOAD_REM_DIR',
2045    default     => '',
2046    description => 'The remote directory to upload to',
2047    help        => q`
2048      You can use filters to instruct ZoneMinder to upload events to
2049      a remote server. This option indicates the remote directory
2050      that ZoneMinder should use to upload event files to.
2051      `,
2052    requires    => [ { name => 'ZM_OPT_UPLOAD', value => 'yes' } ],
2053    type        => $types{rel_path},
2054    category    => 'upload',
2055  },
2056  {
2057    name        => 'ZM_UPLOAD_TIMEOUT',
2058    default     => '120',
2059    description => 'How long to allow the transfer to take for each file',
2060    help        => q`
2061      You can use filters to instruct ZoneMinder to upload events to
2062      a remote server. This option indicates the maximum inactivity
2063      timeout (in seconds) that should be tolerated before ZoneMinder
2064      determines that the transfer has failed and closes down the
2065      connection.
2066      `,
2067    requires    => [ { name => 'ZM_OPT_UPLOAD', value => 'yes' } ],
2068    type        => $types{integer},
2069    category    => 'upload',
2070  },
2071  {
2072    name        => 'ZM_UPLOAD_STRICT',
2073    default     => 'no',
2074    description => 'Require strict host key checking for SFTP uploads',
2075    help        => q`
2076      You can require SFTP uploads to verify the host key of the remote server
2077      for protection against man-in-the-middle attacks. You will need to add the
2078      server's key to the known_hosts file. On most systems, this will be
2079      ~/.ssh/known_hosts, where ~ is the home directory of the web server running
2080      ZoneMinder.
2081      `,
2082    requires    => [ { name => 'ZM_OPT_UPLOAD', value => 'yes' } ],
2083    type        => $types{boolean},
2084    category    => 'upload',
2085  },
2086  {
2087    name        => 'ZM_UPLOAD_FTP_PASSIVE',
2088    default     => 'yes',
2089    description => 'Use passive ftp when uploading',
2090    help        => q`
2091      You can use filters to instruct ZoneMinder to upload events to
2092      a remote ftp server. This option indicates that ftp transfers
2093      should be done in passive mode. This uses a single connection
2094      for all ftp activity and, whilst slower than active transfers,
2095      is more robust and likely to work from behind firewalls. This
2096      option is ignored for SFTP transfers.
2097      `,
2098    requires    => [ { name => 'ZM_OPT_UPLOAD', value => 'yes' } ],
2099    help        => q`
2100      If your computer is behind a firewall or proxy you may need to
2101      set FTP to passive mode. In fact for simple transfers it makes
2102      little sense to do otherwise anyway but you can set this to
2103      'No' if you wish.
2104      `,
2105    type        => $types{boolean},
2106    category    => 'upload',
2107  },
2108  {
2109    name        => 'ZM_UPLOAD_DEBUG',
2110    default     => 'no',
2111    description => 'Switch upload debugging on',
2112    help        => q`
2113      You can use filters to instruct ZoneMinder to upload events to
2114      a remote server. If you are having (or expecting) troubles with
2115      uploading events then setting this to 'yes' permits additional
2116      information to be generated by the underlying transfer modules
2117      and included in the logs.
2118      `,
2119    requires    => [ { name => 'ZM_OPT_UPLOAD', value => 'yes' } ],
2120    type        => $types{boolean},
2121    category    => 'upload',
2122  },
2123  {
2124    name        => 'ZM_OPT_EMAIL',
2125    default     => 'no',
2126    description => 'Should ZoneMinder email you details of events that match corresponding filters',
2127    help        => q`
2128      In ZoneMinder you can create event filters that specify whether
2129      events that match certain criteria should have their details
2130      emailed to you at a designated email address. This will allow
2131      you to be notified of events as soon as they occur and also to
2132      quickly view the events directly. This option specifies whether
2133      this functionality should be available. The email created with
2134      this option can be any size and is intended to be sent to a
2135      regular email reader rather than a mobile device.
2136      `,
2137    type        => $types{boolean},
2138    category    => 'mail',
2139  },
2140  {
2141    name        => 'ZM_OPT_MESSAGE',
2142    default     => 'no',
2143    description => 'Should ZoneMinder message you with details of events that match corresponding filters',
2144    help        => q`
2145      In ZoneMinder you can create event filters that specify whether
2146      events that match certain criteria should have their details
2147      sent to you at a designated short message email address. This
2148      will allow you to be notified of events as soon as they occur.
2149      This option specifies whether this functionality should be
2150      available. The email created by this option will be brief and
2151      is intended to be sent to an SMS gateway or a minimal mail
2152      reader such as a mobile device or phone rather than a regular
2153      email reader.
2154      `,
2155    type        => $types{boolean},
2156    category    => 'mail',
2157  },
2158  {
2159    name        => 'ZM_MESSAGE_ADDRESS',
2160    default     => '',
2161    description => 'The email address to send matching event details to',
2162    requires    => [ { name => 'ZM_OPT_MESSAGE', value => 'yes' } ],
2163    help        => q`
2164      This option is used to define the short message email address
2165      that any events that match the appropriate filters will be sent
2166      to.
2167      `,
2168    type        => $types{email},
2169    category    => 'mail',
2170  },
2171  {
2172    name        => 'ZM_MESSAGE_SUBJECT',
2173    default     => 'ZoneMinder: Alarm - %MN%-%EI%',
2174    description => 'The subject of the message used to send matching event details',
2175    requires    => [ { name => 'ZM_OPT_MESSAGE', value => 'yes' } ],
2176    help        => q`
2177      This option is used to define the subject of the message that
2178      is sent for any events that match the appropriate filters.
2179      `,
2180    type        => $types{string},
2181    category    => 'mail',
2182  },
2183  {
2184    name        => 'ZM_MESSAGE_BODY',
2185    default     => 'ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.',
2186    description => 'The body of the message used to send matching event details',
2187    requires    => [ { name => 'ZM_OPT_MESSAGE', value => 'yes' } ],
2188    help        => q`
2189      This option is used to define the content of the message that
2190      is sent for any events that match the appropriate filters.
2191      `,
2192    type        => $types{text},
2193    category    => 'mail',
2194  },
2195  {
2196    name        => 'ZM_NEW_MAIL_MODULES',
2197    default     => 'no',
2198    description => 'Use a newer perl method to send emails',
2199    requires    => [
2200    { name => 'ZM_OPT_EMAIL', value => 'yes' },
2201    { name => 'ZM_OPT_MESSAGE', value => 'yes' }
2202    ],
2203    help        => q`
2204      Traditionally ZoneMinder has used the MIME::Entity perl module
2205      to construct and send notification emails and messages. Some
2206      people have reported problems with this module not being
2207      present at all or flexible enough for their needs. If you are
2208      one of those people this option allows you to select a new
2209      mailing method using MIME::Lite and Net::SMTP instead. This
2210      method was contributed by Ross Melin and should work for
2211      everyone but has not been extensively tested so currently is
2212      not selected by default.
2213      `,
2214    type        => $types{boolean},
2215    category    => 'mail',
2216  },
2217  {
2218    name        => 'ZM_EMAIL_HOST',
2219    default     => 'localhost',
2220    description => 'The host address of your SMTP mail server',
2221    requires    => [
2222    { name => 'ZM_OPT_EMAIL', value => 'yes' },
2223    { name => 'ZM_OPT_MESSAGE', value => 'yes' }
2224    ],
2225    help        => q`
2226      If you have chosen SMTP as the method by which to send
2227      notification emails or messages then this option allows you to
2228      choose which SMTP server to use to send them. The default of
2229      localhost may work if you have the sendmail, exim or a similar
2230      daemon running however you may wish to enter your ISP's SMTP
2231      mail server here.
2232      `,
2233    type        => $types{hostname},
2234    category    => 'mail',
2235  },
2236  {
2237    name        => 'ZM_FROM_EMAIL',
2238    default     => '',
2239    description => 'The email address you wish your event notifications to originate from',
2240    requires    => [
2241    { name => 'ZM_OPT_EMAIL', value => 'yes' },
2242    { name => 'ZM_OPT_MESSAGE', value => 'yes' }
2243    ],
2244    help        => q`
2245      The emails or messages that will be sent to you informing you
2246      of events can appear to come from a designated email address to
2247      help you with mail filtering etc. An address of something like
2248      ZoneMinder\@your.domain is recommended.
2249      `,
2250    type        => $types{email},
2251    category    => 'mail',
2252  },
2253  {
2254    name        => 'ZM_URL',
2255    default     => '',
2256    description => 'The URL of your ZoneMinder installation',
2257    requires    => [
2258    { name => 'ZM_OPT_EMAIL', value => 'yes' },
2259    { name => 'ZM_OPT_MESSAGE', value => 'yes' }
2260    ],
2261    help        => q`
2262      The emails or messages that will be sent to you informing you
2263      of events can include a link to the events themselves for easy
2264      viewing. If you intend to use this feature then set this option
2265      to the url of your installation as it would appear from where
2266      you read your email, e.g. http://host.your.domain/zm.php.
2267      `,
2268    type        => $types{url},
2269    category    => 'mail',
2270  },
2271  {
2272    name        => 'ZM_MAX_RESTART_DELAY',
2273    default     => '600',
2274    description => 'Maximum delay (in seconds) for daemon restart attempts.',
2275    help        => q`
2276      The zmdc (zm daemon control) process controls when processeses
2277      are started or stopped and will attempt to restart any that
2278      fail. If a daemon fails frequently then a delay is introduced
2279      between each restart attempt. If the daemon stills fails then
2280      this delay is increased to prevent extra load being placed on
2281      the system by continual restarts. This option controls what
2282      this maximum delay is.
2283      `,
2284    type        => $types{integer},
2285    category    => 'system',
2286  },
2287  {
2288    name        => 'ZM_STATS_UPDATE_INTERVAL',
2289    default     => '60',
2290    description => 'How often to update the database statistics',
2291    help        => q`
2292      The zmstats daemon performs various db queries that may take
2293      a long time in the background.
2294      `,
2295    type        => $types{integer},
2296    category    => 'system',
2297  },
2298  {
2299    name        => 'ZM_WATCH_CHECK_INTERVAL',
2300    default     => '10',
2301    description => 'How often to check the capture daemons have not locked up',
2302    help        => q`
2303      The zmwatch daemon checks the image capture performance of the
2304      capture daemons to ensure that they have not locked up (rarely
2305      a sync error may occur which blocks indefinitely). This option
2306      determines how often the daemons are checked.
2307      `,
2308    type        => $types{integer},
2309    category    => 'system',
2310  },
2311  {
2312    name        => 'ZM_WATCH_MAX_DELAY',
2313    default     => '45',
2314    description => 'The maximum delay allowed since the last captured image',
2315    help        => q`
2316      The zmwatch daemon checks the image capture performance of the
2317      capture daemons to ensure that they have not locked up (rarely
2318      a sync error may occur which blocks indefinitely). This option
2319      determines the maximum delay to allow since the last captured
2320      frame. The daemon will be restarted if it has not captured any
2321      images after this period though the actual restart may take
2322      slightly longer in conjunction with the check interval value
2323      above.
2324      `,
2325    type        => $types{decimal},
2326    category    => 'system',
2327  },
2328  {
2329    name        => 'ZM_RUN_AUDIT',
2330    default     => 'no',
2331    description => 'Run zmaudit to check data consistency',
2332    help        => q`
2333      The zmaudit daemon exists to check that the saved information
2334      in the database and on the filesystem match and are consistent
2335      with each other. If an error occurs or if you are using 'fast
2336      deletes' it may be that database records are deleted but files
2337      remain. In this case, and similar, zmaudit will remove
2338      redundant information to synchronise the two data stores. This
2339      option controls whether zmaudit is run in the background and
2340      performs these checks and fixes continuously. This is
2341      recommended for most systems however if you have a very large
2342      number of events the process of scanning the database and
2343      filesystem may take a long time and impact performance. In this
2344      case you may prefer to not have zmaudit running unconditionally
2345      and schedule occasional checks at other, more convenient,
2346      times.
2347      `,
2348    type        => $types{boolean},
2349    category    => 'system',
2350  },
2351  {
2352    name        => 'ZM_AUDIT_CHECK_INTERVAL',
2353    default     => '900',
2354    description => 'How often to check database and filesystem consistency',
2355    help        => q`
2356      The zmaudit daemon exists to check that the saved information
2357      in the database and on the filesystem match and are consistent
2358      with each other. If an error occurs or if you are using 'fast
2359      deletes' it may be that database records are deleted but files
2360      remain. In this case, and similar, zmaudit will remove
2361      redundant information to synchronise the two data stores. The
2362      default check interval of 900 seconds (15 minutes) is fine for
2363      most systems however if you have a very large number of events
2364      the process of scanning the database and filesystem may take a
2365      long time and impact performance. In this case you may prefer
2366      to make this interval much larger to reduce the impact on your
2367      system. This option determines how often these checks are
2368      performed.
2369      `,
2370    type        => $types{integer},
2371    category    => 'system',
2372  },
2373  {
2374    name        => 'ZM_AUDIT_MIN_AGE',
2375    default     => '86400',
2376    description => 'The minimum age in seconds event data must be in order to be deleted.',
2377    help        => q`
2378      The zmaudit daemon exists to check that the saved information
2379      in the database and on the filesystem match and are consistent
2380      with each other. Event files or db records that are younger than
2381      this setting will not be deleted and a warning will be given.
2382      `,
2383    type        => $types{integer},
2384    category    => 'system',
2385  },
2386  {
2387    name        => 'ZM_FORCED_ALARM_SCORE',
2388    default     => '255',
2389    description => 'Score to give forced alarms',
2390    help        => q`
2391      The 'zmu' utility can be used to force an alarm on a monitor
2392      rather than rely on the motion detection algorithms. This
2393      option determines what score to give these alarms to
2394      distinguish them from regular ones. It must be 255 or less.
2395      `,
2396    type        => $types{integer},
2397    category    => 'config',
2398  },
2399  {
2400    name        => 'ZM_BULK_FRAME_INTERVAL',
2401    default     => '100',
2402    description => 'How often a bulk frame should be written to the database',
2403    help        => q`
2404      Traditionally ZoneMinder writes an entry into the Frames
2405      database table for each frame that is captured and saved. This
2406      works well in motion detection scenarios but when in a DVR
2407      situation ('Record' or 'Mocord' mode) this results in a huge
2408      number of frame writes and a lot of database and disk bandwidth
2409      for very little additional information. Setting this to a
2410      non-zero value will enabled ZoneMinder to group these non-alarm
2411      frames into one 'bulk' frame entry which saves a lot of
2412      bandwidth and space. The only disadvantage of this is that
2413      timing information for individual frames is lost but in
2414      constant frame rate situations this is usually not significant.
2415      This setting is ignored in Modect mode and individual frames
2416      are still written if an alarm occurs in Mocord mode also.
2417      `,
2418    type        => $types{integer},
2419    category    => 'config',
2420  },
2421  {
2422    name        => 'ZM_EVENT_CLOSE_MODE',
2423    default     => 'idle',
2424    description => 'When continuous events are closed.',
2425    help        => q`
2426      When a monitor is running in a continuous recording mode
2427      (Record or Mocord) events are usually closed after a fixed
2428      period of time (the section length). However in Mocord mode it
2429      is possible that motion detection may occur near the end of a
2430      section. This option controls what happens when an alarm occurs
2431      in Mocord mode.~~
2432      ~~
2433      The 'time' setting means that the event will be
2434      closed at the end of the section regardless of alarm activity.~~
2435      ~~
2436      The 'idle' setting means that the event will be closed at the
2437      end of the section if there is no alarm activity occurring at
2438      the time otherwise it will be closed once the alarm is over
2439      meaning the event may end up being longer than the normal
2440      section length.~~
2441      ~~
2442      The 'alarm' setting means that if an alarm
2443      occurs during the event, the event will be closed and a new one
2444     will be opened.  So events will only be alarmed or continuous.
2445     This has the
2446      effect of limiting the number of alarms to one per event and
2447      the events may be shorter than the section length if an alarm
2448      has occurred.
2449      `,
2450    type        => $types{boolean},
2451    type        => {
2452      db_type     =>'string',
2453      hint        =>'time|idle|alarm',
2454      pattern     =>qr|^([tia])|i,
2455      format      =>q( ($1 =~ /^t/)
2456          ? 'time'
2457          : ($1 =~ /^i/ ? 'idle' : 'time' )
2458          )
2459    },
2460    category    => 'config',
2461  },
2462# Deprecated, superseded by event close mode
2463  {
2464    name        => 'ZM_WEIGHTED_ALARM_CENTRES',
2465    default     => 'no',
2466    description => 'Use a weighted algorithm to calculate the centre of an alarm',
2467    help        => q`
2468      ZoneMinder will always calculate the centre point of an alarm
2469      in a zone to give some indication of where on the screen it is.
2470      This can be used by the experimental motion tracking feature or
2471      your own custom extensions. In the alarmed or filtered pixels
2472      mode this is a simple midpoint between the extents of the
2473      detected pixels. However in the blob method this can instead be
2474      calculated using weighted pixel locations to give more accurate
2475      positioning for irregularly shaped blobs. This method, while
2476      more precise is also slower and so is turned off by default.
2477      `,
2478    type        => $types{boolean},
2479    category    => 'config',
2480  },
2481  {
2482    name        => 'ZM_EVENT_IMAGE_DIGITS',
2483    default     => '5',
2484    description => 'How many significant digits are used in event image numbering',
2485    help        => q`
2486      As event images are captured they are stored to the filesystem
2487      with a numerical index. By default this index has three digits
2488      so the numbers start 001, 002 etc. This works for most
2489      scenarios as events with more than 999 frames are rarely
2490      captured. However if you have extremely long events and use
2491      external applications then you may wish to increase this to
2492      ensure correct sorting of images in listings etc. Warning,
2493      increasing this value on a live system may render existing
2494      events unviewable as the event will have been saved with the
2495      previous scheme. Decreasing this value should have no ill
2496      effects.
2497      `,
2498    type        => $types{integer},
2499    category    => 'config',
2500  },
2501  {
2502    name        => 'ZM_DEFAULT_ASPECT_RATIO',
2503    default     => '4:3',
2504    description => 'The default width:height aspect ratio used in monitors',
2505    help        => q`
2506      When specifying the dimensions of monitors you can click a
2507      checkbox to ensure that the width stays in the correct ratio to
2508      the height, or vice versa. This setting allows you to indicate
2509      what the ratio of these settings should be. This should be
2510      specified in the format <width value>:<height value> and the
2511      default of 4:3 normally be acceptable but 11:9 is another
2512      common setting. If the checkbox is not clicked when specifying
2513      monitor dimensions this setting has no effect.
2514      `,
2515    type        => $types{string},
2516    category    => 'config',
2517  },
2518  {
2519    name        => 'ZM_USER_SELF_EDIT',
2520    default     => 'no',
2521    description => 'Allow unprivileged users to change their details',
2522    help        => q`
2523      Ordinarily only users with system edit privilege are able to
2524      change users details. Switching this option on allows ordinary
2525      users to change their passwords and their language settings
2526      `,
2527    type        => $types{boolean},
2528    category    => 'config',
2529  },
2530  {
2531    name        => 'ZM_OPT_CONTROL',
2532    default     => 'yes',
2533    description => 'Support controllable (e.g. PTZ) cameras',
2534    help        => q`
2535      ZoneMinder includes limited support for controllable cameras. A
2536      number of sample protocols are included and others can easily
2537      be added. If you wish to control your cameras via ZoneMinder
2538      then select this option otherwise if you only have static
2539      cameras or use other control methods then leave this option
2540      off.
2541      `,
2542    type        => $types{boolean},
2543    category    => 'system',
2544  },
2545  {
2546    name        => 'ZM_OPT_TRIGGERS',
2547    default     => 'no',
2548    description => 'Interface external event triggers via socket or device files',
2549    help        => q`
2550      ZoneMinder can interact with external systems which prompt or
2551      cancel alarms. This is done via the zmtrigger.pl script. This
2552      option indicates whether you want to use these external
2553      triggers. Most people will say no here.
2554      `,
2555    type        => $types{boolean},
2556    category    => 'system',
2557  },
2558  {
2559    name        => 'ZM_CHECK_FOR_UPDATES',
2560    default     => 'yes',
2561    description => 'Check with zoneminder.com for updated versions',
2562    help        => q`
2563      From ZoneMinder version 1.17.0 onwards new versions are
2564      expected to be more frequent. To save checking manually for
2565      each new version ZoneMinder can check with the zoneminder.com
2566      website to determine the most recent release. These checks are
2567      infrequent, about once per week, and no personal or system
2568      information is transmitted other than your current version
2569      number. If you do not wish these checks to take place or your
2570      ZoneMinder system has no internet access you can switch these
2571      check off with this configuration variable
2572      `,
2573    type        => $types{boolean},
2574    category    => 'system',
2575  },
2576  {
2577    name        => 'ZM_CSP_REPORT_URI',
2578    default     =>  '',
2579    description =>  'URI to report unsafe inline javascript violations to',
2580    help        =>  q`
2581    See https://en.wikipedia.org/wiki/Content_Security_Policy for more information.  When the browser detects unsafe inline javascript it will report it to this url, which may warn you of malicious attacks on your ZoneMinder install.`,
2582    type        =>  $types{url},
2583    category    =>  'system',
2584  },
2585  {
2586    name        => 'ZM_TELEMETRY_DATA',
2587    default     => 'no',
2588    description => 'Send usage information to ZoneMinder',
2589    help        => q`
2590      Enable collection of usage information of the local system and send
2591      it to the ZoneMinder development team. This data will be used to
2592      determine things like who and where our customers are, how big their
2593      systems are, the underlying hardware and operating system, etc.
2594      This is being done for the sole purpose of creating a better
2595      product for our target audience. This script is intended to be
2596      completely transparent to the end user, and can be disabled from
2597      the web console under Options. For more details on what information
2598      we collect, please refer to our [privacy](?view=privacy) statement.
2599      `,
2600    type        => $types{boolean},
2601    category    => 'system',
2602  },
2603  {
2604    name        => 'ZM_TELEMETRY_UUID',
2605    default     => '',
2606    description => 'Unique identifier for ZoneMinder telemetry',
2607    help        => q`
2608      This variable is auto-generated once by the system and is used to
2609      uniquely identify it among all other ZoneMinder systems in
2610      existence.
2611      `,
2612    type        => $types{string},
2613    category    => 'dynamic',
2614  },
2615  {
2616    name        => 'ZM_TELEMETRY_LAST_UPLOAD',
2617    default     => '',
2618    description => 'When the last ZoneMinder telemetry upload occurred',
2619    help        => '',
2620    type        => $types{integer},
2621    readonly    => 1,
2622    category    => 'dynamic',
2623  },
2624  {
2625    name        => 'ZM_TELEMETRY_INTERVAL',
2626    default     => '14*24*60*60',
2627    description => 'Interval in seconds between telemetry updates.',
2628    help        => 'This value can be expressed as a mathematical expression for ease.',
2629    type        => $types{string},
2630    category    => 'system',
2631  },
2632  {
2633    name        => 'ZM_TELEMETRY_SERVER_ENDPOINT',
2634    default     => 'https://zmanon:2b2d0b4skps@telemetry.zoneminder.com/zmtelemetry/testing5',
2635    description => 'URL that ZoneMinder will send usage data to',
2636    help        => '',
2637    type        => $types{url},
2638    category    => 'hidden',
2639  },
2640  {
2641    name        => 'ZM_UPDATE_CHECK_PROXY',
2642    default     => '',
2643    description => 'Proxy url if required to access zoneminder.com',
2644    help        => q`
2645      If you use a proxy to access the internet then ZoneMinder needs
2646      to know so it can access zoneminder.com to check for updates.
2647      If you do use a proxy enter the full proxy url here in the form
2648      of http://<proxy host>:<proxy port>/
2649      `,
2650    type        => $types{string},
2651    category    => 'system',
2652  },
2653  {
2654    name        => 'ZM_SHM_KEY',
2655    default     => '0x7a6d0000',
2656    description => 'Shared memory root key to use',
2657    help        => q`
2658      ZoneMinder uses shared memory to speed up communication between
2659      modules. To identify the right area to use shared memory keys
2660      are used. This option controls what the base key is, each
2661      monitor will have it's Id or'ed with this to get the actual key
2662      used. You will not normally need to change this value unless it
2663      clashes with another instance of ZoneMinder on the same
2664      machine. Only the first four hex digits are used, the lower
2665      four will be masked out and ignored.
2666      `,
2667    type        => $types{hexadecimal},
2668    category    => 'system',
2669  },
2670  {
2671    name        => 'ZM_WEB_EVENT_SORT_FIELD',
2672    default     => 'StartDateTime',
2673    description => 'Default field the event lists are sorted by',
2674    help        => q`
2675      Events in lists can be initially ordered in any way you want.
2676      This option controls what field is used to sort them. You can
2677      modify this ordering from filters or by clicking on headings in
2678      the lists themselves. Bear in mind however that the 'Prev' and
2679      'Next' links, when scrolling through events, relate to the
2680      ordering in the lists and so not always to time based ordering.
2681      `,
2682    type        => {
2683      db_type     =>'string',
2684      hint        =>'Id|Name|Cause|DiskSpace|MonitorName|StartDateTime|Length|Frames|AlarmFrames|TotScore|AvgScore|MaxScore',
2685      pattern     =>qr|.|,
2686      format      =>q( $1 )
2687    },
2688    category    => 'web',
2689  },
2690  {
2691    name        => 'ZM_WEB_EVENT_SORT_ORDER',
2692    default     => 'asc',
2693    description => 'Default order the event lists are sorted by',
2694    help        => q`
2695      Events in lists can be initially ordered in any way you want.
2696      This option controls what order (ascending or descending) is
2697      used to sort them. You can modify this ordering from filters or
2698      by clicking on headings in the lists themselves. Bear in mind
2699      however that the 'Prev' and 'Next' links, when scrolling
2700      through events, relate to the ordering in the lists and so not
2701      always to time based ordering.
2702      `,
2703    type        => {
2704      db_type     =>'string',
2705      hint        =>'asc|desc',
2706      pattern     =>qr|^([ad])|i,
2707      format      =>q( $1 =~ /^a/i ? 'asc' : 'desc' )
2708    },
2709    category    => 'web',
2710  },
2711  {
2712    name        => 'ZM_WEB_EVENTS_PER_PAGE',
2713    default     => '25',
2714    description => 'How many events to list per page in paged mode',
2715    help        => q`
2716      In the event list view you can either list all events or just a
2717      page at a time. This option controls how many events are listed
2718      per page in paged mode and how often to repeat the column
2719      headers in non-paged mode.
2720      `,
2721    type        => $types{integer},
2722    category    => 'web',
2723  },
2724  {
2725    name        => 'ZM_WEB_LIST_THUMBS',
2726    default     => 'yes',
2727    description => 'Display mini-thumbnails of event images in event lists',
2728    help        => q`
2729      Ordinarily the event lists just display text details of the
2730      events to save space and time. By switching this option on you
2731      can also display small thumbnails to help you identify events
2732      of interest. The size of these thumbnails is controlled by the
2733      following two options.
2734      `,
2735    type        => $types{boolean},
2736    category    => 'web',
2737  },
2738  {
2739    name        => 'ZM_WEB_LIST_THUMB_WIDTH',
2740    default     => '48',
2741    description => 'The width of the thumbnails that appear in the event lists',
2742    help        => q`
2743      This options controls the width of the thumbnail images that
2744      appear in the event lists. It should be fairly small to fit in
2745      with the rest of the table. If you prefer you can specify a
2746      height instead in the next option but you should only use one
2747      of the width or height and the other option should be set to
2748      zero. If both width and height are specified then width will be
2749      used and height ignored.
2750      `,
2751    type        => $types{integer},
2752    requires    => [ { name => 'ZM_WEB_LIST_THUMBS', value => 'yes' } ],
2753    category    => 'web',
2754  },
2755  {
2756    name        => 'ZM_WEB_LIST_THUMB_HEIGHT',
2757    default     => '0',
2758    description => 'The height of the thumbnails that appear in the event lists',
2759    help        => q`
2760      This options controls the height of the thumbnail images that
2761      appear in the event lists. It should be fairly small to fit in
2762      with the rest of the table. If you prefer you can specify a
2763      width instead in the previous option but you should only use
2764      one of the width or height and the other option should be set
2765      to zero. If both width and height are specified then width will
2766      be used and height ignored.
2767      `,
2768    type        => $types{integer},
2769    requires    => [ { name => 'ZM_WEB_LIST_THUMBS', value => 'yes' } ],
2770    category    => 'web',
2771  },
2772  {
2773    name        => 'ZM_WEB_ANIMATE_THUMBS',
2774    default     => 'yes',
2775    description => 'Enlarge and show the live stream when a thumbnail is hovered over',
2776    help        => q`
2777      Enabling this option causes the static thumbnail, shown on certain
2778      views, to enlarge and show the live stream, when the thumbnail is
2779      hovered over by the mouse.
2780      `,
2781    type        => $types{boolean},
2782    requires    => [ { name => 'ZM_WEB_LIST_THUMBS', value => 'yes' } ],
2783    category    => 'web',
2784  },
2785  {
2786    name        => 'ZM_WEB_USE_OBJECT_TAGS',
2787    default     => 'yes',
2788    description => 'Wrap embed in object tags for media content',
2789    help        => q`
2790      There are two methods of including media content in web pages.
2791      The most common way is use the EMBED tag which is able to give
2792      some indication of the type of content. However this is not a
2793      standard part of HTML. The official method is to use OBJECT
2794      tags which are able to give more information allowing the
2795      correct media viewers etc. to be loaded. However these are less
2796      widely supported and content may be specifically tailored to a
2797      particular platform or player. This option controls whether
2798      media content is enclosed in EMBED tags only or whether, where
2799      appropriate, it is additionally wrapped in OBJECT tags.
2800      Currently OBJECT tags are only used in a limited number of
2801      circumstances but they may become more widespread in the
2802      future. It is suggested that you leave this option on unless
2803      you encounter problems playing some content.
2804      `,
2805    type        => $types{boolean},
2806    category    => 'web',
2807  },
2808  {
2809    name        => 'ZM_WEB_XFRAME_WARN',
2810    default     => 'yes',
2811    description => 'Warn when website X-Frame-Options is set to sameorigin',
2812    help        => q`
2813      When creating a Web Site monitor, if the target web site has
2814      X-Frame-Options set to sameorigin in the header, the site will
2815      not display in ZoneMinder. This is a design feature in most modern
2816      browsers. When this condition occurs, ZoneMinder will write a
2817      warning to the log file. To get around this, one can install a browser
2818      plugin or extension to ignore X-Frame headers, and then the page will
2819      display properly. Once the plugin or extension has ben installed,
2820      the end user may choose to turn this warning off.
2821      `,
2822    type        => $types{boolean},
2823    category    => 'web',
2824  },
2825  {
2826    name        => 'ZM_WEB_FILTER_SOURCE',
2827    default     => 'Hostname',
2828    description => 'How to filter information in the source column.',
2829    help        => q`
2830      This option only affects monitors with a source type of Ffmpeg,
2831      Libvlc, or WebSite. This setting controls what information is
2832      displayed in the Source column on the console. Selecting 'None'
2833      will not filter anything. The entire source string will be
2834      displayed, which may contain sensitive information. Selecting
2835      'NoCredentials' will strip out usernames and passwords from the
2836      string. If there are any port numbers in the string and they are
2837      common (80, 554, etc) then those will be removed as well.
2838      Selecting 'Hostname' will filter out all information except for
2839      the hostname or ip address. When in doubt, stay with the default
2840      'Hostname'. This feature uses the php function 'url_parts' to
2841      identify the various pieces of the url. If the url in question
2842      is unusual or not standard in some way, then filtering may not
2843      produce the desired results.
2844      `,
2845    type        => {
2846      db_type     =>'string',
2847      hint        =>'None|Hostname|NoCredentials',
2848      pattern     =>qr|^([NH])|i,
2849      format      =>q( ($1 =~ /^Non/)
2850          ? 'None'
2851          : ($1 =~ /^H/ ? 'Hostname' : 'NoCredentials' )
2852          )
2853    },
2854    category    => 'web',
2855  },
2856  {
2857    name        => 'ZM_WEB_H_REFRESH_MAIN',
2858    default     => '60',
2859    introduction => q`
2860      There are now a number of options that are grouped into
2861      bandwidth categories, this allows you to configure the
2862      ZoneMinder client to work optimally over the various access
2863      methods you might to access the client.\n\nThe next few options
2864      control what happens when the client is running in 'high'
2865      bandwidth mode. You should set these options for when accessing
2866      the ZoneMinder client over a local network or high speed link.
2867      In most cases the default values will be suitable as a starting
2868      point.
2869      `,
2870    description => 'How often (in seconds) the main console window should refresh itself',
2871    help        => q`
2872      The main console window lists a general status and the event
2873      totals for all monitors. This is not a trivial task and should
2874      not be repeated too frequently or it may affect the performance
2875      of the rest of the system.
2876      `,
2877    type        => $types{integer},
2878    category    => 'highband',
2879  },
2880  {
2881    name        => 'ZM_WEB_H_REFRESH_NAVBAR',
2882    default     => '60',
2883    description => 'How often (in seconds) the navigation header should refresh itself',
2884    help        => q`
2885      The navigation header contains the general status information about server load and storage space.
2886      `,
2887    type        => $types{integer},
2888    category    => 'highband',
2889  },
2890  {
2891    name        => 'ZM_WEB_H_REFRESH_CYCLE',
2892    default     => '10',
2893    description => 'How often (in seconds) the cycle watch window swaps to the next monitor',
2894    help        => q`
2895      The cycle watch window is a method of continuously cycling
2896      between images from all of your monitors. This option
2897      determines how often to refresh with a new image.
2898      `,
2899    type        => $types{integer},
2900    category    => 'highband',
2901  },
2902  {
2903    name        => 'ZM_WEB_H_REFRESH_IMAGE',
2904    default     => '3',
2905    description => 'How often (in seconds) the watched image is refreshed (if not streaming)',
2906    help        => q`
2907      The live images from a monitor can be viewed in either streamed
2908      or stills mode. This option determines how often a stills image
2909      is refreshed, it has no effect if streaming is selected.
2910      `,
2911    type        => $types{integer},
2912    category    => 'highband',
2913  },
2914  {
2915    name        => 'ZM_WEB_H_REFRESH_STATUS',
2916    default     => '1',
2917    description => 'How often (in seconds) the status refreshes itself in the watch window',
2918    help        => q`
2919      The monitor window is actually made from several frames. The
2920      one in the middle merely contains a monitor status which needs
2921      to refresh fairly frequently to give a true indication. This
2922      option determines that frequency.
2923      `,
2924    type        => $types{integer},
2925    category    => 'highband',
2926  },
2927  {
2928    name        => 'ZM_WEB_H_REFRESH_EVENTS',
2929    default     => '5',
2930    description => 'How often (in seconds) the event listing is refreshed in the watch window',
2931    help        => q`
2932      The monitor window is actually made from several frames. The
2933      lower frame contains a listing of the last few events for easy
2934      access. This option determines how often this is refreshed.
2935      `,
2936    type        => $types{integer},
2937    category    => 'highband',
2938  },
2939  {
2940    name        => 'ZM_WEB_H_CAN_STREAM',
2941    default     => 'auto',
2942    description => 'Override the automatic detection of browser streaming capability',
2943    help        => q`
2944      If you know that your browser can handle image streams of the
2945      type 'multipart/x-mixed-replace' but ZoneMinder does not detect
2946      this correctly you can set this option to ensure that the
2947      stream is delivered with or without the use of the Cambozola
2948      plugin. Selecting 'yes' will tell ZoneMinder that your browser
2949      can handle the streams natively, 'no' means that it can't and
2950      so the plugin will be used while 'auto' lets ZoneMinder decide.
2951      `,
2952    type        => $types{tristate},
2953    category    => 'highband',
2954  },
2955  {
2956    name        => 'ZM_WEB_H_STREAM_METHOD',
2957    default     => 'jpeg',
2958    description => 'Which method should be used to send video streams to your browser.',
2959    help        => q`
2960      ZoneMinder can be configured to use either mpeg encoded video
2961      or a series or still jpeg images when sending video streams.
2962      This option defines which is used. If you choose mpeg you
2963      should ensure that you have the appropriate plugins available
2964      on your browser whereas choosing jpeg will work natively on
2965      Mozilla and related browsers and with a Java applet on Internet
2966      Explorer
2967      `,
2968    type        => {
2969      db_type     =>'string',
2970      hint        =>'mpeg|jpeg',
2971      pattern     =>qr|^([mj])|i,
2972      format      =>q( $1 =~ /^m/ ? 'mpeg' : 'jpeg' )
2973    },
2974    category    => 'highband',
2975  },
2976  {
2977    name        => 'ZM_WEB_H_DEFAULT_SCALE',
2978    default     => '100',
2979    description => 'What the default scaling factor applied to \'live\' or \'event\' views is (%)',
2980    help        => q`
2981      Normally ZoneMinder will display 'live' or 'event' streams in
2982      their native size. However if you have monitors with large
2983      dimensions or a slow link you may prefer to reduce this size,
2984      alternatively for small monitors you can enlarge it. This
2985      options lets you specify what the default scaling factor will
2986      be. It is expressed as a percentage so 100 is normal size, 200
2987      is double size etc.
2988      `,
2989    type        => {
2990      db_type     =>'integer',
2991      hint        =>'25|33|50|75|100|150|200|300|400',
2992      pattern     =>qr|^(\d+)$|,
2993      format      =>q( $1 )
2994    },
2995    category    => 'highband',
2996  },
2997  {
2998    name        => 'ZM_WEB_H_DEFAULT_RATE',
2999    default     => '100',
3000    description => 'What the default replay rate factor applied to \'event\' views is (%)',
3001    help        => q`
3002      Normally ZoneMinder will display 'event' streams at their
3003      native rate, i.e. as close to real-time as possible. However if
3004      you have long events it is often convenient to replay them at a
3005      faster rate for review. This option lets you specify what the
3006      default replay rate will be. It is expressed as a percentage so
3007      100 is normal rate, 200 is double speed etc.
3008      `,
3009    type        => {
3010      db_type     =>'integer',
3011      hint        =>'25|50|100|150|200|400|1000|2500|5000|10000',
3012      pattern     =>qr|^(\d+)$|,
3013      format      =>q( $1 )
3014    },
3015    category    => 'highband',
3016  },
3017  {
3018    name        => 'ZM_WEB_H_VIDEO_BITRATE',
3019    default     => '150000',
3020    description => 'What the bitrate of the video encoded stream should be set to',
3021    help        => q`
3022      When encoding real video via the ffmpeg library a bit rate can
3023      be specified which roughly corresponds to the available
3024      bandwidth used for the stream. This setting effectively
3025      corresponds to a 'quality' setting for the video. A low value
3026      will result in a blocky image whereas a high value will produce
3027      a clearer view. Note that this setting does not control the
3028      frame rate of the video however the quality of the video
3029      produced is affected both by this setting and the frame rate
3030      that the video is produced at. A higher frame rate at a
3031      particular bit rate result in individual frames being at a
3032      lower quality.
3033      `,
3034    type        => $types{integer},
3035    category    => 'highband',
3036  },
3037  {
3038    name        => 'ZM_WEB_H_VIDEO_MAXFPS',
3039    default     => '30',
3040    description => 'What the maximum frame rate for streamed video should be',
3041    help        => q`
3042      When using streamed video the main control is the bitrate which
3043      determines how much data can be transmitted. However a lower
3044      bitrate at high frame rates results in a lower quality image.
3045      This option allows you to limit the maximum frame rate to
3046      ensure that video quality is maintained. An additional
3047      advantage is that encoding video at high frame rates is a
3048      processor intensive task when for the most part a very high
3049      frame rate offers little perceptible improvement over one that
3050      has a more manageable resource requirement. Note, this option
3051      is implemented as a cap beyond which binary reduction takes
3052      place. So if you have a device capturing at 15fps and set this
3053      option to 10fps then the video is not produced at 10fps, but
3054      rather at 7.5fps (15 divided by 2) as the final frame rate must
3055      be the original divided by a power of 2.
3056      `,
3057    type        => $types{integer},
3058    category    => 'highband',
3059  },
3060  {
3061    name        => 'ZM_WEB_H_SCALE_THUMBS',
3062    default     => 'no',
3063    description => 'Scale thumbnails in events, bandwidth versus CPU in rescaling',
3064    help        => q`
3065      If unset, this option sends the whole image to the browser
3066      which resizes it in the window. If set the image is scaled down
3067      on the server before sending a reduced size image to the
3068      browser to conserve bandwidth at the cost of CPU on the server.
3069      Note that ZM can only perform the resizing if the appropriate
3070      PHP graphics functionality is installed. This is usually
3071      available in the php-gd package.
3072      `,
3073    type        => $types{boolean},
3074    category    => 'highband',
3075  },
3076  {
3077    name        => 'ZM_WEB_H_EVENTS_VIEW',
3078    default     => 'events',
3079    description => 'What the default view of multiple events should be.',
3080    help        => q`
3081      Stored events can be viewed in either an events list format or
3082      in a timeline based one. This option sets the default view that
3083      will be used. Choosing one view here does not prevent the other
3084      view being used as it will always be selectable from whichever
3085      view is currently being used.
3086      `,
3087    type        => {
3088      db_type     =>'string',
3089      hint        =>'events|timeline',
3090      pattern     =>qr|^([lt])|i,
3091      format      =>q( $1 =~ /^e/ ? 'events' : 'timeline' )
3092    },
3093    category    => 'highband',
3094  },
3095  {
3096    name        => 'ZM_WEB_H_SHOW_PROGRESS',
3097    default     => 'yes',
3098    description => 'Show the progress of replay in event view.',
3099    help        => q`
3100      When viewing events an event navigation panel and progress bar
3101      is shown below the event itself. This allows you to jump to
3102      specific points in the event, but can also dynamically
3103      update to display the current progress of the event replay
3104      itself. This progress is calculated from the actual event
3105      duration and is not directly linked to the replay itself, so on
3106      limited bandwidth connections may be out of step with the
3107      replay. This option allows you to turn off the progress
3108      display, whilst still keeping the navigation aspect, where
3109      bandwidth prevents it functioning effectively.
3110      `,
3111    type        => $types{boolean},
3112    category    => 'highband',
3113  },
3114  {
3115    name        => 'ZM_WEB_H_AJAX_TIMEOUT',
3116    default     => '3000',
3117    description => 'How long to wait for Ajax request responses (ms)',
3118    help        => q`
3119      The newer versions of the live feed and event views use Ajax to
3120      request information from the server and populate the views
3121      dynamically. This option allows you to specify a timeout if
3122      required after which requests are abandoned. A timeout may be
3123      necessary if requests would overwise hang such as on a slow
3124      connection. This would tend to consume a lot of browser memory
3125      and make the interface unresponsive. Ordinarily no requests
3126      should timeout so this setting should be set to a value greater
3127      than the slowest expected response. This value is in
3128      milliseconds but if set to zero then no timeout will be used.
3129      `,
3130    type        => $types{integer},
3131    category    => 'highband',
3132  },
3133  {
3134    name        => 'ZM_WEB_M_REFRESH_MAIN',
3135    default     => '300',
3136    description => 'How often (in seconds) the main console window should refresh itself',
3137    help        => q`
3138      The main console window lists a general status and the event
3139      totals for all monitors. This is not a trivial task and should
3140      not be repeated too frequently or it may affect the performance
3141      of the rest of the system.
3142      `,
3143    type        => $types{integer},
3144    introduction => q`
3145      The next few options control what happens when the client is
3146      running in 'medium' bandwidth mode. You should set these
3147      options for when accessing the ZoneMinder client over a slower
3148      cable or DSL link. In most cases the default values will be
3149      suitable as a starting point.
3150      `,
3151    category    => 'medband',
3152  },
3153  {
3154    name        => 'ZM_WEB_M_REFRESH_NAVBAR',
3155    default     => '120',
3156    description => 'How often (in seconds) the navigation header should refresh itself',
3157    help        => q`
3158      The navigation header contains the general status information about server load and storage space.
3159      `,
3160    type        => $types{integer},
3161    category    => 'medband',
3162  },
3163  {
3164    name        => 'ZM_WEB_M_REFRESH_CYCLE',
3165    default     => '20',
3166    description => 'How often (in seconds) the cycle watch window swaps to the next monitor',
3167    help        => q`
3168      The cycle watch window is a method of continuously cycling
3169      between images from all of your monitors. This option
3170      determines how often to refresh with a new image.
3171      `,
3172    type        => $types{integer},
3173    category    => 'medband',
3174  },
3175  {
3176    name        => 'ZM_WEB_M_REFRESH_IMAGE',
3177    default     => '10',
3178    description => 'How often (in seconds) the watched image is refreshed (if not streaming)',
3179    help        => q`
3180      The live images from a monitor can be viewed in either streamed
3181      or stills mode. This option determines how often a stills image
3182      is refreshed, it has no effect if streaming is selected.
3183      `,
3184    type        => $types{integer},
3185    category    => 'medband',
3186  },
3187  {
3188    name        => 'ZM_WEB_M_REFRESH_STATUS',
3189    default     => '5',
3190    description => 'How often (in seconds) the status refreshes itself in the watch window',
3191    help        => q`
3192      The monitor window is actually made from several frames. The
3193      one in the middle merely contains a monitor status which needs
3194      to refresh fairly frequently to give a true indication. This
3195      option determines that frequency.
3196      `,
3197    type        => $types{integer},
3198    category    => 'medband',
3199  },
3200  {
3201    name        => 'ZM_WEB_M_REFRESH_EVENTS',
3202    default     => '60',
3203    description => 'How often (in seconds) the event listing is refreshed in the watch window',
3204    help        => q`
3205      The monitor window is actually made from several frames. The
3206      lower frame contains a listing of the last few events for easy
3207      access. This option determines how often this is refreshed.
3208      `,
3209    type        => $types{integer},
3210    category    => 'medband',
3211  },
3212  {
3213    name        => 'ZM_WEB_M_CAN_STREAM',
3214    default     => 'auto',
3215    description => 'Override the automatic detection of browser streaming capability',
3216    help        => q`
3217      If you know that your browser can handle image streams of the
3218      type 'multipart/x-mixed-replace' but ZoneMinder does not detect
3219      this correctly you can set this option to ensure that the
3220      stream is delivered with or without the use of the Cambozola
3221      plugin. Selecting 'yes' will tell ZoneMinder that your browser
3222      can handle the streams natively, 'no' means that it can't and
3223      so the plugin will be used while 'auto' lets ZoneMinder decide.
3224      `,
3225    type        => $types{tristate},
3226    category    => 'medband',
3227  },
3228  {
3229    name        => 'ZM_WEB_M_STREAM_METHOD',
3230    default     => 'jpeg',
3231    description => 'Which method should be used to send video streams to your browser.',
3232    help        => q`
3233      ZoneMinder can be configured to use either mpeg encoded video
3234      or a series or still jpeg images when sending video streams.
3235      This option defines which is used. If you choose mpeg you
3236      should ensure that you have the appropriate plugins available
3237      on your browser whereas choosing jpeg will work natively on
3238      Mozilla and related browsers and with a Java applet on Internet
3239      Explorer
3240      `,
3241    type        => {
3242      db_type     =>'string',
3243      hint        =>'mpeg|jpeg',
3244      pattern     =>qr|^([mj])|i,
3245      format      =>q( $1 =~ /^m/ ? 'mpeg' : 'jpeg' )
3246    },
3247    category    => 'medband',
3248  },
3249  {
3250    name        => 'ZM_WEB_M_DEFAULT_SCALE',
3251    default     => '100',
3252    description => q`What the default scaling factor applied to 'live' or 'event' views is (%)`,
3253    help        => q`
3254      Normally ZoneMinder will display 'live' or 'event' streams in
3255      their native size. However if you have monitors with large
3256      dimensions or a slow link you may prefer to reduce this size,
3257      alternatively for small monitors you can enlarge it. This
3258      options lets you specify what the default scaling factor will
3259      be. It is expressed as a percentage so 100 is normal size, 200
3260      is double size etc.
3261      `,
3262    type        => {
3263      db_type     =>'integer',
3264      hint        =>'25|33|50|75|100|150|200|300|400',
3265      pattern     =>qr|^(\d+)$|,
3266      format      =>q( $1 )
3267    },
3268    category    => 'medband',
3269  },
3270  {
3271    name        => 'ZM_WEB_M_DEFAULT_RATE',
3272    default     => '100',
3273    description => q`What the default replay rate factor applied to 'event' views is (%)`,
3274    help        => q`
3275      Normally ZoneMinder will display 'event' streams at their
3276      native rate, i.e. as close to real-time as possible. However if
3277      you have long events it is often convenient to replay them at a
3278      faster rate for review. This option lets you specify what the
3279      default replay rate will be. It is expressed as a percentage so
3280      100 is normal rate, 200 is double speed etc.
3281      `,
3282    type        => {
3283      db_type     =>'integer',
3284      hint        =>'25|50|100|150|200|400|1000|2500|5000|10000',
3285      pattern     =>qr|^(\d+)$|,
3286      format      =>q( $1 )
3287    },
3288    category    => 'medband',
3289  },
3290  {
3291    name        => 'ZM_WEB_M_VIDEO_BITRATE',
3292    default     => '75000',
3293    description => 'What the bitrate of the video encoded stream should be set to',
3294    help        => q`
3295      When encoding real video via the ffmpeg library a bit rate can
3296      be specified which roughly corresponds to the available
3297      bandwidth used for the stream. This setting effectively
3298      corresponds to a 'quality' setting for the video. A low value
3299      will result in a blocky image whereas a high value will produce
3300      a clearer view. Note that this setting does not control the
3301      frame rate of the video however the quality of the video
3302      produced is affected both by this setting and the frame rate
3303      that the video is produced at. A higher frame rate at a
3304      particular bit rate result in individual frames being at a
3305      lower quality.
3306      `,
3307    type        => $types{integer},
3308    category    => 'medband',
3309  },
3310  {
3311    name        => 'ZM_WEB_M_VIDEO_MAXFPS',
3312    default     => '10',
3313    description => 'What the maximum frame rate for streamed video should be',
3314    help        => q`
3315      When using streamed video the main control is the bitrate which
3316      determines how much data can be transmitted. However a lower
3317      bitrate at high frame rates results in a lower quality image.
3318      This option allows you to limit the maximum frame rate to
3319      ensure that video quality is maintained. An additional
3320      advantage is that encoding video at high frame rates is a
3321      processor intensive task when for the most part a very high
3322      frame rate offers little perceptible improvement over one that
3323      has a more manageable resource requirement. Note, this option
3324      is implemented as a cap beyond which binary reduction takes
3325      place. So if you have a device capturing at 15fps and set this
3326      option to 10fps then the video is not produced at 10fps, but
3327      rather at 7.5fps (15 divided by 2) as the final frame rate must
3328      be the original divided by a power of 2.
3329      `,
3330    type        => $types{integer},
3331    category    => 'medband',
3332  },
3333  {
3334    name        => 'ZM_WEB_M_SCALE_THUMBS',
3335    default     => 'yes',
3336    description => 'Scale thumbnails in events, bandwidth versus CPU in rescaling',
3337    help        => q`
3338      If unset, this option sends the whole image to the browser
3339      which resizes it in the window. If set the image is scaled down
3340      on the server before sending a reduced size image to the
3341      browser to conserve bandwidth at the cost of CPU on the server.
3342      Note that ZM can only perform the resizing if the appropriate
3343      PHP graphics functionality is installed. This is usually
3344      available in the php-gd package.
3345      `,
3346    type        => $types{boolean},
3347    category    => 'medband',
3348  },
3349  {
3350    name        => 'ZM_WEB_M_EVENTS_VIEW',
3351    default     => 'events',
3352    description => 'What the default view of multiple events should be.',
3353    help        => q`
3354      Stored events can be viewed in either an events list format or
3355      in a timeline based one. This option sets the default view that
3356      will be used. Choosing one view here does not prevent the other
3357      view being used as it will always be selectable from whichever
3358      view is currently being used.
3359      `,
3360    type        => {
3361      db_type     =>'string',
3362      hint        =>'events|timeline',
3363      pattern     =>qr|^([lt])|i,
3364      format      =>q( $1 =~ /^e/ ? 'events' : 'timeline' )
3365    },
3366    category    => 'medband',
3367  },
3368  {
3369    name        => 'ZM_WEB_M_SHOW_PROGRESS',
3370    default     => 'yes',
3371    description => 'Show the progress of replay in event view.',
3372    help        => q`
3373      When viewing events an event navigation panel and progress bar
3374      is shown below the event itself. This allows you to jump to
3375      specific points in the event, but can also dynamically
3376      update to display the current progress of the event replay
3377      itself. This progress is calculated from the actual event
3378      duration and is not directly linked to the replay itself, so on
3379      limited bandwidth connections may be out of step with the
3380      replay. This option allows you to turn off the progress
3381      display, whilst still keeping the navigation aspect, where
3382      bandwidth prevents it functioning effectively.
3383      `,
3384    type        => $types{boolean},
3385    category    => 'medband',
3386  },
3387  {
3388    name        => 'ZM_WEB_M_AJAX_TIMEOUT',
3389    default     => '5000',
3390    description => 'How long to wait for Ajax request responses (ms)',
3391    help        => q`
3392      The newer versions of the live feed and event views use Ajax to
3393      request information from the server and populate the views
3394      dynamically. This option allows you to specify a timeout if
3395      required after which requests are abandoned. A timeout may be
3396      necessary if requests would overwise hang such as on a slow
3397      connection. This would tend to consume a lot of browser memory
3398      and make the interface unresponsive. Ordinarily no requests
3399      should timeout so this setting should be set to a value greater
3400      than the slowest expected response. This value is in
3401      milliseconds but if set to zero then no timeout will be used.
3402      `,
3403    type        => $types{integer},
3404    category    => 'medband',
3405  },
3406  {
3407    name        => 'ZM_WEB_L_REFRESH_MAIN',
3408    default     => '300',
3409    description => 'How often (in seconds) the main console window should refresh itself',
3410    introduction => q`
3411      The next few options control what happens when the client is
3412      running in 'low' bandwidth mode. You should set these options
3413      for when accessing the ZoneMinder client over a modem or slow
3414      link. In most cases the default values will be suitable as a
3415      starting point.
3416      `,
3417    help        => q`
3418      The main console window lists a general status and the event
3419      totals for all monitors. This is not a trivial task and should
3420      not be repeated too frequently or it may affect the performance
3421      of the rest of the system.
3422      `,
3423    type        => $types{integer},
3424    category    => 'lowband',
3425  },
3426  {
3427    name        => 'ZM_WEB_L_REFRESH_NAVBAR',
3428    default     => '180',
3429    description => 'How often (in seconds) the navigation header should refresh itself',
3430    help        => q`
3431      The navigation header contains the general status information about server load and storage space.
3432      `,
3433    type        => $types{integer},
3434    category    => 'lowband',
3435  },
3436  {
3437    name        => 'ZM_WEB_L_REFRESH_CYCLE',
3438    default     => '30',
3439    description => 'How often (in seconds) the cycle watch window swaps to the next monitor',
3440    help        => q`
3441      The cycle watch window is a method of continuously cycling
3442      between images from all of your monitors. This option
3443      determines how often to refresh with a new image.
3444      `,
3445    type        => $types{integer},
3446    category    => 'lowband',
3447  },
3448  {
3449    name        => 'ZM_WEB_L_REFRESH_IMAGE',
3450    default     => '15',
3451    description => 'How often (in seconds) the watched image is refreshed (if not streaming)',
3452    help        => q`
3453      The live images from a monitor can be viewed in either streamed
3454      or stills mode. This option determines how often a stills image
3455      is refreshed, it has no effect if streaming is selected.
3456      `,
3457    type        => $types{integer},
3458    category    => 'lowband',
3459  },
3460  {
3461    name        => 'ZM_WEB_L_REFRESH_STATUS',
3462    default     => '10',
3463    description => 'How often (in seconds) the status refreshes itself in the watch window',
3464    help        => q`
3465      The monitor window is actually made from several frames. The
3466      one in the middle merely contains a monitor status which needs
3467      to refresh fairly frequently to give a true indication. This
3468      option determines that frequency.
3469      `,
3470    type        => $types{integer},
3471    category    => 'lowband',
3472  },
3473  {
3474    name        => 'ZM_WEB_L_REFRESH_EVENTS',
3475    default     => '180',
3476    description => 'How often (in seconds) the event listing is refreshed in the watch window',
3477    help        => q`
3478      The monitor window is actually made from several frames. The
3479      lower frame contains a listing of the last few events for easy
3480      access. This option determines how often this is refreshed.
3481      `,
3482    type        => $types{integer},
3483    category    => 'lowband',
3484  },
3485  {
3486    name        => 'ZM_WEB_L_CAN_STREAM',
3487    default     => 'auto',
3488    description => 'Override the automatic detection of browser streaming capability',
3489    help        => q`
3490      If you know that your browser can handle image streams of the
3491      type 'multipart/x-mixed-replace' but ZoneMinder does not detect
3492      this correctly you can set this option to ensure that the
3493      stream is delivered with or without the use of the Cambozola
3494      plugin. Selecting 'yes' will tell ZoneMinder that your browser
3495      can handle the streams natively, 'no' means that it can't and
3496      so the plugin will be used while 'auto' lets ZoneMinder decide.
3497      `,
3498    type        => $types{tristate},
3499    category    => 'lowband',
3500  },
3501  {
3502    name        => 'ZM_WEB_L_STREAM_METHOD',
3503    default     => 'jpeg',
3504    description => 'Which method should be used to send video streams to your browser.',
3505    help        => q`
3506      ZoneMinder can be configured to use either mpeg encoded video
3507      or a series or still jpeg images when sending video streams.
3508      This option defines which is used. If you choose mpeg you
3509      should ensure that you have the appropriate plugins available
3510      on your browser whereas choosing jpeg will work natively on
3511      Mozilla and related browsers and with a Java applet on Internet
3512      Explorer
3513      `,
3514    type        => {
3515      db_type     =>'string',
3516      hint        =>'mpeg|jpeg',
3517      pattern     =>qr|^([mj])|i,
3518      format      =>q( $1 =~ /^m/ ? 'mpeg' : 'jpeg' )
3519    },
3520    category    => 'lowband',
3521  },
3522  {
3523    name        => 'ZM_WEB_L_DEFAULT_SCALE',
3524    default     => '100',
3525    description => q`What the default scaling factor applied to 'live' or 'event' views is (%)`,
3526    help        => q`
3527      Normally ZoneMinder will display 'live' or 'event' streams in
3528      their native size. However if you have monitors with large
3529      dimensions or a slow link you may prefer to reduce this size,
3530      alternatively for small monitors you can enlarge it. This
3531      options lets you specify what the default scaling factor will
3532      be. It is expressed as a percentage so 100 is normal size, 200
3533      is double size etc.
3534      `,
3535    type        => {
3536      db_type     =>'integer',
3537      hint        =>'25|33|50|75|100|150|200|300|400',
3538      pattern     =>qr|^(\d+)$|,
3539      format      =>q( $1 )
3540    },
3541    category    => 'lowband',
3542  },
3543  {
3544    name        => 'ZM_WEB_L_DEFAULT_RATE',
3545    default     => '100',
3546    description => q`What the default replay rate factor applied to 'event' views is (%)`,
3547    help        => q`
3548      Normally ZoneMinder will display 'event' streams at their
3549      native rate, i.e. as close to real-time as possible. However if
3550      you have long events it is often convenient to replay them at a
3551      faster rate for review. This option lets you specify what the
3552      default replay rate will be. It is expressed as a percentage so
3553      100 is normal rate, 200 is double speed etc.
3554      `,
3555    type        => {
3556      db_type     =>'integer',
3557      hint        =>'25|50|100|150|200|400|1000|2500|5000|10000',
3558      pattern     =>qr|^(\d+)$|, format=>q( $1 )
3559    },
3560    category    => 'lowband',
3561  },
3562  {
3563    name        => 'ZM_WEB_L_VIDEO_BITRATE',
3564    default     => '25000',
3565    description => 'What the bitrate of the video encoded stream should be set to',
3566    help        => q`
3567      When encoding real video via the ffmpeg library a bit rate can
3568      be specified which roughly corresponds to the available
3569      bandwidth used for the stream. This setting effectively
3570      corresponds to a 'quality' setting for the video. A low value
3571      will result in a blocky image whereas a high value will produce
3572      a clearer view. Note that this setting does not control the
3573      frame rate of the video however the quality of the video
3574      produced is affected both by this setting and the frame rate
3575      that the video is produced at. A higher frame rate at a
3576      particular bit rate result in individual frames being at a
3577      lower quality.
3578      `,
3579    type        => $types{integer},
3580    category    => 'lowband',
3581  },
3582  {
3583    name        => 'ZM_WEB_L_VIDEO_MAXFPS',
3584    default     => '5',
3585    description => 'What the maximum frame rate for streamed video should be',
3586    help        => q`
3587      When using streamed video the main control is the bitrate which
3588      determines how much data can be transmitted. However a lower
3589      bitrate at high frame rates results in a lower quality image.
3590      This option allows you to limit the maximum frame rate to
3591      ensure that video quality is maintained. An additional
3592      advantage is that encoding video at high frame rates is a
3593      processor intensive task when for the most part a very high
3594      frame rate offers little perceptible improvement over one that
3595      has a more manageable resource requirement. Note, this option
3596      is implemented as a cap beyond which binary reduction takes
3597      place. So if you have a device capturing at 15fps and set this
3598      option to 10fps then the video is not produced at 10fps, but
3599      rather at 7.5fps (15 divided by 2) as the final frame rate must
3600      be the original divided by a power of 2.
3601      `,
3602    type        => $types{integer},
3603    category    => 'lowband',
3604  },
3605  {
3606    name        => 'ZM_WEB_L_SCALE_THUMBS',
3607    default     => 'yes',
3608    description => 'Scale thumbnails in events, bandwidth versus CPU in rescaling',
3609    help        => q`
3610      If unset, this option sends the whole image to the browser
3611      which resizes it in the window. If set the image is scaled down
3612      on the server before sending a reduced size image to the
3613      browser to conserve bandwidth at the cost of CPU on the server.
3614      Note that ZM can only perform the resizing if the appropriate
3615      PHP graphics functionality is installed. This is usually
3616      available in the php-gd package.
3617      `,
3618    type        => $types{boolean},
3619    category    => 'lowband',
3620  },
3621  {
3622    name        => 'ZM_WEB_L_EVENTS_VIEW',
3623    default     => 'events',
3624    description => 'What the default view of multiple events should be.',
3625    help        => q`
3626      Stored events can be viewed in either an events list format or
3627      in a timeline based one. This option sets the default view that
3628      will be used. Choosing one view here does not prevent the other
3629      view being used as it will always be selectable from whichever
3630      view is currently being used.
3631      `,
3632    type        => {
3633      db_type     =>'string',
3634      hint        =>'events|timeline',
3635      pattern     =>qr|^([lt])|i,
3636      format      =>q( $1 =~ /^e/ ? 'events' : 'timeline' )
3637    },
3638    category    => 'lowband',
3639  },
3640  {
3641    name        => 'ZM_WEB_L_SHOW_PROGRESS',
3642    default     => 'no',
3643    description => 'Show the progress of replay in event view.',
3644    help        => q`
3645      When viewing events an event navigation panel and progress bar
3646      is shown below the event itself. This allows you to jump to
3647      specific points in the event, but can also dynamically
3648      update to display the current progress of the event replay
3649      itself. This progress is calculated from the actual event
3650      duration and is not directly linked to the replay itself, so on
3651      limited bandwidth connections may be out of step with the
3652      replay. This option allows you to turn off the progress
3653      display, whilst still keeping the navigation aspect, where
3654      bandwidth prevents it functioning effectively.
3655      `,
3656    type        => $types{boolean},
3657    category    => 'lowband',
3658  },
3659  {
3660    name        => 'ZM_WEB_L_AJAX_TIMEOUT',
3661    default     => '10000',
3662    description => 'How long to wait for Ajax request responses (ms)',
3663    help        => q`
3664      The newer versions of the live feed and event views use Ajax to
3665      request information from the server and populate the views
3666      dynamically. This option allows you to specify a timeout if
3667      required after which requests are abandoned. A timeout may be
3668      necessary if requests would overwise hang such as on a slow
3669      connection. This would tend to consume a lot of browser memory
3670      and make the interface unresponsive. Ordinarily no requests
3671      should timeout so this setting should be set to a value greater
3672      than the slowest expected response. This value is in
3673      milliseconds but if set to zero then no timeout will be used.
3674      `,
3675    type        => $types{integer},
3676    category    => 'lowband',
3677  },
3678  {
3679    name        => 'ZM_DYN_LAST_VERSION',
3680    default     => '',
3681    description => 'What the last version of ZoneMinder recorded from zoneminder.com is',
3682    help        => '',
3683    type        => $types{string},
3684    readonly    => 1,
3685    category    => 'dynamic',
3686  },
3687  {
3688    name        => 'ZM_DYN_CURR_VERSION',
3689    default     => '@VERSION@',
3690    description => q`
3691      What the effective current version of ZoneMinder is, might be
3692      different from actual if versions ignored
3693      `,
3694    help        => '',
3695    type        => $types{string},
3696    readonly    => 1,
3697    category    => 'dynamic',
3698  },
3699  {
3700    name        => 'ZM_DYN_DB_VERSION',
3701    default     => '@VERSION@',
3702    description => 'What the version of the database is, from zmupdate',
3703    help        => '',
3704    type        => $types{string},
3705    readonly    => 1,
3706    category    => 'dynamic',
3707  },
3708  {
3709    name        => 'ZM_DYN_LAST_CHECK',
3710    default     => '',
3711    description => 'When the last check for version from zoneminder.com was',
3712    help        => '',
3713    type        => $types{integer},
3714    readonly    => 1,
3715    category    => 'dynamic',
3716  },
3717  {
3718    name        => 'ZM_DYN_NEXT_REMINDER',
3719    default     => '',
3720    description => 'When the earliest time to remind about versions will be',
3721    help        => '',
3722    type        => $types{string},
3723    readonly    => 1,
3724    category    => 'dynamic',
3725  },
3726  {
3727    name        => 'ZM_DYN_DONATE_REMINDER_TIME',
3728    default     => 0,
3729    description => 'When the earliest time to remind about donations will be',
3730    help        => '',
3731    type        => $types{integer},
3732    readonly    => 1,
3733    category    => 'dynamic',
3734  },
3735  {
3736    name        => 'ZM_DYN_SHOW_DONATE_REMINDER',
3737    default     => 'yes',
3738    description => 'Remind about donations or not',
3739    help        => '',
3740    type        => $types{boolean},
3741    readonly    => 1,
3742    category    => 'dynamic',
3743  },
3744  {
3745    name        => 'ZM_SHOW_PRIVACY',
3746    default     => 'yes',
3747    description => 'Present the privacy statment',
3748    help        => '',
3749    type        => $types{boolean},
3750    readonly    => 1,
3751    category    => 'dynamic',
3752  },
3753  {
3754    name        => 'ZM_SSMTP_MAIL',
3755    default     => 'no',
3756    description =>  q`
3757      Use a SSMTP mail server if available.
3758      NEW_MAIL_MODULES must be enabled
3759      `,
3760    requires    => [
3761      { name => 'ZM_OPT_EMAIL', value => 'yes' },
3762      { name => 'ZM_OPT_MESSAGE', value => 'yes' },
3763      { name => 'ZM_NEW_MAIL_MODULES', value => 'yes' }
3764    ],
3765    help        => q`
3766      SSMTP is a lightweight and efficient method to send email.
3767      The SSMTP application is not installed by default.
3768      NEW_MAIL_MODULES must also be enabled.
3769      Please visit the ZoneMinder [SSMTP Wiki page](http://www.zoneminder.com/wiki/index.php/How_to_get_ssmtp_working_with_Zoneminder)
3770      for setup and configuration help.
3771      `,
3772    type        => $types{boolean},
3773    category    => 'mail',
3774  },
3775  {
3776    name        => 'ZM_SSMTP_PATH',
3777    default     => '',
3778    description => 'SSMTP executable path',
3779    requires    => [{ name => 'ZM_SSMTP_MAIL', value => 'yes' }],
3780    help        => q`
3781      Recommend setting the path to the SSMTP application.
3782      If path is not defined. Zoneminder will try to determine
3783      the path via shell command. Example path: /usr/sbin/ssmtp.
3784      `,
3785    type        => $types{string},
3786    category    => 'mail',
3787  },
3788  {
3789    name  =>  'ZM_COOKIE_LIFETIME',
3790    default =>  '3600',
3791    description => q`The maximum life of a COOKIE used when setting up PHP's session handler.`,
3792  help          => q`This will affect how long a session will be valid for since the last request.  Keeping this short helps prevent session hijacking.  Keeping it long allows you to stay logged in longer without refreshing the view.`,
3793    type        =>  $types{integer},
3794    category    =>  'system',
3795  },
3796  {
3797    name        => 'ZM_RECORD_DIAG_IMAGES_FIFO',
3798    default     => 'no',
3799    description => ' Recording intermediate alarm diagnostic use fifo instead of files (faster)',
3800    help        => 'This tries to lessen the load of recording diag images by sending them to a memory FIFO pipe instead of creating each file.',
3801    type        => $types{boolean},
3802    category    => 'logging',
3803  },
3804  {
3805    name        => 'ZM_FONT_FILE_LOCATION',
3806    default     => '@ZM_FONTDIR@/default.zmfnt',
3807    description => 'Font file location',
3808    help        => 'This font is used for timestamp labels.',
3809    type        => $types{string},
3810    category    => 'config',
3811  },
3812);
3813
3814our %options_hash = map { ( $_->{name}, $_ ) } @options;
3815
3816# This function should never need to be called explicitly, except if
3817# this module is 'require'd rather than 'use'd. See zmconfgen.pl.
3818sub initialiseConfig {
3819  return if $configInitialised;
3820
3821# Do some initial data munging to finish the data structures
3822# Create option ids
3823  my $option_id = 0;
3824  foreach my $option ( @options ) {
3825    if ( defined($option->{default}) ) {
3826      $option->{value} = $option->{default}
3827    } else {
3828      $option->{value} = '';
3829    }
3830    $option->{id} = $option_id++;
3831  }
3832  $configInitialised = 1;
3833}
3834
38351;
3836__END__
3837
3838=head1 NAME
3839
3840ZoneMinder::ConfigData - ZoneMinder Configuration Data module
3841
3842=head1 SYNOPSIS
3843
3844use ZoneMinder::ConfigData;
3845use ZoneMinder::ConfigData qw(:all);
3846
3847loadConfigFromDB();
3848saveConfigToDB();
3849
3850=head1 DESCRIPTION
3851
3852The ZoneMinder:ConfigData module contains the master definition of the
3853ZoneMinder configuration options as well as helper methods. This module is
3854intended for specialist configuration management and would not normally be
3855used by end users.
3856
3857The configuration held in this module, which was previously in zmconfig.pl,
3858includes the name, default value, description, help text, type and category
3859for each option, as well as a number of additional fields in a small number
3860of cases.
3861
3862=head1 METHODS
3863
3864=over 4
3865
3866=item loadConfigFromDB ();
3867
3868Loads existing configuration from the database (if any) and merges it with
3869the definitions held in this module. This results in the merging of any new
3870configuration and the removal of any deprecated configuration while
3871preserving the existing values of every else.
3872
3873=item saveConfigToDB ();
3874
3875Saves configuration held in memory to the database. The act of loading and
3876saving configuration is a convenient way to ensure that the configuration
3877held in the database corresponds with the most recent definitions and that
3878all components are using the same set of configuration.
3879
3880=back
3881
3882=head2 EXPORT
3883
3884None by default.
3885The :data tag will export the various configuration data structures
3886The :functions tag will export the helper functions.
3887The :all tag will export all above symbols.
3888
3889
3890=head1 SEE ALSO
3891
3892http://www.zoneminder.com
3893
3894=head1 AUTHOR
3895
3896Philip Coombes, E<lt>philip.coombes@zoneminder.comE<gt>
3897
3898=head1 COPYRIGHT AND LICENSE
3899
3900Copyright (C) 2001-2008  Philip Coombes
3901
3902This library is free software; you can redistribute it and/or modify
3903it under the same terms as Perl itself, either Perl version 5.8.3 or,
3904at your option, any later version of Perl 5 you may have available.
3905
3906
3907=cut
3908