From ecb981c8a7b63bd1a05bbd6e668ccd8fec3ed936 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 12 Aug 2026 20:51:32 -0500 Subject: [PATCH] update --- README.md | 4 +- install-pulse.sh | 2 +- install-ta_proxmenu.sh | 122 +++++++++++++++++++++++++++++++++ tests/test-pulse-standalone.sh | 4 +- 4 files changed, 127 insertions(+), 5 deletions(-) create mode 100755 install-ta_proxmenu.sh diff --git a/README.md b/README.md index 8fd7429..46358d7 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ VE environments. Run as `root` on a Proxmox VE host: ```bash -bash <(curl -fsSL https://go.scity.us/install-tapm) +bash <(curl -fsSL https://tagit.technologyarch.com/TAI/TA-ProxMenu/raw/branch/V2/install-ta_proxmenu.sh) ``` The installed launcher loads TA-ProxMenu's bundled defaults and colors, then @@ -104,7 +104,7 @@ Pulse can also be deployed without installing TA-ProxMenu. Run the standalone bootstrap as root on a Proxmox VE host: ```bash -bash <(curl -fsSL https://tagit.technologyarch.com/taiadmin/TA-ProxMenu/raw/branch/V2/install-pulse.sh) +bash <(curl -fsSL https://tagit.technologyarch.com/TAI/TA-ProxMenu/raw/branch/V2/install-pulse.sh) ``` The bootstrap downloads the Pulse deployment module and its LXC storage helper diff --git a/install-pulse.sh b/install-pulse.sh index bbd2849..27c7820 100755 --- a/install-pulse.sh +++ b/install-pulse.sh @@ -4,7 +4,7 @@ set -u -o pipefail TAPM_PULSE_SOURCE_BRANCH="${TAPM_PULSE_SOURCE_BRANCH:-V2}" -TAPM_PULSE_SOURCE_BASE="${TAPM_PULSE_SOURCE_BASE:-https://tagit.technologyarch.com/taiadmin/TA-ProxMenu/raw/branch/${TAPM_PULSE_SOURCE_BRANCH}}" +TAPM_PULSE_SOURCE_BASE="${TAPM_PULSE_SOURCE_BASE:-https://tagit.technologyarch.com/TAI/TA-ProxMenu/raw/branch/${TAPM_PULSE_SOURCE_BRANCH}}" TAPM_PULSE_BOOTSTRAP_DIR='' TAPM_TEMP_DIR='' declare -a TAPM_TEMP_DIRS=() diff --git a/install-ta_proxmenu.sh b/install-ta_proxmenu.sh new file mode 100755 index 0000000..dfc5d81 --- /dev/null +++ b/install-ta_proxmenu.sh @@ -0,0 +1,122 @@ +#!/usr/bin/env bash +# Install TA-ProxMenu on a Proxmox VE host. + +set -Eeuo pipefail + +readonly INSTALL_ROOT='/opt/idssys' +readonly TAPM_DIR="${INSTALL_ROOT}/ta-proxmenu" +readonly DEFAULTS_DIR="${INSTALL_ROOT}/defaults" +readonly TAPM_REPOSITORY='https://tagit.technologyarch.com/TAI/TA-ProxMenu.git' +readonly DEFAULTS_REPOSITORY='https://git.scity.us/voltron/iDS-Defaults.git' +readonly TAPM_LAUNCHER='/usr/local/bin/tapm' +readonly REQUESTED_BRANCH="${TAPM_BRANCH:-}" + +declare -a TEMP_PATHS=() + +cleanup() { + local path + + for path in "${TEMP_PATHS[@]}"; do + [[ -e "$path" ]] && rm -rf -- "$path" + done +} + +fail() { + printf 'ERROR: %s\n' "$*" >&2 + exit 1 +} + +clone_repository() { + local repository="$1" + local destination="$2" + local label="$3" + local branch="${4:-}" + local temporary + + if [[ -d "${destination}/.git" ]]; then + printf '%s is already installed at %s; leaving it unchanged.\n' \ + "$label" "$destination" + return + fi + + [[ ! -e "$destination" ]] || + fail "${destination} already exists but is not a Git repository." + + temporary="${destination}.install.$$" + TEMP_PATHS+=("$temporary") + + printf 'Cloning %s...\n' "$label" + if [[ -n "$branch" ]]; then + git clone --branch "$branch" --single-branch \ + "$repository" "$temporary" + else + git clone "$repository" "$temporary" + fi + + mv "$temporary" "$destination" +} + +install_launcher() { + local current_target='' + + if [[ -L "$TAPM_LAUNCHER" ]]; then + current_target="$(readlink "$TAPM_LAUNCHER")" + if [[ "$current_target" == "${TAPM_DIR}/run.sh" ]]; then + return + fi + + fail "${TAPM_LAUNCHER} points to ${current_target}; it was not replaced." + fi + + [[ ! -e "$TAPM_LAUNCHER" ]] || + fail "${TAPM_LAUNCHER} already exists and was not replaced." + + ln -s "${TAPM_DIR}/run.sh" "$TAPM_LAUNCHER" +} + +trap cleanup EXIT + +(( EUID == 0 )) || fail 'Run this installer as root.' +command -v pveversion >/dev/null 2>&1 || + fail 'This installer must be run on a Proxmox VE host.' + +if [[ -n "$REQUESTED_BRANCH" ]] && + [[ ! "$REQUESTED_BRANCH" =~ ^[A-Za-z0-9._/-]+$ ]]; then + fail "Invalid TAPM_BRANCH value: ${REQUESTED_BRANCH}" +fi + +printf '\nTA-ProxMenu Installation Script\n\n' + +apt-get update +DEBIAN_FRONTEND=noninteractive apt-get install -y \ + ca-certificates curl git jq python3 wget + +mkdir -p "$INSTALL_ROOT" + +clone_repository \ + "$DEFAULTS_REPOSITORY" "$DEFAULTS_DIR" 'iDSSYS Defaults' +clone_repository \ + "$TAPM_REPOSITORY" "$TAPM_DIR" 'TA-ProxMenu' "$REQUESTED_BRANCH" + +[[ -x "${TAPM_DIR}/run.sh" ]] || + fail "${TAPM_DIR}/run.sh is missing or is not executable." +[[ -r "${DEFAULTS_DIR}/colors.inc" ]] || + fail "${DEFAULTS_DIR}/colors.inc is missing." +[[ -r "${DEFAULTS_DIR}/default.inc" ]] || + fail "${DEFAULTS_DIR}/default.inc is missing." + +install_launcher + +# Load the standard colors only after the trusted defaults repository exists. +# shellcheck disable=SC1091 +source "${DEFAULTS_DIR}/colors.inc" + +printf '\n%bTA-ProxMenu has been installed.%b\n\n' \ + "${idsCL[Yellow]}" "${idsCL[Default]}" +printf 'Run it with: %btapm%b\n\n' \ + "${idsCL[Green]}" "${idsCL[Default]}" + +if [[ -n "$REQUESTED_BRANCH" ]]; then + printf 'Installed branch: %b%s%b\n\n' \ + "${idsCL[Green]}" "$REQUESTED_BRANCH" "${idsCL[Default]}" +fi diff --git a/tests/test-pulse-standalone.sh b/tests/test-pulse-standalone.sh index 3fac251..d699255 100755 --- a/tests/test-pulse-standalone.sh +++ b/tests/test-pulse-standalone.sh @@ -16,9 +16,9 @@ assert_failure "source branch traversal rejected" \ TAPM_PULSE_VALID_SOURCE_BRANCH '../main' assert_success "HTTPS source base accepted" \ TAPM_PULSE_VALID_SOURCE_BASE \ - https://tagit.technologyarch.com/taiadmin/TA-ProxMenu/raw/branch/V2 + https://tagit.technologyarch.com/TAI/TA-ProxMenu/raw/branch/V2 assert_failure "HTTP source base rejected" \ TAPM_PULSE_VALID_SOURCE_BASE \ - http://tagit.technologyarch.com/taiadmin/TA-ProxMenu/raw/branch/V2 + http://tagit.technologyarch.com/TAI/TA-ProxMenu/raw/branch/V2 finish_tests