From 2640791b89374765f3448abd3678a0623ec212b4 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 23 Aug 2021 17:11:40 -0400 Subject: [PATCH 1/5] spacing --- web/skins/classic/views/js/watch.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index 6aa5b93ec..66dabc7ec 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -73,10 +73,10 @@ function processRows(rows) { function showEvents() { $j('#ptzControls').addClass('hidden'); $j('#events').removeClass('hidden'); - if ( $j('#eventsControl') ) { + if ($j('#eventsControl')) { $j('#eventsControl').addClass('hidden'); } - if ( $j('#controlControl') ) { + if ($j('#controlControl')) { $j('#controlControl').removeClass('hidden'); } showMode = 'events'; @@ -85,10 +85,10 @@ function showEvents() { function showPtzControls() { $j('#events').addClass('hidden'); $j('#ptzControls').removeClass('hidden'); - if ( $j('#eventsControl') ) { + if ($j('#eventsControl')) { $j('#eventsControl').removeClass('hidden'); } - if ( $j('#controlControl') ) { + if ($j('#controlControl')) { $j('#controlControl').addClass('hidden'); } showMode = 'control'; @@ -132,13 +132,13 @@ function setAlarmState(currentAlarmState) { alarmState = currentAlarmState; var stateClass = ''; - if ( alarmState == STATE_ALARM ) { + if (alarmState == STATE_ALARM) { stateClass = 'alarm'; - } else if ( alarmState == STATE_ALERT ) { + } else if (alarmState == STATE_ALERT) { stateClass = 'alert'; } $j('#stateValue').text(stateStrings[alarmState]); - if ( stateClass ) { + if (stateClass) { $j('#stateValue').addClass(stateClass); } else { $j('#stateValue').removeClass(); @@ -855,10 +855,10 @@ function initPage() { if (monitorType != 'WebSite') { if (streamMode == 'single') { - statusCmdTimer = setTimeout(statusCmdQuery, (Math.random()+0.1)*statusRefreshTimeout ); + statusCmdTimer = setTimeout(statusCmdQuery, (Math.random()+0.1)*statusRefreshTimeout); setInterval(watchdogCheck, statusRefreshTimeout*2, 'status'); } else { - streamCmdTimer = setTimeout(streamCmdQuery, (Math.random()+0.1)*statusRefreshTimeout ); + streamCmdTimer = setTimeout(streamCmdQuery, (Math.random()+0.1)*statusRefreshTimeout); setInterval(watchdogCheck, statusRefreshTimeout*2, 'stream'); } From 7c1c8482c6c3a7e681c5eb406d62f3284006c80b Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 24 Aug 2021 10:23:24 -0400 Subject: [PATCH 2/5] Make failure to resolve non fatal --- src/zm_remote_camera.cpp | 3 ++- src/zm_remote_camera_http.cpp | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/zm_remote_camera.cpp b/src/zm_remote_camera.cpp index 5e3dfefae..9cb948352 100644 --- a/src/zm_remote_camera.cpp +++ b/src/zm_remote_camera.cpp @@ -100,7 +100,8 @@ void RemoteCamera::Initialise() { int ret = getaddrinfo(host.c_str(), port.c_str(), &hints, &hp); if ( ret != 0 ) { - Fatal( "Can't getaddrinfo(%s port %s): %s", host.c_str(), port.c_str(), gai_strerror(ret) ); + Error( "Can't getaddrinfo(%s port %s): %s", host.c_str(), port.c_str(), gai_strerror(ret) ); + return; } struct addrinfo *p = nullptr; int addr_count = 0; diff --git a/src/zm_remote_camera_http.cpp b/src/zm_remote_camera_http.cpp index 5bfab0966..6169149da 100644 --- a/src/zm_remote_camera_http.cpp +++ b/src/zm_remote_camera_http.cpp @@ -144,6 +144,14 @@ void RemoteCameraHttp::Initialise() { int RemoteCameraHttp::Connect() { struct addrinfo *p = nullptr; + if (!hp) { + RemoteCamera::Initialise(); + if (!hp) { + Error("Unable to resolve address for remote camera, aborting"); + return -1; + } + } + for ( p = hp; p != nullptr; p = p->ai_next ) { sd = socket( p->ai_family, p->ai_socktype, p->ai_protocol ); if ( sd < 0 ) { From dbe16a9cb49e723b0d13b09866f7f5079a8ad47a Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 26 Aug 2021 10:45:36 -0400 Subject: [PATCH 3/5] Don't use AUTH_HASH_IPS when talking to zmu as it doesn't support that at this time. --- web/api/app/Controller/MonitorsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/api/app/Controller/MonitorsController.php b/web/api/app/Controller/MonitorsController.php index 110f590a6..07098623e 100644 --- a/web/api/app/Controller/MonitorsController.php +++ b/web/api/app/Controller/MonitorsController.php @@ -266,7 +266,7 @@ class MonitorsController extends AppController { if ($mToken) { $auth = ' -T '.$mToken; } else if (ZM_AUTH_RELAY == 'hashed') { - $auth = ' -A '.calculateAuthHash(ZM_AUTH_HASH_IPS?$_SERVER['REMOTE_ADDR']:''); + $auth = ' -A '.calculateAuthHash(''); # Can't do REMOTE_IP because zmu doesn't normally have access to it. } else if (ZM_AUTH_RELAY == 'plain') { # Plain requires the plain text password which must either be in request or stored in session $password = $this->request->query('pass') ? $this->request->query('pass') : $this->request->data('pass');; From 84ccf10e651472ebc15620e18b3d0b2cfdcc9bba Mon Sep 17 00:00:00 2001 From: gmanproxtreme <36477327+gmanproxtreme@users.noreply.github.com> Date: Fri, 27 Aug 2021 20:21:02 +1000 Subject: [PATCH 4/5] Updated WEB_TITLE section from ToDo. The Web_Title's use was unknown. I have seen the changed title appear on the login screen. Documentation updated to reflect this. --- docs/userguide/options/options_web.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/userguide/options/options_web.rst b/docs/userguide/options/options_web.rst index 6766a2248..7ae0ac628 100644 --- a/docs/userguide/options/options_web.rst +++ b/docs/userguide/options/options_web.rst @@ -5,10 +5,7 @@ This screen lets you customize several aspects of the web interface of ZoneMinde .. image:: images/Options_web.png -WEB_TITLE - - -.. todo :: - not quite sure what this does. Seems to change the "target" name - not sure what effect it is supposed to have. +WEB_TITLE - The actual text that is shown on the login screen. It is possible that it also appears in other areas. WEB_TITLE_PREFIX - If you have more than one installation of ZoneMinder it can be helpful to display different titles for each one. Changing this option allows you to customise the window titles to include further information to aid identification. @@ -48,4 +45,4 @@ WEB_USE_OBJECT_TAGS - There are two methods of including media content in web pa WEB_XFRAME_WARN - When creating a Web Site monitor, if the target web site has X-Frame-Options set to sameorigin in the header, the site will not display in ZoneMinder. This is a design feature in most modern browsers. When this condition occurs, ZoneMinder will write a warning to the log file. To get around this, one can install a browser plugin or extension to ignore X-Frame headers, and then the page will display properly. Once the plugin or extension has ben installed, the end user may choose to turn this warning off -WEB_FILTER_SOURCE - This option only affects monitors with a source type of Ffmpeg, Libvlc, or WebSite. This setting controls what information is displayed in the Source column on the console. Selecting 'None' will not filter anything. The entire source string will be displayed, which may contain sensitive information. Selecting 'NoCredentials' will strip out usernames and passwords from the string. If there are any port numbers in the string and they are common (80, 554, etc) then those will be removed as well. Selecting 'Hostname' will filter out all information except for the hostname or ip address. When in doubt, stay with the default 'Hostname'. This feature uses the php function 'url_parts' to identify the various pieces of the url. If the url in question is unusual or not standard in some way, then filtering may not produce the desired results. \ No newline at end of file +WEB_FILTER_SOURCE - This option only affects monitors with a source type of Ffmpeg, Libvlc, or WebSite. This setting controls what information is displayed in the Source column on the console. Selecting 'None' will not filter anything. The entire source string will be displayed, which may contain sensitive information. Selecting 'NoCredentials' will strip out usernames and passwords from the string. If there are any port numbers in the string and they are common (80, 554, etc) then those will be removed as well. Selecting 'Hostname' will filter out all information except for the hostname or ip address. When in doubt, stay with the default 'Hostname'. This feature uses the php function 'url_parts' to identify the various pieces of the url. If the url in question is unusual or not standard in some way, then filtering may not produce the desired results. From a52b9057baa09b10981e7c6372fa266f78284c30 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 27 Aug 2021 11:40:29 -0400 Subject: [PATCH 5/5] stretch has debhelper 10 --- distros/ubuntu2004/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distros/ubuntu2004/control b/distros/ubuntu2004/control index a4683bfde..8901e8a58 100644 --- a/distros/ubuntu2004/control +++ b/distros/ubuntu2004/control @@ -2,7 +2,7 @@ Source: zoneminder Section: net Priority: optional Maintainer: Isaac Connor -Build-Depends: debhelper (>= 11), sphinx-doc, python3-sphinx, dh-linktree, dh-apache2 +Build-Depends: debhelper (>= 10), sphinx-doc, python3-sphinx, dh-linktree, dh-apache2 ,cmake ,libavcodec-dev ,libavformat-dev