Skip to content

feat: Provide environment variable to customize varnishd startup parameters and increase limits, fixes #41#42

Merged
stasadev merged 2 commits intoddev:mainfrom
CandoImage:20250721_das-peter_41_provide-env-var-to-set-varnishd-parameters
Jul 22, 2025
Merged

feat: Provide environment variable to customize varnishd startup parameters and increase limits, fixes #41#42
stasadev merged 2 commits intoddev:mainfrom
CandoImage:20250721_das-peter_41_provide-env-var-to-set-varnishd-parameters

Conversation

@das-peter
Copy link
Copy Markdown
Contributor

The Issue

It would be nice to be able to easily adjust the varnish startup parameters.
Env-Variables are a bit more intuitive than docker compose file creation.
Further I think it would be beneficial to increase the default varnishd limits for http headers and payload sizes.
These payloads often are larger on development environments and can cause hard to track issues.

How This PR Solves The Issue

Adds a env-variable for the parameters and defines larger limits by defaiult.

Manual Testing Instructions

ddev add-on get https://github.com/CandoImage/ddev-varnish/tarball/20250721_das-peter_41_provide-env-var-to-set-varnishd-parameters
ddev dotenv set .ddev/.env.varnish --varnish-varnishd-params='-p http_max_hdr=12345'
ddev restart
ddev varnishadm param.show http_max_hdr

Automated Testing Overview

Added new test to check if customization is picked up:
bats ./tests/test.bats --filter "customize varnishd startup parameters"

Release/Deployment Notes

@das-peter das-peter marked this pull request as draft July 21, 2025 10:12
@das-peter das-peter force-pushed the 20250721_das-peter_41_provide-env-var-to-set-varnishd-parameters branch from c8bacac to 5a52f86 Compare July 21, 2025 10:13
@rfay
Copy link
Copy Markdown
Member

rfay commented Jul 21, 2025

So awesome that you provided test and testing instructions!

@das-peter
Copy link
Copy Markdown
Contributor Author

So awesome that you provided test and testing instructions!

We'll I seem to struggle with the tests ;) But will mark this ready once all is passing.
And hey, another testing tool under my belt - didn't know bats yet.

@rfay
Copy link
Copy Markdown
Member

rfay commented Jul 21, 2025

Bats is supposed to be easy but it isn't always easy :)

@das-peter das-peter force-pushed the 20250721_das-peter_41_provide-env-var-to-set-varnishd-parameters branch 2 times, most recently from 2f0f2ce to f07813a Compare July 21, 2025 15:06
@rfay
Copy link
Copy Markdown
Member

rfay commented Jul 21, 2025

Yay, congrats!

@rfay rfay requested a review from stasadev July 21, 2025 15:56
@rfay rfay added this to Next TODOs Jul 21, 2025
@stasadev stasadev changed the title feat: Provide environment variable to customize varnishd startup parmeters and increase limits feat: Provide environment variable to customize varnishd startup parameters and increase limits, fixes #41 Jul 21, 2025
Copy link
Copy Markdown
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

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

Thank you!

Manual testing works well, my suggestion is to add more checks to test for each of these values in all cases.

@das-peter das-peter force-pushed the 20250721_das-peter_41_provide-env-var-to-set-varnishd-parameters branch from f07813a to 98e1010 Compare July 22, 2025 06:00
Co-authored-by: Stanislav Zhuk <stasadev@gmail.com>
@das-peter das-peter marked this pull request as ready for review July 22, 2025 08:42
Copy link
Copy Markdown
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you!

@stasadev stasadev merged commit 59ea68e into ddev:main Jul 22, 2025
2 checks passed
@rfay rfay removed this from Next TODOs Aug 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants