From 32f204c871b4a4884b730bad62224002e2ea1304 Mon Sep 17 00:00:00 2001 From: anten-ka Date: Fri, 10 Apr 2026 11:48:37 +0300 Subject: [PATCH] =?UTF-8?q?v2.4.0=20=E2=80=94=20internationalization=20(EN?= =?UTF-8?q?/RU)=20+=20custom=20git=20templates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - i18n engine (lib/i18n.sh, lib/lang/en.sh, lib/lang/ru.sh) - first-run language picker, persisted to .language + config.json - install.sh, common.sh, backup.sh, templates_catalog.sh wired through t()/tf() - backup.sh preserves .language marker and records language in metadata.json - custom git template feature (first item in pro template picker) * validates HTTPS URLs, rejects shell metachars * 100MB size guard, 90s clone timeout * auto-detects index.html in dist/public/build/_site/site/docs/out/www - bot v2.4.0: i18n.py + lang/{en,ru}.json, /lang command, language toggle button - bot: custom git template via text input with waiter gating --- bootstrap.sh | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index b45b401..cd1a653 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -6,9 +6,11 @@ set -euo pipefail REPO="anten-ka/gotelegram_pro" BRANCH="${GOTELEGRAM_BRANCH:-test}" -PAT="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" +PAT="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" INSTALL_DIR="/opt/gotelegram" -API="https://api.github.com/repos/${REPO}/contents" +# Use raw.githubusercontent.com (CDN) — faster and avoids Contents API caching +# issues that occasionally return 404 for recently added files on non-default branches. +RAW="https://raw.githubusercontent.com/${REPO}/${BRANCH}" RED='\033[0;31m' GREEN='\033[0;32m' @@ -47,17 +49,20 @@ download_file() { dir=$(dirname "$local_path") mkdir -p "$dir" - local http_code - http_code=$(curl -sL -w "%{http_code}" -o "$local_path" \ - -H "Authorization: token ${PAT}" \ - -H "Accept: application/vnd.github.raw" \ - "${API}/${remote_path}?ref=${BRANCH}") + # Retry up to 3 times with short backoff to tolerate transient CDN hiccups + local attempt http_code + for attempt in 1 2 3; do + http_code=$(curl -sL -w "%{http_code}" -o "$local_path" \ + -H "Authorization: token ${PAT}" \ + "${RAW}/${remote_path}") + if [ "$http_code" = "200" ]; then + return 0 + fi + sleep 1 + done - if [ "$http_code" != "200" ]; then - echo -e " ${RED}✗${NC} Ошибка загрузки ${remote_path} (HTTP ${http_code})" - return 1 - fi - return 0 + echo -e " ${RED}✗${NC} Ошибка загрузки ${remote_path} (HTTP ${http_code})" + return 1 } # File list