diff --git a/readme-vars.yml b/readme-vars.yml index 0658b4b..f3e2a5a 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -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. diff --git a/root/docker-entrypoint.sh b/root/docker-entrypoint.sh index 7ce9ce4..d59f9ac 100755 --- a/root/docker-entrypoint.sh +++ b/root/docker-entrypoint.sh @@ -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 diff --git a/root/etc/nginx/proxy.conf b/root/etc/nginx/proxy.conf index eedcac2..149c445 100644 --- a/root/etc/nginx/proxy.conf +++ b/root/etc/nginx/proxy.conf @@ -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; diff --git a/root/templates/default_nopost.template b/root/templates/default_nopost.template index 4f5d44b..79778f9 100644 --- a/root/templates/default_nopost.template +++ b/root/templates/default_nopost.template @@ -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;} diff --git a/root/templates/default_nopost_ipv4.template b/root/templates/default_nopost_ipv4.template index 923a427..b5ad1c0 100644 --- a/root/templates/default_nopost_ipv4.template +++ b/root/templates/default_nopost_ipv4.template @@ -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;} diff --git a/root/templates/default_post.template b/root/templates/default_post.template index 1cb545a..c042183 100644 --- a/root/templates/default_post.template +++ b/root/templates/default_post.template @@ -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;} diff --git a/root/templates/default_post_ipv4.template b/root/templates/default_post_ipv4.template index d44ed84..21c41c4 100644 --- a/root/templates/default_post_ipv4.template +++ b/root/templates/default_post_ipv4.template @@ -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;}