Add MySQL Cache Manager & code cleanup

This commit is contained in:
Brendan LE GLAUNEC
2016-05-21 11:17:08 +02:00
committed by Brendan Le Glaunec
parent faa2570883
commit 8a8e4faa42
29 changed files with 844 additions and 69 deletions
+3 -1
View File
@@ -10,7 +10,9 @@ RUN apt-get update && apt-get install -y \
libgstreamer1.0-dev \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
libcurl4-openssl-dev
libcurl4-openssl-dev \
libmysqlclient18 \
mysql-client
ADD cameradar_*_Release_Linux.tar.gz /
RUN mv cameradar_*_Release_Linux cameradar
Binary file not shown.
Binary file not shown.
+13 -2
View File
@@ -1,5 +1,13 @@
{
"subnets" : "172.16.100.13,localhost",
"mysql_db" : {
"host" : "__MYSQL_ADDR__",
"port" : __MYSQL_PORT__,
"user": "root",
"password": "root",
"db_name": "cmrdr"
},
"subnets" : "localhost",
// If not specified, will scan all ports (1-65535)
"ports" : "554,8554",
@@ -9,6 +17,9 @@
// You must give an accessible path to an already existing directory
"thumbnail_storage_path" : "/tmp",
// This is the path that will be used in the Docker container
// if you're not familiar with Docker, only change the
// cache_manager_name value
"cache_manager_path" : "/cameradar/cache_managers",
"cache_manager_name" : "dumb"
"cache_manager_name" : "mysql"
}
+9
View File
@@ -5,3 +5,12 @@ cameradar:
volumes:
- "./conf:/tmp/conf:ro"
- "./cameradar_thumbnails:/tmp/cameradar_thumbnails"
links:
- ext_cctv_mysql
ext_cctv_mysql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: cmrdr
ports:
- "3306:3306"
+10
View File
@@ -23,6 +23,16 @@ echo -n "replacing cameras ports in configuration "
sed -i s#__PORTS_TO_CHECK__#$CAMERAS_PORTS#g $CONF
echo -e $COL_GREEN"ok"$COL_RESET
# Replace ext_cctv_mysql with the IP address of your DB or the name of its Docker
# container. The container has to be linked in docker-compose.yml for cameradar
# to be able to interact with it.
echo -n "replacing mysql host and port in configuration "
sed -i s#__MYSQL_ADDR__#ext_cctv_mysql#g $CONF
# Reaplce 3306 with the port of your DB
sed -i s#__MYSQL_PORT__#3306#g $CONF
echo -e $COL_GREEN"ok"$COL_RESET
/cameradar/bin/cameradar -l 1 -c /conf/cameradar.conf.json &
cameradar_pid=$!