From b7db2f38d62c413e0da04e3c1a1df7b08ddc1ac9 Mon Sep 17 00:00:00 2001 From: Tobias <96661824+CrazyWolf13@users.noreply.github.com> Date: Thu, 26 Jun 2025 20:30:56 +0200 Subject: [PATCH] Update gitea-mirror.sh --- ct/gitea-mirror.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ct/gitea-mirror.sh b/ct/gitea-mirror.sh index 008830a5..cf014ebd 100644 --- a/ct/gitea-mirror.sh +++ b/ct/gitea-mirror.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: CrazyWolf13 # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -24,10 +24,30 @@ function update_script() { header_info check_container_storage check_container_resources + if [[ ! -d /opt/gitea-mirror ]]; then msg_error "No ${APP} Installation Found!" exit fi + + APP_VERSION=$(grep -o '"version": *"[^"]*"' package.json | cut -d'"' -f4) + if [[ $APP_VERSION =~ ^2\. ]]; then + if ! whiptail --backtitle "Gitea Mirror Update" --title "⚠️ VERSION 2.x DETECTED" --yesno \ + "WARNING: Version $APP_VERSION detected!\n\nUpdating from version 2.x will CLEAR ALL CONFIGURATION.\n\nThis includes:\n• API tokens\n• User settings\n• Repository configurations\n• All custom settings\n\nDo you want to continue with the update process?" 15 70 --defaultno + then + exit 0 + fi + + if ! whiptail --backtitle "Gitea Mirror Update" --title "⚠️ FINAL CONFIRMATION" --yesno \ + "FINAL WARNING: This update WILL clear all configuration!\n\nBEFORE PROCEEDING, please:\n\n• Copy API tokens to a safe location\n• Backup any custom configurations\n• Note down repository settings\n\nThis action CANNOT be undone!" 18 70 --defaultno + then + whiptail --backtitle "Gitea Mirror Update" --title "Update Cancelled" --msgbox "Update process cancelled. Please backup your configuration before proceeding." 8 60 + exit 0 + fi + + whiptail --backtitle "Gitea Mirror Update" --title "Proceeding with Update" --msgbox \ + "Proceeding with version $APP_VERSION update.\n\nAll configuration will be cleared as warned." 8 50 + else RELEASE=$(curl -fsSL https://api.github.com/repos/arunavo4/gitea-mirror/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') if [[ "${RELEASE}" != "$(cat ~/.${APP} 2>/dev/null || cat /opt/${APP}_version.txt 2>/dev/null)" ]]; then