diff --git a/Dockerfile b/Dockerfile index 1f39d96..53c9b21 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,15 +17,16 @@ RUN apt-get install -y \ apt-transport-https \ gnupg \ wget \ -&& wget -O - https://zmrepo.zoneminder.com/debian/archive-keyring.gpg | apt-key add - \ -&& echo 'deb https://zmrepo.zoneminder.com/debian/release-1.34 buster/' >> /etc/apt/sources.list +msmtp \ +msmtp-mta + +RUN wget -O - https://zmrepo.zoneminder.com/debian/archive-keyring.gpg | apt-key add - \ +&& echo 'deb https://zmrepo.zoneminder.com/debian/release-1.36 buster/' >> /etc/apt/sources.list RUN apt-get update RUN apt-get install -y \ -zoneminder \ -msmtp \ -msmtp-mta +zoneminder RUN adduser www-data video @@ -37,7 +38,7 @@ RUN a2enmod ssl \ RUN mkdir /config COPY entrypoint.sh / -run chmod +x /entrypoint.sh +RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] VOLUME /config diff --git a/README.md b/README.md index f590697..eab952d 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,10 @@ Just run the image publishing the port and setting the ENV variables, the shm de ` nardo86/zoneminder` -The SELFSIGNED flag will , the FQDN will be used for configuring Apache2 and, in case of using the SWAG certificate, find the correct folder and the /config folder will contain msmtp and mysql configuration. +The FQDN will be used for configuring Apache2; the SELFSIGNED flag will generate a selfsigned certificate if needed else, in case of using the SWAG certificate, the system find the correct folder. +The /config folder will contain msmtp and mysql configuration. -The shm-size will be the quantity of RAM dedicated to /dev/shm.* +The shm-size will be the quantity of RAM dedicated to /dev/shm, the size depends on the number and settings of the video sources to monitor, check ZoneMinder configuration for further information.* **be sure to not reserve too much RAM to this machine or the docker server wil start to paging and eventually becoming unresponsible** diff --git a/entrypoint.sh b/entrypoint.sh index c3c30a1..f3f09db 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,6 @@ #!/bin/bash -echo $TZ > /etc/timezone +#echo $TZ > /etc/timezone +ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone echo "Configuring MariaDBPath" if [ ! -d /config/mysql ]; then @@ -54,7 +55,7 @@ fi echo "Checking Timezones" RESULT=$(cat /etc/mysql/my.cnf| grep default-time-zone) -if [ "$RESULT" = "" ]; then +if [ "$RESULT" != "default-time-zone=$(cat /etc/timezone)" ]; then echo "Set Mysql timezone" printf "[mysqld]\n default-time-zone=$(cat /etc/timezone)" >> /etc/mysql/my.cnf /etc/init.d/mysql restart @@ -65,9 +66,9 @@ if [ "$RESULT" = "" ]; then fi RESULT=$(cat /etc/php/*/apache2/php.ini| grep "date.timezone =") -if [ "$RESULT" = ";date.timezone =" ]; then +if [ "$RESULT" != "date.timezone = $(sed 's/\\/\//' /etc/timezone)" ]; then echo "Set Php timezone" - sed -i "s/;date.timezone =/date.timezone = $(sed 's/\//\\\//' /etc/timezone)/g" /etc/php/*/apache2/php.ini + sed -i "s/;date.timezone =/date.timezone = $(sed 's/\\/\//' /etc/timezone)/g" /etc/php/*/apache2/php.ini fi echo "Checking MSMTP configuration" @@ -92,7 +93,7 @@ ln -s /config/msmtprc /etc/msmtprc fi if [ "$SELFSIGNED" = "0" ]; then -echo "Configuro collegamento a swag" +echo "Linking to SWAG" sed -i -e 's,/etc/ssl/certs/ssl-cert-snakeoil.pem,/sslcert/live/'$FQDN'/cert.pem,g' /etc/apache2/sites-available/default-ssl.conf sed -i -e 's,/etc/ssl/private/ssl-cert-snakeoil.key,/sslcert/live/'$FQDN'/privkey.pem,g' /etc/apache2/sites-available/default-ssl.conf fi