docker: Make timeout for backend requests configurable.

This commit is contained in:
Joachim Bauch 2025-04-24 08:28:08 +02:00
commit 0daf48ae2b
No known key found for this signature in database
GPG key ID: 77C1D22D53E15F02
2 changed files with 5 additions and 0 deletions

View file

@ -28,6 +28,7 @@ The running container can be configured through different environment variables:
- `BACKENDS_ALLOWALL`: Allow all backends. Extremly insecure - use only for development!
- `BACKENDS_ALLOWALL_SECRET`: Secret when `BACKENDS_ALLOWALL` is enabled.
- `BACKENDS`: Space-separated list of backend ids.
- `BACKENDS_TIMEOUT`: Timeout in seconds for requests to backends.
- `BACKEND_<ID>_URL`: Url of backend `ID` (where `ID` is the uppercase backend id).
- `BACKEND_<ID>_SHARED_SECRET`: Shared secret for backend `ID` (where `ID` is the uppercase backend id).
- `BACKEND_<ID>_SESSION_LIMIT`: Optional session limit for backend `ID` (where `ID` is the uppercase backend id).

View file

@ -248,6 +248,10 @@ if [ ! -f "$CONFIG" ]; then
sed -i "s|#secret = the-shared-secret-for-allowall|secret = $BACKENDS_ALLOWALL_SECRET|" "$CONFIG"
fi
if [ -n "$BACKENDS_TIMEOUT" ]; then
sed -i "/requests to the backend/,/requests to the backend/ s|^timeout =.*|timeout = $BACKENDS_TIMEOUT|" "$CONFIG"
fi
if [ -n "$BACKENDS" ]; then
BACKENDS_CONFIG=${BACKENDS// /,}
sed -i "s|#backends = .*|backends = $BACKENDS_CONFIG|" "$CONFIG"