From 4888c33e4bf9d2c333e3a1e7baccd7842608b07c Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:59:52 +0100 Subject: [PATCH 01/53] [Fix]: Fixed rm Bug in pf2etools (#1292) * [Fix]: Fixed rm Bug in pf2etools * Update pf2etools.sh --- ct/pf2etools.sh | 9 ++++----- install/pf2etools-install.sh | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ct/pf2etools.sh b/ct/pf2etools.sh index 4d2205e8..967c407d 100644 --- a/ct/pf2etools.sh +++ b/ct/pf2etools.sh @@ -45,15 +45,14 @@ function update_script() { # Execute Update msg_info "Updating ${APP}" - cd "/opt/${APP}" + cd /opt wget -q "https://github.com/Pf2eToolsOrg/Pf2eTools/archive/refs/tags/${RELEASE}.zip" - unzip -q "${RELEASE}.zip" + unzip -q ${RELEASE}.zip rm -rf "/opt/${APP}" - mv "${APP}-${RELEASE:1}" "/opt/${APP}" + mv ${APP}-${RELEASE:1} /opt/${APP} cd /opt/Pf2eTools $STD npm install $STD npm run build - cd ~ echo "${RELEASE}" >"/opt/${APP}_version.txt" msg_ok "Updated ${APP}" @@ -62,7 +61,7 @@ function update_script() { # Cleaning up msg_info "Cleaning Up" - rm -rf /opt/${APP}/${RELEASE}.zip + rm -rf /opt/${RELEASE}.zip $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleanup Completed" diff --git a/install/pf2etools-install.sh b/install/pf2etools-install.sh index fda5e8f0..d7e7c312 100644 --- a/install/pf2etools-install.sh +++ b/install/pf2etools-install.sh @@ -38,6 +38,7 @@ msg_ok "Installed Node.js" # Setup App msg_info "Setup Pf2eTools" +cd /opt RELEASE=$(curl -s https://api.github.com/repos/Pf2eToolsOrg/Pf2eTools/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') wget -q "https://github.com/Pf2eToolsOrg/Pf2eTools/archive/refs/tags/${RELEASE}.zip" unzip -q "${RELEASE}.zip" @@ -65,7 +66,7 @@ msg_ok "Created Service" # Cleanup msg_info "Cleaning up" -rm "${RELEASE}.zip" +rm -rf /opt/${RELEASE}.zip $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned" From f7d37a8f3ceaa145ee14d89cedaf1ec27306f7d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=ADcolas=20Pastorello?= Date: Mon, 6 Jan 2025 11:09:12 -0300 Subject: [PATCH 02/53] New script: GLPI (#1201) * Create glpi.json * Create glpi.sh * Create glpi-install.sh * Update glpi.sh * Update glpi.sh * Update glpi.sh * Update glpi-install.sh * Update glpi-install.sh * Update glpi.json * Update glpi.json * Update glpi.sh * Update install/glpi-install.sh Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * Update install/glpi-install.sh Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * Update glpi-install.sh * Update glpi-install.sh * Update glpi-install.sh * Update glpi.json * Update glpi.sh * Update glpi-install.sh Adjusted apt install * Update glpi-install.sh Changed cron * Update glpi-install.sh Added STD * Update glpi.sh * Update glpi-install.sh * Update glpi.json --------- Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com> --- ct/glpi.sh | 52 ++++++++++++++ install/glpi-install.sh | 151 ++++++++++++++++++++++++++++++++++++++++ json/glpi.json | 34 +++++++++ 3 files changed, 237 insertions(+) create mode 100644 ct/glpi.sh create mode 100644 install/glpi-install.sh create mode 100644 json/glpi.json diff --git a/ct/glpi.sh b/ct/glpi.sh new file mode 100644 index 00000000..a485061b --- /dev/null +++ b/ct/glpi.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: Nícolas Pastorello (opastorello) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE + +# App Default Values +APP="GLPI" +var_tags="asset-management;foss" +var_cpu="2" +var_ram="2048" +var_disk="10" +var_os="debian" +var_version="12" +var_unprivileged="1" + +# 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 + + if [[ ! -d /opt/glpi ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + RELEASE=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/') + if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then + msg_error "Ther is currently no automatic update function for ${APP}." + 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}" diff --git a/install/glpi-install.sh b/install/glpi-install.sh new file mode 100644 index 00000000..04cbf1f2 --- /dev/null +++ b/install/glpi-install.sh @@ -0,0 +1,151 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: Nícolas Pastorello (opastorello) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + curl \ + git \ + sudo \ + mc \ + apache2 \ + php8.2-{apcu,cli,common,curl,gd,imap,ldap,mysql,xmlrpc,xml,mbstring,bcmath,intl,zip,redis,bz2,soap} \ + php-cas \ + libapache2-mod-php \ + mariadb-server +msg_ok "Installed Dependencies" + +msg_info "Setting up database" +DB_NAME=glpi_db +DB_USER=glpi +DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) +mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql mysql +mysql -u root -e "CREATE DATABASE $DB_NAME;" +mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';" +mysql -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'localhost';" +mysql -u root -e "GRANT SELECT ON \`mysql\`.\`time_zone_name\` TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" +{ + echo "GLPI Database Credentials" + echo "Database: $DB_NAME" + echo "Username: $DB_USER" + echo "Password: $DB_PASS" +} >> ~/glpi_db.creds +msg_ok "Set up database" + +msg_info "Installing GLPi" +cd /opt +RELEASE=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/') +wget -q "https://github.com/glpi-project/glpi/releases/download/${RELEASE}/glpi-${RELEASE}.tgz" +tar -xzvf glpi-${RELEASE}.tgz +cd /opt/glpi +$STD php bin/console db:install --db-name=$DB_NAME --db-user=$DB_USER --db-password=$DB_PASS --no-interaction +echo "${RELEASE}" >"/opt/${APP}_version.txt" +msg_ok "Installed GLPi" + +msg_info "Setting Downstream file" +cat < /opt/glpi/inc/downstream.php + /etc/glpi/local_define.php +/etc/apache2/sites-available/glpi.conf + + ServerName localhost + DocumentRoot /opt/glpi/public + + + Require all granted + RewriteEngine On + RewriteCond %{HTTP:Authorization} ^(.+)$ + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php [QSA,L] + + + ErrorLog \${APACHE_LOG_DIR}/glpi_error.log + CustomLog \${APACHE_LOG_DIR}/glpi_access.log combined + +EOF +$STD a2dissite 000-default.conf +$STD a2enmod rewrite +$STD a2ensite glpi.conf +msg_ok "Setup Service" + +msg_info "Setup Cronjob" +(crontab -l 2>/dev/null; echo "* * * * * php /opt/glpi/front/cron.php") | crontab - +msg_ok "Setup Cronjob" + +msg_info "Update PHP Params" +PHP_VERSION=$(ls /etc/php/ | grep -E '^[0-9]+\.[0-9]+$' | head -n 1) +PHP_INI="/etc/php/$PHP_VERSION/apache2/php.ini" +sed -i 's/^upload_max_filesize = .*/upload_max_filesize = 20M/' $PHP_INI +sed -i 's/^post_max_size = .*/post_max_size = 20M/' $PHP_INI +sed -i 's/^max_execution_time = .*/max_execution_time = 60/' $PHP_INI +sed -i 's/^max_input_vars = .*/max_input_vars = 5000/' $PHP_INI +sed -i 's/^memory_limit = .*/memory_limit = 256M/' $PHP_INI +sed -i 's/^;\?\s*session.cookie_httponly\s*=.*/session.cookie_httponly = On/' $PHP_INI +systemctl restart apache2 +msg_ok "Update PHP Params" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -rf /opt/glpi/install +rm -rf /opt/glpi-${RELEASE}.tgz +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" diff --git a/json/glpi.json b/json/glpi.json new file mode 100644 index 00000000..6d652bdd --- /dev/null +++ b/json/glpi.json @@ -0,0 +1,34 @@ +{ + "name": "GLPI", + "slug": "glpi", + "categories": [ + 0 + ], + "date_created": "2025-01-06", + "type": "ct", + "updateable": false, + "privileged": false, + "interface_port": 80, + "documentation": "https://glpi-project.org/documentation/", + "website": "https://glpi-project.org/", + "logo": "https://raw.githubusercontent.com/glpi-project/glpi/refs/heads/main/public/pics/login_logo_glpi.png", + "description": "GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.", + "install_methods": [ + { + "type": "default", + "script": "ct/glpi.sh", + "resources": { + "cpu": 2, + "ram": 2048, + "hdd": 10, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": "glpi", + "password": "glpi" + }, + "notes": [] +} From 5184f47eb6e1bacf82ca060a8543279482454d19 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:09:28 +0100 Subject: [PATCH 03/53] Rename validate-filenames.yml to validate-filenames.yml.bak --- .../{validate-filenames.yml => validate-filenames.yml.bak} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{validate-filenames.yml => validate-filenames.yml.bak} (100%) diff --git a/.github/workflows/validate-filenames.yml b/.github/workflows/validate-filenames.yml.bak similarity index 100% rename from .github/workflows/validate-filenames.yml rename to .github/workflows/validate-filenames.yml.bak From 784e1090121d33c475de210cb5e8a5defe05f3ab Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:09:41 +0100 Subject: [PATCH 04/53] Rename validate-formatting.yaml to validate-formatting.yaml.bak --- .../{validate-formatting.yaml => validate-formatting.yaml.bak} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{validate-formatting.yaml => validate-formatting.yaml.bak} (100%) diff --git a/.github/workflows/validate-formatting.yaml b/.github/workflows/validate-formatting.yaml.bak similarity index 100% rename from .github/workflows/validate-formatting.yaml rename to .github/workflows/validate-formatting.yaml.bak From 774cdcaf8d93ca155fe94841f9ad1e01a67a6438 Mon Sep 17 00:00:00 2001 From: tlissak Date: Mon, 6 Jan 2025 15:25:53 +0100 Subject: [PATCH 05/53] New Script: Typesense (#1291) * Add typesense database lxc container * fully upgrade typesende nstall * Update typesense.sh * Update typesense.json --------- Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com> --- ct/typesense.sh | 49 ++++++++++++++++++++++++++++++++++++ install/typesense-install.sh | 39 ++++++++++++++++++++++++++++ json/typesense.json | 39 ++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 ct/typesense.sh create mode 100644 install/typesense-install.sh create mode 100644 json/typesense.json diff --git a/ct/typesense.sh b/ct/typesense.sh new file mode 100644 index 00000000..bf239796 --- /dev/null +++ b/ct/typesense.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: tlissak | Co-Author MickLesk +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://typesense.org/ + +# App Default Values +APP="TypeSense" +var_tags="database" +var_cpu="1" +var_ram="1024" +var_disk="4" +var_os="debian" +var_version="12" +var_unprivileged="1" + +# 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 + if [[ ! -f /etc/typesense/typesense-server.ini ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Updating ${APP} LXC" + apt-get update &>/dev/null + apt-get -y upgrade &>/dev/null + msg_ok "Updated Successfully" + 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 IP:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}${IP}:8108${CL}" diff --git a/install/typesense-install.sh b/install/typesense-install.sh new file mode 100644 index 00000000..cde371b8 --- /dev/null +++ b/install/typesense-install.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: tlissak +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://typesense.org/ + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + curl \ + mc \ + sudo +msg_ok "Installed Dependencies" + +msg_info "Installing TypeSense" +RELEASE=$(curl -s https://api.github.com/repos/typesense/typesense/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +cd /opt +wget -q -O https://dl.typesense.org/releases/${RELEASE}/typesense-server-${RELEASE}-amd64.deb +$STD apt install -y /opt/typesense-server-${RELEASE}-amd64.deb +echo 'enable-cors = true' >> /etc/typesense/typesense-server.ini +echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" +msg_ok "Installed TypeSense" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -rf /opt/typesense-server-${RELEASE}-amd64.deb +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" diff --git a/json/typesense.json b/json/typesense.json new file mode 100644 index 00000000..53f596c9 --- /dev/null +++ b/json/typesense.json @@ -0,0 +1,39 @@ +{ + "name": "TypeSense", + "slug": "typesense", + "categories": [ + 5 + ], + "date_created": "2025-01-06", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": null, + "documentation": "https://typesense.org/docs/", + "website": "https://typesense.org/", + "logo": "https://typesense.org/_nuxt/img/typesense_logo_white.0f9fb0a.svg", + "description": "Typesense is an open-source, fast, and lightweight search engine optimized for delivering instant, relevant, and typo-tolerant search results. Designed for ease of use and high performance, it offers features like real-time indexing, fuzzy matching, customizable relevance ranking, and a simple API for integration. Typesense is particularly well-suited for applications requiring instant search capabilities, such as e-commerce, documentation, or any content-rich websites. It is often compared to tools like Elasticsearch but is more developer-friendly and less resource-intensive.", + "install_methods": [ + { + "type": "default", + "script": "ct/typesense.sh", + "resources": { + "cpu": 1, + "ram": 1024, + "hdd": 4, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "This script requires some extra steps after the installation, Please checkout the 'documentation' Button", + "type": "info" + } + ] +} From 5196539d1be241e75368518c9c58a2eb3b9f4e26 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:27:46 +0100 Subject: [PATCH 06/53] fix glpi echo release --- install/glpi-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/glpi-install.sh b/install/glpi-install.sh index 04cbf1f2..4580a05a 100644 --- a/install/glpi-install.sh +++ b/install/glpi-install.sh @@ -46,10 +46,10 @@ msg_info "Installing GLPi" cd /opt RELEASE=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/') wget -q "https://github.com/glpi-project/glpi/releases/download/${RELEASE}/glpi-${RELEASE}.tgz" -tar -xzvf glpi-${RELEASE}.tgz +$STD tar -xzvf glpi-${RELEASE}.tgz cd /opt/glpi $STD php bin/console db:install --db-name=$DB_NAME --db-user=$DB_USER --db-password=$DB_PASS --no-interaction -echo "${RELEASE}" >"/opt/${APP}_version.txt" +echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed GLPi" msg_info "Setting Downstream file" From 701f7e9cba0576ecc4989a29367b0648e5aaa433 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:31:03 +0100 Subject: [PATCH 07/53] Update typesense-install.sh --- install/typesense-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/typesense-install.sh b/install/typesense-install.sh index cde371b8..897eda5c 100644 --- a/install/typesense-install.sh +++ b/install/typesense-install.sh @@ -23,7 +23,7 @@ msg_ok "Installed Dependencies" msg_info "Installing TypeSense" RELEASE=$(curl -s https://api.github.com/repos/typesense/typesense/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') cd /opt -wget -q -O https://dl.typesense.org/releases/${RELEASE}/typesense-server-${RELEASE}-amd64.deb +wget -q https://dl.typesense.org/releases/${RELEASE}/typesense-server-${RELEASE}-amd64.deb $STD apt install -y /opt/typesense-server-${RELEASE}-amd64.deb echo 'enable-cors = true' >> /etc/typesense/typesense-server.ini echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" From d712be955c106c0cb2465c36450c14a970fccd0d Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:32:55 +0100 Subject: [PATCH 08/53] Update typesense.sh --- ct/typesense.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ct/typesense.sh b/ct/typesense.sh index bf239796..f4e5aa9b 100644 --- a/ct/typesense.sh +++ b/ct/typesense.sh @@ -32,10 +32,15 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - msg_info "Updating ${APP} LXC" - apt-get update &>/dev/null - apt-get -y upgrade &>/dev/null - msg_ok "Updated Successfully" + RELEASE=$(curl -s https://api.github.com/repos/typesense/typesense/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then + msg_info "Updating ${APP} LXC" + apt-get update &>/dev/null + apt-get -y upgrade &>/dev/null + msg_ok "Updated Successfully" + else + msg_ok "No update required. ${APP} is already at ${RELEASE}" + fi exit } From 0ec532a4e778896e15aa889d95239cd5fd0bf915 Mon Sep 17 00:00:00 2001 From: "community-scripts-pr-app[bot]" <189241966+community-scripts-pr-app[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:33:53 +0100 Subject: [PATCH 09/53] Update CHANGELOG.md (#1293) Co-authored-by: github-actions[bot] --- CHANGELOG.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 728042d4..a9402bda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,17 +20,23 @@ Do not break established syntax in this file, as it is automatically updated by ### Changed +### ✨ New Scripts + +- New Script: Typesense [@tlissak](https://github.com/tlissak) ([#1291](https://github.com/community-scripts/ProxmoxVE/pull/1291)) +- New script: GLPI [@opastorello](https://github.com/opastorello) ([#1201](https://github.com/community-scripts/ProxmoxVE/pull/1201)) + ### 🚀 Updated Scripts -- fix: buffer from base64 in formatting pipeline [@se-bastiaan](https://github.com/se-bastiaan) ([#1285](https://github.com/community-scripts/ProxmoxVE/pull/1285)) +- [Fix]: Fixed rm Bug in pf2etools [@MickLesk](https://github.com/MickLesk) ([#1292](https://github.com/community-scripts/ProxmoxVE/pull/1292)) - Fix: Homebox Update Script [@MickLesk](https://github.com/MickLesk) ([#1284](https://github.com/community-scripts/ProxmoxVE/pull/1284)) - Add ca-certificates for Install (Frigate) [@MickLesk](https://github.com/MickLesk) ([#1282](https://github.com/community-scripts/ProxmoxVE/pull/1282)) +- fix: buffer from base64 in formatting pipeline [@se-bastiaan](https://github.com/se-bastiaan) ([#1285](https://github.com/community-scripts/ProxmoxVE/pull/1285)) ### 🧰 Maintenance +- Add reapproval of Changelog-PR [@MickLesk](https://github.com/MickLesk) ([#1279](https://github.com/community-scripts/ProxmoxVE/pull/1279)) - ci: combine header checks into workflow with PR comment [@se-bastiaan](https://github.com/se-bastiaan) ([#1257](https://github.com/community-scripts/ProxmoxVE/pull/1257)) - ci: change filename checks into steps with PR comment [@se-bastiaan](https://github.com/se-bastiaan) ([#1255](https://github.com/community-scripts/ProxmoxVE/pull/1255)) -- Add reapproval of Changelog-PR [@MickLesk](https://github.com/MickLesk) ([#1279](https://github.com/community-scripts/ProxmoxVE/pull/1279)) - ci: add pipeline for code formatting checks [@se-bastiaan](https://github.com/se-bastiaan) ([#1239](https://github.com/community-scripts/ProxmoxVE/pull/1239)) ## 2025-01-05 From 6a78564cc3928ca292b24b7801e97e5f9970fdde Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:36:41 +0100 Subject: [PATCH 10/53] Update glpi-install.sh --- install/glpi-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/glpi-install.sh b/install/glpi-install.sh index 4580a05a..61fc6f29 100644 --- a/install/glpi-install.sh +++ b/install/glpi-install.sh @@ -125,7 +125,7 @@ $STD a2ensite glpi.conf msg_ok "Setup Service" msg_info "Setup Cronjob" -(crontab -l 2>/dev/null; echo "* * * * * php /opt/glpi/front/cron.php") | crontab - +echo "* * * * * php /opt/glpi/front/cron.php" | crontab - msg_ok "Setup Cronjob" msg_info "Update PHP Params" From 9abd8bf9aa40fbf8b3e340c906913f9bd28f2a91 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 6 Jan 2025 21:41:23 +0100 Subject: [PATCH 11/53] Fix Tag in HyperHDR Script (#1299) --- ct/hyperhdr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/hyperhdr.sh b/ct/hyperhdr.sh index 150864a4..bbdc82d3 100644 --- a/ct/hyperhdr.sh +++ b/ct/hyperhdr.sh @@ -7,7 +7,7 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/m # App Default Values APP="HyperHDR" -var_tags="ambient lightning" +var_tags="ambient-lightning" var_cpu="2" var_ram="2048" var_disk="4" From ab10013fbe762b67ec61ecb186e82f6958348b3c Mon Sep 17 00:00:00 2001 From: "community-scripts-pr-app[bot]" <189241966+community-scripts-pr-app[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 21:42:35 +0100 Subject: [PATCH 12/53] Update CHANGELOG.md (#1300) Co-authored-by: github-actions[bot] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9402bda..b1057690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ Do not break established syntax in this file, as it is automatically updated by ### 🚀 Updated Scripts +- Fix Tag in HyperHDR Script [@MickLesk](https://github.com/MickLesk) ([#1299](https://github.com/community-scripts/ProxmoxVE/pull/1299)) - [Fix]: Fixed rm Bug in pf2etools [@MickLesk](https://github.com/MickLesk) ([#1292](https://github.com/community-scripts/ProxmoxVE/pull/1292)) - Fix: Homebox Update Script [@MickLesk](https://github.com/MickLesk) ([#1284](https://github.com/community-scripts/ProxmoxVE/pull/1284)) - Add ca-certificates for Install (Frigate) [@MickLesk](https://github.com/MickLesk) ([#1282](https://github.com/community-scripts/ProxmoxVE/pull/1282)) From bc702e2a6da6b1eb31e19c10f4a6fab2a011b499 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:49:44 +0100 Subject: [PATCH 13/53] Fix Script: Zammad (#1309) --- ct/zammad.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/zammad.sh b/ct/zammad.sh index 43360bd0..e96d4f6c 100644 --- a/ct/zammad.sh +++ b/ct/zammad.sh @@ -28,7 +28,7 @@ function update_script() { header_info check_container_storage check_container_resources - if [[ ! -d /opt/zamad ]]; then + if [[ ! -d /opt/zammad ]]; then msg_error "No ${APP} Installation Found!" exit fi From 2078deca57f841cade7384e4ac6c54a9dd5741b3 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:53:52 +0100 Subject: [PATCH 14/53] Set Execution Rights for GH-Action: Validate Scripts (#1312) --- .github/workflows/validate-scripts.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/validate-scripts.yml b/.github/workflows/validate-scripts.yml index 10d6182d..75e32e13 100644 --- a/.github/workflows/validate-scripts.yml +++ b/.github/workflows/validate-scripts.yml @@ -21,6 +21,10 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} + + - name: Set execute permission for .sh files + run: | + chmod +x ct/*.sh - name: Get changed files id: changed-files From f5a54bc3ad0b28767c28a9b480ef8bba5f69f78d Mon Sep 17 00:00:00 2001 From: "community-scripts-pr-app[bot]" <189241966+community-scripts-pr-app[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:57:50 +0100 Subject: [PATCH 15/53] Update CHANGELOG.md (#1310) Co-authored-by: github-actions[bot] --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1057690..198bf635 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,18 @@ All LXC instances created using this repository come pre-installed with Midnight > [!IMPORTANT] Do not break established syntax in this file, as it is automatically updated by a Github Workflow +## 2025-01-07 + +### Changed + +### 🚀 Updated Scripts + +- Fix: Folder-Check for Updatescript Zammad [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#1309](https://github.com/community-scripts/ProxmoxVE/pull/1309)) + +### 🧰 Maintenance + +- Set Execution Rights for GH-Action: Validate Scripts [@MickLesk](https://github.com/MickLesk) ([#1312](https://github.com/community-scripts/ProxmoxVE/pull/1312)) + ## 2025-01-06 ### Changed From c88d3a3883073831a085afcb00223c5f2afe22a0 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:58:27 +0100 Subject: [PATCH 16/53] Rename validate-filenames.yml.bak to validate-filenames.yml --- .../{validate-filenames.yml.bak => validate-filenames.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{validate-filenames.yml.bak => validate-filenames.yml} (100%) diff --git a/.github/workflows/validate-filenames.yml.bak b/.github/workflows/validate-filenames.yml similarity index 100% rename from .github/workflows/validate-filenames.yml.bak rename to .github/workflows/validate-filenames.yml From 29b98b450b03b33f7ed426554f69e6c1931839b5 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:58:43 +0100 Subject: [PATCH 17/53] Rename validate-formatting.yaml.bak to validate-formatting.yaml --- .../{validate-formatting.yaml.bak => validate-formatting.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{validate-formatting.yaml.bak => validate-formatting.yaml} (100%) diff --git a/.github/workflows/validate-formatting.yaml.bak b/.github/workflows/validate-formatting.yaml similarity index 100% rename from .github/workflows/validate-formatting.yaml.bak rename to .github/workflows/validate-formatting.yaml From 4da57bd76ca18ef07694e43ddbf01ec185650465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastiaan?= Date: Tue, 7 Jan 2025 20:34:37 +0100 Subject: [PATCH 18/53] fix: permissions of validate pipelines (#1316) * Fix permission in validate-filenames pipeline * Run Github Actions for script validation on pull_request_target with right permissions --- .github/workflows/validate-filenames.yml | 17 +++++++++++++++-- .github/workflows/validate-formatting.yaml | 17 ++++++++++++++--- .github/workflows/validate-scripts.yml | 17 ++++++++++++++--- 3 files changed, 43 insertions(+), 8 deletions(-) diff --git a/.github/workflows/validate-filenames.yml b/.github/workflows/validate-filenames.yml index 704715f5..d4dffd8e 100644 --- a/.github/workflows/validate-filenames.yml +++ b/.github/workflows/validate-filenames.yml @@ -1,23 +1,36 @@ name: Validate filenames on: - pull_request: + pull_request_target: paths: - "ct/*.sh" - "install/*.sh" - "json/*.json" - - ".github/workflows/validate-filenames.yml" jobs: check-files: name: Check changed files runs-on: ubuntu-latest + permissions: + pull-requests: write steps: + - name: Get pull request information + uses: actions/github-script@v7 + id: pr + with: + script: | + const { data: pullRequest } = await github.rest.pulls.get({ + ...context.repo, + pull_number: context.payload.pull_request.number, + }); + return pullRequest; + - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 # Ensure the full history is fetched for accurate diffing + ref: ${{ fromJSON(steps.pr.outputs.result).merge_commit_sha }} - name: Get changed files id: changed-files diff --git a/.github/workflows/validate-formatting.yaml b/.github/workflows/validate-formatting.yaml index 760ab277..cde44d6a 100644 --- a/.github/workflows/validate-formatting.yaml +++ b/.github/workflows/validate-formatting.yaml @@ -4,11 +4,10 @@ on: push: branches: - main - pull_request: + pull_request_target: paths: - "**/*.sh" - "**/*.func" - - ".github/workflows/validate-formatting.yaml" jobs: shfmt: @@ -18,10 +17,22 @@ jobs: pull-requests: write steps: + - name: Get pull request information + uses: actions/github-script@v7 + id: pr + with: + script: | + const { data: pullRequest } = await github.rest.pulls.get({ + ...context.repo, + pull_number: context.payload.pull_request.number, + }); + return pullRequest; + - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 0 # Ensure the full history is fetched for accurate diffing + ref: ${{ fromJSON(steps.pr.outputs.result).merge_commit_sha }} - name: Get changed files id: changed-files diff --git a/.github/workflows/validate-scripts.yml b/.github/workflows/validate-scripts.yml index 75e32e13..e7ee667d 100644 --- a/.github/workflows/validate-scripts.yml +++ b/.github/workflows/validate-scripts.yml @@ -3,11 +3,10 @@ on: push: branches: - main - pull_request: + pull_request_target: paths: - "ct/*.sh" - "install/*.sh" - - ".github/workflows/validate-scripts.yml" jobs: check-scripts: @@ -17,10 +16,22 @@ jobs: pull-requests: write steps: + - name: Get pull request information + uses: actions/github-script@v7 + id: pr + with: + script: | + const { data: pullRequest } = await github.rest.pulls.get({ + ...context.repo, + pull_number: context.payload.pull_request.number, + }); + return pullRequest; + - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} + fetch-depth: 0 # Ensure the full history is fetched for accurate diffing + ref: ${{fromJSON(steps.pr.outputs.result).merge_commit_sha}} - name: Set execute permission for .sh files run: | From 670d64ec43577f6f97e4e51ad2126ec094a43cc8 Mon Sep 17 00:00:00 2001 From: "community-scripts-pr-app[bot]" <189241966+community-scripts-pr-app[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 08:13:40 +0100 Subject: [PATCH 19/53] Update CHANGELOG.md (#1320) Co-authored-by: github-actions[bot] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 198bf635..d89bbff7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ Do not break established syntax in this file, as it is automatically updated by ### 🧰 Maintenance +- fix: permissions of validate pipelines [@se-bastiaan](https://github.com/se-bastiaan) ([#1316](https://github.com/community-scripts/ProxmoxVE/pull/1316)) - Set Execution Rights for GH-Action: Validate Scripts [@MickLesk](https://github.com/MickLesk) ([#1312](https://github.com/community-scripts/ProxmoxVE/pull/1312)) ## 2025-01-06 From 5fc783da67c764c960bd5846dcb005e96c2ad536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinaldo=20D=C3=ADaz=20Lugo?= Date: Wed, 8 Jan 2025 08:14:15 +0100 Subject: [PATCH 20/53] update postgresql json to add post install password setup (#1318) --- json/postgresql.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/json/postgresql.json b/json/postgresql.json index c60465c7..6fe236d1 100644 --- a/json/postgresql.json +++ b/json/postgresql.json @@ -30,5 +30,10 @@ "username": null, "password": null }, - "notes": [] + "notes": [ + { + "text": "Set a password after installation for postgres user by running `echo \"ALTER USER postgres with encrypted password 'your_password';\" | sudo -u postgres psql`", + "type": "info" + } + ] } \ No newline at end of file From 9330e9a6401cdee6ecd9849fccf39772010c52bf Mon Sep 17 00:00:00 2001 From: "community-scripts-pr-app[bot]" <189241966+community-scripts-pr-app[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 13:36:05 +0100 Subject: [PATCH 21/53] Update CHANGELOG.md (#1324) Co-authored-by: github-actions[bot] --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d89bbff7..ab782eca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,14 @@ All LXC instances created using this repository come pre-installed with Midnight > [!IMPORTANT] Do not break established syntax in this file, as it is automatically updated by a Github Workflow +## 2025-01-08 + +### Changed + +### 🌐 Website + +- update postgresql json to add post install password setup [@rdiazlugo](https://github.com/rdiazlugo) ([#1318](https://github.com/community-scripts/ProxmoxVE/pull/1318)) + ## 2025-01-07 ### Changed From ff712bc36e5b1ff0080876b3d379a96e635f8dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastiaan?= Date: Wed, 8 Jan 2025 16:33:09 +0100 Subject: [PATCH 22/53] fix: correctly handle pull_request_target event (#1327) * Fix workflow on pull_request_target * fix fromJSON --- .github/workflows/validate-filenames.yml | 9 +++++---- .github/workflows/validate-formatting.yaml | 5 +++-- .github/workflows/validate-scripts.yml | 9 +++++---- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/validate-filenames.yml b/.github/workflows/validate-filenames.yml index d4dffd8e..909c669d 100644 --- a/.github/workflows/validate-filenames.yml +++ b/.github/workflows/validate-filenames.yml @@ -16,6 +16,7 @@ jobs: steps: - name: Get pull request information + if: github.event_name == 'pull_request_target' uses: actions/github-script@v7 id: pr with: @@ -30,13 +31,13 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 # Ensure the full history is fetched for accurate diffing - ref: ${{ fromJSON(steps.pr.outputs.result).merge_commit_sha }} + ref: ${{ github.event_name == 'pull_request_target' && fromJSON(steps.pr.outputs.result).merge_commit_sha || '' }} - name: Get changed files id: changed-files run: | - if ${{ github.event_name == 'pull_request' }}; then - echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)" >> $GITHUB_OUTPUT + if ${{ github.event_name == 'pull_request_target' }}; then + echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ steps.pr.outputs.result && fromJSON(steps.pr.outputs.result).merge_commit_sha }} | xargs)" >> $GITHUB_OUTPUT else echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT fi @@ -88,7 +89,7 @@ jobs: fi - name: Post results and comment - if: always() && steps.check-scripts.outputs.files != '' && steps.check-json.outputs.files != '' && github.event_name == 'pull_request' + if: always() && steps.check-scripts.outputs.files != '' && steps.check-json.outputs.files != '' && github.event_name == 'pull_request_target' uses: actions/github-script@v7 with: script: | diff --git a/.github/workflows/validate-formatting.yaml b/.github/workflows/validate-formatting.yaml index cde44d6a..c0b6ef3b 100644 --- a/.github/workflows/validate-formatting.yaml +++ b/.github/workflows/validate-formatting.yaml @@ -18,6 +18,7 @@ jobs: steps: - name: Get pull request information + if: github.event_name == 'pull_request_target' uses: actions/github-script@v7 id: pr with: @@ -32,13 +33,13 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 # Ensure the full history is fetched for accurate diffing - ref: ${{ fromJSON(steps.pr.outputs.result).merge_commit_sha }} + ref: ${{ github.event_name == 'pull_request_target' && fromJSON(steps.pr.outputs.result).merge_commit_sha || '' }} - name: Get changed files id: changed-files run: | if ${{ github.event_name == 'pull_request' }}; then - echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT + echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ steps.pr.outputs.result && fromJSON(steps.pr.outputs.result).merge_commit_sha }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT else echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT fi diff --git a/.github/workflows/validate-scripts.yml b/.github/workflows/validate-scripts.yml index e7ee667d..0df07a74 100644 --- a/.github/workflows/validate-scripts.yml +++ b/.github/workflows/validate-scripts.yml @@ -17,6 +17,7 @@ jobs: steps: - name: Get pull request information + if: github.event_name == 'pull_request_target' uses: actions/github-script@v7 id: pr with: @@ -31,7 +32,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 # Ensure the full history is fetched for accurate diffing - ref: ${{fromJSON(steps.pr.outputs.result).merge_commit_sha}} + ref: ${{ github.event_name == 'pull_request_target' && fromJSON(steps.pr.outputs.result).merge_commit_sha || '' }} - name: Set execute permission for .sh files run: | @@ -40,8 +41,8 @@ jobs: - name: Get changed files id: changed-files run: | - if ${{ github.event_name == 'pull_request' }}; then - echo "files=$(git diff --name-only -r HEAD^1 HEAD | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT + if ${{ github.event_name == 'pull_request_target' }}; then + echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ steps.pr.outputs.result && fromJSON(steps.pr.outputs.result).merge_commit_sha }} | xargs)" >> $GITHUB_OUTPUT else echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT fi @@ -167,7 +168,7 @@ jobs: fi - name: Post results and comment - if: always() && steps.changed-files.outputs.files != '' && github.event_name == 'pull_request' + if: always() && steps.changed-files.outputs.files != '' && github.event_name == 'pull_request_target' uses: actions/github-script@v7 with: script: | From e1daaa6409d257314b29833bef1206da2f45aded Mon Sep 17 00:00:00 2001 From: "community-scripts-pr-app[bot]" <189241966+community-scripts-pr-app[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:33:40 +0100 Subject: [PATCH 23/53] Update CHANGELOG.md (#1328) Co-authored-by: github-actions[bot] --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab782eca..23c16943 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,10 @@ Do not break established syntax in this file, as it is automatically updated by - update postgresql json to add post install password setup [@rdiazlugo](https://github.com/rdiazlugo) ([#1318](https://github.com/community-scripts/ProxmoxVE/pull/1318)) +### 🧰 Maintenance + +- fix: correctly handle pull_request_target event [@se-bastiaan](https://github.com/se-bastiaan) ([#1327](https://github.com/community-scripts/ProxmoxVE/pull/1327)) + ## 2025-01-07 ### Changed From 0059adecf1b2cce827e652aedefbc53679a3e672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastiaan?= Date: Wed, 8 Jan 2025 21:41:58 +0100 Subject: [PATCH 24/53] fix(ci): formatting event & chmod +x (#1335) --- .github/workflows/validate-formatting.yaml | 4 ++-- .github/workflows/validate-scripts.yml | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validate-formatting.yaml b/.github/workflows/validate-formatting.yaml index c0b6ef3b..22056397 100644 --- a/.github/workflows/validate-formatting.yaml +++ b/.github/workflows/validate-formatting.yaml @@ -38,7 +38,7 @@ jobs: - name: Get changed files id: changed-files run: | - if ${{ github.event_name == 'pull_request' }}; then + if ${{ github.event_name == 'pull_request_target' }}; then echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ steps.pr.outputs.result && fromJSON(steps.pr.outputs.result).merge_commit_sha }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT else echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT @@ -70,7 +70,7 @@ jobs: fi - name: Post comment with results - if: always() && steps.changed-files.outputs.files != '' && github.event_name == 'pull_request' + if: always() && steps.changed-files.outputs.files != '' && github.event_name == 'pull_request_target' uses: actions/github-script@v7 with: script: | diff --git a/.github/workflows/validate-scripts.yml b/.github/workflows/validate-scripts.yml index 0df07a74..c58a5e59 100644 --- a/.github/workflows/validate-scripts.yml +++ b/.github/workflows/validate-scripts.yml @@ -33,10 +33,6 @@ jobs: with: fetch-depth: 0 # Ensure the full history is fetched for accurate diffing ref: ${{ github.event_name == 'pull_request_target' && fromJSON(steps.pr.outputs.result).merge_commit_sha || '' }} - - - name: Set execute permission for .sh files - run: | - chmod +x ct/*.sh - name: Get changed files id: changed-files From f428146c47e9121b556f8fa335895b9bb0aac29a Mon Sep 17 00:00:00 2001 From: "community-scripts-pr-app[bot]" <189241966+community-scripts-pr-app[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 23:05:14 +0100 Subject: [PATCH 25/53] Update CHANGELOG.md (#1336) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23c16943..94a28fe1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ Do not break established syntax in this file, as it is automatically updated by ### 🧰 Maintenance +- fix(ci): formatting event & chmod +x [@se-bastiaan](https://github.com/se-bastiaan) ([#1335](https://github.com/community-scripts/ProxmoxVE/pull/1335)) - fix: correctly handle pull_request_target event [@se-bastiaan](https://github.com/se-bastiaan) ([#1327](https://github.com/community-scripts/ProxmoxVE/pull/1327)) ## 2025-01-07 From e70a3a4b4d9c3c6a3772d06b1a24a5f0cf799b4c Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Date: Thu, 9 Jan 2025 09:29:25 +0100 Subject: [PATCH 26/53] Fix Checkmk Version grep (#1341) --- ct/checkmk.sh | 2 +- install/checkmk-install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/checkmk.sh b/ct/checkmk.sh index 7822d135..f1f930b8 100644 --- a/ct/checkmk.sh +++ b/ct/checkmk.sh @@ -29,7 +29,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/checkmk/checkmk/tags | grep "name" | awk '{print substr($2, 3, length($2)-4) }' | grep -v "*-rc" | tail -n +2 | head -n 1) + RELEASE=$(curl -fsSL https://api.github.com/repos/checkmk/checkmk/tags | grep "name" | awk '{print substr($2, 3, length($2)-4) }') if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then msg_info "Updating ${APP} to v${RELEASE}" omd stop monitoring &>/dev/null diff --git a/install/checkmk-install.sh b/install/checkmk-install.sh index 892c057d..e94f90c5 100644 --- a/install/checkmk-install.sh +++ b/install/checkmk-install.sh @@ -22,7 +22,7 @@ $STD apt-get install -y \ msg_ok "Installed Dependencies" msg_info "Install Checkmk" -RELEASE=$(curl -fsSL https://api.github.com/repos/checkmk/checkmk/tags | grep "name" | awk '{print substr($2, 3, length($2)-4) }' | grep -v "*-rc" | tail -n +2 | head -n 1) +RELEASE=$(curl -fsSL https://api.github.com/repos/checkmk/checkmk/tags | grep "name" | awk '{print substr($2, 3, length($2)-4) }') wget -q https://download.checkmk.com/checkmk/${RELEASE}/check-mk-raw-${RELEASE}_0.bookworm_amd64.deb -O /opt/checkmk.deb $STD apt-get install -y /opt/checkmk.deb echo "${RELEASE}" >"/opt/checkmk_version.txt" From 2d3506c7d33ae41ed563936148da00b89f6d81e8 Mon Sep 17 00:00:00 2001 From: "community-scripts-pr-app[bot]" <189241966+community-scripts-pr-app[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 09:33:13 +0100 Subject: [PATCH 27/53] Update CHANGELOG.md (#1343) --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94a28fe1..8119febd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,14 @@ All LXC instances created using this repository come pre-installed with Midnight > [!IMPORTANT] Do not break established syntax in this file, as it is automatically updated by a Github Workflow +## 2025-01-09 + +### Changed + +### 🚀 Updated Scripts + +- Fix Checkmk: Version grep broken [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#1341](https://github.com/community-scripts/ProxmoxVE/pull/1341)) + ## 2025-01-08 ### Changed From 3bb26b7b417b9e21b6bbd7cf67d2248364490529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastiaan?= Date: Thu, 9 Jan 2025 09:33:50 +0100 Subject: [PATCH 28/53] only validate scripts in validate-scripts workflow (#1344) --- .github/workflows/validate-scripts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-scripts.yml b/.github/workflows/validate-scripts.yml index c58a5e59..938501c3 100644 --- a/.github/workflows/validate-scripts.yml +++ b/.github/workflows/validate-scripts.yml @@ -38,7 +38,7 @@ jobs: id: changed-files run: | if ${{ github.event_name == 'pull_request_target' }}; then - echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ steps.pr.outputs.result && fromJSON(steps.pr.outputs.result).merge_commit_sha }} | xargs)" >> $GITHUB_OUTPUT + echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ steps.pr.outputs.result && fromJSON(steps.pr.outputs.result).merge_commit_sha }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT else echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT fi From 19e7751fb90f0063826245656958efbce57ac0e3 Mon Sep 17 00:00:00 2001 From: "community-scripts-pr-app[bot]" <189241966+community-scripts-pr-app[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 09:35:00 +0100 Subject: [PATCH 29/53] Update CHANGELOG.md (#1345) --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8119febd..3655c70e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,10 @@ Do not break established syntax in this file, as it is automatically updated by - Fix Checkmk: Version grep broken [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#1341](https://github.com/community-scripts/ProxmoxVE/pull/1341)) +### 🧰 Maintenance + +- fix: only validate scripts in validate-scripts workflow [@se-bastiaan](https://github.com/se-bastiaan) ([#1344](https://github.com/community-scripts/ProxmoxVE/pull/1344)) + ## 2025-01-08 ### Changed From 6b183c9e4e6ed1f21690ef7fd6581cf36935294d Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:36:40 +0100 Subject: [PATCH 30/53] Validate and auto-fix script formatting --- .github/workflows/validate-formatting.yaml | 57 ++++++++-------------- 1 file changed, 21 insertions(+), 36 deletions(-) diff --git a/.github/workflows/validate-formatting.yaml b/.github/workflows/validate-formatting.yaml index 22056397..896653be 100644 --- a/.github/workflows/validate-formatting.yaml +++ b/.github/workflows/validate-formatting.yaml @@ -1,4 +1,4 @@ -name: Validate script formatting +name: Validate and auto-fix script formatting on: push: @@ -11,9 +11,10 @@ on: jobs: shfmt: - name: Check changed files + name: Check and fix formatting runs-on: ubuntu-latest permissions: + contents: write pull-requests: write steps: @@ -32,13 +33,13 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: 0 # Ensure the full history is fetched for accurate diffing + fetch-depth: 0 ref: ${{ github.event_name == 'pull_request_target' && fromJSON(steps.pr.outputs.result).merge_commit_sha || '' }} - name: Get changed files id: changed-files run: | - if ${{ github.event_name == 'pull_request_target' }}; then + if [ "${{ github.event_name }}" == "pull_request_target" ]; then echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ steps.pr.outputs.result && fromJSON(steps.pr.outputs.result).merge_commit_sha }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT else echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT @@ -54,42 +55,36 @@ jobs: go install mvdan.cc/sh/v3/cmd/shfmt@latest echo "$GOPATH/bin" >> $GITHUB_PATH - - name: Run shfmt + - name: Fix formatting if: steps.changed-files.outputs.files != '' - id: shfmt run: | - set +e + shfmt -w ${{ steps.changed-files.outputs.files }} - shfmt_output=$(shfmt -d ${{ steps.changed-files.outputs.files }}) - if [[ $? -eq 0 ]]; then - exit 0 - else - echo "diff=\"$(echo -n "$shfmt_output" | base64 -w 0)\"" >> $GITHUB_OUTPUT - printf "%s" "$shfmt_output" - exit 1 - fi + - name: Commit and push changes + if: steps.changed-files.outputs.files != '' && github.event_name == 'pull_request_target' + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add ${{ steps.changed-files.outputs.files }} + git commit -m "chore: auto-fix formatting issues" + git push - name: Post comment with results - if: always() && steps.changed-files.outputs.files != '' && github.event_name == 'pull_request_target' + if: always() && github.event_name == 'pull_request_target' uses: actions/github-script@v7 with: script: | const result = "${{ job.status }}" === "success" ? "success" : "failure"; - const diff = Buffer.from( - ${{ steps.shfmt.outputs.diff }}, - "base64", - ).toString(); const issueNumber = context.payload.pull_request ? context.payload.pull_request.number : null; const commentIdentifier = "validate-formatting"; - let newCommentBody = `\n### Script formatting\n\n`; + let newCommentBody = `\n### Script Formatting Results\n\n`; if (result === "failure") { - newCommentBody += - `:x: We found issues in the formatting of the following changed files:\n\n\`\`\`diff\n${diff}\n\`\`\`\n`; + newCommentBody += `:x: Formatting issues were found and automatically fixed.\n`; } else { - newCommentBody += `:rocket: All changed shell scripts are formatted correctly!\n`; + newCommentBody += `:rocket: All scripts are properly formatted!\n`; } newCommentBody += `\n\n`; @@ -101,20 +96,11 @@ jobs: }); const existingComment = comments.find( - (comment) => comment.user.login === "github-actions[bot]", + (comment) => comment.user.login === "github-actions[bot]" && + comment.body.includes(commentIdentifier) ); if (existingComment) { - if (existingComment.body.includes(commentIdentifier)) { - const re = new RegExp( - String.raw`[\s\S]*?`, - "", - ); - newCommentBody = existingComment.body.replace(re, newCommentBody); - } else { - newCommentBody = existingComment.body + "\n\n---\n\n" + newCommentBody; - } - await github.rest.issues.updateComment({ ...context.repo, comment_id: existingComment.id, @@ -127,4 +113,3 @@ jobs: body: newCommentBody, }); } - } From 2646ea63179db32adf68f378dfd79b0d1a1a8283 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:39:31 +0100 Subject: [PATCH 31/53] Update validate-formatting.yaml --- .github/workflows/validate-formatting.yaml | 60 ++++++++++++++-------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/.github/workflows/validate-formatting.yaml b/.github/workflows/validate-formatting.yaml index 896653be..8eadd0ac 100644 --- a/.github/workflows/validate-formatting.yaml +++ b/.github/workflows/validate-formatting.yaml @@ -1,4 +1,4 @@ -name: Validate and auto-fix script formatting +name: Validate script formatting on: push: @@ -11,10 +11,10 @@ on: jobs: shfmt: - name: Check and fix formatting + name: Check changed files runs-on: ubuntu-latest permissions: - contents: write + pull-requests: write steps: @@ -33,13 +33,13 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 0 # Ensure the full history is fetched for accurate diffing ref: ${{ github.event_name == 'pull_request_target' && fromJSON(steps.pr.outputs.result).merge_commit_sha || '' }} - name: Get changed files id: changed-files run: | - if [ "${{ github.event_name }}" == "pull_request_target" ]; then + if ${{ github.event_name == 'pull_request_target' }}; then echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ steps.pr.outputs.result && fromJSON(steps.pr.outputs.result).merge_commit_sha }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT else echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT @@ -55,36 +55,43 @@ jobs: go install mvdan.cc/sh/v3/cmd/shfmt@latest echo "$GOPATH/bin" >> $GITHUB_PATH - - name: Fix formatting + - name: Run shfmt if: steps.changed-files.outputs.files != '' + id: shfmt run: | - shfmt -w ${{ steps.changed-files.outputs.files }} + set +e - - name: Commit and push changes - if: steps.changed-files.outputs.files != '' && github.event_name == 'pull_request_target' - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add ${{ steps.changed-files.outputs.files }} - git commit -m "chore: auto-fix formatting issues" - git push + + shfmt_output=$(shfmt -d ${{ steps.changed-files.outputs.files }}) + if [[ $? -eq 0 ]]; then + exit 0 + else + echo "diff=\"$(echo -n "$shfmt_output" | base64 -w 0)\"" >> $GITHUB_OUTPUT + printf "%s" "$shfmt_output" + exit 1 + fi - name: Post comment with results - if: always() && github.event_name == 'pull_request_target' + if: always() && steps.changed-files.outputs.files != '' && github.event_name == 'pull_request_target' uses: actions/github-script@v7 with: script: | const result = "${{ job.status }}" === "success" ? "success" : "failure"; + const diff = Buffer.from( + ${{ steps.shfmt.outputs.diff }}, + "base64", + ).toString(); const issueNumber = context.payload.pull_request ? context.payload.pull_request.number : null; const commentIdentifier = "validate-formatting"; - let newCommentBody = `\n### Script Formatting Results\n\n`; + let newCommentBody = `\n### Script formatting\n\n`; if (result === "failure") { - newCommentBody += `:x: Formatting issues were found and automatically fixed.\n`; + newCommentBody += + `:x: We found issues in the formatting of the following changed files:\n\n\`\`\`diff\n${diff}\n\`\`\`\n`; } else { - newCommentBody += `:rocket: All scripts are properly formatted!\n`; + newCommentBody += `:rocket: All changed shell scripts are formatted correctly!\n`; } newCommentBody += `\n\n`; @@ -96,11 +103,21 @@ jobs: }); const existingComment = comments.find( - (comment) => comment.user.login === "github-actions[bot]" && - comment.body.includes(commentIdentifier) + (comment) => comment.user.login === "github-actions[bot]", + ); if (existingComment) { + if (existingComment.body.includes(commentIdentifier)) { + const re = new RegExp( + String.raw`[\s\S]*?`, + "", + ); + newCommentBody = existingComment.body.replace(re, newCommentBody); + } else { + newCommentBody = existingComment.body + "\n\n---\n\n" + newCommentBody; + } + await github.rest.issues.updateComment({ ...context.repo, comment_id: existingComment.id, @@ -113,3 +130,4 @@ jobs: body: newCommentBody, }); } + } From 02401aa35d3c6d31636eb03e08bd074ad9923529 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:42:18 +0100 Subject: [PATCH 32/53] Update validate-scripts.yml --- .github/workflows/validate-scripts.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate-scripts.yml b/.github/workflows/validate-scripts.yml index 938501c3..d0e12923 100644 --- a/.github/workflows/validate-scripts.yml +++ b/.github/workflows/validate-scripts.yml @@ -186,7 +186,11 @@ jobs: newCommentBody += ':x: We found issues in the following changed files:\n\n'; for (const [check, files] of Object.entries(nonCompliantFiles)) { if (files) { - newCommentBody += `**${check}:**\n${files.trim().split(' ').map(file => `- ${file}`).join('\n')}\n\n`; + newCommentBody += `**${check}:**\n`; + files.trim().split(' ').forEach(file => { + newCommentBody += `- ${file}: ${check}\n`; + }); + newCommentBody += `\n`; } } } else { @@ -205,7 +209,7 @@ jobs: if (existingComment) { if (existingComment.body.includes(commentIdentifier)) { - const re = new RegExp(String.raw`[\s\S]*?`, ""); + const re = new RegExp(String.raw`[\\s\\S]*?`, ""); newCommentBody = existingComment.body.replace(re, newCommentBody); } else { newCommentBody = existingComment.body + '\n\n---\n\n' + newCommentBody; From 37f4a841a664beb41cab8b4df27b1f346e6832f3 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:47:37 +0100 Subject: [PATCH 33/53] Update validate-scripts.yml --- .github/workflows/validate-scripts.yml | 38 ++++++++++++++------------ 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/validate-scripts.yml b/.github/workflows/validate-scripts.yml index d0e12923..84b69706 100644 --- a/.github/workflows/validate-scripts.yml +++ b/.github/workflows/validate-scripts.yml @@ -16,6 +16,11 @@ jobs: pull-requests: write steps: + - name: Debug event payload + run: | + echo "Event name: ${{ github.event_name }}" + echo "Payload: $(cat $GITHUB_EVENT_PATH)" + - name: Get pull request information if: github.event_name == 'pull_request_target' uses: actions/github-script@v7 @@ -31,16 +36,16 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: 0 # Ensure the full history is fetched for accurate diffing + fetch-depth: 0 ref: ${{ github.event_name == 'pull_request_target' && fromJSON(steps.pr.outputs.result).merge_commit_sha || '' }} - name: Get changed files id: changed-files run: | - if ${{ github.event_name == 'pull_request_target' }}; then - echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ steps.pr.outputs.result && fromJSON(steps.pr.outputs.result).merge_commit_sha }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT + if [ "${{ github.event_name }}" == "pull_request_target" ]; then + echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ steps.pr.outputs.result && fromJSON(steps.pr.outputs.result).merge_commit_sha }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT else - echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT + echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT fi - name: Check build.func line @@ -170,12 +175,12 @@ jobs: script: | const result = '${{ job.status }}' === 'success' ? 'success' : 'failure'; const nonCompliantFiles = { - 'Invalid build.func source': "${{ steps.build-func.outputs.files }}", - 'Not executable': "${{ steps.check-executable.outputs.files }}", - 'Copyright header line missing or invalid': "${{ steps.check-copyright.outputs.files }}", - 'Author header line missing or invalid': "${{ steps.check-author.outputs.files }}", - 'License header line missing or invalid': "${{ steps.check-license.outputs.files }}", - 'Source header line missing or invalid': "${{ steps.check-source.outputs.files }}" + 'Invalid build.func source': "${{ steps.build-func.outputs.files || '' }}", + 'Not executable': "${{ steps.check-executable.outputs.files || '' }}", + 'Copyright header line missing or invalid': "${{ steps.check-copyright.outputs.files || '' }}", + 'Author header line missing or invalid': "${{ steps.check-author.outputs.files || '' }}", + 'License header line missing or invalid': "${{ steps.check-license.outputs.files || '' }}", + 'Source header line missing or invalid': "${{ steps.check-source.outputs.files || '' }}" }; const issueNumber = context.payload.pull_request ? context.payload.pull_request.number : null; @@ -205,15 +210,14 @@ jobs: issue_number: issueNumber }); - const existingComment = comments.find(comment => comment.user.login === 'github-actions[bot]'); + const existingComment = comments.find(comment => + comment.body.includes(``) && + comment.user.login === 'github-actions[bot]' + ); if (existingComment) { - if (existingComment.body.includes(commentIdentifier)) { - const re = new RegExp(String.raw`[\\s\\S]*?`, ""); - newCommentBody = existingComment.body.replace(re, newCommentBody); - } else { - newCommentBody = existingComment.body + '\n\n---\n\n' + newCommentBody; - } + const re = new RegExp(String.raw`[\\s\\S]*?`, "m"); + newCommentBody = existingComment.body.replace(re, newCommentBody); await github.rest.issues.updateComment({ ...context.repo, From ec1e5b3a4a7a76ec49071ca6642759f170a8b8c4 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:51:33 +0100 Subject: [PATCH 34/53] Rename validate-scripts.yml to validate-scripts.yml.bak --- .../workflows/{validate-scripts.yml => validate-scripts.yml.bak} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{validate-scripts.yml => validate-scripts.yml.bak} (100%) diff --git a/.github/workflows/validate-scripts.yml b/.github/workflows/validate-scripts.yml.bak similarity index 100% rename from .github/workflows/validate-scripts.yml rename to .github/workflows/validate-scripts.yml.bak From 5af9dd9e45a319c637028bbc5fa6fe352c1ab96f Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:51:54 +0100 Subject: [PATCH 35/53] Rename validate-formatting.yaml to validate-formatting.yaml.bak --- .../{validate-formatting.yaml => validate-formatting.yaml.bak} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{validate-formatting.yaml => validate-formatting.yaml.bak} (100%) diff --git a/.github/workflows/validate-formatting.yaml b/.github/workflows/validate-formatting.yaml.bak similarity index 100% rename from .github/workflows/validate-formatting.yaml rename to .github/workflows/validate-formatting.yaml.bak From d56d8dd369dc53c24cfa70e030d830fab178c683 Mon Sep 17 00:00:00 2001 From: Jesper Dramsch Date: Thu, 9 Jan 2025 15:53:47 +0100 Subject: [PATCH 36/53] Fix: AdventureLog - update script bug (#1334) * refactor: move installation for backup and maintain media and env files * fix: return to working directory * Workdir Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * Workdir Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * Avoid Workdir Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * Avoid Workdir Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * Remove old installation (at request of @michelroegl-brunner) Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * rm newline * rm last version --------- Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> --- ct/adventurelog.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/ct/adventurelog.sh b/ct/adventurelog.sh index 5c168ce4..a9c80542 100644 --- a/ct/adventurelog.sh +++ b/ct/adventurelog.sh @@ -40,19 +40,20 @@ function update_script() { msg_ok "Services Stopped" msg_info "Updating ${APP} to ${RELEASE}" - cp /opt/adventurelog/backend/server/.env /opt/server.env - cp /opt/adventurelog/frontend/.env /opt/frontend.env - wget -q "https://github.com/seanmorley15/AdventureLog/archive/refs/tags/v${RELEASE}.zip" - unzip -q v${RELEASE}.zip - mv AdventureLog-${RELEASE} /opt/adventurelog - mv /opt/server.env /opt/adventurelog/backend/server/.env + mv /opt/adventurelog/ /opt/adventurelog-backup/ + wget -qO /opt/v${RELEASE}.zip "https://github.com/seanmorley15/AdventureLog/archive/refs/tags/v${RELEASE}.zip" + unzip -q /opt/v${RELEASE}.zip + mv /opt/AdventureLog-${RELEASE} /opt/adventurelog + + mv /opt/adventurelog-backup/backend/server/.env /opt/adventurelog/backend/server/.env + mv /opt/adventurelog-backup/backend/server/media /opt/adventurelog/backend/server/media cd /opt/adventurelog/backend/server pip install --upgrade pip &>/dev/null pip install -r requirements.txt &>/dev/null python3 manage.py collectstatic --noinput &>/dev/null python3 manage.py migrate &>/dev/null - mv /opt/frontend.env /opt/adventurelog/frontend/.env + mv /opt/adventurelog-backup/frontend/.env /opt/adventurelog/frontend/.env cd /opt/adventurelog/frontend pnpm install &>/dev/null pnpm run build &>/dev/null @@ -65,7 +66,8 @@ function update_script() { msg_ok "Started Services" msg_info "Cleaning Up" - rm -rf v${RELEASE}.zip + rm -rf /opt/v${RELEASE}.zip + rm -rf /opt/adventurelog-backup msg_ok "Cleaned" msg_ok "Updated Successfully" else @@ -81,4 +83,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}:3000${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" From eb8ebfe7e439c318b1912ca6752673a998fae0bf Mon Sep 17 00:00:00 2001 From: Jeron Wong Date: Thu, 9 Jan 2025 07:21:30 -0800 Subject: [PATCH 37/53] New Script: calibre-server (#960) * init commit * spaghetti * Refactor calibre-server scripts: Update license link, correct variable tag case, and add newline in success message * Update * Update calibre-server.sh * Update calibre-server-install.sh * Update calibre-server.json --------- Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com> --- ct/calibre-server.sh | 63 +++++++++++++++++++++++++++++++ install/calibre-server-install.sh | 59 +++++++++++++++++++++++++++++ json/calibre-server.json | 43 +++++++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 ct/calibre-server.sh create mode 100644 install/calibre-server-install.sh create mode 100644 json/calibre-server.json diff --git a/ct/calibre-server.sh b/ct/calibre-server.sh new file mode 100644 index 00000000..b59e89c9 --- /dev/null +++ b/ct/calibre-server.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: thisisjeron +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://calibre-ebook.com + +# App Default Values +APP="Calibre-Server" +var_tags="eBook" +var_cpu="2" +var_ram="1024" +var_disk="4" +var_os="debian" +var_version="12" +var_unprivileged="1" + +# 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 + + if [[ ! -f /etc/systemd/system/calibre-server.service ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Stopping ${APP}" + systemctl stop calibre-server + msg_ok "Stopped ${APP}" + + msg_info "Updating ${APP} Packages" + apt-get update &>/dev/null + apt-get -y upgrade &>/dev/null + msg_ok "Packages updated" + + msg_info "Updating Calibre (latest)" + bash -c "$(curl -fsSL https://download.calibre-ebook.com/linux-installer.sh)" + msg_ok "Updated Calibre" + + msg_info "Starting ${APP}" + systemctl start calibre-server + msg_ok "Started ${APP}" + msg_ok "Updated Successfully" + 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}:8180${CL}" diff --git a/install/calibre-server-install.sh b/install/calibre-server-install.sh new file mode 100644 index 00000000..c9396f30 --- /dev/null +++ b/install/calibre-server-install.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 +# Author: thisisjeron +# License: MIT +# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + sudo \ + curl \ + mc \ + imagemagick \ + xvfb \ + libxcomposite1 +msg_ok "Installed Dependencies" + +msg_info "Installing Calibre" +$STD bash -c "$(curl -fsSL https://download.calibre-ebook.com/linux-installer.sh)" +useradd -c "Calibre Server" -d /opt/calibre -s /bin/bash -m calibre +mkdir -p /opt/calibre/calibre-library +chown -R calibre:calibre /opt/calibre +msg_ok "Installed Calibre" + +msg_info "Creating Service" +cat </etc/systemd/system/calibre-server.service +[Unit] +Description=Calibre Content Server +After=network.target + +[Service] +Type=simple +User=calibre +Group=calibre +ExecStart=/opt/calibre/calibre-server --port=8180 --enable-local-write /opt/calibre/calibre-library +Restart=always + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now calibre-server.service +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" + diff --git a/json/calibre-server.json b/json/calibre-server.json new file mode 100644 index 00000000..2fec344d --- /dev/null +++ b/json/calibre-server.json @@ -0,0 +1,43 @@ +{ + "name": "Calibre-Server", + "slug": "calibre-server", + "categories": [ + 12 + ], + "date_created": "2025-01-09", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 8180, + "documentation": null, + "website": "https://calibre-ebook.com", + "logo": "https://calibre-ebook.com/resources/icons/calibre_icon.png", + "description": "Calibre content server is used to manage and serve eBooks over the network.", + "install_methods": [ + { + "type": "default", + "script": "ct/calibre-server.sh", + "resources": { + "cpu": 2, + "ram": 1024, + "hdd": 4, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "By default, the Calibre Server runs on port 8180 with no username/password.", + "type": "info" + }, + { + "text": "Use 'calibredb add' from the calibre user or run 'xvfb-run calibredb add ...' if you need to add books while the server is running.", + "type": "info" + } + ] + } From 8dd43ddb810989dbb1b46d0acab5d321374659ec Mon Sep 17 00:00:00 2001 From: liecno Date: Thu, 9 Jan 2025 16:23:18 +0100 Subject: [PATCH 38/53] New script: ps5-mqtt (#1198) * Add ps5-mqtt script * Update location of currently installed version for ps5-mqtt script * Add version number to update information for ps5-mqtt script * Reformat dependencies when installing ps5-mqtt * Remove superfluous information messages when installing ps5-mqtt * Remove superfluous comment from ps5-mqtt install script * Improve wording for the config location for the ps5-mqtt script * Remove superfluous empty lines in ps5-mqtt install script * Reorder code structure for ps5-mqtt script * Remove superfluous .service string vom systemctl calls in ps5-mqtt script * Refactor handling with folders in the ps5-mqtt script * Reorder code in ps5-mqtt script * Reorder the code for getting release version in ps5-mqtt script * Update ps5-mqtt-install.sh * Update ps5-mqtt-install.sh * Update ps5-mqtt.json * Update * Update ps5-mqtt-install.sh * Fix npm * Fix Date in json --------- Co-authored-by: Michel Roegl-Brunner --- ct/ps5-mqtt.sh | 76 +++++++++++++++++++++++++ install/ps5-mqtt-install.sh | 109 ++++++++++++++++++++++++++++++++++++ json/ps5-mqtt.json | 39 +++++++++++++ 3 files changed, 224 insertions(+) create mode 100644 ct/ps5-mqtt.sh create mode 100644 install/ps5-mqtt-install.sh create mode 100644 json/ps5-mqtt.json diff --git a/ct/ps5-mqtt.sh b/ct/ps5-mqtt.sh new file mode 100644 index 00000000..4e75d0a5 --- /dev/null +++ b/ct/ps5-mqtt.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: liecno +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/FunkeyFlo/ps5-mqtt/ + +# App Default Values +APP="PS5-MQTT" +var_tags="smarthome;automation" +var_cpu="1" +var_ram="256" +var_disk="3" +var_os="debian" +var_version="12" +var_unprivileged="1" + +# 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 + + if [[ ! -d /opt/ps5-mqtt ]]; then + msg_error "No ${APP} installation found!" + exit + fi + + RELEASE=$(curl -s https://api.github.com/repos/FunkeyFlo/ps5-mqtt/releases/latest | jq -r '.tag_name') + + if [[ "${RELEASE}" != "$(cat /opt/ps5-mqtt_version.txt)" ]]; then + msg_info "Stopping service" + systemctl stop ps5-mqtt + msg_ok "Stopped service" + + msg_info "Updating PS5-MQTT to ${RELEASE}" + wget -P /tmp -q https://github.com/FunkeyFlo/ps5-mqtt/archive/refs/tags/${RELEASE}.tar.gz + rm -rf /opt/ps5-mqtt + tar zxf /tmp/${RELEASE}.tar.gz -C /opt + mv /opt/ps5-mqtt-* /opt/ps5-mqtt + rm /tmp/${RELEASE}.tar.gz + echo ${RELEASE} > /opt/ps5-mqtt_version.txt + msg_ok "Updated PS5-MQTT" + + msg_info "Building new PS5-MQTT version" + cd /opt/ps5-mqtt/ps5-mqtt/ + npm install &>/dev/null + npm run build &>/dev/null + msg_ok "Built new PS5-MQTT version" + + msg_info "Starting service" + systemctl start ps5-mqtt + msg_ok "Started service" + else + msg_ok "No update required. ${APP} is already at ${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}:8645${CL}" \ No newline at end of file diff --git a/install/ps5-mqtt-install.sh b/install/ps5-mqtt-install.sh new file mode 100644 index 00000000..e3a9295c --- /dev/null +++ b/install/ps5-mqtt-install.sh @@ -0,0 +1,109 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: liecno +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/FunkeyFlo/ps5-mqtt/ + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + curl \ + sudo \ + mc \ + jq +msg_ok "Installed Dependencies" + +msg_info "Setting up Node.js Repository" +mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list +msg_ok "Set up Node.js Repository" + +msg_info "Installing Node.js" +$STD apt-get update +$STD apt-get install -y nodejs +$STD npm i -g playactor +msg_ok "Installed Node.js" + + +msg_info "Installing PS5-MQTT" +RELEASE=$(curl -s https://api.github.com/repos/FunkeyFlo/ps5-mqtt/releases/latest | jq -r '.tag_name') +wget -P /tmp -q https://github.com/FunkeyFlo/ps5-mqtt/archive/refs/tags/${RELEASE}.tar.gz +tar zxf /tmp/${RELEASE}.tar.gz -C /opt +mv /opt/ps5-mqtt-* /opt/ps5-mqtt +cd /opt/ps5-mqtt/ps5-mqtt/ +$STD npm install +$STD npm run build +echo ${RELEASE} > /opt/ps5-mqtt_version.txt +msg_ok "Installed PS5-MQTT" + +msg_info "Creating Service" +mkdir -p /opt/.config/ps5-mqtt/ +mkdir -p /opt/.config/ps5-mqtt/playactor +cat < /opt/.config/ps5-mqtt/config.json +{ + "mqtt": { + "host": "", + "port": "", + "user": "", + "pass": "", + "discovery_topic": "homeassistant" + }, + + "device_check_interval": 5000, + "device_discovery_interval": 60000, + "device_discovery_broadcast_address": "", + + "include_ps4_devices": false, + + "psn_accounts": [ + { + "username": "", + "npsso":"" + } + ], + + "account_check_interval": 5000, + + "credentialsStoragePath": "/opt/.config/ps5-mqtt/credentials.json", + "frontendPort": "8645" +} +EOF +cat </etc/systemd/system/ps5-mqtt.service +[Unit] +Description=PS5-MQTT Daemon +After=syslog.target network.target + +[Service] +WorkingDirectory=/opt/ps5-mqtt/ps5-mqtt +Environment="CONFIG_PATH=/opt/.config/ps5-mqtt/config.json" +Environment="DEBUG='@ha:ps5:*'" +Restart=always +RestartSec=5 +Type=simple +ExecStart=node server/dist/index.js +KillMode=process +SyslogIdentifier=ps5-mqtt + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now ps5-mqtt +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +rm /tmp/${RELEASE}.tar.gz +msg_ok "Cleaned" diff --git a/json/ps5-mqtt.json b/json/ps5-mqtt.json new file mode 100644 index 00000000..2371fe15 --- /dev/null +++ b/json/ps5-mqtt.json @@ -0,0 +1,39 @@ +{ + "name": "PS5-MQTT", + "slug": "ps5-mqtt", + "categories": [ + 3 + ], + "date_created": "2025-01-09", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 8645, + "documentation": null, + "website": "https://github.com/FunkeyFlo/", + "logo": "https://github.com/FunkeyFlo/ps5-mqtt/blob/main/add-ons/ps5-mqtt/logo.png?raw=true", + "description": "Integrate your Sony Playstation 5 devices with Home Assistant using MQTT.", + "install_methods": [ + { + "type": "default", + "script": "ct/ps5-mqtt.sh", + "resources": { + "cpu": 1, + "ram": 265, + "hdd": 3, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "After installation, the MQTT endpoint must be configured. The configuration file is located within the LXC container at: `/opt/.config/ps5-mqtt/config.json`", + "type": "info" + } + ] +} From e592b80716fb9578254595d8ca772358539ce9e3 Mon Sep 17 00:00:00 2001 From: Andy Grunwald Date: Thu, 9 Jan 2025 16:25:06 +0100 Subject: [PATCH 39/53] New Script: Prometheus Alertmanager (#1272) * New Script: Prometheus Alertmanager * Alertmanager: Append v before Release-Version * Alertmanager: Switch to `/opt` before updating release * Alertmanager: Split `var_tags` by `;` * Alertmanager: Change installation of curl, sudo and mc to a oneliner Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * Alertmanager: Set correct copyright * Alertmanager: Change the way how the systemd unit file is written to disk Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * Alertmanager: Changed the way on how we move and delete files * Alertmanager: Make files executable * Alertmanager: Set correct license and source header * Update prometheus-alertmanager.json --------- Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com> --- ct/prometheus-alertmanager.sh | 68 ++++++++++++++++++++++ install/prometheus-alertmanager-install.sh | 64 ++++++++++++++++++++ json/prometheus-alertmanager.json | 34 +++++++++++ 3 files changed, 166 insertions(+) create mode 100755 ct/prometheus-alertmanager.sh create mode 100755 install/prometheus-alertmanager-install.sh create mode 100644 json/prometheus-alertmanager.json diff --git a/ct/prometheus-alertmanager.sh b/ct/prometheus-alertmanager.sh new file mode 100755 index 00000000..90858dac --- /dev/null +++ b/ct/prometheus-alertmanager.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: Andy Grunwald (andygrunwald) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://prometheus.io/ + +# App Default Values +APP="Prometheus-Alertmanager" +var_tags="monitoring;alerting" +var_cpu="1" +var_ram="1024" +var_disk="2" +var_os="debian" +var_version="12" +var_unprivileged="1" + +# 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 + if [[ ! -f /etc/systemd/system/prometheus-alertmanager.service ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + RELEASE=$(curl -s https://api.github.com/repos/prometheus/alertmanager/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then + msg_info "Stopping ${APP}" + systemctl stop prometheus-alertmanager + msg_ok "Stopped ${APP}" + + msg_info "Updating ${APP} to v${RELEASE}" + cd /opt + wget -q https://github.com/prometheus/alertmanager/releases/download/v${RELEASE}/alertmanager-${RELEASE}.linux-amd64.tar.gz + tar -xf alertmanager-${RELEASE}.linux-amd64.tar.gz + cd alertmanager-${RELEASE}.linux-amd64 + cp -rf alertmanager amtool /usr/local/bin/ + rm -rf alertmanager-${RELEASE}.linux-amd64 alertmanager-${RELEASE}.linux-amd64.tar.gz + echo "${RELEASE}" >/opt/${APP}_version.txt + msg_ok "Updated ${APP} to ${RELEASE}" + + msg_info "Starting ${APP}" + systemctl start prometheus-alertmanager + msg_ok "Started ${APP}" + msg_ok "Updated Successfully" + else + msg_ok "No update required. ${APP} is already at ${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}:9093${CL}" \ No newline at end of file diff --git a/install/prometheus-alertmanager-install.sh b/install/prometheus-alertmanager-install.sh new file mode 100755 index 00000000..3ce9dc0a --- /dev/null +++ b/install/prometheus-alertmanager-install.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: Andy Grunwald (andygrunwald) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://prometheus.io/ + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + curl \ + sudo \ + mc +msg_ok "Installed Dependencies" + +msg_info "Installing Prometheus Alertmanager" +RELEASE=$(curl -s https://api.github.com/repos/prometheus/alertmanager/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +mkdir -p /etc/alertmanager +mkdir -p /var/lib/alertmanager +wget -q https://github.com/prometheus/alertmanager/releases/download/v${RELEASE}/alertmanager-${RELEASE}.linux-amd64.tar.gz +tar -xf alertmanager-${RELEASE}.linux-amd64.tar.gz +mv alertmanager-${RELEASE}.linux-amd64/alertmanager alertmanager-${RELEASE}.linux-amd64/amtool /usr/local/bin/ +mv alertmanager-${RELEASE}.linux-amd64/alertmanager.yml /etc/alertmanager/alertmanager.yml +echo "${RELEASE}" >/opt/${APPLICATION}_version.txt +msg_ok "Installed Prometheus Alertmanager" + +msg_info "Creating Service" +cat </etc/systemd/system/prometheus-alertmanager.service +echo "[Unit] +Description=Prometheus Alertmanager +Wants=network-online.target +After=network-online.target + +[Service] +User=root +Restart=always +Type=simple +ExecStart=/usr/local/bin/alertmanager \ + --config.file=/etc/alertmanager/alertmanager.yml \ + --storage.path=/var/lib/alertmanager/ \ + --web.listen-address=0.0.0.0:9093 +ExecReload=/bin/kill -HUP \$MAINPID + +[Install] +WantedBy=multi-user.target" +EOF +systemctl enable -q --now prometheus-alertmanager +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +rm -rf alertmanager-${RELEASE}.linux-amd64 alertmanager-${RELEASE}.linux-amd64.tar.gz +msg_ok "Cleaned" diff --git a/json/prometheus-alertmanager.json b/json/prometheus-alertmanager.json new file mode 100644 index 00000000..d6e152d5 --- /dev/null +++ b/json/prometheus-alertmanager.json @@ -0,0 +1,34 @@ +{ + "name": "Prometheus Alertmanager", + "slug": "prometheus-alertmanager", + "categories": [ + 7 + ], + "date_created": "2025-01-09" + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 9093, + "documentation": "https://prometheus.io/docs/alerting/latest/overview/", + "website": "https://prometheus.io/", + "logo": "https://raw.githubusercontent.com/loganmarchione/homelab-svg-assets/main/assets/prometheus.svg", + "description": "Alerting with Prometheus is separated into two parts. Alerting rules in Prometheus servers send alerts to an Alertmanager. The Alertmanager then manages those alerts, including silencing, inhibition, aggregation and sending out notifications via methods such as email, on-call notification systems, and chat platforms.", + "install_methods": [ + { + "type": "default", + "script": "ct/prometheus-alertmanager.sh", + "resources": { + "cpu": 1, + "ram": 1024, + "hdd": 2, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} From 5c1954c85d15230b8d03634423e1083208b448c1 Mon Sep 17 00:00:00 2001 From: Spyros Roum Date: Thu, 9 Jan 2025 17:25:45 +0200 Subject: [PATCH 40/53] Install/update ActualBudget based on releases, not latest master (#1254) * Install/update ActualBudget based on releases, not latest main * Use tarballs for actualbudget install/update --- ct/actualbudget.sh | 11 ++++++++--- install/actualbudget-install.sh | 6 ++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ct/actualbudget.sh b/ct/actualbudget.sh index 8bad74dc..63c94e3e 100644 --- a/ct/actualbudget.sh +++ b/ct/actualbudget.sh @@ -34,11 +34,16 @@ function update_script() { fi msg_info "Updating ${APP}" systemctl stop actualbudget.service + RELEASE=$(curl -s https://api.github.com/repos/actualbudget/actual-server/tags | jq --raw-output '.[0].name') + TEMPD="$(mktemp -d)" + cd "${TEMPD}" + wget -q https://codeload.github.com/actualbudget/actual-server/legacy.tar.gz/refs/tags/${RELEASE} -O - | tar -xz + mv actualbudget-actual-server-*/* /opt/actualbudget/ cd /opt/actualbudget - git pull &>/dev/null yarn install &>/dev/null systemctl start actualbudget.service - msg_ok "Successfully Updated ${APP}" + msg_ok "Successfully Updated ${APP} to ${RELEASE}" + rm -rf "${TEMPD}" exit } @@ -49,4 +54,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}:5006${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5006${CL}" diff --git a/install/actualbudget-install.sh b/install/actualbudget-install.sh index 64995d5a..3a62fb5e 100644 --- a/install/actualbudget-install.sh +++ b/install/actualbudget-install.sh @@ -35,8 +35,10 @@ $STD apt-get install -y nodejs $STD npm install --global yarn msg_ok "Installed Node.js" -msg_info "Installing Actual Budget" -$STD git clone https://github.com/actualbudget/actual-server.git /opt/actualbudget +RELEASE=$(curl -s https://api.github.com/repos/actualbudget/actual-server/tags | jq --raw-output '.[0].name') +msg_info "Installing Actual Budget $RELEASE" +wget -q https://codeload.github.com/actualbudget/actual-server/legacy.tar.gz/refs/tags/${RELEASE} -O - | tar -xz +mv actualbudget-actual-server-* /opt/actualbudget mkdir -p /opt/actualbudget/server-files chown -R root:root /opt/actualbudget/server-files chmod 755 /opt/actualbudget/server-files From c6efe42eeef2f3a1798b051bdb9d86061dcc98a5 Mon Sep 17 00:00:00 2001 From: "community-scripts-pr-app[bot]" <189241966+community-scripts-pr-app[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:28:35 +0100 Subject: [PATCH 41/53] Update CHANGELOG.md (#1352) Co-authored-by: github-actions[bot] --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3655c70e..f3fbf04e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,8 +20,16 @@ Do not break established syntax in this file, as it is automatically updated by ### Changed +### ✨ New Scripts + +- New Script: Prometheus Alertmanager [@andygrunwald](https://github.com/andygrunwald) ([#1272](https://github.com/community-scripts/ProxmoxVE/pull/1272)) +- New script: ps5-mqtt [@liecno](https://github.com/liecno) ([#1198](https://github.com/community-scripts/ProxmoxVE/pull/1198)) +- New Script: calibre-server [@ThisIsJeron](https://github.com/ThisIsJeron) ([#960](https://github.com/community-scripts/ProxmoxVE/pull/960)) + ### 🚀 Updated Scripts +- Install/update ActualBudget based on releases, not latest master [@SpyrosRoum](https://github.com/SpyrosRoum) ([#1254](https://github.com/community-scripts/ProxmoxVE/pull/1254)) +- Fix: AdventureLog - update script bug [@JesperDramsch](https://github.com/JesperDramsch) ([#1334](https://github.com/community-scripts/ProxmoxVE/pull/1334)) - Fix Checkmk: Version grep broken [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#1341](https://github.com/community-scripts/ProxmoxVE/pull/1341)) ### 🧰 Maintenance From 0ce45140c760896ee1d0c74f43f18991c4e14334 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:29:55 +0100 Subject: [PATCH 42/53] fix space in calbre script --- install/calibre-server-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/calibre-server-install.sh b/install/calibre-server-install.sh index c9396f30..fa2916f8 100644 --- a/install/calibre-server-install.sh +++ b/install/calibre-server-install.sh @@ -14,7 +14,7 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt-get install -y \ +$STD apt-get install -y \ sudo \ curl \ mc \ From b2ba72a906dbaa9dd516f8c254cbf8091e582ffe Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:33:44 +0100 Subject: [PATCH 43/53] fix certificate issue ps5mqtt --- install/ps5-mqtt-install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install/ps5-mqtt-install.sh b/install/ps5-mqtt-install.sh index e3a9295c..be880e46 100644 --- a/install/ps5-mqtt-install.sh +++ b/install/ps5-mqtt-install.sh @@ -18,13 +18,15 @@ $STD apt-get install -y \ curl \ sudo \ mc \ - jq + jq \ + ca-certificates \ + gnupg msg_ok "Installed Dependencies" msg_info "Setting up Node.js Repository" mkdir -p /etc/apt/keyrings curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg -echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list msg_ok "Set up Node.js Repository" msg_info "Installing Node.js" From 189dbf67b64595910e2f7bee3af6a5bd002bf55e Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:41:32 +0100 Subject: [PATCH 44/53] add libegl1 --- install/calibre-server-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install/calibre-server-install.sh b/install/calibre-server-install.sh index fa2916f8..c2af70fe 100644 --- a/install/calibre-server-install.sh +++ b/install/calibre-server-install.sh @@ -20,7 +20,8 @@ $STD apt-get install -y \ mc \ imagemagick \ xvfb \ - libxcomposite1 + libxcomposite1 \ + libegl1 msg_ok "Installed Dependencies" msg_info "Installing Calibre" From bfd6b584069f445fddb58f9bed419296511339a8 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:48:06 +0100 Subject: [PATCH 45/53] Increase RAM --- json/ps5-mqtt.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json/ps5-mqtt.json b/json/ps5-mqtt.json index 2371fe15..6151a748 100644 --- a/json/ps5-mqtt.json +++ b/json/ps5-mqtt.json @@ -19,7 +19,7 @@ "script": "ct/ps5-mqtt.sh", "resources": { "cpu": 1, - "ram": 265, + "ram": 512, "hdd": 3, "os": "debian", "version": "12" From 6653b9297287b7c378a7c5ffb5ec6e9d0aab4a05 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:48:29 +0100 Subject: [PATCH 46/53] Increase RAM --- ct/ps5-mqtt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/ps5-mqtt.sh b/ct/ps5-mqtt.sh index 4e75d0a5..98e751e4 100644 --- a/ct/ps5-mqtt.sh +++ b/ct/ps5-mqtt.sh @@ -9,7 +9,7 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/m APP="PS5-MQTT" var_tags="smarthome;automation" var_cpu="1" -var_ram="256" +var_ram="512" var_disk="3" var_os="debian" var_version="12" @@ -73,4 +73,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}:8645${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8645${CL}" From da071d800bef7ca3e5f0081a917ae81bda292cba Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:52:35 +0100 Subject: [PATCH 47/53] Fix Dependency --- install/calibre-server-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/calibre-server-install.sh b/install/calibre-server-install.sh index c2af70fe..28cb7fbb 100644 --- a/install/calibre-server-install.sh +++ b/install/calibre-server-install.sh @@ -21,7 +21,7 @@ $STD apt-get install -y \ imagemagick \ xvfb \ libxcomposite1 \ - libegl1 + libopengl0 msg_ok "Installed Dependencies" msg_info "Installing Calibre" From 179defdd88669dbf7950ebfa741649c2f5da5c8a Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:09:47 +0100 Subject: [PATCH 48/53] Update calibre-server-install.sh --- install/calibre-server-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/calibre-server-install.sh b/install/calibre-server-install.sh index 28cb7fbb..36e28956 100644 --- a/install/calibre-server-install.sh +++ b/install/calibre-server-install.sh @@ -25,7 +25,7 @@ $STD apt-get install -y \ msg_ok "Installed Dependencies" msg_info "Installing Calibre" -$STD bash -c "$(curl -fsSL https://download.calibre-ebook.com/linux-installer.sh)" +wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin useradd -c "Calibre Server" -d /opt/calibre -s /bin/bash -m calibre mkdir -p /opt/calibre/calibre-library chown -R calibre:calibre /opt/calibre From d8ad4545ad2c83dbcd961e6592f36ef72e4d32b5 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:10:36 +0100 Subject: [PATCH 49/53] Update calibre-server.sh --- ct/calibre-server.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/calibre-server.sh b/ct/calibre-server.sh index b59e89c9..e05dd2e7 100644 --- a/ct/calibre-server.sh +++ b/ct/calibre-server.sh @@ -43,7 +43,7 @@ function update_script() { msg_ok "Packages updated" msg_info "Updating Calibre (latest)" - bash -c "$(curl -fsSL https://download.calibre-ebook.com/linux-installer.sh)" + wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin &>/dev/null msg_ok "Updated Calibre" msg_info "Starting ${APP}" From 4985fda206a690b4f38247878374d86703aa0a7d Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:14:09 +0100 Subject: [PATCH 50/53] Update prometheus-alertmanager.json --- json/prometheus-alertmanager.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json/prometheus-alertmanager.json b/json/prometheus-alertmanager.json index d6e152d5..d6b0cda5 100644 --- a/json/prometheus-alertmanager.json +++ b/json/prometheus-alertmanager.json @@ -4,7 +4,7 @@ "categories": [ 7 ], - "date_created": "2025-01-09" + "date_created": "2025-01-09", "type": "ct", "updateable": true, "privileged": false, From 045ba815335f122bd31939a6e5ceb4d6dab60643 Mon Sep 17 00:00:00 2001 From: "community-scripts-pr-app[bot]" <189241966+community-scripts-pr-app[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:17:18 +0100 Subject: [PATCH 51/53] Update CHANGELOG.md (#1353) Co-authored-by: github-actions[bot] --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3fbf04e..b28297be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,8 +28,8 @@ Do not break established syntax in this file, as it is automatically updated by ### 🚀 Updated Scripts -- Install/update ActualBudget based on releases, not latest master [@SpyrosRoum](https://github.com/SpyrosRoum) ([#1254](https://github.com/community-scripts/ProxmoxVE/pull/1254)) - Fix: AdventureLog - update script bug [@JesperDramsch](https://github.com/JesperDramsch) ([#1334](https://github.com/community-scripts/ProxmoxVE/pull/1334)) +- Install/update ActualBudget based on releases, not latest master [@SpyrosRoum](https://github.com/SpyrosRoum) ([#1254](https://github.com/community-scripts/ProxmoxVE/pull/1254)) - Fix Checkmk: Version grep broken [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#1341](https://github.com/community-scripts/ProxmoxVE/pull/1341)) ### 🧰 Maintenance From 9a7dcef25a36f3dfe37f6b2b4e7b8485bda867da Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:20:47 +0100 Subject: [PATCH 52/53] Update calibre-server-install.sh --- install/calibre-server-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install/calibre-server-install.sh b/install/calibre-server-install.sh index 36e28956..0efbcab1 100644 --- a/install/calibre-server-install.sh +++ b/install/calibre-server-install.sh @@ -21,6 +21,7 @@ $STD apt-get install -y \ imagemagick \ xvfb \ libxcomposite1 \ + libegl1 \ libopengl0 msg_ok "Installed Dependencies" From 5170056078b3a1e11c8d872c720e3014530752c9 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:27:59 +0100 Subject: [PATCH 53/53] Update actualbudget.sh --- ct/actualbudget.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ct/actualbudget.sh b/ct/actualbudget.sh index 63c94e3e..75dcdb19 100644 --- a/ct/actualbudget.sh +++ b/ct/actualbudget.sh @@ -32,18 +32,26 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi + if ! command -v jq >/dev/null 2>&1; then + echo "Installing jq..." + apt-get install -y jq >/dev/null 2>&1 + echo "Installed jq..." + fi + msg_info "Updating ${APP}" - systemctl stop actualbudget.service + systemctl stop actualbudget RELEASE=$(curl -s https://api.github.com/repos/actualbudget/actual-server/tags | jq --raw-output '.[0].name') TEMPD="$(mktemp -d)" cd "${TEMPD}" wget -q https://codeload.github.com/actualbudget/actual-server/legacy.tar.gz/refs/tags/${RELEASE} -O - | tar -xz + mv /opt/actualbudget /opt/actualbudget_bak mv actualbudget-actual-server-*/* /opt/actualbudget/ cd /opt/actualbudget yarn install &>/dev/null - systemctl start actualbudget.service + systemctl start actualbudget msg_ok "Successfully Updated ${APP} to ${RELEASE}" rm -rf "${TEMPD}" + rm -rf /opt/actualbudget_bak exit }