svc-api: переход на Gateway (lk-api-gateway), User-Agent+Referer для DDoS-Guard, метод Виталия /instanceOperations/default/{id} с dataDescriptor, LEGACY-пометки везде

This commit is contained in:
“Naeel”
2026-07-16 13:48:34 +04:00
parent b9130fdd79
commit f5547c0465
87 changed files with 505 additions and 288 deletions
+2 -1
View File
@@ -105,7 +105,8 @@ if [[ ! -f "$SERVICES_FILE" ]]; then
exit 2
fi
API_ENDPOINT="${NUBES_API_ENDPOINT:-https://deck-api.ngcloud.ru/api/v1/index.cfm}"
# ⛔ LEGACY: deck-api.ngcloud.ru ЗАКРЫВАЕТСЯ. Default = Gateway. Override via NUBES_API_ENDPOINT.
API_ENDPOINT="${NUBES_API_ENDPOINT:-https://lk-api-gateway.ngcloud.ru/api/v1/svc}"
# Auto-detect API style: if endpoint contains "index.cfm" → legacy proxy (?endpoint=),
# otherwise → new REST gateway (direct paths). No forced /index.cfm normalization.
@@ -92,7 +92,8 @@ mkdir -p "$DOCS_DIR"
# Determine API endpoint for doc examples.
# Use NUBES_API_ENDPOINT from profile.env, fall back to production default.
DOCS_API_ENDPOINT="${NUBES_API_ENDPOINT:-https://deck-api.ngcloud.ru/api/v1/index.cfm}"
# ⛔ LEGACY: deck-api.ngcloud.ru ЗАКРЫВАЕТСЯ. Default = Gateway. Override via NUBES_API_ENDPOINT.
DOCS_API_ENDPOINT="${NUBES_API_ENDPOINT:-https://lk-api-gateway.ngcloud.ru/api/v1/svc}"
# If endpoint looks like new REST gateway (no index.cfm), keep as-is.
# If it's old-style without index.cfm, append it for backward compat in docs.
if [[ "$DOCS_API_ENDPOINT" != *"/index.cfm"* ]] && [[ "$DOCS_API_ENDPOINT" != *"/svc"* ]]; then
+4 -2
View File
@@ -9,8 +9,9 @@ PROFILE_DIR="${PROFILE_DIR:-}"
normalize_api_endpoint() {
local endpoint="$1"
endpoint="${endpoint%/}"
# ⛔ LEGACY: deck-api.ngcloud.ru ЗАКРЫВАЕТСЯ.
if [[ -z "$endpoint" ]]; then
echo "https://deck-api.ngcloud.ru/api/v1/index.cfm"
echo "https://lk-api-gateway.ngcloud.ru/api/v1/svc"
return
fi
# Keep as-is: both legacy proxy (index.cfm) and new REST gateway are valid.
@@ -84,7 +85,8 @@ if [[ -n "$PROFILE_DIR" ]]; then
fi
fi
DOCS_API_ENDPOINT="${NUBES_API_ENDPOINT:-https://deck-api.ngcloud.ru/api/v1/index.cfm}"
# ⛔ LEGACY: deck-api.ngcloud.ru ЗАКРЫВАЕТСЯ. Default = Gateway.
DOCS_API_ENDPOINT="${NUBES_API_ENDPOINT:-https://lk-api-gateway.ngcloud.ru/api/v1/svc}"
DOCS_API_ENDPOINT="$(normalize_api_endpoint "$DOCS_API_ENDPOINT")"
if [[ -n "${MKDOCS_DOCS_DIR:-}" ]]; then