Migrate from 1.X to 2.X
⚠️ Module version 2.0.0 introduces breaking changes. Follow the steps below to migrate from an older version.
Configuration
All configuration parameters have been migrated to environment variables. They can be set directly in your environment, or declared inside the haproxy.cfg file.
| Before (< 2.0.0) | After (2.0.0+) | |
|---|---|---|
| API key configuration | set-var proc.Datadome_key str("...") in global | setenv DATADOME_SERVER_SIDE_KEY "${...}" in global |
| Timeout configuration | httpclient.timeout.connect only | setenv DATADOME_TIMEOUT "150" |
| Endpoint configuration | Server address in backend api-datadome-co | setenv DATADOME_ENDPOINT "api.datadome.co" |
| Referer restoration | restore_referrer = true in datadome.lua | setenv DATADOME_ENABLE_REFERRER_RESTORATION "true" |
| Challenge/block handling | Requires datadome_challenge_backend | Handled internally by the Lua module |
Step-by-Step Migration
- Download module 2.0.0+ from here and replace your existing Lua files.
- Update
globalblock - replaceset-var proc.Datadome_keywithsetenvdirectives and set the corresponding environment variables.# Remove this: set-var proc.Datadome_key str("DATADOME_SERVERSIDE_API_KEY") # Add this: setenv DATADOME_SERVER_SIDE_KEY "${DATADOME_SERVER_SIDE_KEY}" - Remove
use_backend datadome_challenge_backendfrom all protected frontends. - Remove the
datadome_challenge_backendbackend block entirely. - If you previously set
restore_referrer = trueindatadome.lua, revert that change and useDATADOME_ENABLE_REFERRER_RESTORATION=trueas an environment variable instead. - Reload HAProxy and verify requests are being protected as expected.
