Esempio n. 1
0
def gostsh():
    alter("app/gost/gostproxy.sh", "app/gost/new-gostproxy.sh",
          "gostpassword.passphrase", app.gostpassword)
    response = FileResponse("app/gost/new-gostproxy.sh")
    response.media_type = "application/octet-stream"
    response.filename = "gostproxy.sh"
    return response
Esempio n. 2
0
def proxysh():
    alter("app/freelan/freeproxy.sh", "app/freelan/new-freeproxy.sh",
          "freelan.passphrase", app.passphrase)
    response = FileResponse("app/freelan/new-freeproxy.sh")
    response.media_type = "application/octet-stream"
    response.filename = "freeproxy.sh"
    return response
Esempio n. 3
0
def tproxyshell():
    # ext = os.path.basename(file_path).split('.')[-1].lower()
    # response = FileResponse(open(file_path, 'rb'))
    # # cannot be used to download py, db and sqlite3 files.
    # if ext not in ['py', 'db', 'sqlite3']:
    alter("v2rayTproxy.sh", "a39c3628-191c-4d0a-8a5b-47d1464b976b",
          "633134f5-d004-0fcf-766f-3da738a9d5d4")
    response = FileResponse("v2ray_console/new-v2rayTproxy.sh")
    response.media_type = "application/octet-stream"
    response.filename = "v2rayTproxy.sh"
    return response
Esempio n. 4
0
def api_goststart():
    if app.subgostlan.is_alive():
        logging.info("subgostlan is running")
        status = app.subgostlan.status()
        if status == "running":
            logging.info("gostlan is running")
            response = FileResponse("app/gost/error1.sh")
            response.media_type = "application/octet-stream"
            response.filename = "error1.sh"
            return response
        else:
            logging.error("gostlan is stopped")
            app.subgostlan.stop()
            response = FileResponse("app/gost/error2.sh")
            response.media_type = "application/octet-stream"
            response.filename = "error2.sh"
            return response
    else:
        logging.info("subgostlan is starting")
        app.gostpassword = str(uuid.uuid1())
        app.subgostlan = SubGostlan(app.gostpassword)
        app.subgostlan.start()
        return RedirectResponse("/gostsh?" + str(int(time.time())))
Esempio n. 5
0
def api_start():
    if app.subfreelan.is_alive():
        logging.info("subfreelan is running")
        status = app.subfreelan.status()
        if status == "running":
            logging.info("freelan is running")
            response = FileResponse("app/freelan/error1.sh")
            response.media_type = "application/octet-stream"
            response.filename = "error1.sh"
            return response
        else:
            logging.error("freelan is stopped")
            app.subfreelan.stop()
            response = FileResponse("app/freelan/error2.sh")
            response.media_type = "application/octet-stream"
            response.filename = "error2.sh"
            return response
    else:
        logging.info("subfreelan is starting")
        app.passphrase = str(uuid.uuid1())
        app.subfreelan = SubFreelan(app.passphrase)
        app.subfreelan.start()
        return RedirectResponse("/proxysh?" + str(int(time.time())))