Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ZM able to use Postgresql #3644

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6d8c4f6
initial funcitonality
parvit Aug 28, 2022
6003053
better interface for zmDbQuery
parvit Aug 28, 2022
8840b60
zmQuery impl
parvit Aug 29, 2022
af5611b
improvements for insert and update binding, db queue
parvit Sep 3, 2022
05767ea
support bulk vector binding, queries in zm_event.cpp
parvit Sep 8, 2022
7299947
zm_logger.cpp queries
parvit Sep 9, 2022
867925f
zm_eventstream.cpp queries, support for failed execution termination,…
parvit Sep 10, 2022
504f535
zm_group.cpp
parvit Sep 11, 2022
27ba2f2
added monitors queries
parvit Sep 24, 2022
5b9a6d4
zm_monitor queries
parvit Sep 24, 2022
e9b30f7
zm_monitor group load
parvit Sep 25, 2022
fc2e487
zm_user queries
parvit Sep 25, 2022
0fdc01e
zm_storage,zm_zone queries
parvit Sep 25, 2022
e79da38
ported applications, fixed linking issues
parvit Sep 25, 2022
485df11
fixed query bind
parvit Oct 2, 2022
3b65ebc
working data extract, first element issue
parvit Oct 5, 2022
ae9d9c0
fixed missing first result
parvit Oct 5, 2022
55c5031
fixed select and insert queries execution, removed zmDbQueue for inco…
parvit Oct 9, 2022
abca42d
implemented deferred function on query, mysql specific option set
parvit Oct 9, 2022
7b79aa1
fixed stackoverflow on log, fix enum decoding in monitor, removed soc…
parvit Oct 19, 2022
fe1e670
locking and reconnect db, fix fields types, implicit insert/update reset
parvit Oct 23, 2022
53b2103
cmake and configuration support for independent database backends com…
parvit Oct 26, 2022
78aab03
Integration with PostgresSQL soci backend, modular support in cmake
parvit Oct 29, 2022
3f2b3f6
fixed syntax of queries for postgresql, fix empty results query crash
parvit Oct 30, 2022
95562d9
corrected details of postgres integration
parvit Nov 6, 2022
8890007
fixed unsigned int cast issue
parvit Dec 9, 2022
d7fb46b
pulled master
parvit Dec 10, 2022
0dc5c04
Merge branch 'master' into issue-355
parvit Dec 10, 2022
466041a
local repo test build
parvit Dec 10, 2022
23c1d88
fix ci and soci retrocompatibility issues
parvit Dec 25, 2022
044a823
support soci build
parvit Jan 3, 2023
184fc10
ci compilation on freebsd
parvit Jan 3, 2023
031af0e
ci compilation on freebsd
parvit Jan 3, 2023
b0afe80
ci compilation on freebsd
parvit Jan 3, 2023
efb6b06
ci compilation on freebsd with werror
parvit Jan 3, 2023
b9c3e29
test freebsd image update (dependency issues on 13-0)
parvit Jan 3, 2023
ce14890
updated freebsd image from 13.0 to 13.1
parvit Jan 3, 2023
1aa4d20
Merge branch 'master' into issue-355
parvit Jan 4, 2023
64aa9b8
CI Fedora 36
parvit Jan 7, 2023
c82813a
Merge branch 'master' into issue-355
parvit Jan 7, 2023
dd57bd2
typo package name
parvit Jan 8, 2023
257a80f
Merge branch 'issue-355' of https://github.com/parvit/zoneminder into…
parvit Jan 8, 2023
788138e
missed yum command for soci libs
parvit Jan 8, 2023
c1ee149
catch depenendecy
parvit Jan 8, 2023
3c9191e
disable deprecation warnings because of incompatible packages
parvit Jan 8, 2023
dfa17d5
soci support in codeql workflow
parvit Jan 8, 2023
5d3c20d
fix codeql workflow
parvit Jan 8, 2023
aedcbc1
Sync with master
parvit Jun 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 14 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,29 @@ task:
freebsd_instance:
matrix:
- image_family: freebsd-12-3
- image_family: freebsd-13-0
- image_family: freebsd-13-1
# - image_family: freebsd-14-0-snap

