remove ZM_DIR_IMAGES (#2374)

This commit is contained in:
Andrew Bauer 2018-12-29 08:52:58 -06:00 committed by Isaac Connor
parent 03e0be558f
commit 3258d8e590
22 changed files with 10 additions and 101 deletions

View File

@ -162,9 +162,6 @@ set(ZM_WEB_GROUP "" CACHE STRING
Leave empty to be the same as the web user")
set(ZM_DIR_EVENTS "${ZM_CONTENTDIR}/events" CACHE PATH
"Location where events are recorded to, default: ZM_CONTENTDIR/events")
set(ZM_DIR_IMAGES "${ZM_CONTENTDIR}/images" CACHE PATH
"Location where images, not directly associated with events,
are recorded to, default: ZM_CONTENTDIR/images")
set(ZM_DIR_SOUNDS "sounds" CACHE PATH
"Location to look for optional sound files, default: sounds")
set(ZM_PATH_ZMS "/cgi-bin/nph-zms" CACHE PATH
@ -225,7 +222,6 @@ if((ZM_TARGET_DISTRO MATCHES "^el") OR (ZM_TARGET_DISTRO MATCHES "^fc"))
set(ZM_WEBDIR "/usr/share/zoneminder/www")
set(ZM_CGIDIR "/usr/libexec/zoneminder/cgi-bin")
set(ZM_DIR_EVENTS "/var/lib/zoneminder/events")
set(ZM_DIR_IMAGES "/var/lib/zoneminder/images")
set(ZM_PATH_ZMS "/cgi-bin-zm/nph-zms")
elseif(ZM_TARGET_DISTRO STREQUAL "OS13")
set(ZM_RUNDIR "/var/run/zoneminder")

View File

@ -51,7 +51,6 @@ Possible configuration options:
ZM_WEB_USER The user apache or the local web server runs on. Leave empty for automatic detection. If that fails, you can use this variable to force
ZM_WEB_GROUP The group apache or the local web server runs on, Leave empty to be the same as the web user
ZM_DIR_EVENTS Location where events are recorded to, default: ZM_CONTENTDIR/events
ZM_DIR_IMAGES Location where images, not directly associated with events, are recorded to, default: ZM_CONTENTDIR/images
ZM_DIR_SOUNDS Location to look for optional sound files, default: sounds
ZM_PATH_ZMS Web url to zms streaming server, default: /cgi-bin/nph-zms
Advanced:
@ -129,8 +128,8 @@ cmake -C zm_conf.cmake [extra options] .
2) Run "make" to compile ZoneMinder
3) Run "make install" (as root, or use sudo) to install ZoneMinder to your system.
4) Depending on your configuration: If the DIR_EVENTS and DIR_IMAGES options are set to default (pointing to web directory/events and web directory/images), You will need to update the symlinks in the web directory to the correct folders. e.g. web directory/events should point to the real events directory, and likewise for the images directory.
You can use the zmlinkcontent.sh script for this. For example, if /var/lib/zoneminder is the folder that contains the "images" and "events" directories, you can use:
4) Depending on your configuration: If DIR_EVENTS is set to default, You will need to update the symlinks in the web directory to the correct folders. e.g. web directory/events should point to the real events directory.
You can use the zmlinkcontent.sh script for this. For example, if /var/lib/zoneminder is the folder that contains the "events" directory, you can use:
./zmlinkcontent.sh /var/lib/zoneminder
By default, the content directory for new installations is /var/lib/zoneminder. This can be overridden in cmake with the ZM_CONTENTDIR option. e.g. cmake -DZM_CONTENTDIR="/some/big/storage/zm" .

View File

@ -16,11 +16,6 @@
# The web account user must have full read/write permission to this folder.
ZM_DIR_EVENTS=@ZM_DIR_EVENTS@
# Full path to the folder images, not directly associated with events,
# are recorded to.
# The web account user must have full read/write permission to this folder.
ZM_DIR_IMAGES=@ZM_DIR_IMAGES@
# Foldername under the webroot where ZoneMinder looks for optional sound files
# to play when an alarm is detected.
ZM_DIR_SOUNDS=@ZM_DIR_SOUNDS@

View File

@ -24,7 +24,6 @@ override_dh_auto_configure:
-DZM_CONFIG_SUBDIR="/etc/zm/conf.d" \
-DZM_CONFIG_DIR="/etc/zm" \
-DZM_DIR_EVENTS="/var/cache/zoneminder/events" \
-DZM_DIR_IMAGES="/var/cache/zoneminder/images" \
-DZM_PATH_ZMS="/zm/cgi-bin/nph-zms"
override_dh_auto_install:

View File

