From 0da98be2ef12da2bf68f844d5b3f61efbc46b665 Mon Sep 17 00:00:00 2001 From: "Connor J. Farrell" Date: Tue, 21 Jan 2025 20:53:39 -0600 Subject: [PATCH 01/21] Create json file --- json/zoneminder.json | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 json/zoneminder.json diff --git a/json/zoneminder.json b/json/zoneminder.json new file mode 100644 index 00000000..84c675bf --- /dev/null +++ b/json/zoneminder.json @@ -0,0 +1,34 @@ +{ + "name": "ZoneMinder", + "slug": "zoneminder", + "categories": [ + 0 + ], + "date_created": "2025-01-21", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 80, + "documentation": null, + "website": "https://zoneminder.com", + "logo": "https://raw.githubusercontent.com/ZoneMinder/ZoneMinder/master/web/graphics/icon_zoneminder.png", + "description": "ZoneMinder is an open source video surveillance solution for Linux.", + "install_methods": [ + { + "type": "default", + "script": "ct/ZoneMinder.sh", + "resources": { + "cpu": 2, + "ram": 2048, + "hdd": 16, + "os": "ubuntu", + "version": "22.04" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} From 5023b8468d778b7d3f099683b3bd1a7e8c9b1884 Mon Sep 17 00:00:00 2001 From: "Connor J. Farrell" Date: Tue, 21 Jan 2025 20:57:56 -0600 Subject: [PATCH 02/21] create zoneminder.sh --- ct/zoneminder.sh | 96 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 ct/zoneminder.sh diff --git a/ct/zoneminder.sh b/ct/zoneminder.sh new file mode 100644 index 00000000..99243e7d --- /dev/null +++ b/ct/zoneminder.sh @@ -0,0 +1,96 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2024 community-scripts ORG +# Author: [YourUserName] +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: [SOURCE_URL] + +# App Default Values +APP="ZoneMinder" +# Name of the app (e.g. Google, Adventurelog, Apache-Guacamole) +TAGS="cctv;surveillance" +# Tags for Proxmox VE, maximum 2 pcs., no spaces allowed, separated by a semicolon ; (e.g. database | adblock;dhcp) +var_cpu="2" +# Number of cores (1-X) (e.g. 4) - default is 2 +var_ram="2048" +# Amount of used RAM in MB (e.g. 2048 or 4096) +var_disk="16" +# Amount of used disk space in GB (e.g. 4 or 10) +var_os="ubuntu" +# Default OS (e.g. debian, ubuntu, alpine) +var_version="22.04" +# Default OS version (e.g. 12 for debian, 24.04 for ubuntu, 3.20 for alpine) +var_unprivileged="1" +# 1 = unprivileged container, 0 = privileged container + +# App Output & Base Settings +header_info "$APP" +base_settings + +# Core +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + # Check if installation is present | -f for file, -d for folder + # We assume zmpkg.pl is present if ZoneMinder was installed + if [[ ! -f /usr/bin/zmpkg.pl ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + # Get the latest available release tag from GitHub + # NOTE: The container must have 'grep' available (which is standard). + RELEASE=$(curl -fsSL https://api.github.com/repos/ZoneMinder/zoneminder/releases/latest | grep -Po '"tag_name": "\K.*?(?=")') + if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt 2>/dev/null || echo 'none')" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then + msg_info "Updating $APP" + + # Stopping Services + msg_info "Stopping $APP" + systemctl stop zoneminder + msg_ok "Stopped $APP" + + # Creating Backup + # Adjust paths as needed for your environment + msg_info "Creating Backup" + tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /etc/zm /usr/share/zoneminder /var/cache/zoneminder + msg_ok "Backup Created" + + # Execute Update (apt-based) + msg_info "Updating $APP to v${RELEASE}" + apt-get update && apt-get install --only-upgrade zoneminder -y + msg_ok "Updated $APP to v${RELEASE}" + + # Starting Services + msg_info "Starting $APP" + systemctl start zoneminder + sleep 2 + msg_ok "Started $APP" + + # Cleaning up + msg_info "Cleaning Up" + rm -rf /tmp/zoneminder-update + msg_ok "Cleanup Completed" + + # Write out the new version + echo "${RELEASE}" >/opt/${APP}_version.txt + msg_ok "Update Successful" + else + msg_ok "No update required. ${APP} is already at v${RELEASE}" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80${CL}" From d5c28b632bde7dff678976b1ba99adfd27fa466c Mon Sep 17 00:00:00 2001 From: "Connor J. Farrell" Date: Tue, 21 Jan 2025 21:07:33 -0600 Subject: [PATCH 03/21] Create zoneminder-install.sh --- install/zoneminder-install.sh | 70 +++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 install/zoneminder-install.sh diff --git a/install/zoneminder-install.sh b/install/zoneminder-install.sh new file mode 100644 index 00000000..cedab7cd --- /dev/null +++ b/install/zoneminder-install.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 community-scripts ORG +# Author: [YourUserName] +# License: MIT +# Source: [SOURCE_URL] + +# Import Functions und Setup +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +# Installing Dependencies with the 3 core dependencies (curl;sudo;mc) +# plus any additional packages you need +msg_info "Installing Dependencies" +$STD apt-get install -y \ + curl \ + sudo \ + mc \ + apache2 \ + mariadb-server \ + libapache2-mod-php +msg_ok "Installed Dependencies" + +# Install / set up MySQL +msg_info "Install / set up MySQL" +APPLICATION="ZoneMinder" +APP_NAME="ZoneMinder" +DB_NAME="zm" +DB_USER="zmuser" +DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) + +$STD mysql -u root -e "CREATE DATABASE $DB_NAME;" +$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');" +$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" + +{ + echo "Database Credentials" + echo "Database User: $DB_USER" + echo "Database Password: $DB_PASS" + echo "Database Name: $DB_NAME" +} >> ~/$APP_NAME.creds +msg_ok "MySQL setup completed" + +# Enable the ZoneMinder PPA (iconnor/zoneminder-1.36) and install +msg_info "Enabling ZoneMinder PPA and installing ZoneMinder" +$STD apt install -y software-properties-common +$STD add-apt-repository ppa:iconnor/zoneminder-1.36 -y +$STD apt update +$STD apt-get install -y zoneminder +msg_ok "ZoneMinder installed" + +# Enable Apache modules & ZoneMinder service +msg_info "Configuring Apache and ZoneMinder" +a2enmod rewrite +a2enconf zoneminder +systemctl restart apache2 +systemctl enable zoneminder +systemctl start zoneminder +msg_ok "Apache and ZoneMinder configured and running" + +# Cleanup +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" From 215b605099ce7bacffb6026242e34e308d8fe350 Mon Sep 17 00:00:00 2001 From: "Connor J. Farrell" Date: Tue, 21 Jan 2025 21:08:10 -0600 Subject: [PATCH 04/21] modified: misc/build.func --- misc/build.func | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/misc/build.func b/misc/build.func index e9267b7a..6a38a1bf 100644 --- a/misc/build.func +++ b/misc/build.func @@ -950,9 +950,9 @@ build_container() { TEMP_DIR=$(mktemp -d) pushd $TEMP_DIR >/dev/null if [ "$var_os" == "alpine" ]; then - export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/alpine-install.func)" + export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/connorjfarrell/ProxmoxVE/refs/heads/connorjfarrell/zoneminder/misc/alpine-install.func)" else - export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/install.func)" + export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/connorjfarrell/ProxmoxVE/refs/heads/connorjfarrell/zoneminder/misc/install.func)" fi export CACHER="$APT_CACHER" export CACHER_IP="$APT_CACHER_IP" @@ -983,7 +983,7 @@ build_container() { $PW " # This executes create_lxc.sh and creates the container and .conf file - bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/create_lxc.sh)" || exit + bash -c "$(wget -qLO - https://raw.githubusercontent.com/connorjfarrell/ProxmoxVE/refs/heads/connorjfarrell/zoneminder//ct/create_lxc.sh)" || exit LXC_CONFIG=/etc/pve/lxc/${CTID}.conf if [ "$CT_TYPE" == "0" ]; then @@ -1045,7 +1045,7 @@ http://dl-cdn.alpinelinux.org/alpine/latest-stable/community EOF' pct exec "$CTID" -- ash -c "apk add bash >/dev/null" fi - lxc-attach -n "$CTID" -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/$var_install.sh)" || exit + lxc-attach -n "$CTID" -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/connorjfarrell/ProxmoxVE/refs/heads/connorjfarrell/zoneminder//install/$var_install.sh)" || exit } @@ -1057,7 +1057,7 @@ description() { DESCRIPTION=$(cat < - Logo + Logo

${APP} LXC

From 90d8ee2a385ef98f615ccc4cb8a3d73d387867fc Mon Sep 17 00:00:00 2001 From: "Connor J. Farrell" Date: Tue, 21 Jan 2025 21:19:15 -0600 Subject: [PATCH 05/21] Need to actually run zoneminder-install.sh --- ct/zoneminder.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ct/zoneminder.sh b/ct/zoneminder.sh index 99243e7d..83739f24 100644 --- a/ct/zoneminder.sh +++ b/ct/zoneminder.sh @@ -86,6 +86,26 @@ function update_script() { exit } +function post_build_provision() { + local FILE='zoneminder-install.sh' + local file_name="${FILE##*/}" + + # Make sure we actually have the install script on the PVE host: + if [[ ! -f "$FILE" ]]; then + msg_error "Unable to find $FILE on Proxmox host. Please ensure it’s in the same directory." + exit 1 + fi + + msg_info "Uploading $FILE to container" + pct push "${CTID}" "$FILE" "/root/$file_name" >/dev/null 2>&1 + msg_ok "Uploaded $FILE" + + msg_info "Executing $FILE inside container" + pct exec "${CTID}" -- chmod +x "/root/$file_name" + pct exec "${CTID}" -- "/root/$file_name" + msg_ok "Executed $FILE" +} + start build_container description @@ -93,4 +113,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80/zm${CL}" From 0b6fe6e5e36e5d36b4b968b6145288c2b07a6107 Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Tue, 21 Jan 2025 21:22:52 -0600 Subject: [PATCH 06/21] Update zoneminder.sh actually call the function --- ct/zoneminder.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ct/zoneminder.sh b/ct/zoneminder.sh index 83739f24..edc14d10 100644 --- a/ct/zoneminder.sh +++ b/ct/zoneminder.sh @@ -108,6 +108,7 @@ function post_build_provision() { start build_container +post_build_provision description msg_ok "Completed Successfully!\n" From 7691253739991e633d2bb4c3faf9e9785de2b894 Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Tue, 21 Jan 2025 21:25:29 -0600 Subject: [PATCH 07/21] Update zoneminder.json Update categories --- json/zoneminder.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json/zoneminder.json b/json/zoneminder.json index 84c675bf..0609b791 100644 --- a/json/zoneminder.json +++ b/json/zoneminder.json @@ -2,7 +2,7 @@ "name": "ZoneMinder", "slug": "zoneminder", "categories": [ - 0 + 15 ], "date_created": "2025-01-21", "type": "ct", From b7a99e6bae861d691391d5688838ca7240bfd4a8 Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Tue, 21 Jan 2025 21:28:26 -0600 Subject: [PATCH 08/21] Update zoneminder.sh Fix tags --- ct/zoneminder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/zoneminder.sh b/ct/zoneminder.sh index edc14d10..59553adb 100644 --- a/ct/zoneminder.sh +++ b/ct/zoneminder.sh @@ -8,7 +8,7 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/m # App Default Values APP="ZoneMinder" # Name of the app (e.g. Google, Adventurelog, Apache-Guacamole) -TAGS="cctv;surveillance" +var_tags="nvr" # Tags for Proxmox VE, maximum 2 pcs., no spaces allowed, separated by a semicolon ; (e.g. database | adblock;dhcp) var_cpu="2" # Number of cores (1-X) (e.g. 4) - default is 2 From 2fd156686edf92e3b0344a304be7087ba4d940f5 Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Tue, 21 Jan 2025 21:36:05 -0600 Subject: [PATCH 09/21] Update zoneminder.sh Change build.func ref.... rtfm! --- ct/zoneminder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/zoneminder.sh b/ct/zoneminder.sh index 59553adb..05ed59e4 100644 --- a/ct/zoneminder.sh +++ b/ct/zoneminder.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -s https://raw.githubusercontent.com/connorjfarrell/ProxmoxVE/refs/heads/connorjfarrell/zoneminder/misc/build.func) # Copyright (c) 2021-2024 community-scripts ORG # Author: [YourUserName] # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE From 445baab1ef045a7f3a32e8d5b542fecd489adfd9 Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Tue, 21 Jan 2025 21:38:00 -0600 Subject: [PATCH 10/21] Update zoneminder.sh Remove extra bit from before reading instructions --- ct/zoneminder.sh | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/ct/zoneminder.sh b/ct/zoneminder.sh index 05ed59e4..a2a04a61 100644 --- a/ct/zoneminder.sh +++ b/ct/zoneminder.sh @@ -86,29 +86,8 @@ function update_script() { exit } -function post_build_provision() { - local FILE='zoneminder-install.sh' - local file_name="${FILE##*/}" - - # Make sure we actually have the install script on the PVE host: - if [[ ! -f "$FILE" ]]; then - msg_error "Unable to find $FILE on Proxmox host. Please ensure it’s in the same directory." - exit 1 - fi - - msg_info "Uploading $FILE to container" - pct push "${CTID}" "$FILE" "/root/$file_name" >/dev/null 2>&1 - msg_ok "Uploaded $FILE" - - msg_info "Executing $FILE inside container" - pct exec "${CTID}" -- chmod +x "/root/$file_name" - pct exec "${CTID}" -- "/root/$file_name" - msg_ok "Executed $FILE" -} - start build_container -post_build_provision description msg_ok "Completed Successfully!\n" From 3b4b895361bd31f97e25dd4e7dad59be38ef870a Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Tue, 21 Jan 2025 22:01:29 -0600 Subject: [PATCH 11/21] Update zoneminder-install.sh Fix mysql crash --- install/zoneminder-install.sh | 37 ++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/install/zoneminder-install.sh b/install/zoneminder-install.sh index cedab7cd..bc613549 100644 --- a/install/zoneminder-install.sh +++ b/install/zoneminder-install.sh @@ -26,25 +26,30 @@ $STD apt-get install -y \ libapache2-mod-php msg_ok "Installed Dependencies" -# Install / set up MySQL -msg_info "Install / set up MySQL" -APPLICATION="ZoneMinder" -APP_NAME="ZoneMinder" -DB_NAME="zm" -DB_USER="zmuser" -DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) +# create a random password for root +# create a random password for the 'zmuser' +msg_info "Pre-seeding dbconfig-common for ZoneMinder" -$STD mysql -u root -e "CREATE DATABASE $DB_NAME;" -$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');" -$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" +ROOT_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) +ZMPASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) + +export DEBIAN_FRONTEND=noninteractive + +echo "zoneminder zoneminder/dbconfig-install boolean true" | debconf-set-selections +echo "zoneminder zoneminder/dbconfig-reinstall boolean false" | debconf-set-selections +echo "zoneminder zoneminder/mysql/admin-user string root" | debconf-set-selections +echo "zoneminder zoneminder/mysql/admin-pass password $ROOT_PASS" | debconf-set-selections +echo "zoneminder zoneminder/mysql/app-pass password $ZMPASS" | debconf-set-selections +echo "zoneminder zoneminder/app-password-confirm password $ZMPASS"| debconf-set-selections { - echo "Database Credentials" - echo "Database User: $DB_USER" - echo "Database Password: $DB_PASS" - echo "Database Name: $DB_NAME" -} >> ~/$APP_NAME.creds -msg_ok "MySQL setup completed" + echo "ZoneMinder Database Credentials" + echo "MySQL Root Password: $ROOT_PASS" + echo "ZoneMinder DB User: zmuser" + echo "ZoneMinder DB Pass: $ZMPASS" + echo "ZoneMinder DB Name: zm" +} >> ~/zoneminder.creds +msg_ok "dbconfig pre-seeding complete" # Enable the ZoneMinder PPA (iconnor/zoneminder-1.36) and install msg_info "Enabling ZoneMinder PPA and installing ZoneMinder" From 3a28e39cd3e1983c682948c8a40ccac0e0a386d1 Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Tue, 21 Jan 2025 22:51:34 -0600 Subject: [PATCH 12/21] Update zoneminder.sh Change build.func ref back to public repo --- ct/zoneminder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/zoneminder.sh b/ct/zoneminder.sh index a2a04a61..221457f7 100644 --- a/ct/zoneminder.sh +++ b/ct/zoneminder.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -s https://raw.githubusercontent.com/connorjfarrell/ProxmoxVE/refs/heads/connorjfarrell/zoneminder/misc/build.func) +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) # Copyright (c) 2021-2024 community-scripts ORG # Author: [YourUserName] # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE From ff72a6af267bbd696ce5d99e76192083bf141bd4 Mon Sep 17 00:00:00 2001 From: "Connor J. Farrell" Date: Tue, 21 Jan 2025 22:58:03 -0600 Subject: [PATCH 13/21] Revert "modified: misc/build.func" This reverts commit 215b605099ce7bacffb6026242e34e308d8fe350. --- misc/build.func | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/misc/build.func b/misc/build.func index 6a38a1bf..e9267b7a 100644 --- a/misc/build.func +++ b/misc/build.func @@ -950,9 +950,9 @@ build_container() { TEMP_DIR=$(mktemp -d) pushd $TEMP_DIR >/dev/null if [ "$var_os" == "alpine" ]; then - export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/connorjfarrell/ProxmoxVE/refs/heads/connorjfarrell/zoneminder/misc/alpine-install.func)" + export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/alpine-install.func)" else - export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/connorjfarrell/ProxmoxVE/refs/heads/connorjfarrell/zoneminder/misc/install.func)" + export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/install.func)" fi export CACHER="$APT_CACHER" export CACHER_IP="$APT_CACHER_IP" @@ -983,7 +983,7 @@ build_container() { $PW " # This executes create_lxc.sh and creates the container and .conf file - bash -c "$(wget -qLO - https://raw.githubusercontent.com/connorjfarrell/ProxmoxVE/refs/heads/connorjfarrell/zoneminder//ct/create_lxc.sh)" || exit + bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/create_lxc.sh)" || exit LXC_CONFIG=/etc/pve/lxc/${CTID}.conf if [ "$CT_TYPE" == "0" ]; then @@ -1045,7 +1045,7 @@ http://dl-cdn.alpinelinux.org/alpine/latest-stable/community EOF' pct exec "$CTID" -- ash -c "apk add bash >/dev/null" fi - lxc-attach -n "$CTID" -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/connorjfarrell/ProxmoxVE/refs/heads/connorjfarrell/zoneminder//install/$var_install.sh)" || exit + lxc-attach -n "$CTID" -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/$var_install.sh)" || exit } @@ -1057,7 +1057,7 @@ description() { DESCRIPTION=$(cat < - Logo + Logo

${APP} LXC

From e8e0f10cf7832a4eab1770da1d0b0ef466f93eff Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Thu, 23 Jan 2025 20:38:55 -0600 Subject: [PATCH 14/21] Update zoneminder.sh Update header metadata --- ct/zoneminder.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/zoneminder.sh b/ct/zoneminder.sh index 221457f7..b38d19d3 100644 --- a/ct/zoneminder.sh +++ b/ct/zoneminder.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) # Copyright (c) 2021-2024 community-scripts ORG -# Author: [YourUserName] +# Author: connorjfarrell # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE -# Source: [SOURCE_URL] +# Source: https://zoneminder.readthedocs.io/en/latest/installationguide/ubuntu.html#ubuntu-22-04-jammy # App Default Values APP="ZoneMinder" From b74d275b3ef838c2ae27c2970b578c518220bb45 Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Thu, 23 Jan 2025 20:39:22 -0600 Subject: [PATCH 15/21] Update zoneminder-install.sh update header metadata --- install/zoneminder-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/zoneminder-install.sh b/install/zoneminder-install.sh index bc613549..1bbd004d 100644 --- a/install/zoneminder-install.sh +++ b/install/zoneminder-install.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash # Copyright (c) 2021-2024 community-scripts ORG -# Author: [YourUserName] +# Author: connorjfarrell # License: MIT -# Source: [SOURCE_URL] +# Source: https://zoneminder.readthedocs.io/en/latest/installationguide/ubuntu.html#ubuntu-22-04-jammy # Import Functions und Setup source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" From 691c9209dd6df4c8b402cf43687aa8e5f49bf7be Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Fri, 24 Jan 2025 10:24:38 -0600 Subject: [PATCH 16/21] remove comments --- ct/zoneminder.sh | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/ct/zoneminder.sh b/ct/zoneminder.sh index b38d19d3..0ae8ed13 100644 --- a/ct/zoneminder.sh +++ b/ct/zoneminder.sh @@ -5,29 +5,18 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/m # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://zoneminder.readthedocs.io/en/latest/installationguide/ubuntu.html#ubuntu-22-04-jammy -# App Default Values APP="ZoneMinder" -# Name of the app (e.g. Google, Adventurelog, Apache-Guacamole) var_tags="nvr" -# Tags for Proxmox VE, maximum 2 pcs., no spaces allowed, separated by a semicolon ; (e.g. database | adblock;dhcp) var_cpu="2" -# Number of cores (1-X) (e.g. 4) - default is 2 var_ram="2048" -# Amount of used RAM in MB (e.g. 2048 or 4096) var_disk="16" -# Amount of used disk space in GB (e.g. 4 or 10) var_os="ubuntu" -# Default OS (e.g. debian, ubuntu, alpine) var_version="22.04" -# Default OS version (e.g. 12 for debian, 24.04 for ubuntu, 3.20 for alpine) var_unprivileged="1" -# 1 = unprivileged container, 0 = privileged container -# App Output & Base Settings header_info "$APP" base_settings -# Core variables color catch_errors @@ -37,47 +26,36 @@ function update_script() { check_container_storage check_container_resources - # Check if installation is present | -f for file, -d for folder - # We assume zmpkg.pl is present if ZoneMinder was installed if [[ ! -f /usr/bin/zmpkg.pl ]]; then msg_error "No ${APP} Installation Found!" exit fi - # Get the latest available release tag from GitHub - # NOTE: The container must have 'grep' available (which is standard). RELEASE=$(curl -fsSL https://api.github.com/repos/ZoneMinder/zoneminder/releases/latest | grep -Po '"tag_name": "\K.*?(?=")') if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt 2>/dev/null || echo 'none')" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then msg_info "Updating $APP" - # Stopping Services msg_info "Stopping $APP" systemctl stop zoneminder msg_ok "Stopped $APP" - # Creating Backup - # Adjust paths as needed for your environment msg_info "Creating Backup" tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /etc/zm /usr/share/zoneminder /var/cache/zoneminder msg_ok "Backup Created" - # Execute Update (apt-based) msg_info "Updating $APP to v${RELEASE}" apt-get update && apt-get install --only-upgrade zoneminder -y msg_ok "Updated $APP to v${RELEASE}" - # Starting Services msg_info "Starting $APP" systemctl start zoneminder sleep 2 msg_ok "Started $APP" - # Cleaning up msg_info "Cleaning Up" rm -rf /tmp/zoneminder-update msg_ok "Cleanup Completed" - # Write out the new version echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Update Successful" else From 17b23ba04b84c0d506ea20b4408589b324a15b0f Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Fri, 24 Jan 2025 10:26:18 -0600 Subject: [PATCH 17/21] clean up update function --- ct/zoneminder.sh | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/ct/zoneminder.sh b/ct/zoneminder.sh index 0ae8ed13..ef635ee4 100644 --- a/ct/zoneminder.sh +++ b/ct/zoneminder.sh @@ -33,33 +33,19 @@ function update_script() { RELEASE=$(curl -fsSL https://api.github.com/repos/ZoneMinder/zoneminder/releases/latest | grep -Po '"tag_name": "\K.*?(?=")') if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt 2>/dev/null || echo 'none')" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then - msg_info "Updating $APP" + msg_info "Updating to v${RELEASE}" - msg_info "Stopping $APP" systemctl stop zoneminder - msg_ok "Stopped $APP" - msg_info "Creating Backup" - tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /etc/zm /usr/share/zoneminder /var/cache/zoneminder - msg_ok "Backup Created" - - msg_info "Updating $APP to v${RELEASE}" apt-get update && apt-get install --only-upgrade zoneminder -y - msg_ok "Updated $APP to v${RELEASE}" - msg_info "Starting $APP" systemctl start zoneminder sleep 2 - msg_ok "Started $APP" - - msg_info "Cleaning Up" - rm -rf /tmp/zoneminder-update - msg_ok "Cleanup Completed" echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Update Successful" else - msg_ok "No update required. ${APP} is already at v${RELEASE}" + msg_ok "${APP} is already v${RELEASE}" fi exit } From 2ff64bdc37dc0015ec3aba70e93c6cedf194daae Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Fri, 24 Jan 2025 10:27:54 -0600 Subject: [PATCH 18/21] remove comments --- install/zoneminder-install.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/install/zoneminder-install.sh b/install/zoneminder-install.sh index 1bbd004d..ef0e8daa 100644 --- a/install/zoneminder-install.sh +++ b/install/zoneminder-install.sh @@ -5,7 +5,6 @@ # License: MIT # Source: https://zoneminder.readthedocs.io/en/latest/installationguide/ubuntu.html#ubuntu-22-04-jammy -# Import Functions und Setup source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" color verb_ip6 @@ -14,8 +13,6 @@ setting_up_container network_check update_os -# Installing Dependencies with the 3 core dependencies (curl;sudo;mc) -# plus any additional packages you need msg_info "Installing Dependencies" $STD apt-get install -y \ curl \ @@ -26,8 +23,6 @@ $STD apt-get install -y \ libapache2-mod-php msg_ok "Installed Dependencies" -# create a random password for root -# create a random password for the 'zmuser' msg_info "Pre-seeding dbconfig-common for ZoneMinder" ROOT_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) @@ -51,7 +46,6 @@ echo "zoneminder zoneminder/app-password-confirm password $ZMPASS"| debconf-set- } >> ~/zoneminder.creds msg_ok "dbconfig pre-seeding complete" -# Enable the ZoneMinder PPA (iconnor/zoneminder-1.36) and install msg_info "Enabling ZoneMinder PPA and installing ZoneMinder" $STD apt install -y software-properties-common $STD add-apt-repository ppa:iconnor/zoneminder-1.36 -y @@ -59,7 +53,6 @@ $STD apt update $STD apt-get install -y zoneminder msg_ok "ZoneMinder installed" -# Enable Apache modules & ZoneMinder service msg_info "Configuring Apache and ZoneMinder" a2enmod rewrite a2enconf zoneminder @@ -68,7 +61,6 @@ systemctl enable zoneminder systemctl start zoneminder msg_ok "Apache and ZoneMinder configured and running" -# Cleanup msg_info "Cleaning up" $STD apt-get -y autoremove $STD apt-get -y autoclean From 364ead3b565811bce008c442eb7abb5f3b6831ad Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Mon, 27 Jan 2025 10:23:53 -0600 Subject: [PATCH 19/21] Update ct/zoneminder.sh Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> --- ct/zoneminder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/zoneminder.sh b/ct/zoneminder.sh index ef635ee4..bfe19bf4 100644 --- a/ct/zoneminder.sh +++ b/ct/zoneminder.sh @@ -3,7 +3,7 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/m # Copyright (c) 2021-2024 community-scripts ORG # Author: connorjfarrell # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE -# Source: https://zoneminder.readthedocs.io/en/latest/installationguide/ubuntu.html#ubuntu-22-04-jammy +# Source: https://zoneminder.readthedocs.io APP="ZoneMinder" var_tags="nvr" From 64861d0221dfac55c65f61acac665a0e21c27888 Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Mon, 27 Jan 2025 10:24:13 -0600 Subject: [PATCH 20/21] Update install/zoneminder-install.sh Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> --- install/zoneminder-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/zoneminder-install.sh b/install/zoneminder-install.sh index ef0e8daa..13e8587b 100644 --- a/install/zoneminder-install.sh +++ b/install/zoneminder-install.sh @@ -3,7 +3,7 @@ # Copyright (c) 2021-2024 community-scripts ORG # Author: connorjfarrell # License: MIT -# Source: https://zoneminder.readthedocs.io/en/latest/installationguide/ubuntu.html#ubuntu-22-04-jammy +# Source: https://zoneminder.readthedocs.io source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" color From 31ef2e8592c0abb96a594343b5bc1bb4cc5c2151 Mon Sep 17 00:00:00 2001 From: connorjfarrell Date: Mon, 27 Jan 2025 10:26:04 -0600 Subject: [PATCH 21/21] add license url --- install/zoneminder-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/zoneminder-install.sh b/install/zoneminder-install.sh index 13e8587b..1b93bf01 100644 --- a/install/zoneminder-install.sh +++ b/install/zoneminder-install.sh @@ -2,7 +2,7 @@ # Copyright (c) 2021-2024 community-scripts ORG # Author: connorjfarrell -# License: MIT +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://zoneminder.readthedocs.io source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"