MTG:MTProto proxy for Telegram install

https://github.com/9seconds/mtg

安裝 MTG 2.0版本

wget https://github.com/9seconds/mtg/releases/download/v2.0.1/mtg-2.0.1-linux-amd64.tar.gz

最新版 >> MTG

解壓縮:

tar zxvf mtg-2.0.1-linux-amd64.tar.gz

複製檔案:

cp mtg /usr/local/bin/

取得Secret碼:

mtg generate-secret --hex itunes.apple.com 

<上面網址換成自訂需要的網址>

新增設定檔:

nano /etc/mtg.toml

設定內容:

secret = "ee75e_______2e636f6d"
bind-to = "0.0.0.0:56789"
[stats.prometheus]
enabled = true
bind-to = "0.0.0.0:3129"
http-path = "/"
metric-prefix = "mtg"

寫成系統服務方式:

nano /etc/systemd/system/mtg.service
[Unit]
Description=mtg

[Service]
ExecStart=/usr/local/bin/mtg run /etc/mtg.toml
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

載入服務並啟用:

systemctl daemon-reload
systemctl enable mtg
systemctl start mtg
systemctl status mtg

Prometheus:

- job_name: 'MTProto_Service'
    static_configs:
      - targets: ['10.0.1.179:3129']
        labels:
          alias: TW_MTP
      - targets: ['XX.XX.XX.XX:3129']
        labels:
          alias: Toyko_MTP
      - targets: ['XX.XX.XX.XX:3129']
        labels:
          alias: Osaka_MTP

Grafana Dashboard:

MTproto:Telegram MTProto Proxy (mtg) Status-1584207043944.json

 

阅读剩余
THE END