prepare_script:
- pkg install -yq git cmake pkgconf jpeg-turbo mysql80-client ffmpeg libvncserver libjwt catch p5-DBI p5-DBD-mysql p5-Date-Manip p5-Test-LWP-UserAgent p5-Sys-Mmap v4l_compat
- pkg install -yq postgresql13-client postgresql13-server boost-all boost_build

prepare_soci_script:
- git clone https://github.com/parvit/soci
- cd soci
- mkdir build/
- mkdir gen/
- cd gen/
- cmake ../ -DCMAKE_INSTALL_PREFIX=$(realpath $PWD/../build)
- make -j3
- make install

configure_script:
- git submodule update --init --recursive
- mkdir build
- cd build
- cmake --version
- cmake ../ -DBUILD_MAN=0 -DBUILD_TEST_SUITE=1 -DENABLE_WERROR=1 -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations"
- cmake ../ -DBUILD_MAN=0 -DBUILD_TEST_SUITE=1 -DENABLE_WERROR=1 -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" -DSOCI_INCLUDE_DIR=$(realpath $PWD/../soci/build/include)

build_script:
- cd build
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
web/api/lib
web/includes/csrf/
web/js/videojs.zoomrotate.js
web/js/fontfaceobserver.standalone.js
web/skins/classic/js/bootstrap-4.5.0.js
web/skins/classic/js/bootstrap.bundle.min.js
web/skins/classic/js/bootstrap-table-1.21.1
Expand Down
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These are supported funding model platforms

github: [connortechnology,pliablepixels] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github: [zoneminder,connortechnology,pliablepixels] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: zoneminder # Replace with a single Patreon username
open_collective: zoneminder # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci-bionic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ jobs:
libdate-manip-perl libdbd-mysql-perl libsys-mmap-perl libwww-perl
libpolkit-gobject-1-dev
${{ matrix.crypto_package }} ${{ matrix.jwt_package }}
- name: Install postgres
run: >
DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends
postgresql-10 postgresql-client-common postgresql-common postgresql-server-dev-all
- name: Install soci
run: >
apt-get -qq install
libsoci-core3.2v5 libsoci-dev libsoci-core3.2v5 libsoci-postgresql3.2v5 libsoci-mysql3.2v5
- name: Prepare
run: mkdir build
- name: Configure
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci-bullseye.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ jobs:
libpolkit-gobject-1-dev
catch2
${{ matrix.crypto_package }} ${{ matrix.jwt_package }}
- name: Install postgres
run: >
DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends
postgresql-13 postgresql-client-common postgresql-common postgresql-server-dev-all
- name: Install soci
run: >
apt-get -qq install libboost-dev libboost-all-dev
libsoci-core4.0 libsoci-dev libsoci-core4.0 libsoci-postgresql4.0 libsoci-mysql4.0
- name: Prepare
run: mkdir build
- name: Configure
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci-buster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ jobs:
libdate-manip-perl libdbd-mysql-perl libsys-mmap-perl libwww-perl
libpolkit-gobject-1-dev
${{ matrix.crypto_package }} ${{ matrix.jwt_package }}
- name: Install postgres
run: >
DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends
postgresql-11 postgresql-client-common postgresql-common postgresql-server-dev-all
- name: Install soci
run: >
apt-get -qq install
libsoci-core3.2 libsoci-dev libsoci-core3.2 libsoci-postgresql3.2 libsoci-mysql3.2
- name: Prepare
run: mkdir build
- name: Configure
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci-centos-7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies
run: |
yum -y update
yum install -y boost boost-devel
yum install -y rh-postgresql13-postgresql rh-postgresql13-postgresql-devel
yum install -y soci soci-devel soci-mysql soci-mysql-devel soci-postgresql soci-postgresql-devel
- name: Prepare
run: mkdir build
- name: Configure
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci-centos-8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ jobs:
with:
submodules: recursive
- name: Install dependencies
run: yum -y update && yum -y install make cmake gcc-c++ catch-devel mariadb-devel ffmpeg-devel libcurl-devel vlc-devel libvncserver-devel libjpeg-turbo-devel "perl(Date::Manip)" "perl(DBD::mysql)" "perl(ExtUtils::MakeMaker)" "perl(Sys::Mmap)" "perl(Sys::Syslog)" "perl(LWP::UserAgent)" polkit-devel libjwt-devel
run: |
yum -y update && yum -y install make cmake gcc-c++ catch-devel ffmpeg-devel libcurl-devel vlc-devel libvncserver-devel libjpeg-turbo-devel "perl(Date::Manip)" "perl(DBD::mysql)" "perl(ExtUtils::MakeMaker)" "perl(Sys::Mmap)" "perl(Sys::Syslog)" "perl(LWP::UserAgent)" polkit-devel libjwt-devel
yum -y install boost boost-devel postgresql postgresql-server-devel
yum -y install soci soci-devel soci-mysql soci-mysql-devel soci-postgresql soci-postgresql-devel
- name: Prepare
run: mkdir build
- name: Configure
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/ci-fedora-36.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI Fedora 36

