updating configuration

This commit is contained in:
Your Name
2021-03-30 22:50:08 +00:00
parent 1c99d2a6ba
commit 067e9317ff
8 changed files with 109 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
daemon
nserver 10.2.67.10
auth none
log
proxy -p9080
+36
View File
@@ -0,0 +1,36 @@
FROM ventz/openvpn
ENV _3PROXY_VERSION 0.8.12
ENV _3PROXY_DOWNLOAD_URL https://github.com/z3APA3A/3proxy/archive/0.8.12.tar.gz
ENV _3PROXY_DOWNLOAD_SHA1 c669a9af27cf1c4178f73216ee74777d200e03fb
RUN set -ex \
\
&& apk add --no-cache --virtual .build-deps \
gcc \
linux-headers \
make \
musl-dev \
tar \
openssl \
\
&& wget -O 3proxy.tar.gz "$_3PROXY_DOWNLOAD_URL" \
&& echo "$_3PROXY_DOWNLOAD_SHA1 *3proxy.tar.gz" | sha1sum -c - \
&& mkdir -p /usr/src/3proxy \
&& tar -xzf 3proxy.tar.gz -C /usr/src/3proxy --strip-components=1 \
&& rm 3proxy.tar.gz \
\
&& make -C /usr/src/3proxy -f Makefile.Linux \
&& make -C /usr/src/3proxy -f Makefile.Linux install \
\
&& rm -r /usr/src/3proxy \
\
&& apk del .build-deps
RUN apk update && apk add python3 curl && pip3 install pyotp
ADD run.sh /run.sh
ADD generate.py /generate.py
ADD 3pr.cfg /3pr.cfg
RUN chmod +x /run.sh
ENTRYPOINT "/run.sh"
+28
View File
@@ -0,0 +1,28 @@
import pyotp
import os
user = os.getenv('USERNAME')
password = os.getenv('PASSWORD')
secret = os.getenv('SECRET')
if user == "":
print("USERNAME not specified")
os.exit(-1)
if password == "":
print("PASSWORD not specified")
os.exit(-1)
if secret == "":
print("SECRET not specified")
os.exit(-1)
totp = pyotp.TOTP(secret)
token = totp.now()
f = open("/auth.txt", "w")
f.write("{}\n".format(user))
f.write('{}{}\n'.format(password, token))
f.close()
print("Generated OTP token for user ({}): {}".format(user,token))
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
3proxy /3pr.cfg
python3 /generate.py
openvpn --config /etc/openvpn/client.ovpn --auth-user-pass /auth.txt