alexbers/mtprotoproxy's Fake-TLS handshake was rejected by real Telegram clients (server/clock/secret/egress all verified good), so replace it with Telemt (ghcr.io/telemt/telemt:3.4.25) - the same proven implementation as the Hetzner endpoint. Config: Fake-TLS on :1080, use_middle_proxy=false (direct-to-DC, required with a SOCKS5 upstream) and [[upstreams]] socks5 ts-proxy:1055 so only DC-bound traffic exits via the Tailscale exit node. Secret in host-only telemt.toml; config.py.example (alexbers) removed. Telemt stays on json-file (its tracing logs don't ship cleanly via the syslog driver). Dashboard: retarget the working 3proxy queries from :1080 to the HTTP front :3128 (the old HTTP section used stale tinyproxy patterns), drop the retired SOCKS5 section, add a Telegram/Telemt info panel. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
488 lines
12 KiB
JSON
488 lines
12 KiB
JSON
{
|
|
"uid": "tailscale-proxy",
|
|
"title": "Tailscale прокси — HTTP (:3128) + Telegram (:1080)",
|
|
"tags": [
|
|
"proxy",
|
|
"tailscale",
|
|
"loki"
|
|
],
|
|
"schemaVersion": 39,
|
|
"version": 3,
|
|
"editable": true,
|
|
"refresh": "30s",
|
|
"time": {
|
|
"from": "now-6h",
|
|
"to": "now"
|
|
},
|
|
"timezone": "",
|
|
"templating": {
|
|
"list": [
|
|
{
|
|
"name": "datasource",
|
|
"type": "datasource",
|
|
"query": "loki",
|
|
"current": {},
|
|
"hide": 0,
|
|
"refresh": 1,
|
|
"includeAll": false,
|
|
"multi": false,
|
|
"regex": ""
|
|
}
|
|
]
|
|
},
|
|
"annotations": {
|
|
"list": []
|
|
},
|
|
"panels": [
|
|
{
|
|
"type": "row",
|
|
"title": "HTTP-прокси (:3128) — 3proxy",
|
|
"collapsed": false,
|
|
"gridPos": {
|
|
"h": 1,
|
|
"w": 24,
|
|
"x": 0,
|
|
"y": 0
|
|
},
|
|
"panels": []
|
|
},
|
|
{
|
|
"type": "stat",
|
|
"title": "Всего запросов",
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"gridPos": {
|
|
"h": 4,
|
|
"w": 8,
|
|
"x": 0,
|
|
"y": 1
|
|
},
|
|
"options": {
|
|
"reduceOptions": {
|
|
"calcs": [
|
|
"lastNotNull"
|
|
],
|
|
"fields": "",
|
|
"values": false
|
|
},
|
|
"colorMode": "value",
|
|
"graphMode": "none",
|
|
"textMode": "auto",
|
|
"justifyMode": "auto"
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "fixed",
|
|
"fixedColor": "purple"
|
|
},
|
|
"unit": "short"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"editorMode": "code",
|
|
"expr": "sum(count_over_time({source_ip=\"192.168.0.35\"} |~ \" 3128 00000 \" [$__range]))",
|
|
"refId": "A",
|
|
"queryType": "instant"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "stat",
|
|
"title": "Уникальных клиентов",
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"gridPos": {
|
|
"h": 4,
|
|
"w": 8,
|
|
"x": 8,
|
|
"y": 1
|
|
},
|
|
"options": {
|
|
"reduceOptions": {
|
|
"calcs": [
|
|
"lastNotNull"
|
|
],
|
|
"fields": "",
|
|
"values": false
|
|
},
|
|
"colorMode": "value",
|
|
"graphMode": "none",
|
|
"textMode": "auto",
|
|
"justifyMode": "auto"
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "fixed",
|
|
"fixedColor": "purple"
|
|
},
|
|
"unit": "short"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"editorMode": "code",
|
|
"expr": "count(sum by (clientip)(count_over_time({source_ip=\"192.168.0.35\"} |~ \" 3128 00000 \" | pattern \"<ts> <svc> <err> <user> <clientip>:<cport> <_>\" [$__range])))",
|
|
"refId": "A",
|
|
"queryType": "instant"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "stat",
|
|
"title": "Уникальных назначений",
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"gridPos": {
|
|
"h": 4,
|
|
"w": 8,
|
|
"x": 16,
|
|
"y": 1
|
|
},
|
|
"options": {
|
|
"reduceOptions": {
|
|
"calcs": [
|
|
"lastNotNull"
|
|
],
|
|
"fields": "",
|
|
"values": false
|
|
},
|
|
"colorMode": "value",
|
|
"graphMode": "none",
|
|
"textMode": "auto",
|
|
"justifyMode": "auto"
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "fixed",
|
|
"fixedColor": "purple"
|
|
},
|
|
"unit": "short"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"editorMode": "code",
|
|
"expr": "count(sum by (dest)(count_over_time({source_ip=\"192.168.0.35\"} |~ \" 3128 00000 \" | pattern \"<ts> <svc> <err> <user> <c> <via> <bin> <bout> <flag> <method> <dest> <_>\" [$__range])))",
|
|
"refId": "A",
|
|
"queryType": "instant"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "timeseries",
|
|
"title": "Запросы по методам",
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"gridPos": {
|
|
"h": 8,
|
|
"w": 12,
|
|
"x": 0,
|
|
"y": 5
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {
|
|
"drawStyle": "line",
|
|
"fillOpacity": 15,
|
|
"stacking": {
|
|
"mode": "normal",
|
|
"group": "A"
|
|
}
|
|
},
|
|
"unit": "cps"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"legend": {
|
|
"displayMode": "list",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "desc"
|
|
}
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"editorMode": "code",
|
|
"expr": "sum by (method)(count_over_time({source_ip=\"192.168.0.35\"} |~ \" 3128 00000 \" | pattern \"<ts> <svc> <err> <user> <c> <via> <bin> <bout> <flag> <method> <dest> <_>\" [$__auto]))",
|
|
"refId": "A",
|
|
"queryType": "range",
|
|
"legendFormat": "{{method}}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "timeseries",
|
|
"title": "Трафик клиенту (байт/интервал)",
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"gridPos": {
|
|
"h": 8,
|
|
"w": 12,
|
|
"x": 12,
|
|
"y": 5
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {
|
|
"drawStyle": "line",
|
|
"fillOpacity": 15,
|
|
"stacking": {
|
|
"mode": "none",
|
|
"group": "A"
|
|
}
|
|
},
|
|
"unit": "bytes"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"legend": {
|
|
"displayMode": "list",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "desc"
|
|
}
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"editorMode": "code",
|
|
"expr": "sum(sum_over_time({source_ip=\"192.168.0.35\"} |~ \" 3128 00000 \" | pattern \"<ts> <svc> <err> <user> <c> <via> <bin> <bout> <rest>\" | unwrap bout [$__auto]))",
|
|
"refId": "A",
|
|
"queryType": "range",
|
|
"legendFormat": "байт"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "table",
|
|
"title": "Топ назначений",
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"gridPos": {
|
|
"h": 9,
|
|
"w": 12,
|
|
"x": 0,
|
|
"y": 13
|
|
},
|
|
"options": {
|
|
"showHeader": true,
|
|
"sortBy": [
|
|
{
|
|
"displayName": "соединений",
|
|
"desc": true
|
|
}
|
|
]
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {
|
|
"align": "auto",
|
|
"filterable": true
|
|
}
|
|
},
|
|
"overrides": []
|
|
},
|
|
"transformations": [
|
|
{
|
|
"id": "labelsToFields",
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": "organize",
|
|
"options": {
|
|
"excludeByName": {
|
|
"Time": true
|
|
},
|
|
"renameByName": {
|
|
"dest": "dest",
|
|
"Value #A": "соединений",
|
|
"Value": "соединений"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"editorMode": "code",
|
|
"expr": "topk(15, sum by (dest)(count_over_time({source_ip=\"192.168.0.35\"} |~ \" 3128 00000 \" | pattern \"<ts> <svc> <err> <user> <c> <via> <bin> <bout> <flag> <method> <dest> <_>\" [$__range])))",
|
|
"refId": "A",
|
|
"queryType": "instant"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "table",
|
|
"title": "Топ клиентов",
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"gridPos": {
|
|
"h": 9,
|
|
"w": 12,
|
|
"x": 12,
|
|
"y": 13
|
|
},
|
|
"options": {
|
|
"showHeader": true,
|
|
"sortBy": [
|
|
{
|
|
"displayName": "соединений",
|
|
"desc": true
|
|
}
|
|
]
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"custom": {
|
|
"align": "auto",
|
|
"filterable": true
|
|
}
|
|
},
|
|
"overrides": []
|
|
},
|
|
"transformations": [
|
|
{
|
|
"id": "labelsToFields",
|
|
"options": {}
|
|
},
|
|
{
|
|
"id": "organize",
|
|
"options": {
|
|
"excludeByName": {
|
|
"Time": true
|
|
},
|
|
"renameByName": {
|
|
"clientip": "clientip",
|
|
"Value #A": "соединений",
|
|
"Value": "соединений"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"editorMode": "code",
|
|
"expr": "topk(15, sum by (clientip)(count_over_time({source_ip=\"192.168.0.35\"} |~ \" 3128 00000 \" | pattern \"<ts> <svc> <err> <user> <clientip>:<cport> <_>\" [$__range])))",
|
|
"refId": "A",
|
|
"queryType": "instant"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "logs",
|
|
"title": "Журнал доступа HTTP (live)",
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"gridPos": {
|
|
"h": 10,
|
|
"w": 24,
|
|
"x": 0,
|
|
"y": 22
|
|
},
|
|
"options": {
|
|
"showTime": true,
|
|
"wrapLogMessage": false,
|
|
"enableLogDetails": true,
|
|
"dedupStrategy": "none",
|
|
"sortOrder": "Descending"
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "loki",
|
|
"uid": "${datasource}"
|
|
},
|
|
"editorMode": "code",
|
|
"expr": "{source_ip=\"192.168.0.35\"} |~ \" 3128 [0-9]{5} \"",
|
|
"queryType": "range",
|
|
"refId": "A"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "row",
|
|
"title": "Telegram MTProto (:1080) — Telemt",
|
|
"collapsed": false,
|
|
"gridPos": {
|
|
"h": 1,
|
|
"w": 24,
|
|
"x": 0,
|
|
"y": 32
|
|
},
|
|
"panels": []
|
|
},
|
|
{
|
|
"type": "text",
|
|
"title": "Telegram-прокси (Telemt) — наблюдение",
|
|
"gridPos": {
|
|
"h": 7,
|
|
"w": 24,
|
|
"x": 0,
|
|
"y": 33
|
|
},
|
|
"options": {
|
|
"mode": "markdown",
|
|
"content": "### Telegram MTProto прокси — `ts-lan-telemt` (Telemt), порт `192.168.0.35:1080`\n\nFake-TLS MTProto-прокси для Telegram. Егресс к Telegram DC идёт через `ts-proxy` (Tailscale userspace SOCKS5) → выходной узел Hetzner `89.167.72.79`.\n\nЛоги Telemt **не** отправляются в Loki (формат tracing плохо ложится в syslog-драйвер), поэтому здесь панелей нет. Наблюдать за ним:\n\n- `docker logs ts-lan-telemt` на docker-хосте (подключения `peer=`, `user=tekhnohim`, трафик `c2s_bytes/s2c_bytes`, ошибки апстрима к DC);\n- при необходимости включить Prometheus-метрики Telemt (`[server] metrics_port`) и снимать их Zabbix-ом, как на Hetzner.\n\nВнешний вход `p.technohim.com:1080` (роутер Kirochnaya, port-forward + NAT-loopback для LAN). HTTP-трафик Telegram API (`149.154.167.x`) виден и в панелях HTTP-прокси выше."
|
|
},
|
|
"pluginVersion": "",
|
|
"datasource": null
|
|
}
|
|
]
|
|
} |