feat: EXTRA_CONFIG environment variable is supported

This commit is contained in:
Paramtamtam 2024-03-16 18:43:37 +04:00
parent 298e65c0b0
commit 4f60889624
No known key found for this signature in database
GPG Key ID: 366371698FAD0A2B
4 changed files with 27 additions and 12 deletions

View File

@ -19,5 +19,6 @@
"ports": { "ports": {
"proxy": "${PROXY_PORT:-3128}", "proxy": "${PROXY_PORT:-3128}",
"socks": "${SOCKS_PORT:-1080}" "socks": "${SOCKS_PORT:-1080}"
} },
"extra_config": "${EXTRA_CONFIG}"
} }

View File

@ -30,4 +30,9 @@ allow {{ auth.login }}{{#auth.extra_accounts.*}},{{ * }}{{/auth.extra_accounts.*
proxy -a -p{{ ports.proxy }} proxy -a -p{{ ports.proxy }}
socks -a -p{{ ports.socks }} socks -a -p{{ ports.socks }}
flush flush{{^extra_config=}}
# Additional configuration
{{extra_config}}
{{/extra_config=}}

View File

@ -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]. 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 ## v1.8.3
### Fixed ### Fixed

View File

@ -45,16 +45,17 @@ Image: ghcr.io/tarampampam/3proxy:1.8.2
## Supported environment variables ## Supported environment variables
| Variable name | Description | Example | | Variable name | Description | Example |
|----------------------|-----------------------------------------------------------|-----------------------------------| |----------------------|-----------------------------------------------------------------------------------|-----------------------------------|
| `PROXY_LOGIN` | Authorization login (empty by default) | `username` | | `PROXY_LOGIN` | Authorization login (empty by default) | `username` |
| `PROXY_PASSWORD` | Authorization password (empty by default) | `password` | | `PROXY_PASSWORD` | Authorization password (empty by default) | `password` |
| `EXTRA_ACCOUNTS` | Additional proxy users | `{"evil":"live", "guest":"pass"}` | | `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` | | `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` | | `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` | | `MAX_CONNECTIONS` | Maximal connections count (`1024` by default) | `2056` |
| `PROXY_PORT` | HTTP proxy port number (`3128` by default) | `8080` | | `PROXY_PORT` | HTTP proxy port number (`3128` by default) | `8080` |
| `SOCKS_PORT` | SOCKS proxy port number (`1080` by default) | `8888` | | `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? ## How can I use this?