This commit is contained in:
Paramtamtam 2020-07-13 10:44:03 +05:00
parent 32e62010f9
commit 2c12e774bd
No known key found for this signature in database
GPG Key ID: 366371698FAD0A2B
5 changed files with 17 additions and 14 deletions

View File

@ -55,7 +55,6 @@ jobs: # Docs: <https://git.io/JvxXE>
docker run --rm -d \ docker run --rm -d \
-p "3128:3128/tcp" \ -p "3128:3128/tcp" \
-p "1080:1080/tcp" \ -p "1080:1080/tcp" \
-e "AUTH_REQUIRED=true" \
-e "PROXY_LOGIN=evil" \ -e "PROXY_LOGIN=evil" \
-e "PROXY_PASSWORD=live" \ -e "PROXY_PASSWORD=live" \
image:local image:local

View File

@ -4,6 +4,16 @@ All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver]. The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].
## v1.1.0
### Removed
- Environment variable `AUTH_REQUIRED` support
### Changed
- Proxy error pages a little bit styled
## v1.0.0 ## v1.0.0
### Fixed ### Fixed

View File

@ -12,6 +12,11 @@ RUN set -x \
&& git clone --branch ${VERSION} https://github.com/z3APA3A/3proxy.git /tmp/3proxy \ && git clone --branch ${VERSION} https://github.com/z3APA3A/3proxy.git /tmp/3proxy \
&& cd /tmp/3proxy \ && cd /tmp/3proxy \
&& echo '#define ANONYMOUS 1' >> /tmp/3proxy/src/3proxy.h \ && echo '#define ANONYMOUS 1' >> /tmp/3proxy/src/3proxy.h \
&& sed -i 's~\(<\/head>\)~<style>html,body{background-color:#222526;color:#fff;font-family:sans-serif;\
text-align:center;display:flex;flex-direction:column;justify-content:center}h1,h2{margin-bottom:0;font-size:2.5em}\
h2::before{content:'"'"'Proxy error'"'"';display:block;font-size:0.4em;color:#bbb;font-weight:100}\
h3,p{color:#bbb}</style>\1~' /tmp/3proxy/src/proxy.c \
&& cat ./src/proxy.c | grep '</head>' \
&& make -f Makefile.Linux && make -f Makefile.Linux
FROM alpine:latest FROM alpine:latest

View File

@ -12,7 +12,7 @@
## Why this image created? ## Why this image created?
3proxy is awesome and lightweight proxy-server. This image contains stable version with it and can be configured using environment variables. By default, it uses anonymous (hide information about client) proxy settings. 3proxy is awesome and lightweight proxy-server. This image contains stable version with it and can be configured using environment variables. By default, it uses anonymous (information about client hiding) proxy settings.
> Page on `hub.docker.com` can be [found here][link_docker_hub]. > Page on `hub.docker.com` can be [found here][link_docker_hub].
@ -33,7 +33,6 @@ All supported image tags [can be found here][link_docker_tags].
Variable name | Description | Example Variable name | Description | Example
---------------- | ----------------------------------------- | --------------- ---------------- | ----------------------------------------- | ---------------
`AUTH_REQUIRED` | Require authorization? (default: `false`) | `true`, `false`
`PROXY_LOGIN` | Authorization login | `username` `PROXY_LOGIN` | Authorization login | `username`
`PROXY_PASSWORD` | Authorization password | `password` `PROXY_PASSWORD` | Authorization password | `password`
@ -54,7 +53,6 @@ Or with auth settings:
$ docker run --rm -d \ $ docker run --rm -d \
-p "3128:3128/tcp" \ -p "3128:3128/tcp" \
-p "1080:1080/tcp" \ -p "1080:1080/tcp" \
-e "AUTH_REQUIRED=true" \
-e "PROXY_LOGIN=evil" \ -e "PROXY_LOGIN=evil" \
-e "PROXY_PASSWORD=live" \ -e "PROXY_PASSWORD=live" \
tarampampam/3proxy:latest tarampampam/3proxy:latest

View File

@ -1,19 +1,10 @@
#!/usr/bin/env sh #!/usr/bin/env sh
set -e set -e
AUTH_REQUIRED=${AUTH_REQUIRED:-false} # true|false
PROXY_LOGIN=${PROXY_LOGIN:-} # string PROXY_LOGIN=${PROXY_LOGIN:-} # string
PROXY_PASSWORD=${PROXY_PASSWORD:-} # string PROXY_PASSWORD=${PROXY_PASSWORD:-} # string
if [ "$AUTH_REQUIRED" = "true" ]; then if [ -n "$PROXY_LOGIN" ] && [ -n "$PROXY_PASSWORD" ]; then
if [ -z "$PROXY_LOGIN" ]; then
(>&2 echo "$0: environment variable 'PROXY_LOGIN' is not specified!"); exit 1;
fi;
if [ -z "$PROXY_PASSWORD" ]; then
(>&2 echo "$0: environment variable 'PROXY_PASSWORD' is not specified!"); exit 1;
fi;
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;