Allow user to set client timeout.

This commit is contained in:
thespad 2025-01-02 10:20:06 +00:00
parent 30bb0a5aef
commit e876101d00
No known key found for this signature in database
7 changed files with 16 additions and 3 deletions

View File

@ -102,8 +102,9 @@ full_custom_readme: |
- NETWORKS=0 #optional
- NODES=0 #optional
- PING=1 #optional
- POST=0 #optional
- PLUGINS=0 #optional
- POST=0 #optional
- PROXY_READ_TIMEOUT=240 #optional
- SECRETS=0 #optional
- SERVICES=0 #optional
- SESSION=0 #optional
@ -142,8 +143,9 @@ full_custom_readme: |
-e NETWORKS=0 `#optional` \
-e NODES=0 `#optional` \
-e PING=1 `#optional` \
-e POST=0 `#optional` \
-e PLUGINS=0 `#optional` \
-e POST=0 `#optional` \
-e PROXY_READ_TIMEOUT=240 `#optional` \
-e SECRETS=0 `#optional` \
-e SERVICES=0 `#optional` \
-e SESSION=0 `#optional` \
@ -184,6 +186,7 @@ full_custom_readme: |
| `-e PING=1` | `/_ping` |
| `-e PLUGINS=0` | `/plugins` |
| `-e POST=0` | When set to `0`, only `GET` and `HEAD` operations are allowed, making API access read-only. |
| `-e PROXY_READ_TIMEOUT=240` | Connection timeout when no data is being sent. Useful for tailing quiet containers. Accepts values in s/m/h/d/w, no suffix assumes s. |
| `-e SECRETS=0` | `/secrets` |
| `-e SERVICES=0` | `/services` |
| `-e SESSION=0` | `/session` |
@ -316,6 +319,7 @@ full_custom_readme: |
## Versions
* **02.01.25:** - Support custom read timeout values.
* **05.12.24:** - Rebase to Alpine 3.21.
* **26.08.24:** - Change `ALLOW_START`, `ALLOW_STOP`, and `ALLOW_RESTARTS` to work even with `POST=0`.
* **24.05.24:** - Rebase to Alpine 3.20.

View File

@ -1,5 +1,7 @@
#!/bin/bash
export PROXY_READ_TIMEOUT=${PROXY_READ_TIMEOUT:-240}
if [[ $POST == 1 ]] && [[ $DISABLE_IPV6 == 1 ]]; then
envsubst "$(printf '${%s} ' $(bash -c "compgen -A variable"))" < /templates/default_post_ipv4.template > /run/default.conf
elif [[ $POST == 0 ]] && [[ $DISABLE_IPV6 == 1 ]]; then

View File

@ -7,7 +7,6 @@ proxy_connect_timeout 240;
proxy_headers_hash_bucket_size 128;
proxy_headers_hash_max_size 1024;
proxy_http_version 1.1;
proxy_read_timeout 52w;
proxy_redirect http:// $scheme://;
proxy_send_timeout 240;

View File

@ -33,6 +33,8 @@ server {
include /etc/nginx/proxy.conf;
proxy_read_timeout $PROXY_READ_TIMEOUT;
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start {if ($path_start = 0){return 403;}proxy_pass http://unix:$dockersocket;}
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop {if ($path_stop = 0){return 403;}proxy_pass http://unix:$dockersocket;}
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/(stop|restart|kill) {if ($path_restarts = 0){return 403;}proxy_pass http://unix:$dockersocket;}

View File

@ -32,6 +32,8 @@ server {
include /etc/nginx/proxy.conf;
proxy_read_timeout $PROXY_READ_TIMEOUT;
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start {if ($path_start = 0){return 403;}proxy_pass http://unix:$dockersocket;}
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop {if ($path_stop = 0){return 403;}proxy_pass http://unix:$dockersocket;}
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/(stop|restart|kill) {if ($path_restarts = 0){return 403;}proxy_pass http://unix:$dockersocket;}

View File

@ -33,6 +33,8 @@ server {
include /etc/nginx/proxy.conf;
proxy_read_timeout $PROXY_READ_TIMEOUT;
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start {if ($path_start = 0){return 403;}proxy_pass http://unix:$dockersocket;}
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop {if ($path_stop = 0){return 403;}proxy_pass http://unix:$dockersocket;}
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/(stop|restart|kill) {if ($path_restarts = 0){return 403;}proxy_pass http://unix:$dockersocket;}

View File

@ -32,6 +32,8 @@ server {
include /etc/nginx/proxy.conf;
proxy_read_timeout $PROXY_READ_TIMEOUT;
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start {if ($path_start = 0){return 403;}proxy_pass http://unix:$dockersocket;}
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop {if ($path_stop = 0){return 403;}proxy_pass http://unix:$dockersocket;}
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/(stop|restart|kill) {if ($path_restarts = 0){return 403;}proxy_pass http://unix:$dockersocket;}