Files
telemt-api/config.example.yaml
Denozordec d021e4b1d7
Publish telemt-api gateway Docker image / test (push) Successful in 23s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 2m9s
Add Radar DC Telegram functionality and configuration
- Introduced new `RadarConfig` structure in `config.go` to manage radar settings, including `statuses_url`, `http_timeout_ms`, and `ping_from`.
- Implemented validation for radar configuration in `config_test.go` to ensure correct URL schemes and timeout limits.
- Added new API routes for radar statuses and ping functionality in the gateway, enhancing the service's capabilities.
- Updated documentation in `GATEWAY_RUN.md` to include details about the new radar features and their usage.
- Enhanced the user interface to include navigation and display options for the Radar DC section in the sidebar and page titles.
- Added client-side API functions for fetching radar statuses and ping responses, improving integration with the frontend.
2026-04-12 12:53:20 +07:00

82 lines
3.4 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Telemt API gateway — copy to config.yaml and mount into the container.
#
# Semantics: client calls GET /api/{alias}/health
# forwarded to GET {base_url}/v1/health
#
# Web UI (SvelteKit) в образе Docker встроен в тот же процесс: GET / — панель,
# /api/… — API. CORS для панели на том же origin не нужен.
listen: ":8080"
# Диагностика: при 502 от прокси в JSON добавляется error.detail с текстом ошибки RoundTrip (TLS, DNS, таймаут).
# Включайте только во внутренней сети — строка может содержать хосты/порты upstream.
# expose_upstream_errors: true
# If true, IP whitelist is not enforced (development only).
allow_all: false
# CIDR allowlist when allow_all is false. Empty list denies all clients.
# Можно указывать и одиночный IP (будет трактован как /32 или /128), и CIDR.
whitelist_cidrs:
- "127.0.0.1/32"
- "203.0.113.5"
- "::1/128"
# Docker bridge (adjust to your environment):
# - "172.16.0.0/12"
# When the direct TCP peer is in these CIDRs, client IP for whitelist is taken
# from X-Forwarded-For (first hop) or X-Real-IP (e.g. behind nginx).
# trusted_proxies:
# - "10.0.0.0/8"
trusted_proxies: []
# CORS только если фронт на другом origin (например Vite :5173 при разработке).
# В production за nginx на одном хосте с шлюзом обычно не требуется.
# cors_allowed_origins:
# - "http://localhost:5173"
# # - "*"
# Опционально: по умолчанию /api/agg/* опрашивает все servers; можно ограничить список и включить кэш ответов:
# aggregate:
# include_aliases:
# - gt1
# - gt2
# cache_ttl_ms: 2000
# Радар DC Telegram: прокси к radar.telemt.top и TCP-пинг DC с хоста шлюза (см. README).
# radar:
# statuses_url: "https://radar.telemt.top/api/v1/endpoints/statuses"
# http_timeout_ms: 30000
# ping_from: "stats.example.com"
# Геолокация IP в /api/agg/unique-ips. См. docs/GEOIP.md (City + опционально ASN; Country-only не нужен)
# geoip:
# enabled: true
# database_path: /var/lib/telemt-gateway/GeoLite2-City.mmdb
# download_url: "https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-City.mmdb"
# asn_database_path: /var/lib/telemt-gateway/GeoLite2-ASN.mmdb
# asn_download_url: "https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-ASN.mmdb"
servers:
- alias: main_srv
base_url: http://127.0.0.1:9091
path_prefix: /v1
# authorization_env: TELEMT_API_AUTH
# Mihomo: тот же compose-сервис (container_name: mihomo, сеть proxy-net, external-controller :9090).
# У процесса/контейнера gateway в environment: TELEMT_MIHOMO_AUTH=Bearer ${CLASH_SECRET} (как у mihomo).
mihomo_base_url: http://172.20.0.2:9090
mihomo_authorization_env: Bearer Ifwrbqifwrbq1995
# ivx: HTTPS + nginx location /api/ → Telemt; base_url должен заканчиваться на /api/
- alias: gt1
base_url: https://gt1.ivx.su/api/
path_prefix: /v1
- alias: gt2
base_url: https://gt2.ivx.su/api/
path_prefix: /v1
- alias: gt3
base_url: https://gt3.ivx.su/api/
path_prefix: /v1