Skip to content

Allow configuring timeouts via env - #55

Open
thespad wants to merge 2 commits into
mainfrom
timeout-config
Open

thespad wants to merge 2 commits into
mainfrom
timeout-config

Conversation

@thespad

@thespad thespad commented Oct 5, 2026

Copy link
Copy Markdown
Member

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

Closes #45

Benefits of this PR and context:

How Has This Been Tested?

Source / References:

@thespad
thespad requested a review from a team October 5, 2026 17:18
@thespad thespad self-assigned this Oct 5, 2026
@LinuxServer-CI

Copy link
Copy Markdown
Contributor

I am a bot, here are the test results for this PR for commit b022639 :
https://ci-tests.linuxserver.io/lspipepr/socket-proxy/3.4.6-r0-pkg-d2610f98-dev-b022639c17dede99c439aca9b56a791b7e8c9d5f-pr-55/index.html
https://ci-tests.linuxserver.io/lspipepr/socket-proxy/3.4.6-r0-pkg-d2610f98-dev-b022639c17dede99c439aca9b56a791b7e8c9d5f-pr-55/shellcheck-result.xml

Tag Passed
amd64-3.4.6-r0-pkg-d2610f98-dev-b022639c17dede99c439aca9b56a791b7e8c9d5f-pr-55 ✅
arm64v8-3.4.6-r0-pkg-d2610f98-dev-b022639c17dede99c439aca9b56a791b7e8c9d5f-pr-55 ✅

Comment thread root/docker-entrypoint.sh Outdated
Comment on lines +11 to +27
sed "s/@@BIND_PROTO@@/${BIND_PROTO}/g" /templates/haproxy.cfg > /run/haproxy/haproxy.cfg

if [ "${TIMEOUT_CLIENT}" ]; then
true
else
TIMEOUT_CLIENT="10"
fi

sed "s/@@TIMEOUT_CLIENT@@/${TIMEOUT_CLIENT}m/g" /templates/haproxy.cfg > /run/haproxy/haproxy.cfg

if [ "${TIMEOUT_SERVER}" ]; then
true
else
TIMEOUT_SERVER="10"
fi

sed "s/@@TIMEOUT_SERVER@@/${TIMEOUT_SERVER}m/g" /templates/haproxy.cfg > /run/haproxy/haproxy.cfg

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each sed reads the original template and overwrites the output, so only the last substitution survives: @@BIND_PROTO@@ and @@TIMEOUT_CLIENT@@ stay in /run/haproxy/haproxy.cfg, and haproxy -c rejects it:

[ALERT] config : parsing [haproxy.cfg:19] : unexpected character '@' in 'timeout client'
[ALERT] config : parsing [haproxy.cfg:29] : 'bind' : missing port specification in '@@BIND_PROTO@@'

One sed with all three expressions renders a config that validates:

Suggested change
sed "s/@@BIND_PROTO@@/${BIND_PROTO}/g" /templates/haproxy.cfg > /run/haproxy/haproxy.cfg
if [ "${TIMEOUT_CLIENT}" ]; then
true
else
TIMEOUT_CLIENT="10"
fi
sed "s/@@TIMEOUT_CLIENT@@/${TIMEOUT_CLIENT}m/g" /templates/haproxy.cfg > /run/haproxy/haproxy.cfg
if [ "${TIMEOUT_SERVER}" ]; then
true
else
TIMEOUT_SERVER="10"
fi
sed "s/@@TIMEOUT_SERVER@@/${TIMEOUT_SERVER}m/g" /templates/haproxy.cfg > /run/haproxy/haproxy.cfg
TIMEOUT_CLIENT="${TIMEOUT_CLIENT:-10}"
TIMEOUT_SERVER="${TIMEOUT_SERVER:-10}"
sed -e "s/@@BIND_PROTO@@/${BIND_PROTO}/g" \
-e "s/@@TIMEOUT_CLIENT@@/${TIMEOUT_CLIENT}m/g" \
-e "s/@@TIMEOUT_SERVER@@/${TIMEOUT_SERVER}m/g" \
/templates/haproxy.cfg > /run/haproxy/haproxy.cfg

@LinuxServer-CI

Copy link
Copy Markdown
Contributor

I am a bot, here are the test results for this PR for commit 9325223 :
https://ci-tests.linuxserver.io/lspipepr/socket-proxy/3.4.7-r0-pkg-451c4db6-dev-9325223c24e8fb47d7399ec07ff0310d97a0e244-pr-55/index.html
https://ci-tests.linuxserver.io/lspipepr/socket-proxy/3.4.7-r0-pkg-451c4db6-dev-9325223c24e8fb47d7399ec07ff0310d97a0e244-pr-55/shellcheck-result.xml

Tag Passed
amd64-3.4.7-r0-pkg-451c4db6-dev-9325223c24e8fb47d7399ec07ff0310d97a0e244-pr-55 ✅
arm64v8-3.4.7-r0-pkg-451c4db6-dev-9325223c24e8fb47d7399ec07ff0310d97a0e244-pr-55 ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: PRs Ready For Team Review

Development

Successfully merging this pull request may close these issues.

[FEAT] Add possibility to change timeout from env variables or something

3 participants