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 configurationset-var proc.Datadome_key str("...") in globalsetenv DATADOME_SERVER_SIDE_KEY "${...}" in global
Timeout configurationhttpclient.timeout.connect onlysetenv DATADOME_TIMEOUT "150"
Endpoint configurationServer address in backend api-datadome-cosetenv DATADOME_ENDPOINT "api.datadome.co"
Referer restorationrestore_referrer = true in datadome.luasetenv DATADOME_ENABLE_REFERRER_RESTORATION "true"
Challenge/block handlingRequires datadome_challenge_backendHandled internally by the Lua module

Step-by-Step Migration

  1. Download module 2.0.0+ from here and replace your existing Lua files.
  2. Update global block - replace set-var proc.Datadome_key with setenv directives 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}"
  3. Remove use_backend datadome_challenge_backend from all protected frontends.
  4. Remove the datadome_challenge_backend backend block entirely.
  5. If you previously set restore_referrer = true in datadome.lua, revert that change and use DATADOME_ENABLE_REFERRER_RESTORATION=true as an environment variable instead.
  6. Reload HAProxy and verify requests are being protected as expected.