rename variables
This commit is contained in:
parent
7200ecad96
commit
d332716996
@ -8,7 +8,7 @@ The format is based on [Keep a Changelog][keepachangelog] and this project adher
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Possibility of changing DNS resolvers using environment variables `NAME_SERVER_1` (primary) and `NAME_SERVER_2` (secondary)
|
- Possibility of changing DNS resolvers using environment variables `PRIMARY_RESOLVER` (primary) and `SECONDARY_RESOLVER` (secondary)
|
||||||
|
|
||||||
## v1.5.0
|
## v1.5.0
|
||||||
|
|
||||||
|
@ -32,11 +32,11 @@ All supported image tags [can be found here][link_docker_tags].
|
|||||||
## Supported environment variables
|
## Supported environment variables
|
||||||
|
|
||||||
| Variable name | Description | Example |
|
| Variable name | Description | Example |
|
||||||
|------------------|-------------------------------------|------------------------|
|
|----------------------|-------------------------------------|------------------------|
|
||||||
| `PROXY_LOGIN` | Authorization login | `username` |
|
| `PROXY_LOGIN` | Authorization login | `username` |
|
||||||
| `PROXY_PASSWORD` | Authorization password | `password` |
|
| `PROXY_PASSWORD` | Authorization password | `password` |
|
||||||
| `NAME_SERVER_1` | Primary nameserver (dns resolver) | `8.8.8.8` |
|
| `PRIMARY_RESOLVER` | Primary nameserver (dns resolver) | `8.8.8.8` |
|
||||||
| `NAME_SERVER_2` | Secondary nameserver (dns resolver) | `2001:4860:4860::8844` |
|
| `SECONDARY_RESOLVER` | Secondary nameserver (dns resolver) | `2001:4860:4860::8844` |
|
||||||
|
|
||||||
## How can I use this?
|
## How can I use this?
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ $ docker run --rm -d \
|
|||||||
-p "1080:1080/tcp" \
|
-p "1080:1080/tcp" \
|
||||||
-e "PROXY_LOGIN=evil" \
|
-e "PROXY_LOGIN=evil" \
|
||||||
-e "PROXY_PASSWORD=live" \
|
-e "PROXY_PASSWORD=live" \
|
||||||
-e "NAME_SERVER_1=2001:4860:4860::8888" \
|
-e "PRIMARY_RESOLVER=2001:4860:4860::8888" \
|
||||||
tarampampam/3proxy:latest
|
tarampampam/3proxy:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -3,22 +3,22 @@ set -e
|
|||||||
|
|
||||||
PROXY_LOGIN=${PROXY_LOGIN:-} # string
|
PROXY_LOGIN=${PROXY_LOGIN:-} # string
|
||||||
PROXY_PASSWORD=${PROXY_PASSWORD:-} # string
|
PROXY_PASSWORD=${PROXY_PASSWORD:-} # string
|
||||||
NAME_SERVER_1=${NAME_SERVER_1:-} # string
|
PRIMARY_RESOLVER=${PRIMARY_RESOLVER:-} # string
|
||||||
NAME_SERVER_2=${NAME_SERVER_2:-} # string
|
SECONDARY_RESOLVER=${SECONDARY_RESOLVER:-} # string
|
||||||
|
|
||||||
if [ -n "$PROXY_LOGIN" ] && [ -n "$PROXY_PASSWORD" ]; then
|
if [ -n "$PROXY_LOGIN" ] && [ -n "$PROXY_PASSWORD" ]; then
|
||||||
echo "$0: setup '${PROXY_LOGIN}:${PROXY_PASSWORD}' as proxy user";
|
echo "$0: setup '${PROXY_LOGIN}:${PROXY_PASSWORD}' as proxy user";
|
||||||
sed -i "s~#AUTH_SETTINGS~users ${PROXY_LOGIN}:CL:${PROXY_PASSWORD}\nauth strong\nallow ${PROXY_LOGIN}~" /etc/3proxy/3proxy.cfg
|
sed -i "s~#AUTH_SETTINGS~users ${PROXY_LOGIN}:CL:${PROXY_PASSWORD}\nauth strong\nallow ${PROXY_LOGIN}~" /etc/3proxy/3proxy.cfg
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
if [ -n "$NAME_SERVER_1" ]; then
|
if [ -n "$PRIMARY_RESOLVER" ]; then
|
||||||
echo "$0: setup '${NAME_SERVER_1}' as the first nameserver";
|
echo "$0: setup '${PRIMARY_RESOLVER}' as the first nameserver";
|
||||||
sed -i "s~#NSERVER1~nserver ${NAME_SERVER_1}~" /etc/3proxy/3proxy.cfg
|
sed -i "s~#NSERVER1~nserver ${PRIMARY_RESOLVER}~" /etc/3proxy/3proxy.cfg
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
if [ -n "$NAME_SERVER_2" ]; then
|
if [ -n "$SECONDARY_RESOLVER" ]; then
|
||||||
echo "$0: setup '${NAME_SERVER_2}' as the second nameserver";
|
echo "$0: setup '${SECONDARY_RESOLVER}' as the second nameserver";
|
||||||
sed -i "s~#NSERVER2~nserver ${NAME_SERVER_2}~" /etc/3proxy/3proxy.cfg
|
sed -i "s~#NSERVER2~nserver ${SECONDARY_RESOLVER}~" /etc/3proxy/3proxy.cfg
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user