@ -21,7 +21,7 @@ endif(ZM_TARGET_DISTRO MATCHES "^el")
# Configure the common zoneminder files
configure_file(common/zoneminder.logrotate.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.logrotate @ONLY)
configure_file(common/zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY)
file(MAKE_DIRECTORY sock swap zoneminder zoneminder-upload events images temp)
file(MAKE_DIRECTORY sock swap zoneminder zoneminder-upload events temp)
# Configure the Apache zoneminder files
configure_file(httpd/zm-httpd.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zm-httpd.conf @ONLY)
@ -52,7 +52,7 @@ install(DIRECTORY zoneminder DESTINATION /var/log DIRECTORY_PERMISSIONS OWNER_WR
install(DIRECTORY zoneminder DESTINATION /var/run DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(DIRECTORY zoneminder DESTINATION /var/cache DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(DIRECTORY zoneminder-upload DESTINATION /var/spool DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(DIRECTORY events images temp DESTINATION /var/lib/zoneminder DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(DIRECTORY events temp DESTINATION /var/lib/zoneminder DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
# Install the Apache zoneminder files
install(FILES zm-httpd.conf DESTINATION /usr/lib/systemd/system/zoneminder.service.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)

View File

@ -2,5 +2,4 @@ D @ZM_TMPDIR@ 0755 @WEB_USER@ @WEB_GROUP@
D @ZM_SOCKDIR@ 0755 @WEB_USER@ @WEB_GROUP@
D @ZM_CACHEDIR@ 0755 @WEB_USER@ @WEB_GROUP@
d @ZM_DIR_EVENTS@ 0755 @WEB_USER@ @WEB_GROUP@
D @ZM_DIR_IMAGES@ 0755 @WEB_USER@ @WEB_GROUP@

View File

@ -2,5 +2,4 @@ D @ZM_TMPDIR@ 0755 nginx nginx
D @ZM_SOCKDIR@ 0755 nginx nginx
D @ZM_CACHEDIR@ 0755 nginx nginx
d @ZM_DIR_EVENTS@ 0755 nginx nginx
D @ZM_DIR_IMAGES@ 0755 nginx nginx

View File

@ -377,7 +377,6 @@ EOF
%{_tmpfilesdir}/zoneminder.httpd.tmpfiles.conf
%dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_sharedstatedir}/zoneminder
%dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_sharedstatedir}/zoneminder/events
%dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_sharedstatedir}/zoneminder/images
%dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_sharedstatedir}/zoneminder/sock
%dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_sharedstatedir}/zoneminder/swap
%dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_sharedstatedir}/zoneminder/temp
@ -402,7 +401,6 @@ EOF
%{_tmpfilesdir}/zoneminder.nginx.tmpfiles.conf
%dir %attr(755,nginx,nginx) %{_sharedstatedir}/zoneminder
%dir %attr(755,nginx,nginx) %{_sharedstatedir}/zoneminder/events
%dir %attr(755,nginx,nginx) %{_sharedstatedir}/zoneminder/images
%dir %attr(755,nginx,nginx) %{_sharedstatedir}/zoneminder/sock
%dir %attr(755,nginx,nginx) %{_sharedstatedir}/zoneminder/swap
%dir %attr(755,nginx,nginx) %{_sharedstatedir}/zoneminder/temp

View File

@ -27,7 +27,6 @@ override_dh_auto_configure:
-DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \
-DZM_CACHEDIR="/var/cache/zoneminder/cache" \
-DZM_DIR_EVENTS="/var/cache/zoneminder/events" \
-DZM_DIR_IMAGES="/var/cache/zoneminder/images" \
-DZM_PATH_ZMS="/zm/cgi-bin/nph-zms"
override_dh_clean:

View File

@ -64,7 +64,6 @@ override_dh_auto_configure:
-DZM_CONFIG_SUBDIR="/etc/zm/conf.d" \
-DZM_CONFIG_DIR="/etc/zm" \
-DZM_DIR_EVENTS="/var/cache/zoneminder/events" \
-DZM_DIR_IMAGES="/var/cache/zoneminder/images" \
-DZM_PATH_ZMS="/zm/cgi-bin/nph-zms"
override_dh_auto_test:

View File

@ -27,7 +27,6 @@ override_dh_auto_configure:
-DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \
-DZM_CACHEDIR="/var/cache/zoneminder/cache" \
-DZM_DIR_EVENTS="/var/cache/zoneminder/events" \
-DZM_DIR_IMAGES="/var/cache/zoneminder/images" \
-DZM_PATH_ZMS="/zm/cgi-bin/nph-zms"
override_dh_clean:

View File

@ -31,7 +31,6 @@ Add the following content to the file and save your changes:
::
ZM_DIR_EVENTS=/full/path/to/the/events/folder
ZM_DIR_IMAGES=/full/path/to/the/images/folder
**Step 5:** Start ZoneMinder and inspect the ZoneMinder log files for errors.
::

