diff --git a/Dockerfile b/Dockerfile index 382330a09..46b3dac5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # ZoneMinder -FROM ubuntu:precise +FROM ubuntu:trusty MAINTAINER Kyle Johnson # Let the container know that there is no tty @@ -10,10 +10,10 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -y \ libpolkit-gobject-1-dev build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev \ libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libpcre3 \ - libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf libjpeg-turbo8-dev \ + libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm cmake libjpeg-turbo8-dev \ libjpeg-turbo8 libtheora-dev libvorbis-dev libvpx-dev libx264-dev libmp4v2-dev libav-tools mysql-client \ apache2 php5 php5-mysql apache2-mpm-prefork libapache2-mod-php5 php5-cli openssh-server \ - mysql-server libvlc-dev libvlc5 libvlccore-dev libvlccore5 vlc-data libcurl4-openssl-dev \ + mysql-server libvlc-dev libvlc5 libvlccore-dev libvlccore7 vlc-data libcurl4-openssl-dev \ libavformat-dev libswscale-dev libavutil-dev libavcodec-dev libavfilter-dev \ libavresample-dev libavdevice-dev libpostproc-dev libv4l-dev libtool libnetpbm10-dev \ libmime-lite-perl dh-autoreconf dpatch @@ -25,10 +25,11 @@ ADD . /ZoneMinder WORKDIR /ZoneMinder # Setup the ZoneMinder build environment -RUN aclocal && autoheader && automake --force-missing --add-missing && autoconf +#RUN aclocal && autoheader && automake --force-missing --add-missing && autoconf # Configure ZoneMinder -RUN ./configure --with-libarch=lib/$DEB_HOST_GNU_TYPE --disable-debug --host=$DEB_HOST_GNU_TYPE --build=$DEB_BUILD_GNU_TYPE --with-mysql=/usr --with-webdir=/var/www/zm --with-ffmpeg=/usr --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-mmap=yes ZM_SSL_LIB=openssl ZM_DB_USER=zm ZM_DB_PASS=zm +#RUN ./configure --with-libarch=lib/$DEB_HOST_GNU_TYPE --disable-debug --host=$DEB_HOST_GNU_TYPE --build=$DEB_BUILD_GNU_TYPE --with-mysql=/usr --with-webdir=/var/www/zm --with-ffmpeg=/usr --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-mmap=yes --enable-onvif ZM_SSL_LIB=openssl ZM_DB_USER=zm ZM_DB_PASS=zm +RUN cmake . # Build ZoneMinder RUN make @@ -36,6 +37,9 @@ RUN make # Install ZoneMinder RUN make install +# ensure writable folders +RUN ./zmlinkcontent.sh + # Adding the start script ADD utils/docker/start.sh /tmp/start.sh @@ -43,15 +47,23 @@ ADD utils/docker/start.sh /tmp/start.sh # TODO - Files ADD'ed have 755 already...why do we need this? RUN chmod 755 /tmp/start.sh +# give files in /usr/local/share/zoneminder/ +RUN chown -R www-data:www-data /usr/local/share/zoneminder/ + # Creating SSH privledge escalation dir RUN mkdir /var/run/sshd # Adding apache virtual hosts file -ADD utils/docker/apache-vhost /etc/apache2/sites-enabled/000-default +ADD utils/docker/apache-vhost /etc/apache2/sites-available/000-default.conf +ADD utils/docker/phpdate.ini /etc/php5/apache2/conf.d/25-phpdate.ini # Set the root passwd RUN echo 'root:root' | chpasswd +# Add a user we can actually login with +RUN useradd -m -s /bin/bash -G sudo zoneminder +RUN echo 'zoneminder:zoneminder' | chpasswd + # Expose ssh and http ports EXPOSE 80 EXPOSE 22 diff --git a/distros/ubuntu1204_cmake/control b/distros/ubuntu1204_cmake/control index 4b4877562..fd7a53049 100644 --- a/distros/ubuntu1204_cmake/control +++ b/distros/ubuntu1204_cmake/control @@ -51,7 +51,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} ,libwww-perl ,mysql-client | virtual-mysql-client ,perl-modules - ,php5-mysql + ,php5-mysql, php5-gd ,policykit-1 ,rsyslog | system-log-daemon ,zip diff --git a/utils/docker/apache-vhost b/utils/docker/apache-vhost index 622e4b5e4..5f59c01b2 100644 --- a/utils/docker/apache-vhost +++ b/utils/docker/apache-vhost @@ -6,8 +6,7 @@ AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch - Order allow,deny - Allow from all + require all granted diff --git a/utils/docker/phpdate.ini b/utils/docker/phpdate.ini new file mode 100644 index 000000000..d35b47361 --- /dev/null +++ b/utils/docker/phpdate.ini @@ -0,0 +1,5 @@ +[Date] +; Defines the default timezone used by the date functions +; http://php.net/date.timezone +date.timezone = GMT + diff --git a/utils/docker/start.sh b/utils/docker/start.sh index 76ad3dcbb..0772f7b9b 100644 --- a/utils/docker/start.sh +++ b/utils/docker/start.sh @@ -1,5 +1,11 @@ #!/bin/bash +# Prepare proper amount of shared memory +# For H.264 cameras it may be necessary to increase the amout of shared memory +# to 2048 megabytes. +umount /dev/shm +mount -t tmpfs -o rw,nosuid,nodev,noexec,relatime,size=512M tmpfs /dev/shm + # Start MySQL /usr/bin/mysqld_safe & @@ -25,7 +31,13 @@ done mysql -u root < db/zm_create.sql # Add the ZoneMinder DB user -mysql -u root -e "grant insert,select,update,delete,lock tables,alter on zm.* to 'zm'@'localhost' identified by 'zm'" +mysql -u root -e "grant insert,select,update,delete,lock tables,alter on zm.* to 'zmuser'@'localhost' identified by 'zmpass';" + +# Activate CGI +a2enmod cgi + +# Activate modrewrite +a2enmod rewrite # Restart apache service apache2 restart diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index 31ffd9232..4568e974a 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -804,7 +804,7 @@ switch ( $tab ) elseif ( $newMonitor['Type'] == "Remote" ) { ?> - + -  () checked="checked"/> + > () checked="checked"/>