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
|
||||
|
||||
- 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
|
||||
|
||||
|
14
README.md
14
README.md
@ -31,12 +31,12 @@ All supported image tags [can be found here][link_docker_tags].
|
||||
|
||||
## Supported environment variables
|
||||
|
||||
| Variable name | Description | Example |
|
||||
|------------------|-------------------------------------|------------------------|
|
||||
| `PROXY_LOGIN` | Authorization login | `username` |
|
||||
| `PROXY_PASSWORD` | Authorization password | `password` |
|
||||
| `NAME_SERVER_1` | Primary nameserver (dns resolver) | `8.8.8.8` |
|
||||
| `NAME_SERVER_2` | Secondary nameserver (dns resolver) | `2001:4860:4860::8844` |
|
||||
| Variable name | Description | Example |
|
||||
|----------------------|-------------------------------------|------------------------|
|
||||
| `PROXY_LOGIN` | Authorization login | `username` |
|
||||
| `PROXY_PASSWORD` | Authorization password | `password` |
|
||||
| `PRIMARY_RESOLVER` | Primary nameserver (dns resolver) | `8.8.8.8` |
|
||||
| `SECONDARY_RESOLVER` | Secondary nameserver (dns resolver) | `2001:4860:4860::8844` |
|
||||
|
||||
## How can I use this?
|
||||
|
||||
@ -57,7 +57,7 @@ $ docker run --rm -d \
|
||||
-p "1080:1080/tcp" \
|
||||
-e "PROXY_LOGIN=evil" \
|
||||
-e "PROXY_PASSWORD=live" \
|
||||
-e "NAME_SERVER_1=2001:4860:4860::8888" \
|
||||
-e "PRIMARY_RESOLVER=2001:4860:4860::8888" \
|
||||
tarampampam/3proxy:latest
|
||||
```
|
||||
|
||||
|
@ -3,22 +3,22 @@ set -e
|
||||
|
||||
PROXY_LOGIN=${PROXY_LOGIN:-} # string
|
||||
PROXY_PASSWORD=${PROXY_PASSWORD:-} # string
|
||||
NAME_SERVER_1=${NAME_SERVER_1:-} # string
|
||||
NAME_SERVER_2=${NAME_SERVER_2:-} # string
|
||||
PRIMARY_RESOLVER=${PRIMARY_RESOLVER:-} # string
|
||||
SECONDARY_RESOLVER=${SECONDARY_RESOLVER:-} # string
|
||||
|
||||
if [ -n "$PROXY_LOGIN" ] && [ -n "$PROXY_PASSWORD" ]; then
|
||||
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
|
||||
fi;
|
||||
|
||||
if [ -n "$NAME_SERVER_1" ]; then
|
||||
echo "$0: setup '${NAME_SERVER_1}' as the first nameserver";
|
||||
sed -i "s~#NSERVER1~nserver ${NAME_SERVER_1}~" /etc/3proxy/3proxy.cfg
|
||||
if [ -n "$PRIMARY_RESOLVER" ]; then
|
||||
echo "$0: setup '${PRIMARY_RESOLVER}' as the first nameserver";
|
||||
sed -i "s~#NSERVER1~nserver ${PRIMARY_RESOLVER}~" /etc/3proxy/3proxy.cfg
|
||||
fi;
|
||||
|
||||
if [ -n "$NAME_SERVER_2" ]; then
|
||||
echo "$0: setup '${NAME_SERVER_2}' as the second nameserver";
|
||||
sed -i "s~#NSERVER2~nserver ${NAME_SERVER_2}~" /etc/3proxy/3proxy.cfg
|
||||
if [ -n "$SECONDARY_RESOLVER" ]; then
|
||||
echo "$0: setup '${SECONDARY_RESOLVER}' as the second nameserver";
|
||||
sed -i "s~#NSERVER2~nserver ${SECONDARY_RESOLVER}~" /etc/3proxy/3proxy.cfg
|
||||
fi;
|
||||
|
||||
exec "$@"
|
||||
|
Loading…
x
Reference in New Issue
Block a user