From 8bce4aa4c1f3604ab5295495f9049fefa9c629c5 Mon Sep 17 00:00:00 2001 From: "courtmanr@gmail.com" Date: Sun, 4 May 2025 22:51:41 +0100 Subject: [PATCH 01/67] Add Pulse LXC script and JSON definition --- ct/pulse.sh | 193 ++++++++++++++++++++++++++++++++++++++ install/pulse-install.sh | 197 +++++++++++++++++++++++++++++++++++++++ json/pulse.json | 34 +++++++ 3 files changed, 424 insertions(+) create mode 100644 ct/pulse.sh create mode 100644 install/pulse-install.sh create mode 100644 json/pulse.json diff --git a/ct/pulse.sh b/ct/pulse.sh new file mode 100644 index 0000000..f9fd090 --- /dev/null +++ b/ct/pulse.sh @@ -0,0 +1,193 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: rcourtman +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/rcourtman/Pulse + +# App Default Values +APP="Pulse" +# shellcheck disable=SC2034 +var_tags="monitoring;nodejs" +# shellcheck disable=SC2034 +var_cpu="1" +# shellcheck disable=SC2034 +var_ram="1024" +# shellcheck disable=SC2034 +var_disk="4" +# shellcheck disable=SC2034 +var_os="debian" +# shellcheck disable=SC2034 +var_version="12" +# shellcheck disable=SC2034 +var_unprivileged="1" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + # Check if installation is present + if [[ ! -d /opt/pulse-proxmox/.git ]]; then + msg_error "No ${APP} Installation Found! Cannot check/update via git." + exit 1 + fi + + # Check if jq is installed (needed for version parsing) + if ! command -v jq &>/dev/null; then + msg_error "jq is required for version checking but not installed. Please install it (apt-get install jq)." + exit 1 + fi + + # Crawling the new version and checking whether an update is required + msg_info "Checking for ${APP} updates..." + LATEST_RELEASE=$(curl -s https://api.github.com/repos/rcourtman/Pulse/releases/latest | jq -r '.tag_name') + if ! LATEST_RELEASE=$(curl -s https://api.github.com/repos/rcourtman/Pulse/releases/latest | jq -r '.tag_name') || + [[ -z "$LATEST_RELEASE" ]] || [[ "$LATEST_RELEASE" == "null" ]]; then + msg_error "Failed to fetch latest release information from GitHub API." + exit 1 + fi + msg_ok "Latest available version: ${LATEST_RELEASE}" + + CURRENT_VERSION="" + if [[ -f /opt/${APP}_version.txt ]]; then + CURRENT_VERSION=$(cat /opt/${APP}_version.txt) + else + msg_warning "Version file /opt/${APP}_version.txt not found. Cannot determine current version. Will attempt update." + fi + + if [[ "${LATEST_RELEASE}" != "$CURRENT_VERSION" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then + msg_info "Updating ${APP} to ${LATEST_RELEASE}..." + + # Stopping Service + msg_info "Stopping ${APP} service..." + systemctl stop pulse-monitor.service + msg_ok "Stopped ${APP} service." + + # Execute Update using git and npm (run as root, chown later) + msg_info "Fetching and checking out ${LATEST_RELEASE}..." + cd /opt/pulse-proxmox || { + msg_error "Failed to cd into /opt/pulse-proxmox" + exit 1 + } + + msg_info "Configuring git safe directory..." + set -x # Enable command tracing + # Allow root user to operate on the pulse user's git repo - exit if it fails + git config --global --add safe.directory /opt/pulse-proxmox + local git_config_exit_code=$? # Capture exit code + set +x # Disable command tracing + if [ $git_config_exit_code -ne 0 ]; then + msg_error "git config safe.directory failed with exit code $git_config_exit_code" + exit 1 + fi + msg_ok "Configured git safe directory." + + # Reset local changes, fetch, checkout, clean + # Use silent function wrapper for non-interactive update + silent git fetch origin --tags --force || { + msg_error "Failed to fetch from git remote." + exit 1 + } + echo "DEBUG: Attempting checkout command: git checkout ${LATEST_RELEASE}" # DEBUG + # Try checkout without -f and without silent wrapper + git checkout "${LATEST_RELEASE}" || { + msg_error "Failed to checkout tag ${LATEST_RELEASE}." + exit 1 + } + silent git reset --hard "${LATEST_RELEASE}" || { + msg_error "Failed to reset to tag ${LATEST_RELEASE}." + exit 1 + } + silent git clean -fd || { msg_warning "Failed to clean untracked files."; } # Non-fatal warning + msg_ok "Fetched and checked out ${LATEST_RELEASE}." + + msg_info "Setting ownership and permissions before npm install..." + chown -R pulse:pulse /opt/pulse-proxmox || { + msg_error "Failed to chown /opt/pulse-proxmox" + exit 1 + } + # Ensure correct execute permissions before npm install/build + chmod -R u+rwX,go+rX,go-w /opt/pulse-proxmox || { + msg_error "Failed to chmod /opt/pulse-proxmox" + exit 1 + } + # Explicitly add execute permission for node_modules binaries + if [ -d "/opt/pulse-proxmox/node_modules/.bin" ]; then + chmod +x /opt/pulse-proxmox/node_modules/.bin/* || msg_warning "Failed to chmod +x on node_modules/.bin" + fi + msg_ok "Ownership and permissions set." + + msg_info "Installing Node.js dependencies..." + # Run installs as pulse user with simulated login shell, ensuring correct directory + silent sudo -iu pulse sh -c 'cd /opt/pulse-proxmox && npm install --unsafe-perm' || { + msg_error "Failed to install root npm dependencies." + exit 1 + } + # Install server deps + # Explicitly set directory for server deps install as well + silent sudo -iu pulse sh -c 'cd /opt/pulse-proxmox/server && npm install --unsafe-perm' || { + msg_error "Failed to install server npm dependencies." + exit 1 + } + # No need for cd .. here as sh -c runs in a subshell + msg_ok "Node.js dependencies installed." + + msg_info "Building CSS assets..." + # Try running tailwindcss directly as pulse user, specifying full path + TAILWIND_PATH="/opt/pulse-proxmox/node_modules/.bin/tailwindcss" + TAILWIND_ARGS="-c ./src/tailwind.config.js -i ./src/index.css -o ./src/public/output.css" + # Use sh -c to ensure correct directory context for paths in TAILWIND_ARGS + if ! sudo -iu pulse sh -c "cd /opt/pulse-proxmox && $TAILWIND_PATH $TAILWIND_ARGS"; then + # Use echo directly, remove BFR + echo -e "${TAB}${YW}⚠️ Failed to build CSS assets (See errors above). Proceeding anyway.${CL}" + else + msg_ok "CSS assets built." + fi + + msg_info "Setting permissions..." + # Permissions might not be strictly needed now if installs run as pulse, + # but doesn't hurt to ensure consistency. + # Run chown again to be safe, though maybe less critical now. + chown -R pulse:pulse /opt/pulse-proxmox || msg_warning "Final chown failed." + # Final chmod removed as it's done earlier + msg_ok "Permissions set." + + # Starting Service + msg_info "Starting ${APP} service..." + systemctl start pulse-monitor.service + msg_ok "Started ${APP} service." + + # Update version file + echo "${LATEST_RELEASE}" >/opt/${APP}_version.txt + msg_ok "Update Successful to ${LATEST_RELEASE}" + else + msg_ok "No update required. ${APP} is already at ${LATEST_RELEASE}." + fi + exit 0 +} + +start +build_container +description + +# Read port from .env file if it exists, otherwise use default +PULSE_PORT=7655 # Default +if [ -f "/opt/pulse-proxmox/.env" ] && grep -q '^PORT=' "/opt/pulse-proxmox/.env"; then + PULSE_PORT=$(grep '^PORT=' "/opt/pulse-proxmox/.env" | cut -d'=' -f2 | tr -d '[:space:]') + # Basic validation if port looks like a number + if ! [[ "$PULSE_PORT" =~ ^[0-9]+$ ]]; then + PULSE_PORT=7655 # Fallback to default if not a number + fi +fi + +msg_ok "Completed Successfully! +" +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}:${PULSE_PORT}${CL}" diff --git a/install/pulse-install.sh b/install/pulse-install.sh new file mode 100644 index 0000000..0cf9734 --- /dev/null +++ b/install/pulse-install.sh @@ -0,0 +1,197 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: rcourtman +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/rcourtman/Pulse + +# Import Functions and Setup +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" + +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +# --- Configuration --- +APP="Pulse" +APP_DIR="/opt/pulse-proxmox" +PULSE_USER="pulse" +SERVICE_NAME="pulse-monitor.service" +NODE_MAJOR_VERSION=20 # From install-pulse.sh +REPO_URL="https://github.com/rcourtman/Pulse.git" + +# Create Pulse User +msg_info "Creating dedicated user '${PULSE_USER}'..." +if id "$PULSE_USER" &>/dev/null; then + msg_warning "User '${PULSE_USER}' already exists. Skipping creation." +else + useradd -r -m -d /opt/pulse-home -s /bin/bash "$PULSE_USER" # Give a shell for potential debugging/manual commands + if useradd -r -m -d /opt/pulse-home -s /bin/bash "$PULSE_USER"; then + msg_ok "User '${PULSE_USER}' created successfully." + else + msg_error "Failed to create user '${PULSE_USER}'." + exit 1 + fi +fi + +# Installing Dependencies +msg_info "Installing Dependencies (git, curl, sudo, gpg, jq, diffutils)..." +$STD apt-get install -y \ + git \ + curl \ + sudo \ + gpg \ + jq \ + diffutils +msg_ok "Installed Core Dependencies" + +# Setup Node.js via NodeSource +msg_info "Setting up Node.js ${NODE_MAJOR_VERSION}.x repository..." +KEYRING_DIR="/usr/share/keyrings" +KEYRING_FILE="$KEYRING_DIR/nodesource.gpg" +mkdir -p "$KEYRING_DIR" +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --yes --dearmor -o "$KEYRING_FILE" +pipestatus=("${PIPESTATUS[@]}") # Capture pipestatus array +if [ "${pipestatus[1]}" -ne 0 ]; then + msg_error "Failed to download NodeSource GPG key (gpg exited non-zero)." + exit 1 +fi +if [ "${pipestatus[0]}" -ne 0 ]; then msg_warning "Curl failed to download GPG key (curl exited non-zero), but gpg seemed okay? Proceeding cautiously."; fi +echo "deb [signed-by=$KEYRING_FILE] https://deb.nodesource.com/node_$NODE_MAJOR_VERSION.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list >/dev/null +msg_info "Updating package list after adding NodeSource..." +$STD apt-get update +msg_info "Installing Node.js ${NODE_MAJOR_VERSION}.x..." +$STD apt-get install -y nodejs +msg_ok "Installed Node.js" +msg_info "Node version: $(node -v)" +msg_info "npm version: $(npm -v)" + +# Setup App +msg_info "Cloning ${APP} repository..." +# Clone as root initially, then change ownership +$STD git clone "$REPO_URL" "$APP_DIR" +cd "$APP_DIR" || { + msg_error "Failed to cd into $APP_DIR" + exit 1 +} +msg_ok "Cloned ${APP} repository." + +msg_info "Fetching latest release tag..." +LATEST_RELEASE=$(curl -s https://api.github.com/repos/rcourtman/Pulse/releases/latest | jq -r '.tag_name') +pipestatus=("${PIPESTATUS[@]}") +if [ "${pipestatus[0]}" -ne 0 ] || [ "${pipestatus[1]}" -ne 0 ] || + [[ -z "$LATEST_RELEASE" ]] || [[ "$LATEST_RELEASE" == "null" ]]; then + msg_warning "Failed to fetch latest release tag. Proceeding with default branch." + # Optionally, you could fetch tags via git and parse locally: + # LATEST_RELEASE=$(git tag -l 'v*' --sort='-version:refname' | head -n 1) + # if [[ -z "$LATEST_RELEASE" ]]; then msg_error "Could not find any release tags."; exit 1; fi +else + msg_info "Checking out latest release tag: ${LATEST_RELEASE}" + $STD git checkout "${LATEST_RELEASE}" + msg_ok "Checked out ${LATEST_RELEASE}." +fi + +# Install npm dependencies (as root because of /opt permissions) +msg_info "Installing Node.js dependencies for ${APP}..." +# Install root deps (includes dev for build) +$STD npm install --unsafe-perm +# Install server deps +cd server || { + msg_error "Failed to cd into server directory." + exit 1 +} +$STD npm install --unsafe-perm +cd .. +msg_ok "Installed Node.js dependencies." + +# Build CSS +msg_info "Building CSS assets..." +$STD npm run build:css +msg_ok "Built CSS assets." + +# Configure Environment (.env) +msg_info "Configuring environment file..." +ENV_EXAMPLE="${APP_DIR}/.env.example" +ENV_FILE="${APP_DIR}/.env" +if [ -f "$ENV_EXAMPLE" ]; then + # Copy example to .env if .env doesn't exist or is empty + if [ ! -s "$ENV_FILE" ]; then + cp "$ENV_EXAMPLE" "$ENV_FILE" + msg_info "Created ${ENV_FILE} from example." + # Set default values (or leave placeholders for user to fill) + # Using defaults similar to install-pulse.sh prompts + sed -i 's|^PROXMOX_HOST=.*|PROXMOX_HOST=https://proxmox_host:8006|' "$ENV_FILE" + sed -i 's|^PROXMOX_TOKEN_ID=.*|PROXMOX_TOKEN_ID=user@pam!tokenid|' "$ENV_FILE" + sed -i 's|^PROXMOX_TOKEN_SECRET=.*|PROXMOX_TOKEN_SECRET=YOUR_API_SECRET_HERE|' "$ENV_FILE" + sed -i 's|^PROXMOX_ALLOW_SELF_SIGNED_CERTS=.*|PROXMOX_ALLOW_SELF_SIGNED_CERTS=true|' "$ENV_FILE" + sed -i 's|^PORT=.*|PORT=7655|' "$ENV_FILE" + msg_warning "${ENV_FILE} created with placeholder values. Please edit it with your Proxmox details!" + else + msg_warning "${ENV_FILE} already exists. Skipping default configuration." + fi + # Set permissions on .env regardless + chmod 600 "$ENV_FILE" +else + msg_warning "${ENV_EXAMPLE} not found. Skipping environment configuration." +fi + +# Set Permissions for the entire app directory +msg_info "Setting permissions for ${APP_DIR}..." +chown -R ${PULSE_USER}:${PULSE_USER} "${APP_DIR}" +# Ensure pulse user can write to logs if needed, and execute necessary files +find "${APP_DIR}" -type d -exec chmod 755 {} \; +find "${APP_DIR}" -type f -exec chmod 644 {} \; +# Make sure node_modules executables are runnable if needed (though npm scripts handle this) +# chmod +x ${APP_DIR}/server/server.js # Example if direct execution was needed +chmod 600 "$ENV_FILE" # Ensure .env is kept restricted +msg_ok "Set permissions." + +# Save Installed Version +msg_info "Saving installed version information..." +VERSION_TO_SAVE="${LATEST_RELEASE:-$(git rev-parse --short HEAD)}" # Use tag or commit hash +echo "${VERSION_TO_SAVE}" >/opt/${APP}_version.txt +msg_ok "Saved version info (${VERSION_TO_SAVE})." + +# Creating Service +msg_info "Creating systemd service for ${APP}..." +NODE_PATH=$(command -v node) +NPM_PATH=$(command -v npm) +cat </etc/systemd/system/${SERVICE_NAME} +[Unit] +Description=${APP} Monitoring Application +After=network.target + +[Service] +Type=simple +User=${PULSE_USER} +Group=${PULSE_USER} +WorkingDirectory=${APP_DIR} +EnvironmentFile=${APP_DIR}/.env +# Use absolute paths for node and npm +ExecStart=${NODE_PATH} ${NPM_PATH} run start +Restart=on-failure +RestartSec=5 +StandardOutput=journal +StandardError=journal + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now ${SERVICE_NAME} +msg_ok "Created and enabled systemd service." + +# Add motd and customize (standard functions) +motd_ssh +customize + +# Cleanup +msg_info "Cleaning up apt cache..." +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned up." + +# Sentinel file for ct script verification (optional but good practice) +touch /opt/pulse_install_complete diff --git a/json/pulse.json b/json/pulse.json new file mode 100644 index 0000000..554e6a9 --- /dev/null +++ b/json/pulse.json @@ -0,0 +1,34 @@ +{ + "name": "Pulse", + "slug": "pulse", + "categories": [ + 9 + ], + "date_created": "2024-07-26", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 7655, + "documentation": null, + "website": "https://github.com/rcourtman/Pulse", + "logo": "https://raw.githubusercontent.com/rcourtman/Pulse/main/src/public/logos/pulse-logo-256x256.png", + "description": "A lightweight monitoring application for Proxmox VE that displays real-time status for VMs and containers via a simple web interface.", + "install_methods": [ + { + "type": "default", + "script": "ct/pulse.sh", + "resources": { + "cpu": 2, + "ram": 2048, + "hdd": 4, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} \ No newline at end of file From a7a79883605f30d244e949933483151d8877c242 Mon Sep 17 00:00:00 2001 From: "courtmanr@gmail.com" Date: Sun, 4 May 2025 23:44:26 +0100 Subject: [PATCH 02/67] Refactor: Remove comments per reviewer feedback --- ct/pulse.sh | 41 +++++++--------------------------------- install/pulse-install.sh | 39 +++++--------------------------------- 2 files changed, 12 insertions(+), 68 deletions(-) diff --git a/ct/pulse.sh b/ct/pulse.sh index f9fd090..4d04e50 100644 --- a/ct/pulse.sh +++ b/ct/pulse.sh @@ -5,7 +5,6 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/ # License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE # Source: https://github.com/rcourtman/Pulse -# App Default Values APP="Pulse" # shellcheck disable=SC2034 var_tags="monitoring;nodejs" @@ -32,19 +31,16 @@ function update_script() { check_container_storage check_container_resources - # Check if installation is present if [[ ! -d /opt/pulse-proxmox/.git ]]; then msg_error "No ${APP} Installation Found! Cannot check/update via git." exit 1 fi - # Check if jq is installed (needed for version parsing) if ! command -v jq &>/dev/null; then msg_error "jq is required for version checking but not installed. Please install it (apt-get install jq)." exit 1 fi - # Crawling the new version and checking whether an update is required msg_info "Checking for ${APP} updates..." LATEST_RELEASE=$(curl -s https://api.github.com/repos/rcourtman/Pulse/releases/latest | jq -r '.tag_name') if ! LATEST_RELEASE=$(curl -s https://api.github.com/repos/rcourtman/Pulse/releases/latest | jq -r '.tag_name') || @@ -64,12 +60,10 @@ function update_script() { if [[ "${LATEST_RELEASE}" != "$CURRENT_VERSION" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then msg_info "Updating ${APP} to ${LATEST_RELEASE}..." - # Stopping Service msg_info "Stopping ${APP} service..." systemctl stop pulse-monitor.service msg_ok "Stopped ${APP} service." - # Execute Update using git and npm (run as root, chown later) msg_info "Fetching and checking out ${LATEST_RELEASE}..." cd /opt/pulse-proxmox || { msg_error "Failed to cd into /opt/pulse-proxmox" @@ -77,25 +71,21 @@ function update_script() { } msg_info "Configuring git safe directory..." - set -x # Enable command tracing - # Allow root user to operate on the pulse user's git repo - exit if it fails + set -x git config --global --add safe.directory /opt/pulse-proxmox - local git_config_exit_code=$? # Capture exit code - set +x # Disable command tracing + local git_config_exit_code=$? + set +x if [ $git_config_exit_code -ne 0 ]; then msg_error "git config safe.directory failed with exit code $git_config_exit_code" exit 1 fi msg_ok "Configured git safe directory." - # Reset local changes, fetch, checkout, clean - # Use silent function wrapper for non-interactive update silent git fetch origin --tags --force || { msg_error "Failed to fetch from git remote." exit 1 } - echo "DEBUG: Attempting checkout command: git checkout ${LATEST_RELEASE}" # DEBUG - # Try checkout without -f and without silent wrapper + echo "DEBUG: Attempting checkout command: git checkout ${LATEST_RELEASE}" git checkout "${LATEST_RELEASE}" || { msg_error "Failed to checkout tag ${LATEST_RELEASE}." exit 1 @@ -104,7 +94,7 @@ function update_script() { msg_error "Failed to reset to tag ${LATEST_RELEASE}." exit 1 } - silent git clean -fd || { msg_warning "Failed to clean untracked files."; } # Non-fatal warning + silent git clean -fd || { msg_warning "Failed to clean untracked files."; } msg_ok "Fetched and checked out ${LATEST_RELEASE}." msg_info "Setting ownership and permissions before npm install..." @@ -112,58 +102,43 @@ function update_script() { msg_error "Failed to chown /opt/pulse-proxmox" exit 1 } - # Ensure correct execute permissions before npm install/build chmod -R u+rwX,go+rX,go-w /opt/pulse-proxmox || { msg_error "Failed to chmod /opt/pulse-proxmox" exit 1 } - # Explicitly add execute permission for node_modules binaries if [ -d "/opt/pulse-proxmox/node_modules/.bin" ]; then chmod +x /opt/pulse-proxmox/node_modules/.bin/* || msg_warning "Failed to chmod +x on node_modules/.bin" fi msg_ok "Ownership and permissions set." msg_info "Installing Node.js dependencies..." - # Run installs as pulse user with simulated login shell, ensuring correct directory silent sudo -iu pulse sh -c 'cd /opt/pulse-proxmox && npm install --unsafe-perm' || { msg_error "Failed to install root npm dependencies." exit 1 } - # Install server deps - # Explicitly set directory for server deps install as well silent sudo -iu pulse sh -c 'cd /opt/pulse-proxmox/server && npm install --unsafe-perm' || { msg_error "Failed to install server npm dependencies." exit 1 } - # No need for cd .. here as sh -c runs in a subshell msg_ok "Node.js dependencies installed." msg_info "Building CSS assets..." - # Try running tailwindcss directly as pulse user, specifying full path TAILWIND_PATH="/opt/pulse-proxmox/node_modules/.bin/tailwindcss" TAILWIND_ARGS="-c ./src/tailwind.config.js -i ./src/index.css -o ./src/public/output.css" - # Use sh -c to ensure correct directory context for paths in TAILWIND_ARGS if ! sudo -iu pulse sh -c "cd /opt/pulse-proxmox && $TAILWIND_PATH $TAILWIND_ARGS"; then - # Use echo directly, remove BFR echo -e "${TAB}${YW}⚠️ Failed to build CSS assets (See errors above). Proceeding anyway.${CL}" else msg_ok "CSS assets built." fi msg_info "Setting permissions..." - # Permissions might not be strictly needed now if installs run as pulse, - # but doesn't hurt to ensure consistency. - # Run chown again to be safe, though maybe less critical now. chown -R pulse:pulse /opt/pulse-proxmox || msg_warning "Final chown failed." - # Final chmod removed as it's done earlier msg_ok "Permissions set." - # Starting Service msg_info "Starting ${APP} service..." systemctl start pulse-monitor.service msg_ok "Started ${APP} service." - # Update version file echo "${LATEST_RELEASE}" >/opt/${APP}_version.txt msg_ok "Update Successful to ${LATEST_RELEASE}" else @@ -176,13 +151,11 @@ start build_container description -# Read port from .env file if it exists, otherwise use default -PULSE_PORT=7655 # Default +PULSE_PORT=7655 if [ -f "/opt/pulse-proxmox/.env" ] && grep -q '^PORT=' "/opt/pulse-proxmox/.env"; then PULSE_PORT=$(grep '^PORT=' "/opt/pulse-proxmox/.env" | cut -d'=' -f2 | tr -d '[:space:]') - # Basic validation if port looks like a number if ! [[ "$PULSE_PORT" =~ ^[0-9]+$ ]]; then - PULSE_PORT=7655 # Fallback to default if not a number + PULSE_PORT=7655 fi fi diff --git a/install/pulse-install.sh b/install/pulse-install.sh index 0cf9734..4a27eec 100644 --- a/install/pulse-install.sh +++ b/install/pulse-install.sh @@ -5,7 +5,6 @@ # License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE # Source: https://github.com/rcourtman/Pulse -# Import Functions and Setup source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" color @@ -15,20 +14,18 @@ setting_up_container network_check update_os -# --- Configuration --- APP="Pulse" APP_DIR="/opt/pulse-proxmox" PULSE_USER="pulse" SERVICE_NAME="pulse-monitor.service" -NODE_MAJOR_VERSION=20 # From install-pulse.sh +NODE_MAJOR_VERSION=20 REPO_URL="https://github.com/rcourtman/Pulse.git" -# Create Pulse User msg_info "Creating dedicated user '${PULSE_USER}'..." if id "$PULSE_USER" &>/dev/null; then msg_warning "User '${PULSE_USER}' already exists. Skipping creation." else - useradd -r -m -d /opt/pulse-home -s /bin/bash "$PULSE_USER" # Give a shell for potential debugging/manual commands + useradd -r -m -d /opt/pulse-home -s /bin/bash "$PULSE_USER" if useradd -r -m -d /opt/pulse-home -s /bin/bash "$PULSE_USER"; then msg_ok "User '${PULSE_USER}' created successfully." else @@ -37,7 +34,6 @@ else fi fi -# Installing Dependencies msg_info "Installing Dependencies (git, curl, sudo, gpg, jq, diffutils)..." $STD apt-get install -y \ git \ @@ -48,13 +44,12 @@ $STD apt-get install -y \ diffutils msg_ok "Installed Core Dependencies" -# Setup Node.js via NodeSource msg_info "Setting up Node.js ${NODE_MAJOR_VERSION}.x repository..." KEYRING_DIR="/usr/share/keyrings" KEYRING_FILE="$KEYRING_DIR/nodesource.gpg" mkdir -p "$KEYRING_DIR" curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --yes --dearmor -o "$KEYRING_FILE" -pipestatus=("${PIPESTATUS[@]}") # Capture pipestatus array +pipestatus=("${PIPESTATUS[@]}") if [ "${pipestatus[1]}" -ne 0 ]; then msg_error "Failed to download NodeSource GPG key (gpg exited non-zero)." exit 1 @@ -69,9 +64,7 @@ msg_ok "Installed Node.js" msg_info "Node version: $(node -v)" msg_info "npm version: $(npm -v)" -# Setup App msg_info "Cloning ${APP} repository..." -# Clone as root initially, then change ownership $STD git clone "$REPO_URL" "$APP_DIR" cd "$APP_DIR" || { msg_error "Failed to cd into $APP_DIR" @@ -85,20 +78,14 @@ pipestatus=("${PIPESTATUS[@]}") if [ "${pipestatus[0]}" -ne 0 ] || [ "${pipestatus[1]}" -ne 0 ] || [[ -z "$LATEST_RELEASE" ]] || [[ "$LATEST_RELEASE" == "null" ]]; then msg_warning "Failed to fetch latest release tag. Proceeding with default branch." - # Optionally, you could fetch tags via git and parse locally: - # LATEST_RELEASE=$(git tag -l 'v*' --sort='-version:refname' | head -n 1) - # if [[ -z "$LATEST_RELEASE" ]]; then msg_error "Could not find any release tags."; exit 1; fi else msg_info "Checking out latest release tag: ${LATEST_RELEASE}" $STD git checkout "${LATEST_RELEASE}" msg_ok "Checked out ${LATEST_RELEASE}." fi -# Install npm dependencies (as root because of /opt permissions) msg_info "Installing Node.js dependencies for ${APP}..." -# Install root deps (includes dev for build) $STD npm install --unsafe-perm -# Install server deps cd server || { msg_error "Failed to cd into server directory." exit 1 @@ -107,22 +94,17 @@ $STD npm install --unsafe-perm cd .. msg_ok "Installed Node.js dependencies." -# Build CSS msg_info "Building CSS assets..." $STD npm run build:css msg_ok "Built CSS assets." -# Configure Environment (.env) msg_info "Configuring environment file..." ENV_EXAMPLE="${APP_DIR}/.env.example" ENV_FILE="${APP_DIR}/.env" if [ -f "$ENV_EXAMPLE" ]; then - # Copy example to .env if .env doesn't exist or is empty if [ ! -s "$ENV_FILE" ]; then cp "$ENV_EXAMPLE" "$ENV_FILE" msg_info "Created ${ENV_FILE} from example." - # Set default values (or leave placeholders for user to fill) - # Using defaults similar to install-pulse.sh prompts sed -i 's|^PROXMOX_HOST=.*|PROXMOX_HOST=https://proxmox_host:8006|' "$ENV_FILE" sed -i 's|^PROXMOX_TOKEN_ID=.*|PROXMOX_TOKEN_ID=user@pam!tokenid|' "$ENV_FILE" sed -i 's|^PROXMOX_TOKEN_SECRET=.*|PROXMOX_TOKEN_SECRET=YOUR_API_SECRET_HERE|' "$ENV_FILE" @@ -132,30 +114,23 @@ if [ -f "$ENV_EXAMPLE" ]; then else msg_warning "${ENV_FILE} already exists. Skipping default configuration." fi - # Set permissions on .env regardless chmod 600 "$ENV_FILE" else msg_warning "${ENV_EXAMPLE} not found. Skipping environment configuration." fi -# Set Permissions for the entire app directory msg_info "Setting permissions for ${APP_DIR}..." chown -R ${PULSE_USER}:${PULSE_USER} "${APP_DIR}" -# Ensure pulse user can write to logs if needed, and execute necessary files find "${APP_DIR}" -type d -exec chmod 755 {} \; find "${APP_DIR}" -type f -exec chmod 644 {} \; -# Make sure node_modules executables are runnable if needed (though npm scripts handle this) -# chmod +x ${APP_DIR}/server/server.js # Example if direct execution was needed -chmod 600 "$ENV_FILE" # Ensure .env is kept restricted +chmod 600 "$ENV_FILE" msg_ok "Set permissions." -# Save Installed Version msg_info "Saving installed version information..." -VERSION_TO_SAVE="${LATEST_RELEASE:-$(git rev-parse --short HEAD)}" # Use tag or commit hash +VERSION_TO_SAVE="${LATEST_RELEASE:-$(git rev-parse --short HEAD)}" echo "${VERSION_TO_SAVE}" >/opt/${APP}_version.txt msg_ok "Saved version info (${VERSION_TO_SAVE})." -# Creating Service msg_info "Creating systemd service for ${APP}..." NODE_PATH=$(command -v node) NPM_PATH=$(command -v npm) @@ -170,7 +145,6 @@ User=${PULSE_USER} Group=${PULSE_USER} WorkingDirectory=${APP_DIR} EnvironmentFile=${APP_DIR}/.env -# Use absolute paths for node and npm ExecStart=${NODE_PATH} ${NPM_PATH} run start Restart=on-failure RestartSec=5 @@ -183,15 +157,12 @@ EOF systemctl enable -q --now ${SERVICE_NAME} msg_ok "Created and enabled systemd service." -# Add motd and customize (standard functions) motd_ssh customize -# Cleanup msg_info "Cleaning up apt cache..." $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned up." -# Sentinel file for ct script verification (optional but good practice) touch /opt/pulse_install_complete From 65d85674cf700e1f439cbb8417fe00ebb434a137 Mon Sep 17 00:00:00 2001 From: "courtmanr@gmail.com" Date: Sun, 4 May 2025 23:48:23 +0100 Subject: [PATCH 03/67] Refactor: Remove shellcheck disable comments per reviewer feedback --- ct/pulse.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ct/pulse.sh b/ct/pulse.sh index 4d04e50..a3067af 100644 --- a/ct/pulse.sh +++ b/ct/pulse.sh @@ -6,19 +6,12 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/ # Source: https://github.com/rcourtman/Pulse APP="Pulse" -# shellcheck disable=SC2034 var_tags="monitoring;nodejs" -# shellcheck disable=SC2034 var_cpu="1" -# shellcheck disable=SC2034 var_ram="1024" -# shellcheck disable=SC2034 var_disk="4" -# shellcheck disable=SC2034 var_os="debian" -# shellcheck disable=SC2034 var_version="12" -# shellcheck disable=SC2034 var_unprivileged="1" header_info "$APP" From 2a50bf6ab946fa3059a8f28d053a1d8415e2588e Mon Sep 17 00:00:00 2001 From: "courtmanr@gmail.com" Date: Sun, 4 May 2025 23:49:48 +0100 Subject: [PATCH 04/67] Refactor(update): Address reviewer feedback on update script --- ct/pulse.sh | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/ct/pulse.sh b/ct/pulse.sh index a3067af..c5f2e02 100644 --- a/ct/pulse.sh +++ b/ct/pulse.sh @@ -24,23 +24,19 @@ function update_script() { check_container_storage check_container_resources - if [[ ! -d /opt/pulse-proxmox/.git ]]; then - msg_error "No ${APP} Installation Found! Cannot check/update via git." - exit 1 - fi - if ! command -v jq &>/dev/null; then - msg_error "jq is required for version checking but not installed. Please install it (apt-get install jq)." - exit 1 + msg_info "jq is not installed. Installing..." + $STD apt-get update >/dev/null + $STD apt-get install -y jq >/dev/null + if ! command -v jq &>/dev/null; then + msg_error "Failed to install jq. Cannot proceed with update check." + exit 1 + fi + msg_ok "jq installed." fi msg_info "Checking for ${APP} updates..." LATEST_RELEASE=$(curl -s https://api.github.com/repos/rcourtman/Pulse/releases/latest | jq -r '.tag_name') - if ! LATEST_RELEASE=$(curl -s https://api.github.com/repos/rcourtman/Pulse/releases/latest | jq -r '.tag_name') || - [[ -z "$LATEST_RELEASE" ]] || [[ "$LATEST_RELEASE" == "null" ]]; then - msg_error "Failed to fetch latest release information from GitHub API." - exit 1 - fi msg_ok "Latest available version: ${LATEST_RELEASE}" CURRENT_VERSION="" From 1e7e26acf681947fe6f254e52ee4e9c2f98a941e Mon Sep 17 00:00:00 2001 From: "courtmanr@gmail.com" Date: Sun, 4 May 2025 23:54:51 +0100 Subject: [PATCH 05/67] Refactor(update): Remove version file missing warning --- ct/pulse.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ct/pulse.sh b/ct/pulse.sh index c5f2e02..3b16d49 100644 --- a/ct/pulse.sh +++ b/ct/pulse.sh @@ -42,8 +42,6 @@ function update_script() { CURRENT_VERSION="" if [[ -f /opt/${APP}_version.txt ]]; then CURRENT_VERSION=$(cat /opt/${APP}_version.txt) - else - msg_warning "Version file /opt/${APP}_version.txt not found. Cannot determine current version. Will attempt update." fi if [[ "${LATEST_RELEASE}" != "$CURRENT_VERSION" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then From b30110413f86ea24c9c8500a653aca61da490e9d Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 5 May 2025 15:26:16 +0200 Subject: [PATCH 06/67] Update pulse-install.sh --- install/pulse-install.sh | 104 ++++++++++----------------------------- 1 file changed, 25 insertions(+), 79 deletions(-) diff --git a/install/pulse-install.sh b/install/pulse-install.sh index 4a27eec..7acbd4a 100644 --- a/install/pulse-install.sh +++ b/install/pulse-install.sh @@ -18,11 +18,9 @@ APP="Pulse" APP_DIR="/opt/pulse-proxmox" PULSE_USER="pulse" SERVICE_NAME="pulse-monitor.service" -NODE_MAJOR_VERSION=20 -REPO_URL="https://github.com/rcourtman/Pulse.git" -msg_info "Creating dedicated user '${PULSE_USER}'..." -if id "$PULSE_USER" &>/dev/null; then +msg_info "Creating dedicated user pulse..." +if id pulse &>/dev/null; then msg_warning "User '${PULSE_USER}' already exists. Skipping creation." else useradd -r -m -d /opt/pulse-home -s /bin/bash "$PULSE_USER" @@ -34,73 +32,25 @@ else fi fi -msg_info "Installing Dependencies (git, curl, sudo, gpg, jq, diffutils)..." +msg_info "Installing Dependencies" $STD apt-get install -y \ git \ - curl \ - sudo \ - gpg \ jq \ diffutils msg_ok "Installed Core Dependencies" -msg_info "Setting up Node.js ${NODE_MAJOR_VERSION}.x repository..." -KEYRING_DIR="/usr/share/keyrings" -KEYRING_FILE="$KEYRING_DIR/nodesource.gpg" -mkdir -p "$KEYRING_DIR" -curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --yes --dearmor -o "$KEYRING_FILE" -pipestatus=("${PIPESTATUS[@]}") -if [ "${pipestatus[1]}" -ne 0 ]; then - msg_error "Failed to download NodeSource GPG key (gpg exited non-zero)." - exit 1 -fi -if [ "${pipestatus[0]}" -ne 0 ]; then msg_warning "Curl failed to download GPG key (curl exited non-zero), but gpg seemed okay? Proceeding cautiously."; fi -echo "deb [signed-by=$KEYRING_FILE] https://deb.nodesource.com/node_$NODE_MAJOR_VERSION.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list >/dev/null -msg_info "Updating package list after adding NodeSource..." -$STD apt-get update -msg_info "Installing Node.js ${NODE_MAJOR_VERSION}.x..." -$STD apt-get install -y nodejs -msg_ok "Installed Node.js" -msg_info "Node version: $(node -v)" -msg_info "npm version: $(npm -v)" +NODE_VERSION="20" NODE_MODULE="yarn@latest" install_node_and_modules -msg_info "Cloning ${APP} repository..." -$STD git clone "$REPO_URL" "$APP_DIR" -cd "$APP_DIR" || { - msg_error "Failed to cd into $APP_DIR" - exit 1 -} -msg_ok "Cloned ${APP} repository." - -msg_info "Fetching latest release tag..." -LATEST_RELEASE=$(curl -s https://api.github.com/repos/rcourtman/Pulse/releases/latest | jq -r '.tag_name') -pipestatus=("${PIPESTATUS[@]}") -if [ "${pipestatus[0]}" -ne 0 ] || [ "${pipestatus[1]}" -ne 0 ] || - [[ -z "$LATEST_RELEASE" ]] || [[ "$LATEST_RELEASE" == "null" ]]; then - msg_warning "Failed to fetch latest release tag. Proceeding with default branch." -else - msg_info "Checking out latest release tag: ${LATEST_RELEASE}" - $STD git checkout "${LATEST_RELEASE}" - msg_ok "Checked out ${LATEST_RELEASE}." -fi - -msg_info "Installing Node.js dependencies for ${APP}..." +msg_info "Setup ${APP}" +$STD git clone https://github.com/rcourtman/Pulse.git /opt/pulse-proxmox +cd /opt/pulse-proxmox $STD npm install --unsafe-perm -cd server || { - msg_error "Failed to cd into server directory." - exit 1 -} +cd /opt/pulse-proxmox/server $STD npm install --unsafe-perm -cd .. -msg_ok "Installed Node.js dependencies." - -msg_info "Building CSS assets..." +cd /opt/pulse-proxmox $STD npm run build:css -msg_ok "Built CSS assets." - -msg_info "Configuring environment file..." -ENV_EXAMPLE="${APP_DIR}/.env.example" -ENV_FILE="${APP_DIR}/.env" +ENV_EXAMPLE="/opt/pulse-proxmox/.env.example" +ENV_FILE="${/opt/pulse-proxmox}/.env" if [ -f "$ENV_EXAMPLE" ]; then if [ ! -s "$ENV_FILE" ]; then cp "$ENV_EXAMPLE" "$ENV_FILE" @@ -119,10 +69,10 @@ else msg_warning "${ENV_EXAMPLE} not found. Skipping environment configuration." fi -msg_info "Setting permissions for ${APP_DIR}..." -chown -R ${PULSE_USER}:${PULSE_USER} "${APP_DIR}" -find "${APP_DIR}" -type d -exec chmod 755 {} \; -find "${APP_DIR}" -type f -exec chmod 644 {} \; +msg_info "Setting permissions for /opt/pulse-proxmox..." +chown -R ${PULSE_USER}:${PULSE_USER} "/opt/pulse-proxmox" +find "/opt/pulse-proxmox" -type d -exec chmod 755 {} \; +find "/opt/pulse-proxmox" -type f -exec chmod 644 {} \; chmod 600 "$ENV_FILE" msg_ok "Set permissions." @@ -131,21 +81,19 @@ VERSION_TO_SAVE="${LATEST_RELEASE:-$(git rev-parse --short HEAD)}" echo "${VERSION_TO_SAVE}" >/opt/${APP}_version.txt msg_ok "Saved version info (${VERSION_TO_SAVE})." -msg_info "Creating systemd service for ${APP}..." -NODE_PATH=$(command -v node) -NPM_PATH=$(command -v npm) -cat </etc/systemd/system/${SERVICE_NAME} +msg_info "Creating Service" +cat </etc/systemd/system/pulse-monitor.service [Unit] -Description=${APP} Monitoring Application +Description=Pulse Monitoring Application After=network.target [Service] Type=simple -User=${PULSE_USER} -Group=${PULSE_USER} -WorkingDirectory=${APP_DIR} -EnvironmentFile=${APP_DIR}/.env -ExecStart=${NODE_PATH} ${NPM_PATH} run start +User=pulse +Group=pulse +WorkingDirectory=/opt/pulse-proxmox +EnvironmentFile=/opt/pulse-proxmox/.env +ExecStart=/usr/bin/npm run start Restart=on-failure RestartSec=5 StandardOutput=journal @@ -154,8 +102,8 @@ StandardError=journal [Install] WantedBy=multi-user.target EOF -systemctl enable -q --now ${SERVICE_NAME} -msg_ok "Created and enabled systemd service." +systemctl enable -q --now pulse-monitor.service +msg_ok "Created Service" motd_ssh customize @@ -164,5 +112,3 @@ msg_info "Cleaning up apt cache..." $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned up." - -touch /opt/pulse_install_complete From 89cf0e3b52bd423305b385c84faea8f6d51af5f5 Mon Sep 17 00:00:00 2001 From: Aliaksei Pilko Date: Fri, 9 May 2025 16:35:24 +0100 Subject: [PATCH 07/67] Add garmin-grafana scripts --- ct/garmin-grafana.sh | 112 +++++++++++ frontend/public/json/garmin-grafana.json | 44 +++++ install/garmin-grafana-install.sh | 226 +++++++++++++++++++++++ 3 files changed, 382 insertions(+) create mode 100644 ct/garmin-grafana.sh create mode 100644 frontend/public/json/garmin-grafana.json create mode 100644 install/garmin-grafana-install.sh diff --git a/ct/garmin-grafana.sh b/ct/garmin-grafana.sh new file mode 100644 index 0000000..1da4abe --- /dev/null +++ b/ct/garmin-grafana.sh @@ -0,0 +1,112 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/aliaksei135/ProxmoxVE/refs/heads/garmin-grafana/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: aliaksei135 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/arpanghosh8453/garmin-grafana + +APP="garmin-grafana" +var_tags="${var_tags:-sports;visualization}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +# this only updates garmin-grafana, not influxdb or grafana, which are upgraded with apt +function update_script() { + header_info + check_container_storage + check_container_resources + + # Check if installation is present | -f for file, -d for folder + if [[ ! -d /opt/garmin-grafana/ ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + # Crawling the new version and checking whether an update is required + RELEASE=$(curl -fsSL https://api.github.com/repos/arpanghosh8453/garmin-grafana/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') + if [[ ! -d /opt/garmin-grafana/ ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then + # Stopping Services + msg_info "Stopping $APP" + systemctl stop garmin-grafana + systemctl stop grafana-server + systemctl stop influxdb + msg_ok "Stopped $APP" + + # Get required environment variables from the .env file + if [[ ! -f /opt/garmin-grafana/.env ]]; then + msg_error "No .env file found in /opt/garmin-grafana/.env" + exit + fi + source /opt/garmin-grafana/.env + if [[ -z "${INFLUXDB_USER}" || -z "${INFLUXDB_PASSWORD}" || -z "${INFLUXDB_NAME}" ]]; then + msg_error "INFLUXDB_USER, INFLUXDB_PASSWORD, or INFLUXDB_NAME not set in .env file" + exit + fi + + # Creating Backup + msg_info "Creating Backup" + tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/garmin-grafana/.garminconnect /opt/garmin-grafana/.env + mv /opt/garmin-grafana/ /opt/garmin-grafana-backup/ + msg_ok "Backup Created" + + # Execute Update + msg_info "Updating $APP to v${RELEASE}" + curl -fsSL -o "${RELEASE}.zip" "https://github.com/arpanghosh8453/garmin-grafana/archive/refs/tags/${RELEASE}.zip" + unzip -q "${RELEASE}.zip" + mv "garmin-grafana-${RELEASE}/" "/opt/garmin-grafana" + rm -f "${RELEASE}.zip" + # Install python dependencies with uv + $STD uv sync --locked --project /opt/garmin-grafana/ + # Setup grafana provisioning configs + # shellcheck disable=SC2016 + sed -i 's/\${DS_GARMIN_STATS}/garmin_influxdb/g' /opt/garmin-grafana/Grafana_Dashboard/Garmin-Grafana-Dashboard.json + sed -i 's/influxdb:8086/localhost:8086/' /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml + sed -i "s/influxdb_user/${INFLUXDB_USER}/" /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml + sed -i "s/influxdb_secret_password/${INFLUXDB_PASSWORD}/" /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml + sed -i "s/GarminStats/${INFLUXDB_NAME}/" /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml + # Copy across grafana data + cp -r /opt/garmin-grafana/Grafana_Datasource/* /etc/grafana/provisioning/datasources + cp -r /opt/garmin-grafana/Grafana_Dashboard/* /etc/grafana/provisioning/dashboards + # Copy back the env and token files + cp /opt/garmin-grafana-backup/.env /opt/garmin-grafana/.env + cp -r /opt/garmin-grafana-backup/.garminconnect /opt/garmin-grafana/.garminconnect + msg_ok "Updated $APP to v${RELEASE}" + + # Starting Services + msg_info "Starting $APP" + systemctl start garmin-grafana + systemctl start grafana-server + systemctl start influxdb + msg_ok "Started $APP" + + # Cleaning up + msg_info "Cleaning Up" + rm -rf /opt/garmin-grafana-backup + msg_ok "Cleanup Completed" + + # Last Action + echo "${RELEASE}" >/opt/${APP}_version.txt + msg_ok "Update Successful" + else + msg_ok "No update required. ${APP} is already at v${RELEASE}" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/frontend/public/json/garmin-grafana.json b/frontend/public/json/garmin-grafana.json new file mode 100644 index 0000000..d9a9283 --- /dev/null +++ b/frontend/public/json/garmin-grafana.json @@ -0,0 +1,44 @@ +{ + "name": "garmin-grafana", + "slug": "garmin-grafana", + "categories": [ + 24 + ], + "date_created": "2025-05-08", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 3000, + "documentation": "https://github.com/arpanghosh8453/garmin-grafana", + "config_path": "", + "website": "https://github.com/arpanghosh8453/garmin-grafana", + "logo": "https://github.com/arpanghosh8453/garmin-grafana/raw/refs/heads/main/Extra/Garmin-Grafana-Logo.svg", + "description": "A docker container to fetch data from Garmin servers and store the data in a local influxdb database for appealing visualization with Grafana.", + "install_methods": [ + { + "type": "default", + "script": "ct/garmin-grafana.sh", + "resources": { + "cpu": 2, + "ram": 2, + "hdd": 8, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "Show login and database credentials: `cat ~/.garmin-grafana.creds`", + "type": "info" + }, + { + "text": "`garmin-grafana` only imports the past 7 days by default. To import historical data, use the `~/bulk-import.sh` script after installation.", + "type": "info" + } + ] +} diff --git a/install/garmin-grafana-install.sh b/install/garmin-grafana-install.sh new file mode 100644 index 0000000..f49a56e --- /dev/null +++ b/install/garmin-grafana-install.sh @@ -0,0 +1,226 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: aliaksei135 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/arpanghosh8453/garmin-grafana + +# Import Functions und Setup +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +# Installing Dependencies +msg_info "Installing Dependencies" +# Grafana dependencies +$STD apt-get install -y gnupg +$STD apt-get install -y apt-transport-https +$STD apt-get install -y software-properties-common +# Influx dependencies +$STD apt-get install -y lsb-base +$STD apt-get install -y lsb-release +$STD apt-get install -y gnupg2 +# garmin-grafana dependencies +$STD apt-get install -y python3 +$STD apt-get install -y python3-requests +$STD apt-get install -y python3-dotenv +setup_uv +msg_ok "Installed Dependencies" + +msg_info "Setting up InfluxDB Repository" +curl -fsSL "https://repos.influxdata.com/influxdata-archive_compat.key" | gpg --dearmor >/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg +echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main" >/etc/apt/sources.list.d/influxdata.list +msg_ok "Set up InfluxDB Repository" + +# garmin-grafana recommends influxdb v1 +# this install chronograf, which is the UI for influxdb. this might be overkill? +msg_info "Installing InfluxDB" +$STD apt-get update +$STD apt-get install -y influxdb +curl -fsSL "https://dl.influxdata.com/chronograf/releases/chronograf_1.10.7_amd64.deb" -o "$(basename "https://dl.influxdata.com/chronograf/releases/chronograf_1.10.7_amd64.deb")" +$STD dpkg -i chronograf_1.10.7_amd64.deb +msg_ok "Installed InfluxDB" + +msg_info "Setting up InfluxDB" +# Patch the config file to use the tsi1 index +$STD sed -i 's/# index-version = "inmem"/index-version = "tsi1"/' /etc/influxdb/influxdb.conf + +# Create InfluxDB user and database +INFLUXDB_USER="garmin_grafana_user" +INFLUXDB_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13) +INFLUXDB_NAME="GarminStats" +$STD influx -execute "CREATE DATABASE ${INFLUXDB_NAME}" +$STD influx -execute "CREATE USER ${INFLUXDB_USER} WITH PASSWORD '${INFLUXDB_PASSWORD}'" +$STD influx -execute "GRANT ALL ON ${INFLUXDB_NAME} TO ${INFLUXDB_USER}" +# Start the service +$STD systemctl enable --now influxdb +msg_ok "Set up InfluxDB" + +msg_info "Setting up Grafana Repository" +curl -fsSL "https://apt.grafana.com/gpg.key" -o "/usr/share/keyrings/grafana.key" +sh -c 'echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" > /etc/apt/sources.list.d/grafana.list' +msg_ok "Set up Grafana Repository" + +msg_info "Installing Grafana" +$STD apt-get update +$STD apt-get install -y grafana +systemctl start grafana-server +systemctl daemon-reload +systemctl enable --now -q grafana-server.service +# This avoids the "database is locked" error when running the grafana-cli +sleep 20 +msg_ok "Installed Grafana" + +msg_info "Setting up Grafana" +GRAFANA_USER="admin" +GRAFANA_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13) +# Create Grafana user +$STD grafana-cli admin reset-admin-password "${GRAFANA_PASS}" +# # Install plugins +$STD grafana-cli plugins install marcusolsson-hourly-heatmap-panel +$STD systemctl restart grafana-server +# Output credentials to file +{ + echo "Grafana Credentials" + echo "Grafana User: ${GRAFANA_USER}" + echo "Grafana Password: ${GRAFANA_PASS}" +} >>~/garmin-grafana.creds +msg_ok "Set up Grafana" + +# Setup App +msg_info "Installing garmin-grafana" +RELEASE=$(curl -fsSL https://api.github.com/repos/arpanghosh8453/garmin-grafana/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') +curl -fsSL -o "${RELEASE}.zip" "https://github.com/arpanghosh8453/garmin-grafana/archive/refs/tags/${RELEASE}.zip" +unzip -q "${RELEASE}.zip" +# Remove the v prefix to RELEASE if it exists +if [[ "${RELEASE}" == v* ]]; then + RELEASE="${RELEASE:1}" +fi +mv "garmin-grafana-${RELEASE}/" "/opt/garmin-grafana" +# Create dir for garmin tokens +mkdir -p /opt/garmin-grafana/.garminconnect +# Install python dependencies with uv +$STD uv sync --locked --project /opt/garmin-grafana/ +# Setup grafana provisioning configs +# shellcheck disable=SC2016 +sed -i 's/\${DS_GARMIN_STATS}/garmin_influxdb/g' /opt/garmin-grafana/Grafana_Dashboard/Garmin-Grafana-Dashboard.json +sed -i 's/influxdb:8086/localhost:8086/' /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml +sed -i "s/influxdb_user/${INFLUXDB_USER}/" /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml +sed -i "s/influxdb_secret_password/${INFLUXDB_PASSWORD}/" /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml +sed -i "s/GarminStats/${INFLUXDB_NAME}/" /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml +# Copy across grafana data +cp -r /opt/garmin-grafana/Grafana_Datasource/* /etc/grafana/provisioning/datasources +cp -r /opt/garmin-grafana/Grafana_Dashboard/* /etc/grafana/provisioning/dashboards +echo "${RELEASE}" >"/opt/garmin-grafana_version.txt" +msg_ok "Installed garmin-grafana" + +msg_info "Setting up garmin-grafana" +# Check if using Chinese garmin servers +read -rp "Are you using Garmin in mainland China? (y/N): " prompt +if [[ "${prompt,,}" =~ ^(y|yes|Y)$ ]]; then + GARMIN_CN="True" +else + GARMIN_CN="False" +fi + +# Setup environment variables +cat </opt/garmin-grafana/.env +INFLUXDB_HOST=localhost +INFLUXDB_PORT=8086 +INFLUXDB_ENDPOINT_IS_HTTP=True +INFLUXDB_USERNAME=${INFLUXDB_USER} +INFLUXDB_PASSWORD=${INFLUXDB_PASSWORD} +INFLUXDB_DATABASE=${INFLUXDB_NAME} +GARMIN_IS_CN=${GARMIN_CN} +TOKEN_DIR=/opt/garmin-grafana/.garminconnect +EOF + +# garmin-grafana usually prompts the user for email and password (and MFA) on first run, +# then stores a refreshable token. We try to avoid storing user credentials in the env vars +if [ -z "$(ls -A /opt/garmin-grafana/.garminconnect)" ]; then + # Get the email and password from the user + read -r -p "Please enter your Garmin Connect Email: " GARMIN_EMAIL + read -r -p "Please enter your Garmin Connect Password (this is used to generate a token and NOT stored): " GARMIN_PASSWORD + read -r -p "Please enter your MFA Code (if applicable, leave blank if not): " GARMIN_MFA + # Run the script once to prompt for credential + msg_info "Creating Garmin credentials, this will timeout in 60 seconds" + timeout 60s uv run --env-file /opt/garmin-grafana/.env --project /opt/garmin-grafana/ /opt/garmin-grafana/src/garmin_grafana/garmin_fetch.py <~/bulk-import.sh +#!/usr/bin/env bash +if [[ -z \$1 ]]; then + echo "Usage: \$0 " + echo "Example: \$0 2023-01-01 2023-01-31" + echo "Date format: YYYY-MM-DD" + echo "This will import data from the start_date to the end_date (inclusive)" + exit 1 +fi + +START_DATE="\$1" +if [[ -z \$2 ]]; then + END_DATE="\$(date +%Y-%m-%d)" + echo "No end date provided, using today as end date: \${END_DATE}" +else + END_DATE="\$2" +fi + +# Stop the service if running +systemctl stop garmin-grafana + +MANUAL_START_DATE="\${START_DATE}" MANUAL_END_DATE="\${END_DATE}" uv run --env-file /opt/garmin-grafana/.env --project /opt/garmin-grafana/ /opt/garmin-grafana/src/garmin_grafana/garmin_fetch.py + +# Restart the service +systemctl start garmin-grafana +EOF +chmod +x ~/bulk-import.sh +msg_ok "Set up garmin-grafana" + +# Creating Service (if needed) +msg_info "Creating Service" +cat </etc/systemd/system/garmin-grafana.service +[Unit] +Description=garmin-grafana Service +After=network.target + +[Service] +ExecStart=uv run --project /opt/garmin-grafana/ /opt/garmin-grafana/src/garmin_grafana/garmin_fetch.py +Restart=always +EnvironmentFile=/opt/garmin-grafana/.env + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now garmin-grafana +msg_ok "Created Service" + +motd_ssh +customize + +# Cleanup +msg_info "Cleaning up" +rm -f "${RELEASE}".zip +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" From 7d45266c30339b8000f734fc2a022696d367ea2a Mon Sep 17 00:00:00 2001 From: Aliaksei Pilko Date: Fri, 9 May 2025 16:38:24 +0100 Subject: [PATCH 08/67] Change URLs back to community-scripts --- ct/garmin-grafana.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/garmin-grafana.sh b/ct/garmin-grafana.sh index 1da4abe..87236f2 100644 --- a/ct/garmin-grafana.sh +++ b/ct/garmin-grafana.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/aliaksei135/ProxmoxVE/refs/heads/garmin-grafana/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/raw/main/garmin-grafana/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: aliaksei135 # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE From c21a9345ecc42d0c87019f930ed390a43dc0c8ec Mon Sep 17 00:00:00 2001 From: Aliaksei Pilko Date: Fri, 9 May 2025 19:45:24 +0100 Subject: [PATCH 09/67] PR fixes --- ct/garmin-grafana.sh | 11 ----------- install/garmin-grafana-install.sh | 33 ++++++++++--------------------- 2 files changed, 10 insertions(+), 34 deletions(-) diff --git a/ct/garmin-grafana.sh b/ct/garmin-grafana.sh index 87236f2..fb0a5af 100644 --- a/ct/garmin-grafana.sh +++ b/ct/garmin-grafana.sh @@ -25,23 +25,19 @@ function update_script() { check_container_storage check_container_resources - # Check if installation is present | -f for file, -d for folder if [[ ! -d /opt/garmin-grafana/ ]]; then msg_error "No ${APP} Installation Found!" exit fi - # Crawling the new version and checking whether an update is required RELEASE=$(curl -fsSL https://api.github.com/repos/arpanghosh8453/garmin-grafana/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') if [[ ! -d /opt/garmin-grafana/ ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then - # Stopping Services msg_info "Stopping $APP" systemctl stop garmin-grafana systemctl stop grafana-server systemctl stop influxdb msg_ok "Stopped $APP" - # Get required environment variables from the .env file if [[ ! -f /opt/garmin-grafana/.env ]]; then msg_error "No .env file found in /opt/garmin-grafana/.env" exit @@ -52,21 +48,17 @@ function update_script() { exit fi - # Creating Backup msg_info "Creating Backup" tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/garmin-grafana/.garminconnect /opt/garmin-grafana/.env mv /opt/garmin-grafana/ /opt/garmin-grafana-backup/ msg_ok "Backup Created" - # Execute Update msg_info "Updating $APP to v${RELEASE}" curl -fsSL -o "${RELEASE}.zip" "https://github.com/arpanghosh8453/garmin-grafana/archive/refs/tags/${RELEASE}.zip" unzip -q "${RELEASE}.zip" mv "garmin-grafana-${RELEASE}/" "/opt/garmin-grafana" rm -f "${RELEASE}.zip" - # Install python dependencies with uv $STD uv sync --locked --project /opt/garmin-grafana/ - # Setup grafana provisioning configs # shellcheck disable=SC2016 sed -i 's/\${DS_GARMIN_STATS}/garmin_influxdb/g' /opt/garmin-grafana/Grafana_Dashboard/Garmin-Grafana-Dashboard.json sed -i 's/influxdb:8086/localhost:8086/' /opt/garmin-grafana/Grafana_Datasource/influxdb.yaml @@ -81,19 +73,16 @@ function update_script() { cp -r /opt/garmin-grafana-backup/.garminconnect /opt/garmin-grafana/.garminconnect msg_ok "Updated $APP to v${RELEASE}" - # Starting Services msg_info "Starting $APP" systemctl start garmin-grafana systemctl start grafana-server systemctl start influxdb msg_ok "Started $APP" - # Cleaning up msg_info "Cleaning Up" rm -rf /opt/garmin-grafana-backup msg_ok "Cleanup Completed" - # Last Action echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Update Successful" else diff --git a/install/garmin-grafana-install.sh b/install/garmin-grafana-install.sh index f49a56e..c0d85a6 100644 --- a/install/garmin-grafana-install.sh +++ b/install/garmin-grafana-install.sh @@ -16,18 +16,16 @@ update_os # Installing Dependencies msg_info "Installing Dependencies" -# Grafana dependencies -$STD apt-get install -y gnupg -$STD apt-get install -y apt-transport-https -$STD apt-get install -y software-properties-common -# Influx dependencies -$STD apt-get install -y lsb-base -$STD apt-get install -y lsb-release -$STD apt-get install -y gnupg2 -# garmin-grafana dependencies -$STD apt-get install -y python3 -$STD apt-get install -y python3-requests -$STD apt-get install -y python3-dotenv +$STD apt-get install -y \ + gnupg \ + apt-transport-https \ + software-properties-common \ + lsb-base \ + lsb-release \ + gnupg2 \ + python3 \ + python3-requests \ + python3-dotenv setup_uv msg_ok "Installed Dependencies" @@ -46,10 +44,8 @@ $STD dpkg -i chronograf_1.10.7_amd64.deb msg_ok "Installed InfluxDB" msg_info "Setting up InfluxDB" -# Patch the config file to use the tsi1 index $STD sed -i 's/# index-version = "inmem"/index-version = "tsi1"/' /etc/influxdb/influxdb.conf -# Create InfluxDB user and database INFLUXDB_USER="garmin_grafana_user" INFLUXDB_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13) INFLUXDB_NAME="GarminStats" @@ -78,9 +74,7 @@ msg_ok "Installed Grafana" msg_info "Setting up Grafana" GRAFANA_USER="admin" GRAFANA_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13) -# Create Grafana user $STD grafana-cli admin reset-admin-password "${GRAFANA_PASS}" -# # Install plugins $STD grafana-cli plugins install marcusolsson-hourly-heatmap-panel $STD systemctl restart grafana-server # Output credentials to file @@ -101,9 +95,7 @@ if [[ "${RELEASE}" == v* ]]; then RELEASE="${RELEASE:1}" fi mv "garmin-grafana-${RELEASE}/" "/opt/garmin-grafana" -# Create dir for garmin tokens mkdir -p /opt/garmin-grafana/.garminconnect -# Install python dependencies with uv $STD uv sync --locked --project /opt/garmin-grafana/ # Setup grafana provisioning configs # shellcheck disable=SC2016 @@ -127,7 +119,6 @@ else GARMIN_CN="False" fi -# Setup environment variables cat </opt/garmin-grafana/.env INFLUXDB_HOST=localhost INFLUXDB_PORT=8086 @@ -142,7 +133,6 @@ EOF # garmin-grafana usually prompts the user for email and password (and MFA) on first run, # then stores a refreshable token. We try to avoid storing user credentials in the env vars if [ -z "$(ls -A /opt/garmin-grafana/.garminconnect)" ]; then - # Get the email and password from the user read -r -p "Please enter your Garmin Connect Email: " GARMIN_EMAIL read -r -p "Please enter your Garmin Connect Password (this is used to generate a token and NOT stored): " GARMIN_PASSWORD read -r -p "Please enter your MFA Code (if applicable, leave blank if not): " GARMIN_MFA @@ -153,7 +143,6 @@ ${GARMIN_EMAIL} ${GARMIN_PASSWORD} ${GARMIN_MFA} EOF - # Clear the credentials from the terminal unset GARMIN_EMAIL unset GARMIN_PASSWORD unset GARMIN_MFA @@ -164,7 +153,6 @@ EOF fi fi -# Restart Grafana to pick up the provisioned data sources and dashboards $STD systemctl restart grafana-server # Add a script to make the manual bulk data import easier @@ -197,7 +185,6 @@ EOF chmod +x ~/bulk-import.sh msg_ok "Set up garmin-grafana" -# Creating Service (if needed) msg_info "Creating Service" cat </etc/systemd/system/garmin-grafana.service [Unit] From fcea354de2d271e9a8d5d5680dd0d9e98104b3e5 Mon Sep 17 00:00:00 2001 From: finkerle <145992792+finkerle@users.noreply.github.com> Date: Mon, 19 May 2025 10:03:09 +0200 Subject: [PATCH 10/67] Add install script for configarr (#401) --- ct/configarr.sh | 66 +++++++++++++++++++++++++++ frontend/public/json/configarr.json | 40 +++++++++++++++++ install/configarr-install.sh | 70 +++++++++++++++++++++++++++++ 3 files changed, 176 insertions(+) create mode 100644 ct/configarr.sh create mode 100644 frontend/public/json/configarr.json create mode 100644 install/configarr-install.sh diff --git a/ct/configarr.sh b/ct/configarr.sh new file mode 100644 index 0000000..02ca312 --- /dev/null +++ b/ct/configarr.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: finkerle +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/raydak-labs/configarr + +APP="Configarr" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-512}" +var_disk="${var_disk:-4}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -d /opt/configarr ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + RELEASE=$(curl -fsSL https://api.github.com/repos/raydak-labs/configarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + if [[ "${RELEASE}" != "$(cat /opt/configarr_version.txt)" ]] || [[ ! -f /opt/configarr_version.txt ]]; then + msg_info "Stopping $APP" + systemctl stop configarr-task.timer + msg_ok "Stopped $APP" + + msg_info "Updating $APP to v${RELEASE}" + mkdir -p /opt/backup/ + mv /opt/configarr/{config.yml,secrets.yml,.env} "/opt/backup/" + rm -rf /opt/configarr + fetch_and_deploy_gh_release "raydak-labs/configarr" + mv /opt/backup/* /opt/configarr/ + cd /opt/configarr + pnpm install + pnpm run build + msg_ok "Updated $APP to v${RELEASE}" + + msg_info "Starting $APP" + systemctl start configarr-task.timer + msg_ok "Started configarr" + + rm -rf /opt/backup + msg_ok "Update Successful" + else + msg_ok "No update required. ${APP} is already at v${RELEASE}" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:[PORT]${CL}" diff --git a/frontend/public/json/configarr.json b/frontend/public/json/configarr.json new file mode 100644 index 0000000..964c974 --- /dev/null +++ b/frontend/public/json/configarr.json @@ -0,0 +1,40 @@ +{ + "name": "Configarr", + "slug": "configarr", + "categories": [ + 14 + ], + "date_created": "2025-05-06", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": null, + "documentation": "https://configarr.raydak.de/docs/intro", + "config_path": "/opt/configarr/config.yml", + "website": "https://configarr.raydak.de/", + "logo": "https://github.com/raydak-labs/configarr/blob/main/docs/static/img/logo.webp", + "description": "Configarr is an open-source tool designed to simplify configuration and synchronization for Sonarr and Radarr (and other experimental). It integrates with TRaSH Guides to automate updates of custom formats, quality profiles, and other settings, while also supporting user-defined configurations.", + "install_methods": [ + { + "type": "default", + "script": "ct/configarr.sh", + "resources": { + "cpu": 1, + "ram": 512, + "hdd": 4, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "change secrets file /opt/configarr/secrets.yml", + "type": "info" + } + ] +} diff --git a/install/configarr-install.sh b/install/configarr-install.sh new file mode 100644 index 0000000..d915ab5 --- /dev/null +++ b/install/configarr-install.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: finkerle +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/raydak-labs/configarr + +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 \ + git +msg_ok "Installed Dependencies" + +NODE_MODULE="pnpm@latest" install_node_and_modules +fetch_and_deploy_gh_release "raydak-labs/configarr" + +msg_info "Setup ${APPLICATION}" +cat </opt/configarr/.env +ROOT_PATH=/opt/configarr +CUSTOM_REPO_ROOT=/opt/configarr/repos +CONFIG_LOCATION=/opt/configarr/config.yml +SECRETS_LOCATION=/opt/configarr/secrets.yml +EOF +mv /opt/configarr/secrets.yml.template /opt/configarr/secrets.yml +sed 's|#localConfigTemplatesPath: /app/templates|#localConfigTemplatesPath: /opt/configarr/templates|' /opt/configarr/config.yml.template >/opt/configarr/config.yml +cd /opt/configarr +pnpm install +pnpm run build +msg_ok "Setup ${APPLICATION}" + +msg_info "Creating Service" +cat </etc/systemd/system/configarr-task.service +[Unit] +Description=Run Configarr Task + +[Service] +Type=oneshot +WorkingDirectory=/opt/configarr +ExecStart=/usr/bin/node /opt/configarr/bundle.cjs + +EOF +cat </etc/systemd/system/configarr-task.timer +[Unit] +Description=Run Configarr every 5 minutes + +[Timer] +OnBootSec=2min +OnUnitActiveSec=5min +Persistent=true + +[Install] +WantedBy=timers.target +EOF +systemctl enable -q --now configarr-task.timer +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" From d0742ccc0b1d398f7d5894f6d01eed6febe8c49c Mon Sep 17 00:00:00 2001 From: "app-header-generator[bot]" <194485257+app-header-generator[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 08:03:29 +0000 Subject: [PATCH 11/67] Update .app files (#418) Co-authored-by: GitHub Actions --- ct/headers/configarr | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ct/headers/configarr diff --git a/ct/headers/configarr b/ct/headers/configarr new file mode 100644 index 0000000..cf84ff3 --- /dev/null +++ b/ct/headers/configarr @@ -0,0 +1,6 @@ + ______ _____ + / ____/___ ____ / __(_)___ _____ ___________ + / / / __ \/ __ \/ /_/ / __ `/ __ `/ ___/ ___/ +/ /___/ /_/ / / / / __/ / /_/ / /_/ / / / / +\____/\____/_/ /_/_/ /_/\__, /\__,_/_/ /_/ + /____/ From fd9889bf8a16464fb9a3e46fd3a31c600495fd72 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 19 May 2025 13:28:43 +0200 Subject: [PATCH 12/67] test --- ct/alpine-homarr.sh | 114 +++++++++++++++++++++++++++++++ install/alpine-homarr-install.sh | 105 ++++++++++++++++++++++++++++ 2 files changed, 219 insertions(+) create mode 100644 ct/alpine-homarr.sh create mode 100644 install/alpine-homarr-install.sh diff --git a/ct/alpine-homarr.sh b/ct/alpine-homarr.sh new file mode 100644 index 0000000..90822b8 --- /dev/null +++ b/ct/alpine-homarr.sh @@ -0,0 +1,114 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 tteck +# Author: tteck (tteckster) | Co-Author: MickLesk (Canbiz) | Co-Author: CrazyWolf13 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://homarr.dev/ + +APP="homarr" +var_tags="${var_tags:-arr;dashboard}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-4096}" +var_disk="${var_disk:-8}" +var_os="${var_os:-alpine}" +var_version="${var_version:-3.21}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" + +variables +color +catch_errors + +function update_script() { + header_info + RELEASE=$(curl -fsSL https://api.github.com/repos/homarr-labs/homarr/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 Services (Patience)" + systemctl stop homarr + msg_ok "Services Stopped" + + msg_info "Backup Data" + mkdir -p /opt/homarr-data-backup + cp /opt/homarr/.env /opt/homarr-data-backup/.env + msg_ok "Backup Data" + + msg_info "Updating and rebuilding ${APP} to v${RELEASE} (Patience)" + rm /opt/run_homarr.sh + cat <<'EOF' >/opt/run_homarr.sh +#!/bin/bash +set -a +source /opt/homarr/.env +set +a +export DB_DIALECT='sqlite' +export AUTH_SECRET=$(openssl rand -base64 32) +node /opt/homarr_db/migrations/$DB_DIALECT/migrate.cjs /opt/homarr_db/migrations/$DB_DIALECT +for dir in $(find /opt/homarr_db/migrations/migrations -mindepth 1 -maxdepth 1 -type d); do + dirname=$(basename "$dir") + mkdir -p "/opt/homarr_db/migrations/$dirname" + cp -r "$dir"/* "/opt/homarr_db/migrations/$dirname/" 2>/dev/null || true +done +export HOSTNAME=$(ip route get 1.1.1.1 | grep -oP 'src \K[^ ]+') +envsubst '${HOSTNAME}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf +nginx -g 'daemon off;' & +redis-server /opt/homarr/packages/redis/redis.conf & +node apps/tasks/tasks.cjs & +node apps/websocket/wssServer.cjs & +node apps/nextjs/server.js & PID=$! +wait $PID +EOF + chmod +x /opt/run_homarr.sh + NODE_VERSION=$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.engines.node | split(">=")[1] | split(".")[0]') + NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.packageManager | split("@")[1]')" + install_node_and_modules + rm -rf /opt/homarr + fetch_and_deploy_gh_release "homarr-labs/homarr" + mv /opt/homarr-data-backup/.env /opt/homarr/.env + cd /opt/homarr + echo "test2" + export NODE_ENV="" + $STD pnpm install --recursive --frozen-lockfile --shamefully-hoist + $STD pnpm build + cp /opt/homarr/apps/nextjs/next.config.ts . + cp /opt/homarr/apps/nextjs/package.json . + cp -r /opt/homarr/packages/db/migrations /opt/homarr_db/migrations + cp -r /opt/homarr/apps/nextjs/.next/standalone/* /opt/homarr + mkdir -p /appdata/redis + cp /opt/homarr/packages/redis/redis.conf /opt/homarr/redis.conf + rm /etc/nginx/nginx.conf + mkdir -p /etc/nginx/templates + cp /opt/homarr/nginx.conf /etc/nginx/templates/nginx.conf + + mkdir -p /opt/homarr/apps/cli + cp /opt/homarr/packages/cli/cli.cjs /opt/homarr/apps/cli/cli.cjs + echo $'#!/bin/bash\ncd /opt/homarr/apps/cli && node ./cli.cjs "$@"' >/usr/bin/homarr + chmod +x /usr/bin/homarr + + mkdir /opt/homarr/build + cp ./node_modules/better-sqlite3/build/Release/better_sqlite3.node ./build/better_sqlite3.node + echo "${RELEASE}" >/opt/${APP}_version.txt + msg_ok "Updated ${APP}" + + msg_info "Starting Services" + systemctl start homarr + msg_ok "Started Services" + msg_ok "Updated Successfully" + read -p "It's recommended to reboot the LXC after an update, would you like to reboot the LXC now ? (y/n): " choice + if [[ "$choice" =~ ^[Yy]$ ]]; then + reboot + fi + 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}:7575${CL}" diff --git a/install/alpine-homarr-install.sh b/install/alpine-homarr-install.sh new file mode 100644 index 0000000..69cabf2 --- /dev/null +++ b/install/alpine-homarr-install.sh @@ -0,0 +1,105 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (Canbiz) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/homarr-labs/homarr + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apk add --no-cache \ + redis \ + nginx \ + ca-certificates \ + openssl \ + jq \ + make \ + g++ \ + gettext \ + libstdc++ \ + libgcc \ + python3 \ + py3-pip +msg_ok "Installed Dependencies" + +NODE_VERSION=$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.engines.node | split(">=")[1] | split(".")[0]') +NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.packageManager | split("@")[1]')" +install_node_and_modules +fetch_and_deploy_gh_release "homarr-labs/homarr" + +msg_info "Installing Homarr" +mkdir -p /opt/homarr_db +touch /opt/homarr_db/db.sqlite +SECRET_ENCRYPTION_KEY="$(openssl rand -hex 32)" +cd /opt/homarr +cat </opt/homarr/.env +DB_DRIVER='better-sqlite3' +DB_DIALECT='sqlite' +SECRET_ENCRYPTION_KEY='${SECRET_ENCRYPTION_KEY}' +DB_URL='/opt/homarr_db/db.sqlite' +TURBO_TELEMETRY_DISABLED=1 +AUTH_PROVIDERS='credentials' +NODE_ENV='production' +EOF + +$STD pnpm install +$STD pnpm build +msg_ok "Installed Homarr" + +msg_info "Copying build and config files" +cp /opt/homarr/apps/nextjs/next.config.ts . +cp /opt/homarr/apps/nextjs/package.json . +cp -r /opt/homarr/packages/db/migrations /opt/homarr_db/migrations +cp -r /opt/homarr/apps/nextjs/.next/standalone/* /opt/homarr +mkdir -p /appdata/redis +cp /opt/homarr/packages/redis/redis.conf /opt/homarr/redis.conf +mkdir -p /etc/nginx/templates +cp /opt/homarr/nginx.conf /etc/nginx/templates/nginx.conf +mkdir -p /opt/homarr/apps/cli +cp /opt/homarr/packages/cli/cli.cjs /opt/homarr/apps/cli/cli.cjs +echo -e '#!/bin/sh\ncd /opt/homarr/apps/cli && node ./cli.cjs "$@"' >/usr/bin/homarr +chmod +x /usr/bin/homarr +mkdir -p /opt/homarr/build +cp ./node_modules/better-sqlite3/build/Release/better_sqlite3.node ./build/better_sqlite3.node +echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" +msg_ok "Finished copying" + +msg_info "Creating run script" +cat <<'EOF' >/opt/run_homarr.sh +#!/bin/sh +set -a +. /opt/homarr/.env +set +a +export DB_DIALECT='sqlite' +export AUTH_SECRET=$(openssl rand -base64 32) +node /opt/homarr_db/migrations/$DB_DIALECT/migrate.cjs /opt/homarr_db/migrations/$DB_DIALECT +for dir in $(find /opt/homarr_db/migrations/migrations -mindepth 1 -maxdepth 1 -type d); do + dirname=$(basename "$dir") + mkdir -p "/opt/homarr_db/migrations/$dirname" + cp -r "$dir"/* "/opt/homarr_db/migrations/$dirname/" 2>/dev/null || true +done +export HOSTNAME=$(ip route get 1.1.1.1 | awk '/src/ { print $7 }') +envsubst '${HOSTNAME}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf +nginx -g 'daemon off;' & +redis-server /opt/homarr/redis.conf & +node apps/tasks/tasks.cjs & +node apps/websocket/wssServer.cjs & +node apps/nextjs/server.js & PID=$! +wait $PID +EOF +chmod +x /opt/run_homarr.sh +msg_ok "Created run script" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -rf /opt/v${RELEASE}.zip +msg_ok "Cleaned" From a5f64865a6b04ff83e49cd2debbff27f6144c053 Mon Sep 17 00:00:00 2001 From: "app-header-generator[bot]" <194485257+app-header-generator[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 11:29:04 +0000 Subject: [PATCH 13/67] Update .app files (#420) Co-authored-by: GitHub Actions --- ct/headers/alpine-homarr | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ct/headers/alpine-homarr diff --git a/ct/headers/alpine-homarr b/ct/headers/alpine-homarr new file mode 100644 index 0000000..99bf510 --- /dev/null +++ b/ct/headers/alpine-homarr @@ -0,0 +1,6 @@ + __ + / /_ ____ ____ ___ ____ ___________ + / __ \/ __ \/ __ `__ \/ __ `/ ___/ ___/ + / / / / /_/ / / / / / / /_/ / / / / +/_/ /_/\____/_/ /_/ /_/\__,_/_/ /_/ + From 764a21ef0954856f75287beea6f2c40bccd1d1e3 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 19 May 2025 13:31:38 +0200 Subject: [PATCH 14/67] Update alpine-homarr.sh --- ct/alpine-homarr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/alpine-homarr.sh b/ct/alpine-homarr.sh index 90822b8..fc87c90 100644 --- a/ct/alpine-homarr.sh +++ b/ct/alpine-homarr.sh @@ -5,7 +5,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://homarr.dev/ -APP="homarr" +APP="alpine-homarr" var_tags="${var_tags:-arr;dashboard}" var_cpu="${var_cpu:-2}" var_ram="${var_ram:-4096}" From cd5be58c843c610f2c42c807f4be078bc968d769 Mon Sep 17 00:00:00 2001 From: "app-header-generator[bot]" <194485257+app-header-generator[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 11:32:06 +0000 Subject: [PATCH 15/67] Update .app files (#421) Co-authored-by: GitHub Actions --- ct/headers/alpine-homarr | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ct/headers/alpine-homarr b/ct/headers/alpine-homarr index 99bf510..86ef993 100644 --- a/ct/headers/alpine-homarr +++ b/ct/headers/alpine-homarr @@ -1,6 +1,6 @@ - __ - / /_ ____ ____ ___ ____ ___________ - / __ \/ __ \/ __ `__ \/ __ `/ ___/ ___/ - / / / / /_/ / / / / / / /_/ / / / / -/_/ /_/\____/_/ /_/ /_/\__,_/_/ /_/ - + __ _ __ + ____ _/ /___ (_)___ ___ / /_ ____ ____ ___ ____ ___________ + / __ `/ / __ \/ / __ \/ _ \______/ __ \/ __ \/ __ `__ \/ __ `/ ___/ ___/ +/ /_/ / / /_/ / / / / / __/_____/ / / / /_/ / / / / / / /_/ / / / / +\__,_/_/ .___/_/_/ /_/\___/ /_/ /_/\____/_/ /_/ /_/\__,_/_/ /_/ + /_/ From 8e172e1fd10d16a41bcf30749bbedcf54f3d6370 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 19 May 2025 14:38:26 +0200 Subject: [PATCH 16/67] Create argus-install.sh --- install/argus-install.sh | 99 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 install/argus-install.sh diff --git a/install/argus-install.sh b/install/argus-install.sh new file mode 100644 index 0000000..1b7d35e --- /dev/null +++ b/install/argus-install.sh @@ -0,0 +1,99 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVED/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 \ + jq +msg_ok "Installed Dependencies" + +msg_info "Setup Argus" +RELEASE=$(curl -fsSL https://api.github.com/repos/release-argus/Argus/releases/latest | jq -r .tag_name | sed 's/^v//') +mkdir -p /opt/argus +curl -fsSL "https://github.com/release-argus/Argus/releases/download/${RELEASE}/Argus-${RELEASE}.linux-amd64" -o /opt/argus/Argus +chmod +x /opt/argus/Argus +msg_ok "Setup Argus" + +msg_info "Setup Argus Config" +cat </opt/argus/config.yml +settings: + log: + level: INFO + timestamps: false + data: + database_file: data/argus.db + web: + listen_host: 0.0.0.0 + listen_port: 8080 + route_prefix: / + +defaults: + service: + options: + interval: 30m + semantic_versioning: true + latest_version: + allow_invalid_certs: false + use_prerelease: false + dashboard: + auto_approve: true + webhook: + desired_status_code: 201 + +service: + release-argus/argus: + latest_version: + type: github + url: release-argus/argus + dashboard: + icon: https://raw.githubusercontent.com/release-argus/Argus/master/web/ui/react-app/public/favicon.svg + icon_link_to: https://release-argus.io + web_url: https://github.com/release-argus/Argus/blob/master/CHANGELOG.md + + community-scripts/ProxmoxVE: + latest_version: + type: github + url: community-scripts/ProxmoxVE + use_prerelease: false + dashboard: + icon: https://raw.githubusercontent.com/community-scripts/ProxmoxVE/refs/heads/main/misc/images/logo.png + icon_link_to: https://helper-scripts.com/ + web_url: https://github.com/community-scripts/ProxmoxVE/releases +EOF +echo "${RELEASE}" >/opt/argus_version.txt +msg_ok "Setup Config" + +msg_info "Creating Service" +cat </etc/systemd/system/argus.service +[Unit] +Description=Argus +After=network.target +[Service] +Type=simple +WorkingDirectory=/opt/argus +ExecStart=/opt/argus/Argus +Restart=on-failure +RestartSec=5 +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now argus +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" From dd97a162ee9d3a98c1ce87bb644229f89baade37 Mon Sep 17 00:00:00 2001 From: "app-header-generator[bot]" <194485257+app-header-generator[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 12:39:56 +0000 Subject: [PATCH 17/67] Update versions.json (#423) Co-authored-by: GitHub Actions[bot] --- frontend/public/json/versions.json | 85 ++++++++++++++---------------- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/frontend/public/json/versions.json b/frontend/public/json/versions.json index dcdddf2..2739d3a 100644 --- a/frontend/public/json/versions.json +++ b/frontend/public/json/versions.json @@ -1,9 +1,44 @@ [ + { + "name": "Graylog2/graylog2-server", + "version": "6.3.0-beta.1", + "date": "2025-05-19T11:23:27Z" + }, + { + "name": "Checkmk/checkmk", + "version": "v2.4.0p2-rc1", + "date": "2025-05-19T06:47:49Z" + }, + { + "name": "documenso/documenso", + "version": "v1.11.0", + "date": "2025-05-19T06:21:18Z" + }, + { + "name": "Jackett/Jackett", + "version": "v0.22.1921", + "date": "2025-05-19T05:54:21Z" + }, + { + "name": "esphome/esphome", + "version": "2025.4.2", + "date": "2025-05-11T22:18:43Z" + }, + { + "name": "firefly-iii/firefly-iii", + "version": "v6.2.12", + "date": "2025-04-20T19:22:17Z" + }, { "name": "MediaBrowser/Emby.Releases", "version": "4.8.11.0", "date": "2025-03-10T06:39:11Z" }, + { + "name": "open-webui/open-webui", + "version": "v0.6.10", + "date": "2025-05-19T01:34:37Z" + }, { "name": "Part-DB/Part-DB-server", "version": "v1.17.1", @@ -36,8 +71,8 @@ }, { "name": "runtipi/runtipi", - "version": "nightly", - "date": "2025-05-18T13:00:01Z" + "version": "v4.1.1", + "date": "2025-05-16T17:37:30Z" }, { "name": "hansmi/prometheus-paperless-exporter", @@ -49,15 +84,10 @@ "version": "v1.35.1.5034", "date": "2025-04-30T11:02:36Z" }, - { - "name": "Jackett/Jackett", - "version": "v0.22.1917", - "date": "2025-05-18T05:59:41Z" - }, { "name": "theonedev/onedev", "version": "v11.9.8", - "date": "2025-05-17T13:13:22Z" + "date": "2025-05-18T01:27:37Z" }, { "name": "inventree/InvenTree", @@ -204,11 +234,6 @@ "version": "v1.6.1", "date": "2025-03-15T17:29:17Z" }, - { - "name": "Checkmk/checkmk", - "version": "v2.4.0p1", - "date": "2025-05-15T12:41:12Z" - }, { "name": "zwave-js/zwave-js-ui", "version": "v10.5.1", @@ -226,8 +251,8 @@ }, { "name": "ollama/ollama", - "version": "v0.7.0", - "date": "2025-05-14T23:42:30Z" + "version": "v0.7.0-rc1", + "date": "2025-05-14T03:58:02Z" }, { "name": "glanceapp/glance", @@ -244,11 +269,6 @@ "version": "3.0.2", "date": "2025-05-14T20:38:06Z" }, - { - "name": "esphome/esphome", - "version": "2025.4.2", - "date": "2025-05-11T22:18:43Z" - }, { "name": "Athou/commafeed", "version": "5.9.0", @@ -269,11 +289,6 @@ "version": "0.42.1", "date": "2020-06-07T07:27:04Z" }, - { - "name": "firefly-iii/firefly-iii", - "version": "v6.2.12", - "date": "2025-04-20T19:22:17Z" - }, { "name": "jenkinsci/jenkins", "version": "jenkins-2.510", @@ -324,11 +339,6 @@ "version": "7.2.7rc1", "date": "2025-05-13T11:55:32Z" }, - { - "name": "Graylog2/graylog2-server", - "version": "6.3.0-alpha.4", - "date": "2025-05-13T11:18:29Z" - }, { "name": "zitadel/zitadel", "version": "v2.65.9", @@ -404,11 +414,6 @@ "version": "v0.2.3", "date": "2025-05-10T21:14:45Z" }, - { - "name": "open-webui/open-webui", - "version": "v0.6.9", - "date": "2025-05-10T19:05:02Z" - }, { "name": "Stirling-Tools/Stirling-PDF", "version": "v0.46.1", @@ -458,15 +463,5 @@ "name": "donaldzou/WGDashboard", "version": "v4.2.3", "date": "2025-05-07T15:35:04Z" - }, - { - "name": "stonith404/pingvin-share", - "version": "v1.12.0", - "date": "2025-05-07T14:12:11Z" - }, - { - "name": "Brandawg93/PeaNUT", - "version": "v5.7.5", - "date": "2025-05-07T14:01:45Z" } ] From 6e9e4fdcbaffb82b1e0c4542710cbd4cfad130e5 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 19 May 2025 14:43:19 +0200 Subject: [PATCH 18/67] Argus --- ct/argus.sh | 52 ++++++++++++++++++++++++++++++++++++++++ install/argus-install.sh | 1 + 2 files changed, 53 insertions(+) create mode 100644 ct/argus.sh diff --git a/ct/argus.sh b/ct/argus.sh new file mode 100644 index 0000000..b7032fe --- /dev/null +++ b/ct/argus.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://release-argus.io/ + +APP="Argus" +var_tags="${var_tags:-os}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-512}" +var_disk="${var_disk:-3}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -d /opt/argus ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + RELEASE=$(curl -fsSL https://api.github.com/repos/release-argus/Argus/releases/latest | jq -r .tag_name | sed 's/^v//') + if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then + msg_info "Updating $APP to ${RELEASE}" + curl -fsSL "https://github.com/release-argus/Argus/releases/download/${RELEASE}/Argus-${RELEASE}.linux-amd64" -o /opt/argus/Argus + chmod +x /opt/argus/Argus + systemctl restart argus + echo "${RELEASE}" >/opt/${APP}_version.txt + msg_ok "Updated $APP to ${RELEASE}" + else + msg_ok "$APP is already up to date (${RELEASE})" + fi +} + +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}:8080${CL}" diff --git a/install/argus-install.sh b/install/argus-install.sh index 1b7d35e..b196b93 100644 --- a/install/argus-install.sh +++ b/install/argus-install.sh @@ -3,6 +3,7 @@ # Copyright (c) 2021-2025 community-scripts ORG # Author: MickLesk (CanbiZ) # License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://release-argus.io/ source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" color From fa09116826dd4a4590664d2db6987ebdb1df8acd Mon Sep 17 00:00:00 2001 From: "app-header-generator[bot]" <194485257+app-header-generator[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 12:43:41 +0000 Subject: [PATCH 19/67] Update .app files (#424) Co-authored-by: GitHub Actions --- ct/headers/argus | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ct/headers/argus diff --git a/ct/headers/argus b/ct/headers/argus new file mode 100644 index 0000000..47434a3 --- /dev/null +++ b/ct/headers/argus @@ -0,0 +1,6 @@ + ___ + / | _________ ___ _______ + / /| | / ___/ __ `/ / / / ___/ + / ___ |/ / / /_/ / /_/ (__ ) +/_/ |_/_/ \__, /\__,_/____/ + /____/ From 9d3dea7950e0af0974bd959bc8fde77189fba168 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 19 May 2025 14:45:16 +0200 Subject: [PATCH 20/67] Create argus.json --- frontend/public/json/argus.json | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 frontend/public/json/argus.json diff --git a/frontend/public/json/argus.json b/frontend/public/json/argus.json new file mode 100644 index 0000000..cba2a3c --- /dev/null +++ b/frontend/public/json/argus.json @@ -0,0 +1,35 @@ +{ + "name": "Argus", + "slug": "argus", + "categories": [ + 11 + ], + "date_created": "2025-05-19", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 3000, + "documentation": "https://release-argus.io/docs/overview/", + "website": "https://release-argus.io/", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/argus.webp", + "config_path": "/opt/argus/config.yml", + "description": "Argus will query websites at a user defined interval for new software releases and then trigger Gotify/Slack/Other notification(s) and/or WebHook(s) when one has been found. For example, you could set it to monitor the Argus repo (release-argus/argus). This will query the GitHub API and track the "tag_name" variable. When this variable changes from what it was on a previous query, a GitHub-style WebHook could be sent that triggers something (like AWX) to update Argus on your server.", + "install_methods": [ + { + "type": "default", + "script": "ct/argus.sh", + "resources": { + "cpu": 1, + "ram": 256, + "hdd": 3, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} From 21bd9618c0188bc7a80a6c0c4d8b51c15aa5ee19 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 19 May 2025 14:47:49 +0200 Subject: [PATCH 21/67] Update argus.json --- frontend/public/json/argus.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/public/json/argus.json b/frontend/public/json/argus.json index cba2a3c..c1368ff 100644 --- a/frontend/public/json/argus.json +++ b/frontend/public/json/argus.json @@ -13,7 +13,7 @@ "website": "https://release-argus.io/", "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/argus.webp", "config_path": "/opt/argus/config.yml", - "description": "Argus will query websites at a user defined interval for new software releases and then trigger Gotify/Slack/Other notification(s) and/or WebHook(s) when one has been found. For example, you could set it to monitor the Argus repo (release-argus/argus). This will query the GitHub API and track the "tag_name" variable. When this variable changes from what it was on a previous query, a GitHub-style WebHook could be sent that triggers something (like AWX) to update Argus on your server.", + "description": "Argus will query websites at a user defined interval for new software releases and then trigger Gotify/Slack/Other notification(s) and/or WebHook(s) when one has been found. For example, you could set it to monitor the Argus repo (release-argus/argus). This will query the GitHub API and track the tag_name variable. When this variable changes from what it was on a previous query, a GitHub-style WebHook could be sent that triggers something (like AWX) to update Argus on your server.", "install_methods": [ { "type": "default", From 2da7eaa41a1ff5d57bad95b870932d24f88b2aa5 Mon Sep 17 00:00:00 2001 From: tremor021 Date: Mon, 19 May 2025 22:36:09 +0200 Subject: [PATCH 22/67] test --- ct/openwebui.sh | 71 ++++++++++++++++++++++++++ install/openwebui-install.sh | 99 ++++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+) create mode 100644 ct/openwebui.sh create mode 100644 install/openwebui-install.sh diff --git a/ct/openwebui.sh b/ct/openwebui.sh new file mode 100644 index 0000000..94ddfbe --- /dev/null +++ b/ct/openwebui.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 tteck +# Author: havardthom +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://openwebui.com/ + +APP="Open WebUI" +var_tags="${var_tags:-ai;interface}" +var_cpu="${var_cpu:-4}" +var_ram="${var_ram:-8192}" +var_disk="${var_disk:-25}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/open-webui ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if [ -x "/usr/bin/ollama" ]; then + msg_info "Updating Ollama" + OLLAMA_VERSION=$(ollama -v | awk '{print $NF}') + RELEASE=$(curl -s https://api.github.com/repos/ollama/ollama/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') + if [ "$OLLAMA_VERSION" != "$RELEASE" ]; then + curl -fsSLO https://ollama.com/download/ollama-linux-amd64.tgz + tar -C /usr -xzf ollama-linux-amd64.tgz + rm -rf ollama-linux-amd64.tgz + msg_ok "Ollama updated to version $RELEASE" + else + msg_ok "Ollama is already up to date." + fi + fi + + msg_info "Updating ${APP} (Patience)" + systemctl stop open-webui.service + mkdir -p /opt/open-webui-backup + cp -rf /opt/open-webui/backend/data /opt/open-webui-backup + cp /opt/open-webui/.env /opt + rm -rf /opt/open-webui + fetch_and_deploy_gh_release "open-webui/open-webui" + cd /opt/open-webui + $STD npm install + export NODE_OPTIONS="--max-old-space-size=3584" + $STD npm run build + cd ./backend + $STD pip install -r requirements.txt -U + cp -rf /opt/open-webui-backup/* /opt/open-webui/backend + systemctl start open-webui.service + 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}:8080${CL}" diff --git a/install/openwebui-install.sh b/install/openwebui-install.sh new file mode 100644 index 0000000..9390b5a --- /dev/null +++ b/install/openwebui-install.sh @@ -0,0 +1,99 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 tteck +# Author: tteck +# Co-Author: havardthom +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://openwebui.com/ + +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 \ + git \ + ffmpeg +msg_ok "Installed Dependencies" + +msg_info "Setup Python3" +$STD apt-get install -y --no-install-recommends \ + python3 \ + python3-pip +msg_ok "Setup Python3" + +install_node_and_modules + +msg_info "Installing Open WebUI (Patience)" +fetch_and_deploy_gh_release "open-webui/open-webui" +cd /opt/open-webui/backend +$STD pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu +$STD pip3 install -r requirements.txt -U +cd /opt/open-webui +cp .env.example .env +cat </opt/open-webui/.env +ENV=prod +ENABLE_OLLAMA_API=false +OLLAMA_BASE_URL=http://0.0.0.0:11434 +EOF +$STD npm install +export NODE_OPTIONS="--max-old-space-size=3584" +$STD npm run build +msg_ok "Installed Open WebUI" + +read -r -p "${TAB3}Would you like to add Ollama? " prompt +if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then + msg_info "Installing Ollama" + curl -fsSLO https://ollama.com/download/ollama-linux-amd64.tgz + tar -C /usr -xzf ollama-linux-amd64.tgz + rm -rf ollama-linux-amd64.tgz + cat </etc/systemd/system/ollama.service +[Unit] +Description=Ollama Service +After=network-online.target + +[Service] +Type=exec +ExecStart=/usr/bin/ollama serve +Environment=HOME=$HOME +Environment=OLLAMA_HOST=0.0.0.0 +Restart=always +RestartSec=3 + +[Install] +WantedBy=multi-user.target +EOF + systemctl enable -q --now ollama + sed -i 's/ENABLE_OLLAMA_API=false/ENABLE_OLLAMA_API=true/g' /opt/open-webui/.env + msg_ok "Installed Ollama" +fi + +msg_info "Creating Service" +cat </etc/systemd/system/open-webui.service +[Unit] +Description=Open WebUI Service +After=network.target + +[Service] +Type=exec +WorkingDirectory=/opt/open-webui +EnvironmentFile=/opt/open-webui/.env +ExecStart=/opt/open-webui/backend/start.sh + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now open-webui +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" From cc51e7d9c9fd4548791585c53084f39a5bdeab63 Mon Sep 17 00:00:00 2001 From: "app-header-generator[bot]" <194485257+app-header-generator[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 20:36:43 +0000 Subject: [PATCH 23/67] Update .app files (#425) Co-authored-by: GitHub Actions --- ct/headers/openwebui | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ct/headers/openwebui diff --git a/ct/headers/openwebui b/ct/headers/openwebui new file mode 100644 index 0000000..0097a27 --- /dev/null +++ b/ct/headers/openwebui @@ -0,0 +1,6 @@ + ____ _ __ __ __ ______ + / __ \____ ___ ____ | | / /__ / /_ / / / / _/ + / / / / __ \/ _ \/ __ \ | | /| / / _ \/ __ \/ / / // / +/ /_/ / /_/ / __/ / / / | |/ |/ / __/ /_/ / /_/ // / +\____/ .___/\___/_/ /_/ |__/|__/\___/_.___/\____/___/ + /_/ From e59cc562537beb36d27b5aee74df5dbf1938112c Mon Sep 17 00:00:00 2001 From: tremor021 Date: Mon, 19 May 2025 22:48:46 +0200 Subject: [PATCH 24/67] Update oweb --- ct/openwebui.sh | 13 +++++++------ install/openwebui-install.sh | 14 +++++++------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/ct/openwebui.sh b/ct/openwebui.sh index 94ddfbe..71b4431 100644 --- a/ct/openwebui.sh +++ b/ct/openwebui.sh @@ -44,18 +44,19 @@ function update_script() { msg_info "Updating ${APP} (Patience)" systemctl stop open-webui.service - mkdir -p /opt/open-webui-backup - cp -rf /opt/open-webui/backend/data /opt/open-webui-backup - cp /opt/open-webui/.env /opt - rm -rf /opt/open-webui + mkdir -p /opt/openwebui-backup + cp -rf /opt/openwebui/backend/data /opt/openwebui-backup + cp /opt/openwebui/.env /opt + rm -rf /opt/openwebui fetch_and_deploy_gh_release "open-webui/open-webui" - cd /opt/open-webui + cd /opt/openwebui $STD npm install export NODE_OPTIONS="--max-old-space-size=3584" $STD npm run build cd ./backend $STD pip install -r requirements.txt -U - cp -rf /opt/open-webui-backup/* /opt/open-webui/backend + cp -rf /opt/openwebui-backup/* /opt/openwebui/backend + mv /opt/.env /opt/openwebui/ systemctl start open-webui.service msg_ok "Updated Successfully" exit diff --git a/install/openwebui-install.sh b/install/openwebui-install.sh index 9390b5a..5afeee0 100644 --- a/install/openwebui-install.sh +++ b/install/openwebui-install.sh @@ -30,12 +30,12 @@ install_node_and_modules msg_info "Installing Open WebUI (Patience)" fetch_and_deploy_gh_release "open-webui/open-webui" -cd /opt/open-webui/backend +cd /opt/openwebui/backend $STD pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu $STD pip3 install -r requirements.txt -U -cd /opt/open-webui +cd /opt/openwebui cp .env.example .env -cat </opt/open-webui/.env +cat </opt/openwebui/.env ENV=prod ENABLE_OLLAMA_API=false OLLAMA_BASE_URL=http://0.0.0.0:11434 @@ -68,7 +68,7 @@ RestartSec=3 WantedBy=multi-user.target EOF systemctl enable -q --now ollama - sed -i 's/ENABLE_OLLAMA_API=false/ENABLE_OLLAMA_API=true/g' /opt/open-webui/.env + sed -i 's/ENABLE_OLLAMA_API=false/ENABLE_OLLAMA_API=true/g' /opt/openwebui/.env msg_ok "Installed Ollama" fi @@ -80,9 +80,9 @@ After=network.target [Service] Type=exec -WorkingDirectory=/opt/open-webui -EnvironmentFile=/opt/open-webui/.env -ExecStart=/opt/open-webui/backend/start.sh +WorkingDirectory=/opt/openwebui +EnvironmentFile=/opt/openwebui/.env +ExecStart=/opt/openwebui/backend/start.sh [Install] WantedBy=multi-user.target From b8e8a5048b15584eb2c36e98e8e2f613d9052a43 Mon Sep 17 00:00:00 2001 From: tremor021 Date: Mon, 19 May 2025 23:23:05 +0200 Subject: [PATCH 25/67] Update oweb --- install/openwebui-install.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/install/openwebui-install.sh b/install/openwebui-install.sh index 5afeee0..b597a7f 100644 --- a/install/openwebui-install.sh +++ b/install/openwebui-install.sh @@ -34,8 +34,20 @@ cd /opt/openwebui/backend $STD pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu $STD pip3 install -r requirements.txt -U cd /opt/openwebui -cp .env.example .env cat </opt/openwebui/.env +# Ollama URL for the backend to connect +# The path '/ollama' will be redirected to the specified backend URL +OLLAMA_BASE_URL='http://localhost:11434' + +OPENAI_API_BASE_URL='' +OPENAI_API_KEY='' + +# AUTOMATIC1111_BASE_URL="http://localhost:7860" + +# DO NOT TRACK +SCARF_NO_ANALYTICS=true +DO_NOT_TRACK=true +ANONYMIZED_TELEMETRY=false ENV=prod ENABLE_OLLAMA_API=false OLLAMA_BASE_URL=http://0.0.0.0:11434 From 1f98e049d24666d29f36caaaef304914c3395e12 Mon Sep 17 00:00:00 2001 From: "app-header-generator[bot]" <194485257+app-header-generator[bot]@users.noreply.github.com> Date: Tue, 20 May 2025 01:37:01 +0000 Subject: [PATCH 26/67] Update versions.json (#426) Co-authored-by: GitHub Actions[bot] --- frontend/public/json/versions.json | 124 ++++++++++++++--------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/frontend/public/json/versions.json b/frontend/public/json/versions.json index 2739d3a..dfd7608 100644 --- a/frontend/public/json/versions.json +++ b/frontend/public/json/versions.json @@ -1,14 +1,69 @@ [ + { + "name": "crafty-controller/crafty-4", + "version": "v4.4.9", + "date": "2025-05-20T00:08:29Z" + }, + { + "name": "HabitRPG/habitica", + "version": "v5.36.4", + "date": "2025-05-19T22:28:11Z" + }, + { + "name": "apache/cassandra", + "version": "cassandra-4.1.9", + "date": "2025-05-19T21:37:07Z" + }, + { + "name": "paperless-ngx/paperless-ngx", + "version": "v2.16.1", + "date": "2025-05-19T21:26:44Z" + }, + { + "name": "glanceapp/glance", + "version": "v0.8.3", + "date": "2025-05-19T20:45:10Z" + }, + { + "name": "bunkerity/bunkerweb", + "version": "testing", + "date": "2025-05-15T12:54:33Z" + }, + { + "name": "Forceu/Gokapi", + "version": "v1.9.6", + "date": "2024-12-18T14:35:37Z" + }, + { + "name": "Checkmk/checkmk", + "version": "v2.4.0p2", + "date": "2025-05-19T17:06:15Z" + }, + { + "name": "firefly-iii/firefly-iii", + "version": "v6.2.12", + "date": "2025-04-20T19:22:17Z" + }, + { + "name": "esphome/esphome", + "version": "2025.4.2", + "date": "2025-05-11T22:18:43Z" + }, + { + "name": "n8n-io/n8n", + "version": "n8n@1.91.3", + "date": "2025-05-08T12:25:10Z" + }, + { + "name": "docker/compose", + "version": "v2.36.1", + "date": "2025-05-19T12:26:41Z" + }, { "name": "Graylog2/graylog2-server", "version": "6.3.0-beta.1", "date": "2025-05-19T11:23:27Z" }, - { - "name": "Checkmk/checkmk", - "version": "v2.4.0p2-rc1", - "date": "2025-05-19T06:47:49Z" - }, { "name": "documenso/documenso", "version": "v1.11.0", @@ -19,16 +74,6 @@ "version": "v0.22.1921", "date": "2025-05-19T05:54:21Z" }, - { - "name": "esphome/esphome", - "version": "2025.4.2", - "date": "2025-05-11T22:18:43Z" - }, - { - "name": "firefly-iii/firefly-iii", - "version": "v6.2.12", - "date": "2025-04-20T19:22:17Z" - }, { "name": "MediaBrowser/Emby.Releases", "version": "4.8.11.0", @@ -71,8 +116,8 @@ }, { "name": "runtipi/runtipi", - "version": "v4.1.1", - "date": "2025-05-16T17:37:30Z" + "version": "nightly", + "date": "2025-05-18T13:00:01Z" }, { "name": "hansmi/prometheus-paperless-exporter", @@ -94,11 +139,6 @@ "version": "0.17.12", "date": "2025-05-17T19:16:00Z" }, - { - "name": "crafty-controller/crafty-4", - "version": "v4.4.8", - "date": "2025-05-17T18:47:36Z" - }, { "name": "Radarr/Radarr", "version": "v5.23.3.9987", @@ -214,11 +254,6 @@ "version": "2025.5.0", "date": "2025-05-15T17:09:50Z" }, - { - "name": "apache/cassandra", - "version": "4.1.9-tentative", - "date": "2025-05-15T15:52:53Z" - }, { "name": "VictoriaMetrics/VictoriaMetrics", "version": "pmm-6401-v1.117.1", @@ -229,11 +264,6 @@ "version": "v3.1.1", "date": "2025-05-15T15:17:57Z" }, - { - "name": "bunkerity/bunkerweb", - "version": "v1.6.1", - "date": "2025-03-15T17:29:17Z" - }, { "name": "zwave-js/zwave-js-ui", "version": "v10.5.1", @@ -254,11 +284,6 @@ "version": "v0.7.0-rc1", "date": "2025-05-14T03:58:02Z" }, - { - "name": "glanceapp/glance", - "version": "v0.8.2", - "date": "2025-05-14T21:34:41Z" - }, { "name": "Ombi-app/Ombi", "version": "v4.47.1", @@ -369,11 +394,6 @@ "version": "v0.24.3", "date": "2025-05-12T15:23:21Z" }, - { - "name": "n8n-io/n8n", - "version": "n8n@1.91.3", - "date": "2025-05-08T12:25:10Z" - }, { "name": "apache/tika", "version": "3.2.0-rc1", @@ -443,25 +463,5 @@ "name": "apache/tomcat", "version": "10.1.41", "date": "2025-05-08T12:45:44Z" - }, - { - "name": "semaphoreui/semaphore", - "version": "v2.14.10", - "date": "2025-05-07T20:23:29Z" - }, - { - "name": "readeck/readeck", - "version": "0.18.2", - "date": "2025-05-07T19:22:22Z" - }, - { - "name": "HabitRPG/habitica", - "version": "v5.36.3", - "date": "2025-05-07T17:22:07Z" - }, - { - "name": "donaldzou/WGDashboard", - "version": "v4.2.3", - "date": "2025-05-07T15:35:04Z" } ] From 10b980fb86c12fb1237fa7759bc444e18d2fd72f Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 08:52:48 +0200 Subject: [PATCH 27/67] trap handler --- misc/core.func | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/misc/core.func b/misc/core.func index fb5937c..5cb594e 100644 --- a/misc/core.func +++ b/misc/core.func @@ -30,6 +30,7 @@ _CORE_FUNC_LOADED=1 load_functions() { [[ -n "${__FUNCTIONS_LOADED:-}" ]] && return __FUNCTIONS_LOADED=1 + setup_trap_abort_handling color formatting icons @@ -39,6 +40,67 @@ load_functions() { # add more } +setup_trap_abort_handling() { + trap '__handle_signal_abort SIGINT' SIGINT + trap '__handle_signal_abort SIGTERM' SIGTERM + trap '__handle_unexpected_error $?' ERR +} + +__handle_signal_abort() { + local signal="$1" + echo + [ -n "${SPINNER_PID:-}" ] && kill "$SPINNER_PID" 2>/dev/null && wait "$SPINNER_PID" 2>/dev/null + + case "$signal" in + SIGINT) + msg_error "Script aborted by user (CTRL+C)" + exit 130 + ;; + SIGTERM) + msg_error "Script terminated (SIGTERM)" + exit 143 + ;; + *) + msg_error "Script interrupted (unknown signal: $signal)" + exit 1 + ;; + esac +} + +__handle_unexpected_error() { + local exit_code="$1" + echo + [ -n "${SPINNER_PID:-}" ] && kill "$SPINNER_PID" 2>/dev/null && wait "$SPINNER_PID" 2>/dev/null + + case "$exit_code" in + 1) + msg_error "Generic error occurred (exit code 1)" + ;; + 2) + msg_error "Misuse of shell builtins (exit code 2)" + ;; + 126) + msg_error "Command invoked cannot execute (exit code 126)" + ;; + 127) + msg_error "Command not found (exit code 127)" + ;; + 128) + msg_error "Invalid exit argument (exit code 128)" + ;; + 130) + msg_error "Script aborted by user (CTRL+C)" + ;; + 143) + msg_error "Script terminated by SIGTERM" + ;; + *) + msg_error "Unexpected error occurred (exit code $exit_code)" + ;; + esac + exit "$exit_code" +} + # ------------------------------------------------------------------------------ # Sets ANSI color codes used for styled terminal output. # ------------------------------------------------------------------------------ From e1edebd91c5dab2839f56a65341f950b151d80e2 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 09:02:25 +0200 Subject: [PATCH 28/67] Update build.func --- misc/build.func | 54 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/misc/build.func b/misc/build.func index 5842081..5f2f82e 100644 --- a/misc/build.func +++ b/misc/build.func @@ -46,8 +46,8 @@ error_handler() { if [[ -n "$CT_ID" ]]; then read -p "Remove this Container? " prompt if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then - pct stop "$CT_ID" &> /dev/null - pct destroy "$CT_ID" &> /dev/null + pct stop "$CT_ID" &>/dev/null + pct destroy "$CT_ID" &>/dev/null msg_ok "Removed this Container" fi fi @@ -327,8 +327,8 @@ EOF else echo -e "${INFO}${BOLD}${RD}Configuration file already exists at ${FILEPATH}${CL}" if whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --defaultno --title "Overwrite configfile" --yesno "Do you want to overwrite the existing config file?" 10 60; then - rm -f "$FILEPATH" - cat <"$FILEPATH" + rm -f "$FILEPATH" + cat <"$FILEPATH" # ${NSAPP} Configuration File # Generated on $(date) @@ -498,7 +498,6 @@ advanced_settings() { exit_script fi - IFACE_FILEPATH_LIST="/etc/network/interfaces"$'\n'$(find "/etc/network/interfaces.d/" -type f) BRIDGES="" OLD_IFS=$IFS @@ -506,21 +505,21 @@ advanced_settings() { for iface_filepath in ${IFACE_FILEPATH_LIST}; do iface_indexes_tmpfile=$(mktemp -q -u '.iface-XXXX') - ( grep -Pn '^\s*iface' "${iface_filepath}" | cut -d':' -f1 && wc -l "${iface_filepath}" | cut -d' ' -f1 ) | awk 'FNR==1 {line=$0; next} {print line":"$0-1; line=$0}' > "${iface_indexes_tmpfile}" || true + (grep -Pn '^\s*iface' "${iface_filepath}" | cut -d':' -f1 && wc -l "${iface_filepath}" | cut -d' ' -f1) | awk 'FNR==1 {line=$0; next} {print line":"$0-1; line=$0}' >"${iface_indexes_tmpfile}" || true if [ -f "${iface_indexes_tmpfile}" ]; then - while read -r pair; do - start=$(echo "${pair}" | cut -d':' -f1) - end=$(echo "${pair}" | cut -d':' -f2) + while read -r pair; do + start=$(echo "${pair}" | cut -d':' -f1) + end=$(echo "${pair}" | cut -d':' -f2) - if awk "NR >= ${start} && NR <= ${end}" "${iface_filepath}" | grep -qP '^\s*(bridge[-_](ports|stp|fd|vlan-aware|vids)|ovs_type\s+OVSBridge)\b'; then - iface_name=$(sed "${start}q;d" "${iface_filepath}" | awk '{print $2}') - BRIDGES="${iface_name}"$'\n'"${BRIDGES}" - fi + if awk "NR >= ${start} && NR <= ${end}" "${iface_filepath}" | grep -qP '^\s*(bridge[-_](ports|stp|fd|vlan-aware|vids)|ovs_type\s+OVSBridge)\b'; then + iface_name=$(sed "${start}q;d" "${iface_filepath}" | awk '{print $2}') + BRIDGES="${iface_name}"$'\n'"${BRIDGES}" + fi - done < "${iface_indexes_tmpfile}" - rm -f "${iface_indexes_tmpfile}" + done <"${iface_indexes_tmpfile}" + rm -f "${iface_indexes_tmpfile}" fi done @@ -779,7 +778,6 @@ EOF } - install_script() { pve_check shell_check @@ -1077,7 +1075,27 @@ EOF' pct exec "$CTID" -- bash -c "apt-get update >/dev/null && apt-get install -y sudo curl mc gnupg2 >/dev/null" fi msg_ok "Customized LXC Container" - lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/install/$var_install.sh)" $? + + # Remote-Skript innerhalb des Containers mit Trap sauber ausführen + lxc-attach -n "$CTID" -- bash -c ' + set -e + trap "echo Aborted in container; exit 130" SIGINT SIGTERM + + tmp_script="/tmp/install_remote.sh" + curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/install/'"$var_install"'.sh -o "$tmp_script" + chmod +x "$tmp_script" + bash "$tmp_script" +' + exit_code=$? + if [[ "$exit_code" -eq 130 || "$exit_code" -eq 143 ]]; then + echo + msg_error "Script aborted by user inside container" + exit "$exit_code" + elif [[ "$exit_code" -ne 0 ]]; then + echo + msg_error "Install script failed in container (exit code $exit_code)" + exit "$exit_code" + fi } @@ -1124,8 +1142,6 @@ EOF systemctl start ping-instances.service fi - - post_update_to_api "done" "none" } From b26c43870728e0d853e282b40e6eebf09427e46f Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 09:11:42 +0200 Subject: [PATCH 29/67] Update build.func --- misc/build.func | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/build.func b/misc/build.func index 5f2f82e..6c676cb 100644 --- a/misc/build.func +++ b/misc/build.func @@ -1077,15 +1077,16 @@ EOF' msg_ok "Customized LXC Container" # Remote-Skript innerhalb des Containers mit Trap sauber ausführen - lxc-attach -n "$CTID" -- bash -c ' + lxc-attach -n "$CTID" -- env var_install="$var_install" bash -c ' set -e trap "echo Aborted in container; exit 130" SIGINT SIGTERM tmp_script="/tmp/install_remote.sh" - curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/install/'"$var_install"'.sh -o "$tmp_script" + curl -fsSL "https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/install/${var_install}.sh" -o "$tmp_script" chmod +x "$tmp_script" bash "$tmp_script" ' + exit_code=$? if [[ "$exit_code" -eq 130 || "$exit_code" -eq 143 ]]; then echo From cd808970cc7d48a9be8a56d657f2be284abecfe6 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 09:14:07 +0200 Subject: [PATCH 30/67] Update build.func --- misc/build.func | 1 - 1 file changed, 1 deletion(-) diff --git a/misc/build.func b/misc/build.func index 6c676cb..b14b1a8 100644 --- a/misc/build.func +++ b/misc/build.func @@ -1097,7 +1097,6 @@ EOF' msg_error "Install script failed in container (exit code $exit_code)" exit "$exit_code" fi - } # This function sets the description of the container. From 8428c9a449fac18b3e6213eec1e416ff7d0f97cf Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 09:16:53 +0200 Subject: [PATCH 31/67] test --- misc/build.func | 2 ++ misc/core.func | 1 - misc/install.func | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/build.func b/misc/build.func index b14b1a8..44be138 100644 --- a/misc/build.func +++ b/misc/build.func @@ -19,10 +19,12 @@ source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxV if command -v curl >/dev/null 2>&1; then source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) load_functions + setup_trap_abort_handling #echo "(build.func) Loaded core.func via curl" elif command -v wget >/dev/null 2>&1; then source <(wget -qO- https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) load_functions + setup_trap_abort_handling #echo "(build.func) Loaded core.func via wget" fi diff --git a/misc/core.func b/misc/core.func index 5cb594e..4972b79 100644 --- a/misc/core.func +++ b/misc/core.func @@ -30,7 +30,6 @@ _CORE_FUNC_LOADED=1 load_functions() { [[ -n "${__FUNCTIONS_LOADED:-}" ]] && return __FUNCTIONS_LOADED=1 - setup_trap_abort_handling color formatting icons diff --git a/misc/install.func b/misc/install.func index 0f23430..f481558 100644 --- a/misc/install.func +++ b/misc/install.func @@ -12,6 +12,7 @@ if ! command -v curl >/dev/null 2>&1; then fi source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) load_functions +setup_trap_abort_handling # # Function to set STD mode based on verbosity # set_std_mode() { From 0e626b50280999d61c13e0329167fca4ec512bf0 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 09:19:14 +0200 Subject: [PATCH 32/67] reverted --- misc/build.func | 24 +----------------------- misc/install.func | 1 - 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/misc/build.func b/misc/build.func index 44be138..d8b0ee0 100644 --- a/misc/build.func +++ b/misc/build.func @@ -19,12 +19,10 @@ source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxV if command -v curl >/dev/null 2>&1; then source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) load_functions - setup_trap_abort_handling #echo "(build.func) Loaded core.func via curl" elif command -v wget >/dev/null 2>&1; then source <(wget -qO- https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) load_functions - setup_trap_abort_handling #echo "(build.func) Loaded core.func via wget" fi @@ -1077,28 +1075,8 @@ EOF' pct exec "$CTID" -- bash -c "apt-get update >/dev/null && apt-get install -y sudo curl mc gnupg2 >/dev/null" fi msg_ok "Customized LXC Container" + lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/install/$var_install.sh)" $? - # Remote-Skript innerhalb des Containers mit Trap sauber ausführen - lxc-attach -n "$CTID" -- env var_install="$var_install" bash -c ' - set -e - trap "echo Aborted in container; exit 130" SIGINT SIGTERM - - tmp_script="/tmp/install_remote.sh" - curl -fsSL "https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/install/${var_install}.sh" -o "$tmp_script" - chmod +x "$tmp_script" - bash "$tmp_script" -' - - exit_code=$? - if [[ "$exit_code" -eq 130 || "$exit_code" -eq 143 ]]; then - echo - msg_error "Script aborted by user inside container" - exit "$exit_code" - elif [[ "$exit_code" -ne 0 ]]; then - echo - msg_error "Install script failed in container (exit code $exit_code)" - exit "$exit_code" - fi } # This function sets the description of the container. diff --git a/misc/install.func b/misc/install.func index f481558..0f23430 100644 --- a/misc/install.func +++ b/misc/install.func @@ -12,7 +12,6 @@ if ! command -v curl >/dev/null 2>&1; then fi source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) load_functions -setup_trap_abort_handling # # Function to set STD mode based on verbosity # set_std_mode() { From 5f8f57023f98087cff1dd2f5340daf733b5277b0 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:21:56 +0200 Subject: [PATCH 33/67] Config File --- misc/config-file.func | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/misc/config-file.func b/misc/config-file.func index 2f4fe16..54e10fe 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -333,13 +333,8 @@ config_file() { else if [[ -n "${APT_CACHER_IP-}" ]]; then if [[ ! $APT_CACHER_IP == "none" ]]; then - if [[ "$APT_CACHER_IP" =~ $ip_regex ]]; then APT_CACHER="yes" echo -e "${NETWORK}${BOLD}${DGN}APT-CACHER IP Address: ${BGN}$APT_CACHER_IP${CL}" - else - msg_error "Invalid IP Address format for APT-Cacher. Needs to be 0.0.0.0, was ${APT_CACHER_IP}" - exit - fi else APT_CACHER="" echo -e "${NETWORK}${BOLD}${DGN}APT-Cacher IP Address: ${BGN}No${CL}" @@ -497,7 +492,11 @@ config_file() { fi if [[ -n "${TAGS-}" ]]; then - echo -e "${NETWORK}${BOLD}${DGN}Tags: ${BGN}$TAGS${CL}" + if [[ "$TAGS" == *"DEFAULT"* ]]; then + TAGS="${TAGS//DEFAULT/}" + TAGS="$TAGS;${var_tags:-}" + echo -e "${NETWORK}${BOLD}${DGN}Tags: ${BGN}$TAGS${CL}" + fi else TAGS="community-scripts;" if ADV_TAGS=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Custom Tags?[If you remove all, there will be no tags!]" 8 58 "${TAGS}" --title "Advanced Tags" 3>&1 1>&2 2>&3); then From a8bb5347a32fbeda46c93c485fce429dbc16605f Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:24:45 +0200 Subject: [PATCH 34/67] Config File --- misc/config-file.func | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/config-file.func b/misc/config-file.func index 54e10fe..085f172 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -494,6 +494,7 @@ config_file() { if [[ -n "${TAGS-}" ]]; then if [[ "$TAGS" == *"DEFAULT"* ]]; then TAGS="${TAGS//DEFAULT/}" + TAGS="${TAGS#;}" TAGS="$TAGS;${var_tags:-}" echo -e "${NETWORK}${BOLD}${DGN}Tags: ${BGN}$TAGS${CL}" fi From 74bcd30ef338007a5ae52d94adaa62e87e7f7d6a Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:25:32 +0200 Subject: [PATCH 35/67] Config File --- misc/config-file.func | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/config-file.func b/misc/config-file.func index 085f172..b475717 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -494,7 +494,7 @@ config_file() { if [[ -n "${TAGS-}" ]]; then if [[ "$TAGS" == *"DEFAULT"* ]]; then TAGS="${TAGS//DEFAULT/}" - TAGS="${TAGS#;}" + TAGS="${TAGS//;/}" TAGS="$TAGS;${var_tags:-}" echo -e "${NETWORK}${BOLD}${DGN}Tags: ${BGN}$TAGS${CL}" fi From c3420494dd60d43af61b0005ef3d5b642452801c Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:26:50 +0200 Subject: [PATCH 36/67] Config File --- misc/build.func | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/build.func b/misc/build.func index d8b0ee0..165ffd3 100644 --- a/misc/build.func +++ b/misc/build.func @@ -293,6 +293,7 @@ exit_script() { } write_config() { + mkdir -p /opt/community-scripts # This function writes the configuration to a file. if whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --defaultno --title "Write configfile" --yesno "Do you want to write the selections to a config file?" 10 60; then FILEPATH="/opt/community-scripts/${NSAPP}.conf" From 5f5478b19f244920f9e22e72c225a1e66c0fd097 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 09:27:11 +0200 Subject: [PATCH 37/67] test --- misc/build.func | 8 +++++++- misc/core.func | 11 +++++++++++ misc/install.func | 12 ++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/misc/build.func b/misc/build.func index d8b0ee0..de144aa 100644 --- a/misc/build.func +++ b/misc/build.func @@ -4,6 +4,12 @@ # Co-Author: michelroegl-brunner # License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +set -Eeuo pipefail + +trap '__handle_general_error "${BASH_SOURCE[0]}:${LINENO}"' ERR +trap '__handle_signal_exit' SIGINT SIGTERM +trap '__handle_exit' EXIT + variables() { NSAPP=$(echo "${APP,,}" | tr -d ' ') # This function sets the NSAPP variable by converting the value of the APP variable to lowercase and removing any spaces. var_install="${NSAPP}-install" # sets the var_install variable by appending "-install" to the value of NSAPP. @@ -1075,7 +1081,7 @@ EOF' pct exec "$CTID" -- bash -c "apt-get update >/dev/null && apt-get install -y sudo curl mc gnupg2 >/dev/null" fi msg_ok "Customized LXC Container" - lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/install/$var_install.sh)" $? + run_container_safe "curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/install/$var_install.sh" } diff --git a/misc/core.func b/misc/core.func index 4972b79..c1fbcba 100644 --- a/misc/core.func +++ b/misc/core.func @@ -439,3 +439,14 @@ msg_progress() { printf "\n" >&2 fi } + +run_container_safe() { + local ct="$1" + shift + local cmd="$*" + + lxc-attach -n "$ct" -- bash -euo pipefail -c " + trap 'echo Aborted in container; exit 130' SIGINT SIGTERM + $cmd + " || __handle_general_error "lxc-attach to CT $ct" +} diff --git a/misc/install.func b/misc/install.func index 0f23430..52774bd 100644 --- a/misc/install.func +++ b/misc/install.func @@ -13,6 +13,18 @@ fi source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) load_functions +__handle_general_error() { + local location="$1" + local code="$?" + msg_error "Error at ${location} (exit code ${code})" + exit "$code" +} + +__handle_signal_exit() { + msg_error "Script aborted by signal (SIGINT or SIGTERM)" + exit 130 +} + # # Function to set STD mode based on verbosity # set_std_mode() { # if [ "$VERBOSE" = "yes" ]; then From 91852f78ca1aeab64985621bb21ee47319f1301a Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 09:29:32 +0200 Subject: [PATCH 38/67] Update build.func --- misc/build.func | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/misc/build.func b/misc/build.func index 04f4c50..16c9ce5 100644 --- a/misc/build.func +++ b/misc/build.func @@ -299,7 +299,6 @@ exit_script() { } write_config() { - mkdir -p /opt/community-scripts # This function writes the configuration to a file. if whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --defaultno --title "Write configfile" --yesno "Do you want to write the selections to a config file?" 10 60; then FILEPATH="/opt/community-scripts/${NSAPP}.conf" @@ -1082,7 +1081,7 @@ EOF' pct exec "$CTID" -- bash -c "apt-get update >/dev/null && apt-get install -y sudo curl mc gnupg2 >/dev/null" fi msg_ok "Customized LXC Container" - run_container_safe "curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/install/$var_install.sh" + lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/install/$var_install.sh)" $? } From 87143ae90fdcde655a5e659848d76b9a7ed8c36e Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 09:31:04 +0200 Subject: [PATCH 39/67] Update core.func --- misc/core.func | 8 -------- 1 file changed, 8 deletions(-) diff --git a/misc/core.func b/misc/core.func index c1fbcba..ea549bf 100644 --- a/misc/core.func +++ b/misc/core.func @@ -294,14 +294,6 @@ __curl_err_handler() { exit 1 } -detect_os() { - case "$PCT_OSTYPE" in - alpine) CORE_OS="alpine" ;; - debian | ubuntu) CORE_OS="debian" ;; - *) CORE_OS="unknown" ;; - esac -} - fatal() { msg_error "$1" kill -INT $$ From 3684c3d3b2f50934537edf7c0de44df28bff829b Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 09:31:38 +0200 Subject: [PATCH 40/67] Update build.func --- misc/build.func | 6 ------ 1 file changed, 6 deletions(-) diff --git a/misc/build.func b/misc/build.func index 16c9ce5..d8b0ee0 100644 --- a/misc/build.func +++ b/misc/build.func @@ -4,12 +4,6 @@ # Co-Author: michelroegl-brunner # License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE -set -Eeuo pipefail - -trap '__handle_general_error "${BASH_SOURCE[0]}:${LINENO}"' ERR -trap '__handle_signal_exit' SIGINT SIGTERM -trap '__handle_exit' EXIT - variables() { NSAPP=$(echo "${APP,,}" | tr -d ' ') # This function sets the NSAPP variable by converting the value of the APP variable to lowercase and removing any spaces. var_install="${NSAPP}-install" # sets the var_install variable by appending "-install" to the value of NSAPP. From 09273f00dd7bbc765ff2e4bd2e06b370ed0a2e9e Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 09:31:52 +0200 Subject: [PATCH 41/67] Update install.func --- misc/install.func | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/misc/install.func b/misc/install.func index 52774bd..0f23430 100644 --- a/misc/install.func +++ b/misc/install.func @@ -13,18 +13,6 @@ fi source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) load_functions -__handle_general_error() { - local location="$1" - local code="$?" - msg_error "Error at ${location} (exit code ${code})" - exit "$code" -} - -__handle_signal_exit() { - msg_error "Script aborted by signal (SIGINT or SIGTERM)" - exit 130 -} - # # Function to set STD mode based on verbosity # set_std_mode() { # if [ "$VERBOSE" = "yes" ]; then From bfcd955c0b7ce6e60333ab237851a2c6a0adb978 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 09:32:49 +0200 Subject: [PATCH 42/67] - --- misc/alpine-install.func | 1 - misc/core.func | 1 - misc/install.func | 1 - 3 files changed, 3 deletions(-) diff --git a/misc/alpine-install.func b/misc/alpine-install.func index 8d19309..c1a01eb 100644 --- a/misc/alpine-install.func +++ b/misc/alpine-install.func @@ -99,7 +99,6 @@ update_os() { $STD apk update $STD apk upgrade msg_ok "Updated Container OS" - detect_os } # This function modifies the message of the day (motd) and SSH settings diff --git a/misc/core.func b/misc/core.func index ea549bf..ee75e23 100644 --- a/misc/core.func +++ b/misc/core.func @@ -35,7 +35,6 @@ load_functions() { icons default_vars set_std_mode - detect_os # add more } diff --git a/misc/install.func b/misc/install.func index 0f23430..8855689 100644 --- a/misc/install.func +++ b/misc/install.func @@ -168,7 +168,6 @@ EOF $STD apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED msg_ok "Updated Container OS" - detect_os source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/tools.func) } From ece6c7c07bd715c241c0b5dbfaa01db85bf85653 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:32:54 +0200 Subject: [PATCH 43/67] Config File --- misc/config-file.func | 44 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/misc/config-file.func b/misc/config-file.func index b475717..1b5d4a6 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -265,6 +265,7 @@ config_file() { local ip_cidr_regex='^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/([0-9]{1,2})$' local ip_regex='^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$' + ip_range_regex="^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}-([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$" if [[ -n ${NET-} ]]; then if [ "$NET" == "dhcp" ]; then @@ -279,13 +280,46 @@ config_file() { else msg_error "Invalid IP Address format for Gateway. Needs to be 0.0.0.0, was ${GATE}" exit + fi + else + msg_error "Gateway IP Address cannot be empty" + exit + fi + elif [[ "$NET" =~ $ip_range_regex ]]; then + base="${BASH_REMATCH[1]}" + start="${BASH_REMATCH[2]}" + end="${BASH_REMATCH[4]}" + cidr="${BASH_REMATCH[3]}" + + msg_info "Checking IPs from $base.$start/$cidr to $base.$end/$cidr" + + for ((i=start; i<=end; i++)); do + ip="$base.$i" + if ! ping -c 1 -W 1 "$ip" > /dev/null 2>&1; then + NET="$ip/$cidr" + msg_ok "Selected unused IP: $NET" + break + fi + done + + if [[ ! "$NET" =~ / ]]; then + msg_error "No free IP found in range" + exit 1 + fi + if [ -n "$GATE" ]; then + if [[ "$GATE" =~ $ip_regex ]]; then + echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}$GATE${CL}" + GATE=",gw=$GATE" + else + msg_error "Invalid IP Address format for Gateway. Needs to be 0.0.0.0, was ${GATE}" + exit + fi + else + msg_error "Gateway IP Address cannot be empty" + exit fi else - msg_error "Gateway IP Address cannot be empty" - exit - fi - else - msg_error "Invalid IP Address format. Needs to be 0.0.0.0/0, was ${NET}" + msg_error "Invalid IP Address format. Needs to be 0.0.0.0/0 or a range like 10.0.0.1/24-10.0.0.10/24, was ${NET}" exit fi else From 27da0b98fe344917bf23d1195a94ea8de7db16fe Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:34:59 +0200 Subject: [PATCH 44/67] Config File --- misc/config-file.func | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/misc/config-file.func b/misc/config-file.func index 1b5d4a6..e6b2f62 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -285,18 +285,25 @@ config_file() { msg_error "Gateway IP Address cannot be empty" exit fi - elif [[ "$NET" =~ $ip_range_regex ]]; then + elif [[ "$NET" =~ ^([0-9]+\.[0-9]+\.[0-9]+)\.([0-9]+)/([0-9]+)-([0-9]+)/([0-9]+)$ ]]; then base="${BASH_REMATCH[1]}" start="${BASH_REMATCH[2]}" end="${BASH_REMATCH[4]}" - cidr="${BASH_REMATCH[3]}" + cidr_start="${BASH_REMATCH[3]}" + cidr_end="${BASH_REMATCH[5]}" - msg_info "Checking IPs from $base.$start/$cidr to $base.$end/$cidr" + # Optional check: CIDR must match (can be customized) + if [[ "$cidr_start" != "$cidr_end" ]]; then + msg_error "Mismatched CIDR: /$cidr_start and /$cidr_end" + exit 1 + fi + + msg_info "Checking IPs from $base.$start/$cidr_start to $base.$end/$cidr_start" for ((i=start; i<=end; i++)); do ip="$base.$i" if ! ping -c 1 -W 1 "$ip" > /dev/null 2>&1; then - NET="$ip/$cidr" + NET="$ip/$cidr_start" msg_ok "Selected unused IP: $NET" break fi From 77080e6fb5602d37ba1c14d1695d0d71d925c485 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:38:30 +0200 Subject: [PATCH 45/67] Config File --- misc/config-file.func | 51 ++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/misc/config-file.func b/misc/config-file.func index e6b2f62..33d8c5a 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -265,7 +265,7 @@ config_file() { local ip_cidr_regex='^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/([0-9]{1,2})$' local ip_regex='^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$' - ip_range_regex="^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}-([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$" + local ip_cidr_range_regex="^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$" if [[ -n ${NET-} ]]; then if [ "$NET" == "dhcp" ]; then @@ -285,34 +285,49 @@ config_file() { msg_error "Gateway IP Address cannot be empty" exit fi - elif [[ "$NET" =~ ^([0-9]+\.[0-9]+\.[0-9]+)\.([0-9]+)/([0-9]+)-([0-9]+)/([0-9]+)$ ]]; then - base="${BASH_REMATCH[1]}" - start="${BASH_REMATCH[2]}" - end="${BASH_REMATCH[4]}" - cidr_start="${BASH_REMATCH[3]}" - cidr_end="${BASH_REMATCH[5]}" + elif [[ "$NET" == *-* ]]; then + IFS="-" read -r ip_start ip_end <<< "$NET" - # Optional check: CIDR must match (can be customized) - if [[ "$cidr_start" != "$cidr_end" ]]; then - msg_error "Mismatched CIDR: /$cidr_start and /$cidr_end" + if [[ ! "$ip_start" =~ $ip_cidr_regex ]] || [[ ! "$ip_end" =~ $ip_cidr_regex ]]; then + echo "Invalid IP range format: $NET" exit 1 fi - msg_info "Checking IPs from $base.$start/$cidr_start to $base.$end/$cidr_start" + # Extract IPs and ignore CIDR for scanning + ip1="${ip_start%%/*}" + ip2="${ip_end%%/*}" + cidr="${ip_start##*/}" - for ((i=start; i<=end; i++)); do - ip="$base.$i" - if ! ping -c 1 -W 1 "$ip" > /dev/null 2>&1; then - NET="$ip/$cidr_start" - msg_ok "Selected unused IP: $NET" + # Convert IP to integer + ip_to_int() { + local IFS=. + read -r i1 i2 i3 i4 <<< "$1" + echo $(( (i1 << 24) + (i2 << 16) + (i3 << 8) + i4 )) + } + + # Convert integer back to IP + int_to_ip() { + local ip=$1 + echo "$(( (ip >> 24) & 0xFF )).$(( (ip >> 16) & 0xFF )).$(( (ip >> 8) & 0xFF )).$(( ip & 0xFF ))" + } + + start_int=$(ip_to_int "$ip1") + end_int=$(ip_to_int "$ip2") + + for ((ip_int=start_int; ip_int<=end_int; ip_int++)); do + ip=$(int_to_ip $ip_int) + if ! ping -c 1 -W 1 "$ip" >/dev/null 2>&1; then + NET="$ip/$cidr" + echo "Selected unused IP: $NET" break fi done - if [[ ! "$NET" =~ / ]]; then - msg_error "No free IP found in range" + if [[ "$NET" == *-* ]]; then + echo "No free IP found in range" exit 1 fi + if [ -n "$GATE" ]; then if [[ "$GATE" =~ $ip_regex ]]; then echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}$GATE${CL}" From 5bdcf2f2bdc119b4d43eff6618e165aa6e77dc26 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:43:20 +0200 Subject: [PATCH 46/67] Config File --- misc/config-file.func | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/misc/config-file.func b/misc/config-file.func index 33d8c5a..2c168d2 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -289,23 +289,20 @@ config_file() { IFS="-" read -r ip_start ip_end <<< "$NET" if [[ ! "$ip_start" =~ $ip_cidr_regex ]] || [[ ! "$ip_end" =~ $ip_cidr_regex ]]; then - echo "Invalid IP range format: $NET" + msg_error "Invalid IP range format, was $NET should be 0.0.0.0/0-0.0.0.0/0" exit 1 fi - # Extract IPs and ignore CIDR for scanning ip1="${ip_start%%/*}" ip2="${ip_end%%/*}" cidr="${ip_start##*/}" - # Convert IP to integer ip_to_int() { local IFS=. read -r i1 i2 i3 i4 <<< "$1" echo $(( (i1 << 24) + (i2 << 16) + (i3 << 8) + i4 )) } - # Convert integer back to IP int_to_ip() { local ip=$1 echo "$(( (ip >> 24) & 0xFF )).$(( (ip >> 16) & 0xFF )).$(( (ip >> 8) & 0xFF )).$(( ip & 0xFF ))" @@ -316,18 +313,17 @@ config_file() { for ((ip_int=start_int; ip_int<=end_int; ip_int++)); do ip=$(int_to_ip $ip_int) - if ! ping -c 1 -W 1 "$ip" >/dev/null 2>&1; then + msg_info "Checking IP: $ip" + if ! ping -c 4 -W 1 "$ip" >/dev/null 2>&1; then NET="$ip/$cidr" - echo "Selected unused IP: $NET" + echo -e "${NETWORK}${BOLD}${DGN}IP Address: ${BGN}$NET${CL}" break fi done - if [[ "$NET" == *-* ]]; then - echo "No free IP found in range" + msg_error "No free IP found in range" exit 1 fi - if [ -n "$GATE" ]; then if [[ "$GATE" =~ $ip_regex ]]; then echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}$GATE${CL}" @@ -337,8 +333,18 @@ config_file() { exit fi else - msg_error "Gateway IP Address cannot be empty" - exit + while true; do + GATE1=$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --inputbox "Enter gateway IP address" 8 58 --title "Gateway IP" 3>&1 1>&2 2>&3) + if [ -z "$GATE1" ]; then + whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --msgbox "Gateway IP address cannot be empty" 8 58 + elif [[ ! "$GATE1" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then + whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --msgbox "Invalid IP address format" 8 58 + else + GATE=",gw=$GATE1" + echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}$GATE1${CL}" + break + fi + done fi else msg_error "Invalid IP Address format. Needs to be 0.0.0.0/0 or a range like 10.0.0.1/24-10.0.0.10/24, was ${NET}" From b8e3bb02d3caa4aebc33829ee4d464e86f7bf998 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:45:04 +0200 Subject: [PATCH 47/67] Config File --- misc/config-file.func | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/misc/config-file.func b/misc/config-file.func index 2c168d2..af21032 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -316,7 +316,7 @@ config_file() { msg_info "Checking IP: $ip" if ! ping -c 4 -W 1 "$ip" >/dev/null 2>&1; then NET="$ip/$cidr" - echo -e "${NETWORK}${BOLD}${DGN}IP Address: ${BGN}$NET${CL}" + echo -e "\n${NETWORK}${BOLD}${DGN}Found free IP Address: ${BGN}$NET${CL}" break fi done @@ -329,8 +329,18 @@ config_file() { echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}$GATE${CL}" GATE=",gw=$GATE" else - msg_error "Invalid IP Address format for Gateway. Needs to be 0.0.0.0, was ${GATE}" - exit + while true; do + GATE1=$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --inputbox "Enter gateway IP address" 8 58 --title "Gateway IP" 3>&1 1>&2 2>&3) + if [ -z "$GATE1" ]; then + whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --msgbox "Gateway IP address cannot be empty" 8 58 + elif [[ ! "$GATE1" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then + whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --msgbox "Invalid IP address format" 8 58 + else + GATE=",gw=$GATE1" + echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}$GATE1${CL}" + break + fi + done fi else while true; do From 24dc2c887a64bd76d1d106612f1642ba2660ec05 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:46:16 +0200 Subject: [PATCH 48/67] Config File --- misc/config-file.func | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/misc/config-file.func b/misc/config-file.func index af21032..46f7bb1 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -316,7 +316,7 @@ config_file() { msg_info "Checking IP: $ip" if ! ping -c 4 -W 1 "$ip" >/dev/null 2>&1; then NET="$ip/$cidr" - echo -e "\n${NETWORK}${BOLD}${DGN}Found free IP Address: ${BGN}$NET${CL}" + echo -e "${NETWORK}${BOLD}${DGN}Using free IP Address: ${BGN}$NET${CL}" break fi done @@ -329,18 +329,8 @@ config_file() { echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}$GATE${CL}" GATE=",gw=$GATE" else - while true; do - GATE1=$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --inputbox "Enter gateway IP address" 8 58 --title "Gateway IP" 3>&1 1>&2 2>&3) - if [ -z "$GATE1" ]; then - whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --msgbox "Gateway IP address cannot be empty" 8 58 - elif [[ ! "$GATE1" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then - whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --msgbox "Invalid IP address format" 8 58 - else - GATE=",gw=$GATE1" - echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}$GATE1${CL}" - break - fi - done + msg_error "Invalid IP Address format for Gateway. Needs to be 0.0.0.0, was ${GATE}" + exit fi else while true; do @@ -637,7 +627,6 @@ config_file() { if (whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --title "ADVANCED SETTINGS WITH CONFIG FILE COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then echo -e "${CREATING}${BOLD}${RD}Creating a ${APP} LXC using the above settings${CL}" - write_config else clear header_info From ef0fcb96a196a7222ebd6954b0113761872f24b4 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:52:16 +0200 Subject: [PATCH 49/67] Config File --- misc/build.func | 4 ++-- misc/config-file.func | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/misc/build.func b/misc/build.func index d8b0ee0..f645f69 100644 --- a/misc/build.func +++ b/misc/build.func @@ -316,7 +316,7 @@ VERBOSE="${VERBOSE}" TAGS="${TAGS:-none}" VLAN="${VLAN:-none}" MTU="${MTU:-1500}" -GATE="${GATE:-none}" +GATE="${GATE:-}" SD="${SD:-none}" MAC="${MAC:-none}" NS="${NS:-none}" @@ -347,7 +347,7 @@ VERBOSE="${VERBOSE}" TAGS="${TAGS:-none}" VLAN="${VLAN:-none}" MTU="${MTU:-1500}" -GATE="${GATE:-none}" +GATE="${GATE:-}" SD="${SD:-none}" MAC="${MAC:-none}" NS="${NS:-none}" diff --git a/misc/config-file.func b/misc/config-file.func index 46f7bb1..a0bb727 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -265,7 +265,6 @@ config_file() { local ip_cidr_regex='^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/([0-9]{1,2})$' local ip_regex='^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$' - local ip_cidr_range_regex="^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$" if [[ -n ${NET-} ]]; then if [ "$NET" == "dhcp" ]; then @@ -336,9 +335,9 @@ config_file() { while true; do GATE1=$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --inputbox "Enter gateway IP address" 8 58 --title "Gateway IP" 3>&1 1>&2 2>&3) if [ -z "$GATE1" ]; then - whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --msgbox "Gateway IP address cannot be empty" 8 58 + whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox "Gateway IP address cannot be empty" 8 58 elif [[ ! "$GATE1" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then - whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --msgbox "Invalid IP address format" 8 58 + whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox "Invalid IP address format" 8 58 else GATE=",gw=$GATE1" echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}$GATE1${CL}" From aebc3cddde4a526015500c926db0e6c46afbf95f Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:54:41 +0200 Subject: [PATCH 50/67] Config File --- misc/config-file.func | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/misc/config-file.func b/misc/config-file.func index a0bb727..59f5952 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -280,9 +280,20 @@ config_file() { msg_error "Invalid IP Address format for Gateway. Needs to be 0.0.0.0, was ${GATE}" exit fi + else - msg_error "Gateway IP Address cannot be empty" - exit + while true; do + GATE1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Enter gateway IP address" 8 58 --title "Gateway IP" 3>&1 1>&2 2>&3) + if [ -z "$GATE1" ]; then + whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox "Gateway IP address cannot be empty" 8 58 + elif [[ ! "$GATE1" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then + whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox "Invalid IP address format" 8 58 + else + GATE=",gw=$GATE1" + echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}$GATE1${CL}" + break + fi + done fi elif [[ "$NET" == *-* ]]; then IFS="-" read -r ip_start ip_end <<< "$NET" From 957ba3c430acebd1547cd41fb5f8d11077570bda Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:57:50 +0200 Subject: [PATCH 51/67] Config File --- misc/config-file.func | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/config-file.func b/misc/config-file.func index 59f5952..e26d466 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -325,6 +325,7 @@ config_file() { ip=$(int_to_ip $ip_int) msg_info "Checking IP: $ip" if ! ping -c 4 -W 1 "$ip" >/dev/null 2>&1; then + msg_ok " " NET="$ip/$cidr" echo -e "${NETWORK}${BOLD}${DGN}Using free IP Address: ${BGN}$NET${CL}" break From 7edc2132c2c0550ebed8e373a6c2ed9fcde1973a Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:57:58 +0200 Subject: [PATCH 52/67] Config File --- misc/config-file.func | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/config-file.func b/misc/config-file.func index e26d466..57401be 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -324,7 +324,7 @@ config_file() { for ((ip_int=start_int; ip_int<=end_int; ip_int++)); do ip=$(int_to_ip $ip_int) msg_info "Checking IP: $ip" - if ! ping -c 4 -W 1 "$ip" >/dev/null 2>&1; then + if ! ping -c 1 -W 1 "$ip" >/dev/null 2>&1; then msg_ok " " NET="$ip/$cidr" echo -e "${NETWORK}${BOLD}${DGN}Using free IP Address: ${BGN}$NET${CL}" From cb477e91f162e350555fdb56e0e2e6d37dc559b8 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 09:59:55 +0200 Subject: [PATCH 53/67] Config File --- misc/config-file.func | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/config-file.func b/misc/config-file.func index 57401be..18abf1e 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -325,9 +325,11 @@ config_file() { ip=$(int_to_ip $ip_int) msg_info "Checking IP: $ip" if ! ping -c 1 -W 1 "$ip" >/dev/null 2>&1; then - msg_ok " " + [ -n "${SPINNER_PID:-}" ] && kill "$SPINNER_PID" 2>/dev/null && wait "$SPINNER_PID" 2>/dev/null + NET="$ip/$cidr" echo -e "${NETWORK}${BOLD}${DGN}Using free IP Address: ${BGN}$NET${CL}" + sleep 3 break fi done From 4cd307543aa126672929871fc01693dff4fcdf03 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 10:02:14 +0200 Subject: [PATCH 54/67] Config File --- misc/config-file.func | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/misc/config-file.func b/misc/config-file.func index 18abf1e..81b9002 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -324,11 +324,9 @@ config_file() { for ((ip_int=start_int; ip_int<=end_int; ip_int++)); do ip=$(int_to_ip $ip_int) msg_info "Checking IP: $ip" - if ! ping -c 1 -W 1 "$ip" >/dev/null 2>&1; then - [ -n "${SPINNER_PID:-}" ] && kill "$SPINNER_PID" 2>/dev/null && wait "$SPINNER_PID" 2>/dev/null - + if ! ping -c 2 -W 1 "$ip" >/dev/null 2>&1; then NET="$ip/$cidr" - echo -e "${NETWORK}${BOLD}${DGN}Using free IP Address: ${BGN}$NET${CL}" + msg_ok "${NETWORK}${BOLD}${DGN}Using free IP Address: ${BGN}$NET${CL}" sleep 3 break fi From 17a862c810a75fd80558eb8c0d8b338146da2d10 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 10:03:23 +0200 Subject: [PATCH 55/67] Config File --- misc/config-file.func | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/config-file.func b/misc/config-file.func index 81b9002..d7d2683 100644 --- a/misc/config-file.func +++ b/misc/config-file.func @@ -326,7 +326,7 @@ config_file() { msg_info "Checking IP: $ip" if ! ping -c 2 -W 1 "$ip" >/dev/null 2>&1; then NET="$ip/$cidr" - msg_ok "${NETWORK}${BOLD}${DGN}Using free IP Address: ${BGN}$NET${CL}" + msg_ok "Using free IP Address: ${BGN}$NET${CL}" sleep 3 break fi From 6b1a5349ca10e8e7c326e3f9d8ba3ff6f82a36ac Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 10:08:34 +0200 Subject: [PATCH 56/67] Update tools.func --- misc/tools.func | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/tools.func b/misc/tools.func index 4380f29..0534750 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -790,9 +790,13 @@ fetch_and_deploy_gh_release() { local content_root content_root=$(find "$tmpdir" -mindepth 1 -maxdepth 1 -type d) if [[ $(echo "$content_root" | wc -l) -eq 1 ]]; then + shopt -s dotglob nullglob cp -r "$content_root"/* "/opt/$app/" + shopt -u dotglob nullglob else + shopt -s dotglob nullglob cp -r "$tmpdir"/* "/opt/$app/" + shopt -u dotglob nullglob fi echo "$version" >"/opt/${app}_version.txt" $STD msg_ok "Deployed $app v$version to /opt/$app" From 98368bdd1bed3e5a33f0fff5d3781c101b844793 Mon Sep 17 00:00:00 2001 From: tremor021 Date: Tue, 20 May 2025 10:54:37 +0200 Subject: [PATCH 57/67] update --- install/openwebui-install.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/install/openwebui-install.sh b/install/openwebui-install.sh index b597a7f..a2100f7 100644 --- a/install/openwebui-install.sh +++ b/install/openwebui-install.sh @@ -16,7 +16,6 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ - git \ ffmpeg msg_ok "Installed Dependencies" @@ -37,20 +36,16 @@ cd /opt/openwebui cat </opt/openwebui/.env # Ollama URL for the backend to connect # The path '/ollama' will be redirected to the specified backend URL -OLLAMA_BASE_URL='http://localhost:11434' - +OLLAMA_BASE_URL=http://0.0.0.0:11434 OPENAI_API_BASE_URL='' OPENAI_API_KEY='' - # AUTOMATIC1111_BASE_URL="http://localhost:7860" - # DO NOT TRACK SCARF_NO_ANALYTICS=true DO_NOT_TRACK=true ANONYMIZED_TELEMETRY=false ENV=prod ENABLE_OLLAMA_API=false -OLLAMA_BASE_URL=http://0.0.0.0:11434 EOF $STD npm install export NODE_OPTIONS="--max-old-space-size=3584" From 8e1d8bdefae816a6b9e17821a097454cf5f49663 Mon Sep 17 00:00:00 2001 From: tremor021 Date: Tue, 20 May 2025 11:20:04 +0200 Subject: [PATCH 58/67] Update oweb --- ct/openwebui.sh | 1 + install/openwebui-install.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/ct/openwebui.sh b/ct/openwebui.sh index 71b4431..96647a9 100644 --- a/ct/openwebui.sh +++ b/ct/openwebui.sh @@ -52,6 +52,7 @@ function update_script() { cd /opt/openwebui $STD npm install export NODE_OPTIONS="--max-old-space-size=3584" + sed -i "s/git rev-parse HEAD/openssl rand -hex 20/g" /opt/openwebui/svelte.config.js $STD npm run build cd ./backend $STD pip install -r requirements.txt -U diff --git a/install/openwebui-install.sh b/install/openwebui-install.sh index a2100f7..aebb130 100644 --- a/install/openwebui-install.sh +++ b/install/openwebui-install.sh @@ -49,6 +49,7 @@ ENABLE_OLLAMA_API=false EOF $STD npm install export NODE_OPTIONS="--max-old-space-size=3584" +sed -i "s/git rev-parse HEAD/openssl rand -hex 20/g" /opt/openwebui/svelte.config.js $STD npm run build msg_ok "Installed Open WebUI" From 85c2c99b122f88331ff580d52f8d696700aac538 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Tue, 20 May 2025 14:07:15 +0200 Subject: [PATCH 59/67] Add LXC-Updater --- tools/pve/update-apps.sh | 111 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 tools/pve/update-apps.sh diff --git a/tools/pve/update-apps.sh b/tools/pve/update-apps.sh new file mode 100644 index 0000000..e7712e4 --- /dev/null +++ b/tools/pve/update-apps.sh @@ -0,0 +1,111 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: BvdBerg01 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE + +function header_info { + clear + cat <<"EOF" + __ _ ________ __ __ __ __ + / / | |/ / ____/ / / / /___ ____/ /___ _/ /____ + / / | / / / / / / __ \/ __ / __ `/ __/ _ \ + / /___/ / /___ / /_/ / /_/ / /_/ / /_/ / /_/ __/ +/_____/_/|_\____/ \____/ .___/\__,_/\__,_/\__/\___/ + /_/ +EOF +} + +source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) + +header_info +echo "Loading..." +whiptail --backtitle "Proxmox VE Helper Scripts" --title "LXC Container Update" --yesno "This will update LXC container. Proceed?" 10 58 || exit + +NODE=$(hostname) +containers=$(pct list | tail -n +2 | awk '{print $0 " " $4}') + +if [ -z "$containers" ]; then + whiptail --title "LXC Container Update" --msgbox "No LXC containers available!" 10 60 + exit 1 +fi + +menu_items=() +FORMAT="%-10s %-15s %-10s" + +while read -r container; do + container_id=$(echo $container | awk '{print $1}') + container_name=$(echo $container | awk '{print $2}') + container_status=$(echo $container | awk '{print $3}') + formatted_line=$(printf "$FORMAT" "$container_name" "$container_status") + IS_HELPERSCRIPT_LXC=$(pct exec $container_id -- [ -e /usr/bin/update ] && echo true || echo false) + if [ "$IS_HELPERSCRIPT_LXC" = true ]; then + menu_items+=("$container_id" "$formatted_line" "OFF") + fi +done <<< "$containers" + +CHOICE=$(whiptail --title "LXC Container Update" \ + --radiolist "Select LXC container to update:" 25 60 13 \ + "${menu_items[@]}" 3>&2 2>&1 1>&3) + +if [ -z "$CHOICE" ]; then + whiptail --title "LXC Container Update" \ + --msgbox "No containers selected!" 10 60 + exit 1 +fi + +header_info +if(whiptail --backtitle "Proxmox VE Helper Scripts" --title "LXC Container Update" --yesno "Do you want to create a backup from your container?" 10 58); then + + STORAGES=$(awk '/^(\S+):/ {storage=$2} /content.*backup/ {print storage}' /etc/pve/storage.cfg) + + if [ -z "$STORAGES" ]; then + whiptail --msgbox "Geen opslag met 'backup' gevonden!" 8 40 + exit 1 + fi + + MENU_ITEMS=() + for STORAGE in $STORAGES; do + MENU_ITEMS+=("$STORAGE" "") + done + + STORAGE_CHOICE=$(whiptail --title "Select storage device" --menu "Select a storage device (Only storage devices with 'backup' support are listed):" 15 50 5 "${MENU_ITEMS[@]}" 3>&1 1>&2 2>&3) + + if [ -z "$STORAGE_CHOICE" ]; then + msg_error "No storage selected!" + exit 1 + fi + + msg_info "Creating backup" + vzdump $CHOICE --compress zstd --storage $STORAGE_CHOICE -notes-template "community-scripts backup updater" > /dev/null 2>&1 + status=$? + + if [ $status -eq 0 ]; then + msg_ok "Backup created" + pct exec $CHOICE -- update --from-pve + exit_code=$? + else + msg_error "Backup failed" + fi + +else + pct exec $CHOICE -- update --from-pve + exit_code=$? +fi + +if [ $exit_code -eq 0 ]; then + msg_ok "Update completed" +else + msg_info "Restoring LXC from backup" + pct stop $CHOICE + LXC_STORAGE=$(pct config $CHOICE | awk -F '[:,]' '/rootfs/ {print $2}') + pct restore $CHOICE /var/lib/vz/dump/vzdump-lxc-$CHOICE-*.tar.zst --storage $LXC_STORAGE --force > /dev/null 2>&1 + pct start $CHOICE + restorestatus=$? + if [ $restorestatus -eq 0 ]; then + msg_ok "Restored LXC from backup" + else + msg_error "Restored LXC from backup failed" + fi + +fi From 683d0e7279ef652eca2d568418c606f3b4f9b54e Mon Sep 17 00:00:00 2001 From: "app-header-generator[bot]" <194485257+app-header-generator[bot]@users.noreply.github.com> Date: Tue, 20 May 2025 12:39:51 +0000 Subject: [PATCH 60/67] Update versions.json (#427) Co-authored-by: GitHub Actions[bot] --- frontend/public/json/versions.json | 79 ++++++++++++++++-------------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/frontend/public/json/versions.json b/frontend/public/json/versions.json index dfd7608..f65a399 100644 --- a/frontend/public/json/versions.json +++ b/frontend/public/json/versions.json @@ -1,4 +1,29 @@ [ + { + "name": "Stirling-Tools/Stirling-PDF", + "version": "v0.46.2", + "date": "2025-05-20T11:21:04Z" + }, + { + "name": "zabbix/zabbix", + "version": "7.2.7", + "date": "2025-05-20T11:00:56Z" + }, + { + "name": "mattermost/mattermost", + "version": "server/public/v0.1.13", + "date": "2025-05-16T03:44:25Z" + }, + { + "name": "Luligu/matterbridge", + "version": "3.0.3", + "date": "2025-05-20T06:51:42Z" + }, + { + "name": "Jackett/Jackett", + "version": "v0.22.1930", + "date": "2025-05-20T06:38:17Z" + }, { "name": "crafty-controller/crafty-4", "version": "v4.4.9", @@ -24,10 +49,15 @@ "version": "v0.8.3", "date": "2025-05-19T20:45:10Z" }, + { + "name": "keycloak/keycloak", + "version": "26.0.12", + "date": "2025-05-15T14:06:52Z" + }, { "name": "bunkerity/bunkerweb", - "version": "testing", - "date": "2025-05-15T12:54:33Z" + "version": "v1.6.1", + "date": "2025-03-15T17:29:17Z" }, { "name": "Forceu/Gokapi", @@ -69,11 +99,6 @@ "version": "v1.11.0", "date": "2025-05-19T06:21:18Z" }, - { - "name": "Jackett/Jackett", - "version": "v0.22.1921", - "date": "2025-05-19T05:54:21Z" - }, { "name": "MediaBrowser/Emby.Releases", "version": "4.8.11.0", @@ -116,8 +141,8 @@ }, { "name": "runtipi/runtipi", - "version": "nightly", - "date": "2025-05-18T13:00:01Z" + "version": "v4.1.1", + "date": "2025-05-16T17:37:30Z" }, { "name": "hansmi/prometheus-paperless-exporter", @@ -132,7 +157,7 @@ { "name": "theonedev/onedev", "version": "v11.9.8", - "date": "2025-05-18T01:27:37Z" + "date": "2025-05-17T13:13:22Z" }, { "name": "inventree/InvenTree", @@ -209,11 +234,6 @@ "version": "2.0.4", "date": "2025-05-16T15:09:53Z" }, - { - "name": "keycloak/keycloak", - "version": "26.0.12", - "date": "2025-05-15T14:06:52Z" - }, { "name": "emqx/emqx", "version": "e5.10.0-alpha.1", @@ -229,11 +249,6 @@ "version": "1.21.3", "date": "2025-05-16T04:31:05Z" }, - { - "name": "mattermost/mattermost", - "version": "server/public/v0.1.13", - "date": "2025-05-16T03:44:25Z" - }, { "name": "ipfs/kubo", "version": "v0.34.1", @@ -281,19 +296,14 @@ }, { "name": "ollama/ollama", - "version": "v0.7.0-rc1", - "date": "2025-05-14T03:58:02Z" + "version": "v0.7.0", + "date": "2025-05-14T23:42:30Z" }, { "name": "Ombi-app/Ombi", "version": "v4.47.1", "date": "2025-01-05T21:14:23Z" }, - { - "name": "Luligu/matterbridge", - "version": "3.0.2", - "date": "2025-05-14T20:38:06Z" - }, { "name": "Athou/commafeed", "version": "5.9.0", @@ -359,11 +369,6 @@ "version": "v1.129.0", "date": "2025-05-06T12:28:54Z" }, - { - "name": "zabbix/zabbix", - "version": "7.2.7rc1", - "date": "2025-05-13T11:55:32Z" - }, { "name": "zitadel/zitadel", "version": "v2.65.9", @@ -434,11 +439,6 @@ "version": "v0.2.3", "date": "2025-05-10T21:14:45Z" }, - { - "name": "Stirling-Tools/Stirling-PDF", - "version": "v0.46.1", - "date": "2025-05-10T15:39:10Z" - }, { "name": "pelican-dev/wings", "version": "v1.0.0-beta13", @@ -463,5 +463,10 @@ "name": "apache/tomcat", "version": "10.1.41", "date": "2025-05-08T12:45:44Z" + }, + { + "name": "semaphoreui/semaphore", + "version": "v2.14.10", + "date": "2025-05-07T20:23:29Z" } ] From ee8a808c29f73ba34d2a23666f97259c1b24d51b Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 17:08:45 +0200 Subject: [PATCH 61/67] Update build.func --- misc/build.func | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/misc/build.func b/misc/build.func index f645f69..8084e63 100644 --- a/misc/build.func +++ b/misc/build.func @@ -244,6 +244,8 @@ base_settings() { SSH_AUTHORIZED_KEY="" TAGS="community-script;" UDHCPC_FIX="" + ENABLE_FUSE=="0" + ENABLE_TUN="0" # Override default settings with variables from ct script CT_TYPE=${var_unprivileged:-$CT_TYPE} @@ -252,6 +254,8 @@ base_settings() { RAM_SIZE=${var_ram:-$RAM_SIZE} VERBOSE=${var_verbose:-$VERBOSE} TAGS="${TAGS}${var_tags:-}" + ENABLE_FUSE="${var_fuse:-$ENABLE_FUSE}" + ENABLE_TUN="${var_tun:-$ENABLE_TUN}" # Since these 2 are only defined outside of default_settings function, we add a temporary fallback. TODO: To align everything, we should add these as constant variables (e.g. OSTYPE and OSVERSION), but that would currently require updating the default_settings function for all existing scripts if [ -z "$var_os" ]; then @@ -958,6 +962,17 @@ build_container() { FEATURES="nesting=1" fi + if [ "$ENABLE_FUSE" == "1" ]; then + FEATURES="$FEATURES,fuse=1" + fi + + if [ "$ENABLE_TUN" == "1" ]; then + cat <>"$LXC_CONFIG" +lxc.cgroup2.devices.allow: c 10:200 rwm +lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file +EOF + fi + if [[ $DIAGNOSTICS == "yes" ]]; then post_to_api fi @@ -982,6 +997,8 @@ build_container() { export SSH_AUTHORIZED_KEY export CTID="$CT_ID" export CTTYPE="$CT_TYPE" + export ENABLE_FUSE="$ENABLE_FUSE" + export ENABLE_TUN="$ENABLE_TUN" export PCT_OSTYPE="$var_os" export PCT_OSVERSION="$var_version" export PCT_DISK_SIZE="$DISK_SIZE" From 5cce8148317a4554ed5229908c811f6085cb61d3 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 17:10:22 +0200 Subject: [PATCH 62/67] Update argus.sh --- ct/argus.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ct/argus.sh b/ct/argus.sh index b7032fe..ebfb9ad 100644 --- a/ct/argus.sh +++ b/ct/argus.sh @@ -13,6 +13,8 @@ var_disk="${var_disk:-3}" var_os="${var_os:-debian}" var_version="${var_version:-12}" var_unprivileged="${var_unprivileged:-1}" +var_fuser="${var_fuser:-1}" +var_tunnel="${var_tunnel:-1}" header_info "$APP" variables From 16d6e24f16a58da070fae0a7df019dc79ac52d23 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 17:10:33 +0200 Subject: [PATCH 63/67] Update argus.sh --- ct/argus.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/argus.sh b/ct/argus.sh index ebfb9ad..ff3602a 100644 --- a/ct/argus.sh +++ b/ct/argus.sh @@ -13,8 +13,8 @@ var_disk="${var_disk:-3}" var_os="${var_os:-debian}" var_version="${var_version:-12}" var_unprivileged="${var_unprivileged:-1}" -var_fuser="${var_fuser:-1}" -var_tunnel="${var_tunnel:-1}" +var_fuse="${var_fuse:-1}" +var_tun="${var_tun:-1}" header_info "$APP" variables From 0f2af7f39f8b27fbee1c229acea8cfa51a65bcfe Mon Sep 17 00:00:00 2001 From: "app-header-generator[bot]" <194485257+app-header-generator[bot]@users.noreply.github.com> Date: Tue, 20 May 2025 15:10:49 +0000 Subject: [PATCH 64/67] Update .app files (#429) Co-authored-by: GitHub Actions --- ct/headers/garmin-grafana | 6 ++++++ ct/headers/pulse | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 ct/headers/garmin-grafana create mode 100644 ct/headers/pulse diff --git a/ct/headers/garmin-grafana b/ct/headers/garmin-grafana new file mode 100644 index 0000000..5509b81 --- /dev/null +++ b/ct/headers/garmin-grafana @@ -0,0 +1,6 @@ + _ ____ + ____ _____ __________ ___ (_)___ ____ __________ _/ __/___ _____ ____ _ + / __ `/ __ `/ ___/ __ `__ \/ / __ \______/ __ `/ ___/ __ `/ /_/ __ `/ __ \/ __ `/ + / /_/ / /_/ / / / / / / / / / / / /_____/ /_/ / / / /_/ / __/ /_/ / / / / /_/ / + \__, /\__,_/_/ /_/ /_/ /_/_/_/ /_/ \__, /_/ \__,_/_/ \__,_/_/ /_/\__,_/ +/____/ /____/ diff --git a/ct/headers/pulse b/ct/headers/pulse new file mode 100644 index 0000000..3d3b702 --- /dev/null +++ b/ct/headers/pulse @@ -0,0 +1,6 @@ + ____ __ + / __ \__ __/ /_______ + / /_/ / / / / / ___/ _ \ + / ____/ /_/ / (__ ) __/ +/_/ \__,_/_/____/\___/ + From 5c253045d825fe8643d71e226abadf113cb93646 Mon Sep 17 00:00:00 2001 From: "app-header-generator[bot]" <194485257+app-header-generator[bot]@users.noreply.github.com> Date: Tue, 20 May 2025 15:10:59 +0000 Subject: [PATCH 65/67] [core] update .app files (#430) * Update argus.sh * Update .app files --------- Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com> Co-authored-by: GitHub Actions --- ct/argus.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/argus.sh b/ct/argus.sh index ebfb9ad..ff3602a 100644 --- a/ct/argus.sh +++ b/ct/argus.sh @@ -13,8 +13,8 @@ var_disk="${var_disk:-3}" var_os="${var_os:-debian}" var_version="${var_version:-12}" var_unprivileged="${var_unprivileged:-1}" -var_fuser="${var_fuser:-1}" -var_tunnel="${var_tunnel:-1}" +var_fuse="${var_fuse:-1}" +var_tun="${var_tun:-1}" header_info "$APP" variables From 9f612cafbbe916258eca1e7ba3a38af68d66bb12 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 17:11:07 +0200 Subject: [PATCH 66/67] test --- ct/argus.sh | 2 -- ct/debian.sh | 38 ++++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ct/argus.sh b/ct/argus.sh index ff3602a..b7032fe 100644 --- a/ct/argus.sh +++ b/ct/argus.sh @@ -13,8 +13,6 @@ var_disk="${var_disk:-3}" var_os="${var_os:-debian}" var_version="${var_version:-12}" var_unprivileged="${var_unprivileged:-1}" -var_fuse="${var_fuse:-1}" -var_tun="${var_tun:-1}" header_info "$APP" variables diff --git a/ct/debian.sh b/ct/debian.sh index 187457d..2a28d61 100644 --- a/ct/debian.sh +++ b/ct/debian.sh @@ -13,6 +13,8 @@ var_disk="${var_disk:-2}" var_os="${var_os:-debian}" var_version="${var_version:-12}" var_unprivileged="${var_unprivileged:-1}" +var_fuse="${var_fuse:-1}" +var_tun="${var_tun:-1}" header_info "$APP" variables @@ -20,18 +22,18 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /var ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating $APP LXC" - $STD apt-get update - $STD apt-get -y upgrade - msg_ok "Updated $APP LXC" + header_info + check_container_storage + check_container_resources + if [[ ! -d /var ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Updating $APP LXC" + $STD apt-get update + $STD apt-get -y upgrade + msg_ok "Updated $APP LXC" + exit } start @@ -42,10 +44,10 @@ msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" read -p "Remove this Container? " prompt - if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then - pct stop "$CTID" - pct destroy "$CTID" - msg_ok "Removed this script" - else - msg_warn "Did not remove this script" - fi +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then + pct stop "$CTID" + pct destroy "$CTID" + msg_ok "Removed this script" +else + msg_warn "Did not remove this script" +fi From 46497cdc8deea4ff44aed0088e6efa5bd12d6027 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 20 May 2025 17:12:34 +0200 Subject: [PATCH 67/67] Update build.func --- misc/build.func | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/misc/build.func b/misc/build.func index 8084e63..431eaf0 100644 --- a/misc/build.func +++ b/misc/build.func @@ -966,13 +966,6 @@ build_container() { FEATURES="$FEATURES,fuse=1" fi - if [ "$ENABLE_TUN" == "1" ]; then - cat <>"$LXC_CONFIG" -lxc.cgroup2.devices.allow: c 10:200 rwm -lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file -EOF - fi - if [[ $DIAGNOSTICS == "yes" ]]; then post_to_api fi @@ -1066,6 +1059,13 @@ EOF fi fi + if [ "$ENABLE_TUN" == "1" ]; then + cat <>"$LXC_CONFIG" +lxc.cgroup2.devices.allow: c 10:200 rwm +lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file +EOF + fi + # This starts the container and executes -install.sh msg_info "Starting LXC Container" pct start "$CTID"