Hi All,
I figure if it takes me a while to set up, documenting it may help others who stumble across this page.
SO FIRSTLY - important note - dlandon’s docker contains a bunch of options to enable face / object detection with yolo/tiny and others. This made it more interesting to me as I was shifting back from Shinobi.
My set up is on a docker using IP cameras (some Wifi most PoE) and a Synology NAS reverse proxy (NGINX) under the hood.
I use https://subdomain.domain.com (this hits my Synology Box which forwards the relevant subdomain to the correct IP and port).
SECONDLY - dlandon has done a great job, even down to autocreating self-signed certs etc to make like easier!
LASTLY - before the steps, the Zoneminder component is also very well built and makes ingesting the components (cameras, switches etc super easy).
Step 1: run the command to show GUID and PUID:
id
Step 2: Docker command (info here)
docker run -d --name="Zoneminder" \
--net="bridge" \
--privileged="true" \
-p 8080:80/tcp \
-p 9000:9000/tcp \
-e TZ="America/Los_Angeles" \
-e SHMEM="50%" \
-e PUID="1000" \
-e PGID="1000" \
-e INSTALL_HOOK="1" \
-e INSTALL_FACE="1" \
-e INSTALL_TINY_YOLO="1" \
-e INSTALL_YOLO="0" \
-v "/home/docker/Zoneminder":"/config":rw \
-v "/home/docker/Zoneminder/data":"/var/cache/zoneminder":rw \
dlandon/zoneminder
Notice the changes I made. I also plan to add a mount to my Synology NAS storage, but that’s down the list.
It takes a fair while to build the first time so be patient.
Step 3: Configure Zoneminder:
i) Add Monitors
ii) customise alarm settings
iii) Add associated zones
iv) ENABLE_AUTH_HASH
v) Enable 3rd Party Event Server
vi) create a new admin user, be sure to provide adequate access.
vii) Enable Auth login
Step 4: Edit the secrets.
for whatever reason I only got a result with this, not the other one. not sure why:
ZMES_PICTURE_URL=http://<IP_of_docker>:8080/zm/index.php?view=image&eid=EVENTID&fid=snapshot&width=600
zm_user & zm_pass are from the new admin user you just created
zm_portal for testing should be http://<IP_of_docker>:8080/zm
same for api http://<IP_of_docker>:8080/zm/api
make sure to add the IP_of_docker
to the top line of the “ServerName” file under the keys folder:
X.X.X.X
localhost
Now delete the .key and .crt files (ZM will recreate them) and restart)
Step 5: Download ZMninja (PC or iOS - if you want to test FCM alerts you’ll need the paid iOS app.
Step 6: Edit the zmeventnotification.ini
I use MQTT so set the correct IP address and credentials.
I left this as default so use WSS (not WS):
[ssl]
# Enable SSL (default: yes)
enable = yes
cert = !ES_CERT_FILE
key = !ES_KEY_FILE
I amended this (but only as I had chosen to enable that in the docker).
use_hooks = yes
Step 7: Test local setup. Use ZMninja to connect to the docker.
using ZM Authentication add the new user creds you created
use the url http://<IP_of_docker>:8080/zm
(the others should auto-populate)
save settings, and then check the “Event Server”. this should be:
wss://<IP_of_docker>:9000
If it is working correctly, ZMninja should offer to alert you. you can always turn off websockets and use FCM in the Event Server menu.
Step 8: prepare your Synology box for incoming traffic. This is pretty unique to each person, but hopefully this will give you the idea.
https://subdomain.domain.com/zm -> Nameserver A record -> public IP of my Synology -> IP address and port (remembering to forward port 443 on your router to the Synology IP address)
I use two subdomains, one for the portal, and one for the zmninja websockets.
Once you have validated everything works internally, now is the time to move to your subdomain A records on your provider.
First off add 2 new reverse proxies in the application portal.
https 443 camera.domain.com —> http 8080 <IP_of_docker>
zmninja 443 zmninja.domain.com —> https 9000 <IP_of_docker> (note https as WSS)
You will need to edit the zmninja one to enable parsing of websocks [(info here)](``` ZMES_PICTURE_URL=http://<IP_of_docker>:8080/zm/index.php?view=image&eid=EVENTID&fid=snapshot&width=600 ````)
You will need to change secrets.ini
zm_portal is now https://subdomain.domain.com/zm
(no port)
same for picture:
ZMES_PICTURE_URL=https://subdomain.domain.com/zm/index.php?view=image&eid=EVENTID&fid=snapshot&width=600
You will also need to make the changes in the ZMninja App
including the event server.