on:
push:
branches:
- '*'
pull_request:
branches: [ master ]

permissions:
contents: read

jobs:
build:
strategy:
matrix:
crypto_backend: [ gnutls, openssl ]
jwt_backend: [ libjwt, jwt_cpp ]
exclude:
- crypto_backend: gnutls
jwt_backend: jwt_cpp
- crypto_backend: gnutls
jwt_backend: libjwt
runs-on: ubuntu-latest
container: fedora:36

steps:
- name: Install git
run: yum -y install git
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies
run: |
yum -y update && yum -y upgrade
yum install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
yum -y groupinstall "Development Tools"
yum -y install make cmake g++
yum -y install libavutil-free libavutil-free-devel libavcodec-free libavcodec-free-devel libavformat-free libavformat-free-devel libswresample-free libswresample-free-devel
yum -y install libswscale-free libswscale-free-devel libavdevice-free libavdevice-free-devel libvncserver libvncserver-devel libcurl libcurl-devel
yum -y install libvncserver libvncserver-devel openssl-devel openssl-libs libjwt libjwt-devel libjpeg-turbo libjpeg-turbo-devel
yum -y install polkit polkit-devel polkit-libs catch22 catch-devel
yum -y install perl-Date-Manip perl-DBD-MySQL perl-Sys-Mmap perl-libwww-perl perl-Sys-Syslog perl-Time-HiRes perl-ExtUtils-Depends perl-ExtUtils-MakeMaker
yum -y install vlc-devel postgresql postgresql-server mariadb-devel
yum -y install postgresql postgresql-server mariadb-devel
yum -y install boost boost-devel soci soci-devel soci-mysql soci-mysql-devel soci-postgresql soci-postgresql-devel
- name: Prepare
run: mkdir build
# note: jwt_cpp + openssl-3.0.5 are incompatible with ENABLE_WERROR=1 as it marks function definitions as deprecated
# also openssl cannot be downgraded otherwise devel packages for mariadb, libpq and soci get removed as well
- name: Configure
run: cd build && cmake --version && cmake .. -DBUILD_MAN=0 -DBUILD_TEST_SUITE=1 -DENABLE_WERROR=0 -DZM_CRYPTO_BACKEND=${{ matrix.crypto_backend }} -DZM_JWT_BACKEND=${{ matrix.jwt_backend }}
- name: Build
run: cd build && make -j3 | grep --line-buffered -Ev '^(cp lib\/|Installing.+\.pm)' && (exit ${PIPESTATUS[0]})
- name: Run tests
run: cd build/tests && ./tests "~[notCI]"
3 changes: 3 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ jobs:
sudo apt-get install default-libmysqlclient-dev libpcre3-dev libpolkit-gobject-1-dev libv4l-dev libvlc-dev
sudo apt-get install libdate-manip-perl libdbd-mysql-perl libphp-serialization-perl libsys-mmap-perl
sudo apt-get install libwww-perl libdata-uuid-perl libssl-dev libcrypt-eksblowfish-perl libdata-entropy-perl
sudo apt-get install libboost-dev libboost-all-dev libssl-dev
sudo apt-get install libsoci-core4.0 libsoci-dev
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends postgresql-14 postgresql-client-common postgresql-common

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/create-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ jobs:
dist: buster
- os: debian
dist: bullseye
- os: debian
dist: bookworm
- os: ubuntu
dist: bionic
- os: ubuntu
dist: focal
- os: ubuntu
dist: jammy
runs-on: ubuntu-latest

