Skip to content

Commit

Permalink
feat: EXTRA_CONFIG environment variable is supported
Browse files Browse the repository at this point in the history
  • Loading branch information
tarampampam committed Mar 16, 2024
1 parent 298e65c commit 4f60889
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
3 changes: 2 additions & 1 deletion 3proxy.cfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"ports": {
"proxy": "${PROXY_PORT:-3128}",
"socks": "${SOCKS_PORT:-1080}"
}
},
"extra_config": "${EXTRA_CONFIG}"
}
7 changes: 6 additions & 1 deletion 3proxy.cfg.mustach
Original file line number Diff line number Diff line change
Expand Up @@ -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=}}

8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down

0 comments on commit 4f60889

Please sign in to comment.