first version

This commit is contained in:
root 2020-04-14 16:13:56 +00:00
commit b7c1bc8bc9
2 changed files with 27 additions and 0 deletions

15
Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM debian:buster
WORKDIR /data
COPY docker-entrypoint.sh /usr/bin
RUN apt update \
&& apt install -y git curl build-essential libssl-dev zlib1g-dev xxd \
&& git clone https://github.com/TelegramMessenger/MTProxy /MTProxy \
&& cd /MTProxy \
&& make \
&& cp objs/bin/mtproto-proxy /usr/bin \
&& curl -s https://core.telegram.org/getProxySecret -o /proxy-secret \
&& curl -s https://core.telegram.org/getProxyConfig -o /proxy-multi.conf
EXPOSE 4443
EXPOSE 8888
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["mtproto"]

12
docker-entrypoint.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
set -e
if [ "$1" = "mtproto" ]; then
if [ ! -f "/data/secret" ]; then
echo "Geaerate secret ::"
head -c 16 /dev/urandom | xxd -ps | tee /data/secret
fi
exec /usr/bin/mtproto-proxy -u nobody -p 8888 -H 4443 -6 -S `cat /data/secret` --aes-pwd /proxy-secret /proxy-multi.conf -M 1
fi
exec "$@"