Release master - Bugfixes
This commit is contained in:
parent
a8d09f3093
commit
d1cc355cd4
Binary file not shown.
BIN
madeline.phar
BIN
madeline.phar
Binary file not shown.
32
mtproxyd
32
mtproxyd
@ -1,7 +1,24 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
$debug = false; // Set this to true to avoid automatic updates of this script
|
||||
|
||||
/**
|
||||
* MTProxy.
|
||||
*
|
||||
* Copyright 2016-2019 Daniil Gentili
|
||||
* (https://daniil.it)
|
||||
* This file is part of MadelineProto.
|
||||
* MadelineProto is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
* MadelineProto is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU Affero General Public License for more details.
|
||||
* You should have received a copy of the GNU General Public License along with MadelineProto.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @author Daniil Gentili <daniil@daniil.it>
|
||||
* @copyright 2016-2019 Daniil Gentili <daniil@daniil.it>
|
||||
* @license https://opensource.org/licenses/AGPL-3.0 AGPLv3
|
||||
*
|
||||
* @link https://docs.madelineproto.xyz MadelineProto documentation
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@ -12,23 +29,24 @@ if (!isset($argv[2])) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!file_exists('madeline.php')) {
|
||||
copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
|
||||
if (!\file_exists('madeline.php')) {
|
||||
\copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
|
||||
}
|
||||
|
||||
if (!$debug) {
|
||||
$mtproxyd = file_get_contents('https://phar.madelineproto.xyz/mtproxyd?v=new');
|
||||
$mtproxyd = \file_get_contents('https://phar.madelineproto.xyz/mtproxyd?v=new');
|
||||
if ($mtproxyd) {
|
||||
file_put_contents($argv[0], $mtproxyd);
|
||||
\file_put_contents($argv[0], $mtproxyd);
|
||||
}
|
||||
}
|
||||
|
||||
\define('MADELINE_BRANCH', 'deprecated');
|
||||
require_once 'madeline.php';
|
||||
|
||||
$secret = md5($argv[1]);
|
||||
$secret = \md5($argv[1]);
|
||||
echo "Secret is $secret\n";
|
||||
|
||||
$MadelineProto = new \danog\MadelineProto\API('proxy.madeline');
|
||||
$MadelineProto->parse_dc_options($MadelineProto->help->getConfig()['dc_options']);
|
||||
$handler = new \danog\MadelineProto\Server(['type' => AF_INET, 'protocol' => 0, 'address' => '0.0.0.0', 'port' => $argv[2], 'handler' => '\danog\MadelineProto\Server\Proxy', 'extra' => ['madeline' => $MadelineProto->API->datacenter->sockets, 'secret' => hex2bin($secret), 'timeout' => 10]]);
|
||||
$handler = new \danog\MadelineProto\Server(['type' => AF_INET, 'protocol' => 0, 'address' => '0.0.0.0', 'port' => $argv[2], 'handler' => '\danog\MadelineProto\Server\Proxy', 'extra' => ['madeline' => $MadelineProto->API->datacenter->sockets, 'secret' => \hex2bin($secret), 'timeout' => 10]]);
|
||||
$handler->start();
|
||||
|
6
phar.php
6
phar.php
@ -61,15 +61,11 @@ function ___install_madeline()
|
||||
$release_branch = '';
|
||||
}
|
||||
$release_fallback_branch = '';
|
||||
/*if (isset($_SERVER['SERVER_ADMIN']) && strpos($_SERVER['SERVER_ADMIN'], '000webhost.io') && $custom_branch === null) {
|
||||
$release_branch = '-deprecated';
|
||||
$release_fallback_branch = '-deprecated';
|
||||
}*/
|
||||
|
||||
if (PHP_MAJOR_VERSION <= 5) {
|
||||
$release_branch = '5'.$release_branch;
|
||||
$release_fallback_branch = '5'.$release_fallback_branch;
|
||||
} elseif (PHP_MAJOR_VERSION === 7 && PHP_MINOR_VERSION === 0) {
|
||||
} elseif (PHP_MAJOR_VERSION === 7 && PHP_MINOR_VERSION < 4) {
|
||||
$release_branch = '70'.$release_branch;
|
||||
$release_fallback_branch = '70'.$release_fallback_branch;
|
||||
}
|
||||
|
2
release
2
release
@ -1 +1 @@
|
||||
e81ecc87c998b40ae474c526008fab6d8a5d0818
|
||||
0bcef40328349aefa3dc3a4c0c43b52a0b3d4abb
|
@ -1 +1 @@
|
||||
e81ecc87c998b40ae474c526008fab6d8a5d0818
|
||||
0bcef40328349aefa3dc3a4c0c43b52a0b3d4abb
|
Loading…
Reference in New Issue
Block a user