make proxy
This commit is contained in:
@@ -4,6 +4,7 @@ It can authomatically authentificate via 'password+otp pin' schema and provide p
|
|||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
Please specify your username, password and secret token in openvpn/settings/openvpn.env (you can use openvpn.env.sample)
|
Please specify your username, password and secret token in openvpn/settings/openvpn.env (you can use openvpn.env.sample)
|
||||||
|
Also you can specify proxy password for authentification, username is 'admin'.
|
||||||
|
|
||||||
### Definitions
|
### Definitions
|
||||||
Openvpn configuration file must be named 'client.ovpn' in 'openvpn/settings/conf/' directory.
|
Openvpn configuration file must be named 'client.ovpn' in 'openvpn/settings/conf/' directory.
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ services:
|
|||||||
- "/dev/net/tun:/dev/net/tun"
|
- "/dev/net/tun:/dev/net/tun"
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- ./openvpn/settings/conf:/etc/openvpn
|
- ./openvpn/settings/conf:/etc/openvpn:ro
|
||||||
logging:
|
logging:
|
||||||
driver: json-file
|
driver: json-file
|
||||||
options:
|
options:
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ RUN set -ex \
|
|||||||
\
|
\
|
||||||
&& apk del .build-deps
|
&& apk del .build-deps
|
||||||
|
|
||||||
RUN apk update && apk add python3 curl && pip3 install pyotp
|
RUN apk update && apk upgrade && apk add python3 curl && pip3 install pyotp
|
||||||
ADD run.sh /run.sh
|
ADD run.sh /run.sh
|
||||||
ADD generate.py /generate.py
|
ADD generate.py /generate.py
|
||||||
ADD nserver.py /nserver.py
|
ADD nserver.py /nserver.py
|
||||||
|
|||||||
@@ -16,5 +16,9 @@ if 'nserver' in filedata:
|
|||||||
else:
|
else:
|
||||||
filedata = filedata.replace('daemon', 'daemon\nnserver {}'.format(nameserver))
|
filedata = filedata.replace('daemon', 'daemon\nnserver {}'.format(nameserver))
|
||||||
|
|
||||||
|
password = os.getenv('PROXY_PASSWORD')
|
||||||
|
if password != None:
|
||||||
|
filedata = filedata.replace('auth none', 'auth strong\nusers admin:CL:{}'.format(password))
|
||||||
|
|
||||||
with open(filename, 'w') as file:
|
with open(filename, 'w') as file:
|
||||||
file.write(filedata)
|
file.write(filedata)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
USERNAME=xxxxxxxxx
|
USERNAME=xxxxxxxxx
|
||||||
PASSWORD=xxxxxxxxx
|
PASSWORD=xxxxxxxxx
|
||||||
|
PROXY_PASSWORD=xxxxxxxxx
|
||||||
SECRET=xxxxxxxxx
|
SECRET=xxxxxxxxx
|
||||||
NAMESERVER=xxxxxxxxx
|
NAMESERVER=xxxxxxxxx
|
||||||
|
|||||||
Reference in New Issue
Block a user