View File

@ -7,8 +7,6 @@ ZM_DIR_EVENTS - This is the path to the events directory where all the event ima
USE_DEEP_STORAGE - Traditionally ZoneMinder stores all events for a monitor in one directory for that monitor. This is simple and efficient except when you have very large amounts of events. Some filesystems are unable to store more than 32k files in one directory and even without this limitation, large numbers of files in a directory can slow creation and deletion of files. This option allows you to select an alternate method of storing events by year/month/day/hour/min/second which has the effect of separating events out into more directories, resulting in less per directory, and also making it easier to manually navigate to any events that may have happened at a particular time or date.
DIR_IMAGES - ZoneMinder generates a myriad of images, mostly of which are associated with events. For those that aren't this is where they go. CAUTION: The directory you specify here cannot be outside the web root. This is a common mistake. Most users should never change this value. If you intend to save images to a second disk or network share, then you should mount the drive or share directly to the ZoneMinder images folder or follow the instructions in the ZoneMinder Wiki titled Using a dedicated Hard Drive.
DIR_SOUNDS - ZoneMinder can optionally play a sound file when an alarm is detected. This indicates where to look for this file. CAUTION: The directory you specify here cannot be outside the web root. Most users should never change this value.
PATH_ZMS - The ZoneMinder streaming server is required to send streamed images to your browser. It will be installed into the cgi-bin path given at configuration time. This option determines what the web path to the server is rather than the local path on your machine. Ordinarily the streaming server runs in parser-header mode however if you experience problems with streaming you can change this to non-parsed-header (nph) mode by changing 'zms' to 'nph-zms'.

View File

@ -48,7 +48,6 @@ use Time::HiRes qw/gettimeofday/;
use Getopt::Long;
use autouse 'Pod::Usage'=>qw(pod2usage);
use constant IMAGE_PATH => $Config{ZM_PATH_WEB}.'/'.$Config{ZM_DIR_IMAGES};
use constant EVENT_PATH => ($Config{ZM_DIR_EVENTS}=~m|/|)
? $Config{ZM_DIR_EVENTS}
: ($Config{ZM_PATH_WEB}.'/'.$Config{ZM_DIR_EVENTS})
@ -144,7 +143,8 @@ require ZoneMinder::Event;
my $max_image_age = 6/24; # 6 hours
my $max_swap_age = 24/24; # 24 hours
my $image_path = IMAGE_PATH;
# images now live under the event path
my $image_path = EVENT_PATH;
my $loop = 1;
my $cleaned = 0;

View File

