From ec1c6b4fb6e838f97657dd9c96147dc690237c11 Mon Sep 17 00:00:00 2001 From: Alexander Bersenev Date: Wed, 27 Jun 2018 20:04:05 +0500 Subject: [PATCH] we need at least one undocumented launching way :) --- mtprotoproxy.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mtprotoproxy.py b/mtprotoproxy.py index cc2e608..022eb22 100755 --- a/mtprotoproxy.py +++ b/mtprotoproxy.py @@ -73,10 +73,18 @@ if hasattr(signal, 'SIGUSR1'): signal.signal(signal.SIGUSR1, debug_signal) -if len(sys.argv) > 1: +if len(sys.argv) < 2: + config = runpy.run_module("config") +elif len(sys.argv) == 2: config = runpy.run_path(sys.argv[1]) else: - config = runpy.run_module("config") + # undocumented way of launching + config = {} + config["PORT"] = int(sys.argv[1]) + secrets = sys.argv[2].split(",") + config["USERS"] = {"user%d" % i: secrets[i].zfill(32) for i in range(len(secrets))} + if len(sys.argv) > 3: + config["AD_TAG"] = sys.argv[3] PORT = config["PORT"] USERS = config["USERS"]