Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bad8266d07 | ||
|
|
7287fec0ed | ||
|
|
2c12e774bd | ||
|
|
32e62010f9 | ||
|
|
04fb12076c | ||
|
|
6d94db1ba6 |
7
.github/workflows/release.yml
vendored
7
.github/workflows/release.yml
vendored
@@ -19,7 +19,12 @@ jobs:
|
||||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_LOGIN }}" --password-stdin &> /dev/null
|
||||
|
||||
- name: Build image
|
||||
run: docker build --tag "tarampampam/3proxy:${IMAGE_TAG}" --tag "tarampampam/3proxy:latest" -f ./Dockerfile .
|
||||
run: |
|
||||
docker build \
|
||||
--build-arg "BUILD_DATE=`date -u +'%Y-%m-%dT%H:%M:%SZ'`" \
|
||||
--tag "tarampampam/3proxy:${IMAGE_TAG}" \
|
||||
--tag "tarampampam/3proxy:latest" \
|
||||
-f ./Dockerfile .
|
||||
|
||||
- name: Push version image
|
||||
run: docker push "tarampampam/3proxy:${IMAGE_TAG}"
|
||||
|
||||
1
.github/workflows/tests.yml
vendored
1
.github/workflows/tests.yml
vendored
@@ -55,7 +55,6 @@ jobs: # Docs: <https://git.io/JvxXE>
|
||||
docker run --rm -d \
|
||||
-p "3128:3128/tcp" \
|
||||
-p "1080:1080/tcp" \
|
||||
-e "AUTH_REQUIRED=true" \
|
||||
-e "PROXY_LOGIN=evil" \
|
||||
-e "PROXY_PASSWORD=live" \
|
||||
image:local
|
||||
|
||||
29
3proxy.cfg
Normal file
29
3proxy.cfg
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/3proxy
|
||||
config /etc/3proxy/3proxy.cfg
|
||||
|
||||
# you may use system to execute some external command if proxy starts
|
||||
system "echo `which 3proxy`': Starting 3proxy'"
|
||||
|
||||
# We can configure nservers to avoid unsafe gethostbyname() usage
|
||||
nserver 1.0.0.1
|
||||
nserver 1.1.1.1
|
||||
nserver 8.8.4.4
|
||||
nserver 8.8.8.8
|
||||
|
||||
# nscache is good to save speed, traffic and bandwidth
|
||||
nscache 65536
|
||||
|
||||
# Here we can change timeout values
|
||||
timeouts 1 5 30 60 180 1800 15 60
|
||||
|
||||
log /dev/stdout
|
||||
logformat "- +_L%t.%. %N.%p %E %U %C:%c %R:%r %O %I %h %T"
|
||||
|
||||
maxconn 1024
|
||||
|
||||
#AUTH_SETTINGS
|
||||
|
||||
proxy -a -p3128
|
||||
socks -a -p1080
|
||||
|
||||
flush
|
||||
22
CHANGELOG.md
22
CHANGELOG.md
@@ -4,6 +4,28 @@ 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].
|
||||
|
||||
## v1.1.0
|
||||
|
||||
### Removed
|
||||
|
||||
- Environment variable `AUTH_REQUIRED` support
|
||||
|
||||
### Changed
|
||||
|
||||
- Proxy error pages a little bit styled
|
||||
|
||||
## v1.0.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- Dockerfile and docker entry-point script cleanup
|
||||
|
||||
## v0.1.1
|
||||
|
||||
### Fixed
|
||||
|
||||
- Docker entry-point script clean
|
||||
|
||||
## v0.1.0
|
||||
|
||||
### Changed
|
||||
|
||||
15
Dockerfile
15
Dockerfile
@@ -6,18 +6,24 @@ ARG VERSION="0.8.13"
|
||||
|
||||
RUN set -x \
|
||||
&& apk add --no-cache \
|
||||
ca-certificates \
|
||||
linux-headers \
|
||||
build-base \
|
||||
git \
|
||||
&& update-ca-certificates \
|
||||
&& git clone --branch ${VERSION} https://github.com/z3APA3A/3proxy.git /tmp/3proxy \
|
||||
&& cd /tmp/3proxy \
|
||||
&& 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
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
# e.g.: `docker build --build-arg "BUILD_DATE=`date -u +'%Y-%m-%dT%H:%M:%SZ'`" .`
|
||||
ARG BUILD_DATE
|
||||
|
||||
LABEL \
|
||||
org.label-schema.name="3proxy" \
|
||||
org.label-schema.description="Tiny free proxy server" \
|
||||
@@ -25,13 +31,13 @@ LABEL \
|
||||
org.label-schema.vcs-url="https://github.com/tarampampam/3proxy-docker" \
|
||||
org.label-schema.docker.cmd="docker run --rm -d -p \"3128:3128/tcp\" -p \"1080:1080/tcp\" this_image" \
|
||||
org.label-schema.vendor="tarampampam" \
|
||||
org.label-schema.build-date="$BUILD_DATE" \
|
||||
org.label-schema.license="WTFPL" \
|
||||
org.label-schema.schema-version="1.0"
|
||||
|
||||
COPY 3proxy.cfg /etc/3proxy/3proxy.cfg
|
||||
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
COPY --from=builder /tmp/3proxy/src/3proxy /usr/bin/3proxy
|
||||
COPY --from=builder /tmp/3proxy/cfg/3proxy.cfg.sample /etc/3proxy/3proxy.cfg
|
||||
|
||||
RUN set -x \
|
||||
# Unprivileged user creation <https://stackoverflow.com/a/55757473/12429735RUN>
|
||||
@@ -43,7 +49,6 @@ RUN set -x \
|
||||
--no-create-home \
|
||||
--uid 10001 \
|
||||
3proxy \
|
||||
&& touch /etc/3proxy/passwd \
|
||||
&& chown 3proxy:3proxy -R /etc/3proxy
|
||||
|
||||
# Use an unprivileged user
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
## 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.
|
||||
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].
|
||||
|
||||
@@ -33,7 +33,6 @@ All supported image tags [can be found here][link_docker_tags].
|
||||
|
||||
Variable name | Description | Example
|
||||
---------------- | ----------------------------------------- | ---------------
|
||||
`AUTH_REQUIRED` | Require authorization? (default: `false`) | `true`, `false`
|
||||
`PROXY_LOGIN` | Authorization login | `username`
|
||||
`PROXY_PASSWORD` | Authorization password | `password`
|
||||
|
||||
@@ -54,7 +53,6 @@ Or with auth settings:
|
||||
$ docker run --rm -d \
|
||||
-p "3128:3128/tcp" \
|
||||
-p "1080:1080/tcp" \
|
||||
-e "AUTH_REQUIRED=true" \
|
||||
-e "PROXY_LOGIN=evil" \
|
||||
-e "PROXY_PASSWORD=live" \
|
||||
tarampampam/3proxy:latest
|
||||
@@ -79,7 +77,7 @@ If you will find any package errors, please, [make an issue][link_create_issue]
|
||||
WTFPL. Use anywhere for your pleasure.
|
||||
|
||||
[badge_build_status]:https://img.shields.io/github/workflow/status/tarampampam/3proxy-docker/tests/master?logo=github&label=build
|
||||
[badge_release_status]:https://img.shields.io/github/workflow/status/tarampampam/3proxy-docker/release/master?logo=github&label=release
|
||||
[badge_release_status]:https://img.shields.io/github/workflow/status/tarampampam/3proxy-docker/release?logo=github&label=release
|
||||
[badge_release_date]:https://img.shields.io/github/release-date/tarampampam/3proxy-docker.svg?style=flat-square&maxAge=180
|
||||
[badge_commits_since_release]:https://img.shields.io/github/commits-since/tarampampam/3proxy-docker/latest.svg?style=flat-square&maxAge=180
|
||||
[badge_issues]:https://img.shields.io/github/issues/tarampampam/3proxy-docker.svg?style=flat-square&maxAge=180
|
||||
@@ -92,7 +90,7 @@ WTFPL. Use anywhere for your pleasure.
|
||||
[link_changes_log]:https://github.com/tarampampam/3proxy-docker/blob/master/CHANGELOG.md
|
||||
[link_issues]:https://github.com/tarampampam/3proxy-docker/issues
|
||||
[link_pulls]:https://github.com/tarampampam/3proxy-docker/pulls
|
||||
[link_build_status]:https://travis-ci.org/tarampampam/3proxy-docker
|
||||
[link_build_status]:https://github.com/tarampampam/3proxy-docker/actions
|
||||
[link_create_issue]:https://github.com/tarampampam/3proxy-docker/issues/new
|
||||
[link_license]:https://github.com/tarampampam/3proxy-docker/blob/master/LICENSE
|
||||
[link_docker_tags]:https://hub.docker.com/r/tarampampam/3proxy/tags
|
||||
|
||||
@@ -1,62 +1,12 @@
|
||||
#!/usr/bin/env sh
|
||||
set -e
|
||||
|
||||
AUTH_REQUIRED=${AUTH_REQUIRED:-false} # true|false
|
||||
PROXY_LOGIN=${PROXY_LOGIN:-} # string
|
||||
PROXY_PASSWORD=${PROXY_PASSWORD:-} # string
|
||||
|
||||
if [ "$AUTH_REQUIRED" = "true" ]; 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;
|
||||
|
||||
if [ -n "$PROXY_LOGIN" ] && [ -n "$PROXY_PASSWORD" ]; then
|
||||
echo "$0: setup '${PROXY_LOGIN}:${PROXY_PASSWORD}' as proxy user";
|
||||
echo "${PROXY_LOGIN}:CL:${PROXY_PASSWORD}" > /etc/3proxy/passwd
|
||||
sed -i "s~#AUTH_SETTINGS~users ${PROXY_LOGIN}:CL:${PROXY_PASSWORD}\nauth strong\nallow ${PROXY_LOGIN}~" /etc/3proxy/3proxy.cfg
|
||||
fi;
|
||||
|
||||
echo "$0: rewrite configuration file";
|
||||
cat << \EOF > /etc/3proxy/3proxy.cfg
|
||||
#!/usr/bin/3proxy
|
||||
config /etc/3proxy/3proxy.cfg
|
||||
|
||||
# you may use system to execute some external command if proxy starts
|
||||
system "echo `which 3proxy`': Starting 3proxy'"
|
||||
|
||||
# We can configure nservers to avoid unsafe gethostbyname() usage
|
||||
nserver 1.0.0.1
|
||||
nserver 1.1.1.1
|
||||
nserver 8.8.4.4
|
||||
nserver 8.8.8.8
|
||||
|
||||
# nscache is good to save speed, traffic and bandwidth
|
||||
nscache 65536
|
||||
|
||||
# Here we can change timeout values
|
||||
timeouts 1 5 30 60 180 1800 15 60
|
||||
|
||||
log /dev/stdout
|
||||
logformat "- +_L%t.%. %N.%p %E %U %C:%c %R:%r %O %I %h %T"
|
||||
|
||||
maxconn 1024
|
||||
|
||||
#AUTH_SETTINGS
|
||||
|
||||
proxy -a -p3128
|
||||
socks -a -p1080
|
||||
|
||||
flush
|
||||
EOF
|
||||
|
||||
if [ "$AUTH_REQUIRED" = "true" ]; then
|
||||
echo "$0: setup auth settings in configuration file";
|
||||
|
||||
sed -i "s~#AUTH_SETTINGS~users \$/etc/3proxy/passwd\nauth strong\nallow ${PROXY_LOGIN}~" /etc/3proxy/3proxy.cfg
|
||||
fi;
|
||||
|
||||
cat /etc/3proxy/3proxy.cfg
|
||||
|
||||
exec "$@"
|
||||
|
||||
Reference in New Issue
Block a user