Add Telegram cancellation import functionality with tests and documentation

- Implemented Telegram cancellation parsing logic in `telegramCancellationParser.js`.
- Created unit tests for cancellation parsing in `telegramCancellationParser.test.js`.
- Developed integration tests for Telegram import service in `telegramImport.integration.test.js`.
- Added API tests for Telegram import endpoints in `telegramImportApi.test.js`.
- Introduced service tests for Telegram import logic in `telegramImportService.test.js`.
- Documented the Telegram cancellation import process in `telegram-cancellation-import.md`.
- Built a React component for managing Telegram imports in `TelegramImportPanel.jsx`.
This commit is contained in:
2026-10-03 00:45:41 +03:00
parent b5c6b1973e
commit f7f0b039dd
28 changed files with 1381 additions and 17 deletions

View File

@@ -28,6 +28,20 @@ FIREBASE_SECRETS_DIR=/opt/polotsk-transit/secrets
# with the absolute host path to the JSON file.
GOOGLE_APPLICATION_CREDENTIALS=/run/secrets/firebase-service-account.json
# Telegram cancellation import through a separate user account (MTProto).
# Get API credentials at my.telegram.org. Never put a session in the checkout.
TELEGRAM_IMPORT_ENABLED=false
TELEGRAM_AUTO_PUBLISH=true
TELEGRAM_API_ID=
TELEGRAM_API_HASH=
TELEGRAM_CHANNEL=avp2Polotsk
TELEGRAM_CITY_SLUG=polotsk
TELEGRAM_POLL_INTERVAL_MS=60000
# Host directory, mounted read-only into the backend container.
TELEGRAM_SECRETS_DIR=/opt/polotsk-transit/telegram-secrets
# For direct Node.js launches, replace this with the absolute host path.
TELEGRAM_SESSION_FILE=/run/telegram-secrets/account.session
# Bootstrap admin
BOOTSTRAP_ADMIN=true
BOOTSTRAP_ADMIN_RESET_PASSWORD=false