Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve docker and config parameters #184

Open
wants to merge 3 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ Fast and simple to setup MTProto proxy written in Python.

1. `git clone -b stable https://github.com/alexbers/mtprotoproxy.git; cd mtprotoproxy`
2. *(optional, recommended)* edit *config.py*, set **PORT**, **USERS** and **AD_TAG**
3. `docker-compose up -d` (or just `python3 mtprotoproxy.py` if you don't like Docker)
4. *(optional, get a link to share the proxy)* `docker-compose logs`
3. `docker build -t mtprotoproxy .`
4. `docker-compose up -d` (or just `python3 mtprotoproxy.py` if you don't like Docker)
5. *(optional, get a link to share the proxy)* `docker-compose logs`

![Demo](https://alexbers.com/mtprotoproxy/install_demo_v2.gif)

Expand Down
11 changes: 6 additions & 5 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import os
PORT = 443

# name -> secret (32 hex chars)
USERS = {
"tg": "00000000000000000000000000000001",
"tg": os.environ.get("TG_KEY", "00000000000000000000000000000001"),
# "tg2": "0123456789abcdef0123456789abcdef",
}

# Makes the proxy harder to detect
# Can be incompatible with very old clients
SECURE_ONLY = True
SECURE_ONLY = os.environ.get('SECURE_ONLY', True)

# Makes the proxy even more hard to detect
# Compatible only with the recent clients
TLS_ONLY = True
TLS_ONLY = os.environ.get('TLS_ONLY', True)

# The domain for TLS, bad clients are proxied there
# Use random existing domain, proxy checks it on start
# TLS_DOMAIN = "www.google.com"
TLS_DOMAIN = os.environ.get('TLS_DOMAIN', 'www.google.com')

# Tag for advertising, obtainable from @MTProxybot
# AD_TAG = "3c09c680b76ee91a4c25ad51f742267d"
AD_TAG = os.environ.get('AD_TAG', '3c09c680b76ee91a4c25ad51f742267d')
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
version: '2.0'
services:
mtprotoproxy:
build: .
image: mtprotoproxy
restart: unless-stopped
network_mode: "host"
environment:
- TG_KEY=00000000000000000000000000000001
- SECURE_ONLY=true
- TLS_ONLY=true
- TLS_DOMAIN=www.drive.google.com
- AD_TAG=3c09c680b76ee91a4c25ad51f742267d

volumes:
- ./config.py:/home/tgproxy/config.py
- ./mtprotoproxy.py:/home/tgproxy/mtprotoproxy.py
Expand Down