new mtproto image
This commit is contained in:
+6
-6
@@ -728,11 +728,11 @@ class Bot
|
|||||||
public function restartTG()
|
public function restartTG()
|
||||||
{
|
{
|
||||||
$secret = file_get_contents('/config/mtprotosecret');
|
$secret = file_get_contents('/config/mtprotosecret');
|
||||||
$fakedomain = file_get_contents('/config/mtprotodomain') ?: 'vk.com';
|
$fakedomain = file_get_contents('/config/mtprotodomain') ?: 'yandex.ru';
|
||||||
$this->ssh('pkill mtproto-proxy', 'tg');
|
$this->ssh('pkill mtproto-proxy', 'tg');
|
||||||
if (preg_match('~^\w{32}$~', $secret)) {
|
if (preg_match('~^\w{32}$~', $secret)) {
|
||||||
$p = getenv('TGPORT');
|
$p = getenv('TGPORT');
|
||||||
$this->ssh("mtproto-proxy --domain $fakedomain -u nobody -H $p --nat-info 10.10.0.8:{$this->ip} -S $secret --aes-pwd /proxy-secret /proxy-multi.conf -M 1 >/dev/null 2>&1 &", 'tg');
|
$this->ssh("mtproto-proxy --domain $fakedomain -u nobody -H $p --nat-info 10.10.0.8:{$this->ip} -S $secret --aes-pwd /proxy-secret /proxy-multi.conf -M 1", 'tg', false, '/logs/mtproto');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -820,15 +820,15 @@ class Bot
|
|||||||
{
|
{
|
||||||
$s = file_get_contents('/config/mtprotosecret');
|
$s = file_get_contents('/config/mtprotosecret');
|
||||||
$p = getenv('TGPORT');
|
$p = getenv('TGPORT');
|
||||||
$d = trim(file_get_contents('/config/mtprotodomain') ?: 'vk.com');
|
$d = trim(file_get_contents('/config/mtprotodomain') ?: 'yandex.ru');
|
||||||
$d = exec("echo $d | tr -d '\\n' | xxd -ps -c 200");
|
$d = exec("echo $d | tr -d '\\n' | xxd -ps -c 200");
|
||||||
$ip = $this->getPacConf()['domain'] ?: $this->ip;
|
$ip = $this->getDomain();
|
||||||
return "https://t.me/proxy?server=$ip&port=$p&secret=ee$s$d";
|
return "https://t.me/proxy?server=$ip&port=$p&secret=ee$s$d";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function mtproto()
|
public function mtproto()
|
||||||
{
|
{
|
||||||
$d = file_get_contents('/config/mtprotodomain') ?: 'vk.com';
|
$d = file_get_contents('/config/mtprotodomain') ?: 'yandex.ru';
|
||||||
$st = $this->ssh('pgrep mtproto-proxy', 'tg') ? 'on' : 'off';
|
$st = $this->ssh('pgrep mtproto-proxy', 'tg') ? 'on' : 'off';
|
||||||
$text[] = "Menu -> MTProto\n";
|
$text[] = "Menu -> MTProto\n";
|
||||||
$text[] = "status: $st\n";
|
$text[] = "status: $st\n";
|
||||||
@@ -9077,7 +9077,7 @@ DNS-over-HTTPS with IP:
|
|||||||
$x = $this->getXray();
|
$x = $this->getXray();
|
||||||
$h = $this->getHashBot();
|
$h = $this->getHashBot();
|
||||||
|
|
||||||
$p['reality']['domain'] = $p['reality']['domain'] ?: 'web.telegram.org';
|
$p['reality']['domain'] = $p['reality']['domain'] ?: 'yandex.ru';
|
||||||
$p['reality']['destination'] = $p['reality']['destination'] ?: $p['reality']['domain'] . ':443';
|
$p['reality']['destination'] = $p['reality']['destination'] ?: $p['reality']['domain'] . ':443';
|
||||||
$p['transport'] = $transport;
|
$p['transport'] = $transport;
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -325,15 +325,16 @@ services:
|
|||||||
entrypoint: ["/bin/sh", "/start_ad.sh"]
|
entrypoint: ["/bin/sh", "/start_ad.sh"]
|
||||||
logging: *default-logging
|
logging: *default-logging
|
||||||
tg:
|
tg:
|
||||||
image: mercurykd/vpnbot-tg:1.2
|
image: mercurykd/vpnbot-tg:1.3
|
||||||
build:
|
build:
|
||||||
dockerfile: dockerfile/telegram.dockerfile
|
dockerfile: dockerfile/telegram.dockerfile
|
||||||
volumes:
|
volumes:
|
||||||
- ./config/.profile:/root/.ashrc:ro
|
- ./config/.profile:/root/.bashrc:ro
|
||||||
- ./ssh:/ssh
|
- ./ssh:/ssh
|
||||||
- ./config/sshd_config:/etc/ssh/sshd_config
|
- ./config/sshd_config:/etc/ssh/sshd_config
|
||||||
- ./scripts/start_tg.sh:/start_tg.sh
|
- ./scripts/start_tg.sh:/start_tg.sh
|
||||||
- ./config/mtprotosecret:/mtprotosecret
|
- ./config/mtprotosecret:/mtprotosecret
|
||||||
|
- ./logs/:/logs/
|
||||||
hostname: telegram
|
hostname: telegram
|
||||||
container_name: mtproto-${VER}
|
container_name: mtproto-${VER}
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
@@ -1,13 +1,33 @@
|
|||||||
FROM alpine:3.6
|
# Build stage
|
||||||
RUN apk add --no-cache --virtual .build-deps alpine-sdk linux-headers openssl-dev \
|
FROM ubuntu:22.04 AS builder
|
||||||
&& git clone --single-branch --depth 1 https://github.com/TelegramMessenger/MTProxy.git /mtproxy/sources \
|
|
||||||
&& mkdir /mtproxy/patches && wget -P /mtproxy/patches https://raw.githubusercontent.com/alexdoesh/mtproxy/master/patches/randr_compat.patch \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
&& cd /mtproxy/sources && patch -p0 -i /mtproxy/patches/randr_compat.patch \
|
git \
|
||||||
&& make \
|
build-essential \
|
||||||
&& mkdir /root/.ssh \
|
libssl-dev \
|
||||||
&& cp /mtproxy/sources/objs/bin/mtproto-proxy /usr/bin \
|
zlib1g-dev \
|
||||||
&& rm -rf /mtproxy \
|
ca-certificates \
|
||||||
&& apk del .build-deps\
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
&& apk add --no-cache --update curl openssh \
|
|
||||||
&& ln -s /usr/lib/libcrypto.so.41 /usr/lib/libcrypto.so.1.0.0
|
WORKDIR /src
|
||||||
ENV ENV="/root/.ashrc"
|
RUN git clone --single-branch --depth 1 https://github.com/GetPageSpeed/MTProxy . \
|
||||||
|
&& make -j$(nproc) \
|
||||||
|
&& strip objs/bin/mtproto-proxy
|
||||||
|
|
||||||
|
# Runtime stage - minimal Ubuntu
|
||||||
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
libssl3 \
|
||||||
|
zlib1g \
|
||||||
|
curl \
|
||||||
|
openssh-client \
|
||||||
|
openssh-server \
|
||||||
|
ca-certificates \
|
||||||
|
vim-common \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& mkdir -p /root/.ssh /var/run/sshd
|
||||||
|
|
||||||
|
COPY --from=builder /src/objs/bin/mtproto-proxy /usr/local/bin/mtproto-proxy
|
||||||
|
|
||||||
|
ENV PATH="/usr/local/bin:$PATH"
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
echo 'root:dummy_passwd'|chpasswd
|
|
||||||
cat /ssh/key.pub > /root/.ssh/authorized_keys
|
cat /ssh/key.pub > /root/.ssh/authorized_keys
|
||||||
ssh-keygen -A
|
ssh-keygen -A
|
||||||
exec /usr/sbin/sshd -D -e "$@" &
|
exec /usr/sbin/sshd -D -e "$@" &
|
||||||
|
|||||||
Reference in New Issue
Block a user