diff --git a/README.md b/README.md index 96fba81..4b68c7c 100644 --- a/README.md +++ b/README.md @@ -203,6 +203,7 @@ A collection of delicious docker recipes. - [x] hans - [x] haproxy-arm - [x] kcptun :cn: +- [x] mtproxy - [x] mysql-proxy - [x] ngrok :+1: - [x] obfsproxy diff --git a/mtproxy/Dockerfile b/mtproxy/Dockerfile new file mode 100644 index 0000000..9fe41a0 --- /dev/null +++ b/mtproxy/Dockerfile @@ -0,0 +1,45 @@ +# +# Dockerfile for mtproxy +# + +FROM debian:stretch +MAINTAINER EasyPi Software Foundation + +WORKDIR /usr/local/src/mtproxy + +RUN set -xe \ + && apt update \ + && apt install -y build-essential curl git libssl-dev zlib1g-dev \ + && git clone --single-branch --depth 1 https://github.com/TelegramMessenger/MTProxy.git . \ + && make -j$(getconf _NPROCESSORS_ONLN) \ + && cp ./objs/bin/mtproto-proxy /usr/local/bin/ \ + && apt remove -y build-essential git libssl-dev zlib1g-dev \ + && cd .. \ + && rm -r mtproxy /var/lib/apt/lists/* + +WORKDIR /etc/mtproxy + +RUN set -xe \ + && curl -sSL https://core.telegram.org/getProxySecret > proxy-secret \ + && curl -sSL https://core.telegram.org/getProxyConfig > proxy-multi.conf + +VOLUME /etc/mtproxy + +ENV MTP_SECRET 00000000000000000000000000000000 +ENV MTP_SLAVES 1 + +EXPOSE 443 8888 + +CMD set -xe \ + && curl -sSL https://core.telegram.org/getProxySecret > proxy-secret \ + && curl -sSL https://core.telegram.org/getProxyConfig > proxy-multi.conf \ + && mtproto-proxy --allow-skip-dh \ + --user root \ + --address 0.0.0.0 \ + --port 8888 \ + --http-ports 443 \ + --slaves $MTP_SLAVES \ + --mtproto-secret $MTP_SECRET \ + --aes-pwd proxy-secret \ + proxy-multi.conf + diff --git a/mtproxy/Dockerfile.alpine b/mtproxy/Dockerfile.alpine new file mode 100644 index 0000000..a42622f --- /dev/null +++ b/mtproxy/Dockerfile.alpine @@ -0,0 +1,47 @@ +# +# Dockerfile for mtproxy +# + +FROM alpine +MAINTAINER EasyPi Software Foundation + +WORKDIR /usr/local/src/mtproxy + +RUN set -xe \ + && apk add --no-cache curl gcc git linux-headers make musl-dev openssl-dev zlib-dev \ + && git clone --single-branch --depth 1 https://github.com/TelegramMessenger/MTProxy.git . \ + && curl -sSL https://github.com/alexdoesh/mtproxy/raw/master/patches/randr_compat.patch > randr_compat.patch \ + && patch -p0 -i randr_compat.patch \ + && make -j$(getconf _NPROCESSORS_ONLN) \ + && cp ./objs/bin/mtproto-proxy /usr/local/bin/ \ + && cd .. \ + && rm -r mtproxy \ + && apk del gcc git linux-headers make musl-dev openssl-dev zlib-dev + +WORKDIR /etc/mtproxy + +RUN set -xe \ + && ln -s /usr/lib/libcrypto.so.42 /usr/lib/libcrypto.so.1.0.0 \ + && curl -sSL https://core.telegram.org/getProxySecret > proxy-secret \ + && curl -sSL https://core.telegram.org/getProxyConfig > proxy-multi.conf + +VOLUME /etc/mtproxy + +ENV MTP_SECRET 00000000000000000000000000000000 +ENV MTP_SLAVES 1 + +EXPOSE 443 8888 + +CMD set -xe \ + && curl -sSL https://core.telegram.org/getProxySecret > proxy-secret \ + && curl -sSL https://core.telegram.org/getProxyConfig > proxy-multi.conf \ + && mtproto-proxy --allow-skip-dh \ + --user root \ + --address 0.0.0.0 \ + --port 8888 \ + --http-ports 443 \ + --slaves $MTP_SLAVES \ + --mtproto-secret $MTP_SECRET \ + --aes-pwd proxy-secret \ + proxy-multi.conf + diff --git a/mtproxy/README.md b/mtproxy/README.md new file mode 100644 index 0000000..636455c --- /dev/null +++ b/mtproxy/README.md @@ -0,0 +1,4 @@ +mtproxy +======= + +[1]: https://github.com/TelegramMessenger/MTProxy diff --git a/mtproxy/docker-compose.yml b/mtproxy/docker-compose.yml new file mode 100644 index 0000000..563f98f --- /dev/null +++ b/mtproxy/docker-compose.yml @@ -0,0 +1,11 @@ +mtproxy: + image: vimagick/mtproxy + ports: + - "8443:443" + - "8888:8888" + volumes: + - ./data:/etc/mtproxy + environment: + - MTP_SECRET=092b4a4da9855f7923c7dc032157ff53 + - MTP_SLAVES=4 + restart: unless-stopped