Skip to content

Commit 3be8f6f

Browse files
authored
Merge pull request #22 from linuxserver/user-timeout
2 parents 30bb0a5 + e876101 commit 3be8f6f

7 files changed

+16
-3
lines changed

readme-vars.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ full_custom_readme: |
102102
- NETWORKS=0 #optional
103103
- NODES=0 #optional
104104
- PING=1 #optional
105-
- POST=0 #optional
106105
- PLUGINS=0 #optional
106+
- POST=0 #optional
107+
- PROXY_READ_TIMEOUT=240 #optional
107108
- SECRETS=0 #optional
108109
- SERVICES=0 #optional
109110
- SESSION=0 #optional
@@ -142,8 +143,9 @@ full_custom_readme: |
142143
-e NETWORKS=0 `#optional` \
143144
-e NODES=0 `#optional` \
144145
-e PING=1 `#optional` \
145-
-e POST=0 `#optional` \
146146
-e PLUGINS=0 `#optional` \
147+
-e POST=0 `#optional` \
148+
-e PROXY_READ_TIMEOUT=240 `#optional` \
147149
-e SECRETS=0 `#optional` \
148150
-e SERVICES=0 `#optional` \
149151
-e SESSION=0 `#optional` \
@@ -184,6 +186,7 @@ full_custom_readme: |
184186
| `-e PING=1` | `/_ping` |
185187
| `-e PLUGINS=0` | `/plugins` |
186188
| `-e POST=0` | When set to `0`, only `GET` and `HEAD` operations are allowed, making API access read-only. |
189+
| `-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. |
187190
| `-e SECRETS=0` | `/secrets` |
188191
| `-e SERVICES=0` | `/services` |
189192
| `-e SESSION=0` | `/session` |
@@ -316,6 +319,7 @@ full_custom_readme: |
316319
317320
## Versions
318321
322+
* **02.01.25:** - Support custom read timeout values.
319323
* **05.12.24:** - Rebase to Alpine 3.21.
320324
* **26.08.24:** - Change `ALLOW_START`, `ALLOW_STOP`, and `ALLOW_RESTARTS` to work even with `POST=0`.
321325
* **24.05.24:** - Rebase to Alpine 3.20.

root/docker-entrypoint.sh

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
export PROXY_READ_TIMEOUT=${PROXY_READ_TIMEOUT:-240}
4+
35
if [[ $POST == 1 ]] && [[ $DISABLE_IPV6 == 1 ]]; then
46
envsubst "$(printf '${%s} ' $(bash -c "compgen -A variable"))" < /templates/default_post_ipv4.template > /run/default.conf
57
elif [[ $POST == 0 ]] && [[ $DISABLE_IPV6 == 1 ]]; then

root/etc/nginx/proxy.conf

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ proxy_connect_timeout 240;
77
proxy_headers_hash_bucket_size 128;
88
proxy_headers_hash_max_size 1024;
99
proxy_http_version 1.1;
10-
proxy_read_timeout 52w;
1110
proxy_redirect http:// $scheme://;
1211
proxy_send_timeout 240;
1312

root/templates/default_nopost.template

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ server {
3333

3434
include /etc/nginx/proxy.conf;
3535

36+
proxy_read_timeout $PROXY_READ_TIMEOUT;
37+
3638
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start {if ($path_start = 0){return 403;}proxy_pass http://unix:$dockersocket;}
3739
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop {if ($path_stop = 0){return 403;}proxy_pass http://unix:$dockersocket;}
3840
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/(stop|restart|kill) {if ($path_restarts = 0){return 403;}proxy_pass http://unix:$dockersocket;}

root/templates/default_nopost_ipv4.template

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ server {
3232

3333
include /etc/nginx/proxy.conf;
3434

35+
proxy_read_timeout $PROXY_READ_TIMEOUT;
36+
3537
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start {if ($path_start = 0){return 403;}proxy_pass http://unix:$dockersocket;}
3638
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop {if ($path_stop = 0){return 403;}proxy_pass http://unix:$dockersocket;}
3739
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/(stop|restart|kill) {if ($path_restarts = 0){return 403;}proxy_pass http://unix:$dockersocket;}

root/templates/default_post.template

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ server {
3333

3434
include /etc/nginx/proxy.conf;
3535

36+
proxy_read_timeout $PROXY_READ_TIMEOUT;
37+
3638
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start {if ($path_start = 0){return 403;}proxy_pass http://unix:$dockersocket;}
3739
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop {if ($path_stop = 0){return 403;}proxy_pass http://unix:$dockersocket;}
3840
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/(stop|restart|kill) {if ($path_restarts = 0){return 403;}proxy_pass http://unix:$dockersocket;}

root/templates/default_post_ipv4.template

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ server {
3232

3333
include /etc/nginx/proxy.conf;
3434

35+
proxy_read_timeout $PROXY_READ_TIMEOUT;
36+
3537
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start {if ($path_start = 0){return 403;}proxy_pass http://unix:$dockersocket;}
3638
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop {if ($path_stop = 0){return 403;}proxy_pass http://unix:$dockersocket;}
3739
location ~* ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/(stop|restart|kill) {if ($path_restarts = 0){return 403;}proxy_pass http://unix:$dockersocket;}

0 commit comments

Comments
 (0)