From 4f60889624f3f038772923876ee7086e51e18b1e Mon Sep 17 00:00:00 2001 From: Paramtamtam <7326800+tarampampam@users.noreply.github.com> Date: Sat, 16 Mar 2024 18:43:37 +0400 Subject: [PATCH] feat: `EXTRA_CONFIG` environment variable is supported --- 3proxy.cfg.json | 3 ++- 3proxy.cfg.mustach | 7 ++++++- CHANGELOG.md | 8 ++++++++ README.md | 21 +++++++++++---------- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/3proxy.cfg.json b/3proxy.cfg.json index 321ce9f..1aa6717 100644 --- a/3proxy.cfg.json +++ b/3proxy.cfg.json @@ -19,5 +19,6 @@ "ports": { "proxy": "${PROXY_PORT:-3128}", "socks": "${SOCKS_PORT:-1080}" - } + }, + "extra_config": "${EXTRA_CONFIG}" } diff --git a/3proxy.cfg.mustach b/3proxy.cfg.mustach index e24618e..fb414b5 100644 --- a/3proxy.cfg.mustach +++ b/3proxy.cfg.mustach @@ -30,4 +30,9 @@ allow {{ auth.login }}{{#auth.extra_accounts.*}},{{ * }}{{/auth.extra_accounts.* proxy -a -p{{ ports.proxy }} socks -a -p{{ ports.socks }} -flush +flush{{^extra_config=}} + +# Additional configuration +{{extra_config}} +{{/extra_config=}} + diff --git a/CHANGELOG.md b/CHANGELOG.md index 2859aef..c73c062 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ 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.9.0 + +### Added + +- `EXTRA_CONFIG` environment variable is supported now [#47] + +[#47]:https://github.com/tarampampam/3proxy-docker/issues/47 + ## v1.8.3 ### Fixed diff --git a/README.md b/README.md index 9b9cf43..a55b656 100644 --- a/README.md +++ b/README.md @@ -45,16 +45,17 @@ Image: ghcr.io/tarampampam/3proxy:1.8.2 ## Supported environment variables -| Variable name | Description | Example | -|----------------------|-----------------------------------------------------------|-----------------------------------| -| `PROXY_LOGIN` | Authorization login (empty by default) | `username` | -| `PROXY_PASSWORD` | Authorization password (empty by default) | `password` | -| `EXTRA_ACCOUNTS` | Additional proxy users | `{"evil":"live", "guest":"pass"}` | -| `PRIMARY_RESOLVER` | Primary nameserver (dns resolver; `1.0.0.1` by default) | `8.8.8.8:5353/tcp` | -| `SECONDARY_RESOLVER` | Secondary nameserver (dns resolver; `8.8.4.4` by default) | `2001:4860:4860::8844` | -| `MAX_CONNECTIONS` | Maximal connections count (`1024` by default) | `2056` | -| `PROXY_PORT` | HTTP proxy port number (`3128` by default) | `8080` | -| `SOCKS_PORT` | SOCKS proxy port number (`1080` by default) | `8888` | +| Variable name | Description | Example | +|----------------------|-----------------------------------------------------------------------------------|-----------------------------------| +| `PROXY_LOGIN` | Authorization login (empty by default) | `username` | +| `PROXY_PASSWORD` | Authorization password (empty by default) | `password` | +| `EXTRA_ACCOUNTS` | Additional proxy users | `{"evil":"live", "guest":"pass"}` | +| `PRIMARY_RESOLVER` | Primary nameserver (dns resolver; `1.0.0.1` by default) | `8.8.8.8:5353/tcp` | +| `SECONDARY_RESOLVER` | Secondary nameserver (dns resolver; `8.8.4.4` by default) | `2001:4860:4860::8844` | +| `MAX_CONNECTIONS` | Maximal connections count (`1024` by default) | `2056` | +| `PROXY_PORT` | HTTP proxy port number (`3128` by default) | `8080` | +| `SOCKS_PORT` | SOCKS proxy port number (`1080` by default) | `8888` | +| `EXTRA_CONFIG` | Additional 3proxy configuration (will be added to the **end** of the config file) | `log /dev/stdout` | ## How can I use this?