steps:
Expand All @@ -32,7 +36,7 @@ jobs:
SMPFLAGS: -j4
OS: ${{ matrix.os_dist.os }}
DIST: ${{ matrix.os_dist.dist }}
DOCKER_REPO: iconzm/packpack
DOCKER_REPO: packpack/packpack
run: utils/packpack/startpackpack.sh

- name: Publish
Expand Down
62 changes: 62 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,50 @@ scripts/zmupdate.pl
scripts/zmvideo.pl
scripts/zmwatch.pl
scripts/zmx10.pl
scripts/ZoneMinder/lib/ZoneMinder/ONVIF.pm
scripts/zmaudit.pl.8
scripts/zmaudit.pl.8.gz
scripts/zmcamtool.pl.8
scripts/zmcamtool.pl.8.gz
scripts/zmcontrol.pl.8
scripts/zmcontrol.pl.8.gz
scripts/zmdc.pl.8
scripts/zmdc.pl.8.gz
scripts/zmeventtool.pl
scripts/zmeventtool.pl.8
scripts/zmeventtool.pl.8.gz
scripts/zmfilter.pl.8
scripts/zmfilter.pl.8.gz
scripts/zmonvif-probe.pl
scripts/zmonvif-probe.pl.8
scripts/zmonvif-probe.pl.8.gz
scripts/zmonvif-trigger.pl
scripts/zmonvif-trigger.pl.8
scripts/zmonvif-trigger.pl.8.gz
scripts/zmpkg.pl.8
scripts/zmpkg.pl.8.gz
scripts/zmrecover.pl
scripts/zmrecover.pl.8
scripts/zmrecover.pl.8.gz
scripts/zmstats.pl
scripts/zmstats.pl.8
scripts/zmstats.pl.8.gz
scripts/zmsystemctl.pl.8
scripts/zmsystemctl.pl.8.gz
scripts/zmtelemetry.pl.8
scripts/zmtelemetry.pl.8.gz
scripts/zmtrack.pl.8
scripts/zmtrack.pl.8.gz
scripts/zmtrigger.pl.8
scripts/zmtrigger.pl.8.gz
scripts/zmupdate.pl.8
scripts/zmupdate.pl.8.gz
scripts/zmvideo.pl.8
scripts/zmvideo.pl.8.gz
scripts/zmwatch.pl.8
scripts/zmwatch.pl.8.gz
scripts/zmx10.pl.8
scripts/zmx10.pl.8.gz
scripts/zoneminder-zmaudit.pl.8
scripts/zoneminder-zmaudit.pl.8.gz
scripts/zoneminder-zmcamtool.pl.8
Expand Down Expand Up @@ -120,10 +164,15 @@ src/CMakeFiles/
src/cmake_install.cmake
src/libzm.a
src/nph-zms
src/zmbenchmark
src/zmc
src/zmf
src/zms
src/zmu
src/zmc.8
src/zmc.8.gz
src/zmu.8
src/zmu.8.gz
src/zm_rtsp_server
src/zoneminder-zmc.8
src/zoneminder-zmc.8.gz
Expand All @@ -138,6 +187,8 @@ stamp-h1
web/CMakeFiles/
web/api/CMakeFiles/
web/api/app/Config/bootstrap.php
web/api/app/Config/database.php
web/api/lib/Cake/bootstrap.php
web/api/app/Config/core.php
web/api/cmake_install.cmake
web/cgi-bin/
Expand All @@ -156,3 +207,14 @@ zmlinkcontent.sh
zm_config_data.h
zm_config_defines.h
**/.DS_Store
conf.d/01-system-paths.conf
db/zm_update-1.31.30.sql
db/zm_update-1.35.24.sql
db/zm_update-1.37.4.sql
dep/libbcrypt/libbcrypt.a
misc/com.zoneminder.arp-scan.policy
misc/com.zoneminder.arp-scan.rules
misc/nginx.conf
misc/zm-sudo
misc/zoneminder.desktop
gen/**
Loading