@ -176,8 +176,6 @@ void process_configfile( char* configFile) {
staticConfig.SERVER_ID = atoi(val_ptr);
else if ( strcasecmp( name_ptr, "ZM_DIR_EVENTS" ) == 0 )
staticConfig.DIR_EVENTS = std::string(val_ptr);
else if ( strcasecmp( name_ptr, "ZM_DIR_IMAGES" ) == 0 )
staticConfig.DIR_IMAGES = std::string(val_ptr);
else if ( strcasecmp( name_ptr, "ZM_DIR_SOUNDS" ) == 0 )
staticConfig.DIR_SOUNDS = std::string(val_ptr);
else if ( strcasecmp( name_ptr, "ZM_DIR_EXPORTS" ) == 0 )

View File

@ -76,7 +76,6 @@ struct StaticConfig {
std::string SERVER_NAME;
unsigned int SERVER_ID;
std::string DIR_EVENTS;
std::string DIR_IMAGES;
std::string DIR_SOUNDS;
std::string DIR_EXPORTS;
std::string PATH_ZMS;

View File

@ -9,37 +9,6 @@ elseif ( !isset($_REQUEST['zid']) )
ajaxError( 'No zone id(s) supplied' );
}
if ( canView( 'Monitors' ) )
{
switch ( $_REQUEST['action'] )
{
case "zoneImage" :
{
$wd = getcwd();
chdir( ZM_DIR_IMAGES );
$hiColor = '0x00ff00';
$command = getZmuCommand( " -m ".$_REQUEST['mid']." -z" );
if ( !isset($_REQUEST['zid']) )
$_REQUEST['zid'] = 0;
$command .= "'".$_REQUEST['zid'].' '.$hiColor.' '.$_REQUEST['coords']."'";
$status = exec( escapeshellcmd($command) );
chdir( $wd );
$monitor = dbFetchOne( 'SELECT * FROM Monitors WHERE Id = ?', NULL, array($_REQUEST['mid']) );
$points = coordsToPoints( $_REQUEST['coords'] );
ajaxResponse( array(
'zoneImage' => ZM_DIR_IMAGES.'/Zones'.$monitor['Id'].'.jpg?'.time(),
'selfIntersecting' => isSelfIntersecting( $points ),
'area' => getPolyArea( $points )
) );
break;
}
}
}
ajaxError( 'Unrecognised action or insufficient permissions' );
?>

View File

@ -7,12 +7,10 @@ class ImageComponent extends Component {
$captImage = sprintf( "%0".$config['ZM_EVENT_IMAGE_DIGITS']."d-capture.jpg", $frame['Frame']['FrameId'] );
$captPath = $eventPath.'/'.$captImage;
$thumbCaptPath = $config['ZM_DIR_IMAGES'].'/'.$event['Event']['Id'].'-'.$captImage;
$analImage = sprintf( "%0".$config['ZM_EVENT_IMAGE_DIGITS']."d-analyse.jpg", $frame['Frame']['FrameId'] );
$analPath = $eventPath.'/'.$analImage;
$analFile = $config['ZM_DIR_EVENTS']."/".$analPath;
$thumbAnalPath = $config['ZM_DIR_IMAGES'].'/'.$event['Event']['Id'].'-'.$analImage;
$alarmFrame = $frame['Frame']['Type']=='Alarm';
@ -31,8 +29,8 @@ class ImageComponent extends Component {
$fraction = sprintf( "%.3f", $scale/100 );
$scale = (int)round( $scale );
$thumbCaptPath = preg_replace( "/\.jpg$/", "-$scale.jpg", $thumbCaptPath );
$thumbAnalPath = preg_replace( "/\.jpg$/", "-$scale.jpg", $thumbAnalPath );
$thumbCaptPath = preg_replace( "/\.jpg$/", "-$scale.jpg", $captPath );
$thumbAnalPath = preg_replace( "/\.jpg$/", "-$scale.jpg", $analPath );
if ( $isAnalImage )
{

View File

@ -318,7 +318,6 @@ class EventsController extends AppController {
'ZM_WEB_LIST_THUMB_WIDTH',
'ZM_WEB_LIST_THUMB_HEIGHT',
'ZM_EVENT_IMAGE_DIGITS',
'ZM_DIR_IMAGES',
$thumbs,
'ZM_DIR_EVENTS'
)

View File

@ -137,33 +137,4 @@ class ZonesController extends AppController {
return $this->flash(__('The zone could not be deleted. Please, try again.'), array('action' => 'index'));
}
}
public function createZoneImage($id = null) {
$this->loadModel('Monitor');
$this->Monitor->id = $id;
if ( !$this->Monitor->exists() ) {
throw new NotFoundException(__('Invalid zone'));
}
$this->loadModel('Config');
$zm_dir_images = $this->Config->find('list', array(
'conditions' => array('Name' => 'ZM_DIR_IMAGES'),
'fields' => array('Name', 'Value')
));
$zm_dir_images = $zm_dir_images['ZM_DIR_IMAGES'];
$zm_path_web = Configure::read('ZM_PATH_WEB');
$zm_path_bin = Configure::read('ZM_PATH_BIN');
$images_path = "$zm_path_web/$zm_dir_images";
chdir($images_path);
$command = escapeshellcmd("$zm_path_bin/zmu -z -m $id");
system($command, $status);
$this->set(array(
'status' => $status,
'_serialize' => array('status')
));
}
} // end class

View File

@ -164,8 +164,8 @@ $running = null;
CORSHeaders();
// Check for valid content dirs
if ( !is_writable(ZM_DIR_EVENTS) || !is_writable(ZM_DIR_IMAGES) ) {
Warning("Cannot write to content dirs('".ZM_DIR_EVENTS."','".ZM_DIR_IMAGES."'). Check that these exist and are owned by the web account user");
if ( !is_writable(ZM_DIR_EVENTS) ) {
Warning("Cannot write to event folder ".ZM_DIR_EVENTS.". Check that it exists and is owned by the web account user.");
}
# Globals

View File

@ -882,10 +882,6 @@ $OLANG = array(
'Prompt' => "Directorul în care sunt stocate evenimentele",
'Help' => "Acesta este subdirectorul în care sunt salvate imaginile generate de evenimente şi alte fişiere. Implicit este un subdirector al directorului rădăcina zoneminder; dacă spaţiul nu vă permite puteţi să stocaţi imaginile pe altă partiţie, caz în care ar trebui să faceţi un link la subdirectorul implicit."
),
'DIR_IMAGES' => array(
'Prompt' => "Directorul în care sunt stocate imaginile",
'Help' => "ZoneMinder generează multe imagini, majoritate asociate cu evenimente. În acest director vor fi stocate imaginile neasociate evenimentelor."
),
'DIR_SOUNDS' => array(
'Prompt' => "Directorul cu sunetele care pot fi folosite de ZoneMinder",
'Help' => "ZoneMinder poate rula un sunet atunci când este detectată o alarmă. Acesta este directorul în care este stocat sunetul care va fi rulat."