mirror of
https://github.com/anten-ka/gotelegram_pro.git
synced 2026-05-19 14:36:05 +00:00
v2.4.0 — internationalization (EN/RU) + custom git templates
- 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
This commit is contained in:
29
bootstrap.sh
29
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
|
||||
|
||||
Reference in New Issue
Block a user