Skip to content
Environment Variables

Environment Variables

This page documents every environment variable that TSDProxy recognizes, including active variables used at runtime and legacy variables carried over from versions before v0.6.0.

Active Variables

VariablePurposeDefaultSet By
TSDPROXY_HTTP_PORTHTTP server port for the healthcheck binaryValue of http.port in config (defaults to 8080)Server binary (automatic)
TSDPROXY_PPROFEnable Go pprof profiling endpoints"false"User
DOCKER_HOSTDocker daemon address (standard Docker variable)unix:///var/run/docker.sockUser / Docker runtime

TSDPROXY_HTTP_PORT

Set automatically by the server binary on startup. It reads the http.port value from your config file and exports it so the healthcheck binary can reach the readiness endpoint at http://127.0.0.1:<port>/health/ready/.

You should not need to set this yourself. If the variable is empty (for example, when running the healthcheck binary standalone), it falls back to 8080.

TSDPROXY_PPROF

Set to "true" to enable Go’s built-in profiling endpoints on the HTTP server. This is useful for debugging performance issues or memory leaks.

docker-compose.yaml
services:
  tsdproxy:
    image: almeidapaulopt/tsdproxy:2
    environment:
      TSDPROXY_PPROF: "true"

When enabled, the following endpoints become available:

EndpointPurpose
/debug/pprof/Profile index
/debug/pprof/cmdlineCommand line
/debug/pprof/profileCPU profile
/debug/pprof/symbolSymbol table
/debug/pprof/traceExecution trace

Warning

pprof endpoints expose internal runtime data, including memory contents and goroutine stacks. Never enable this in production.

DOCKER_HOST

The standard Docker environment variable. TSDProxy reads it during initial config generation to determine the Docker daemon address. If set, it overrides the default socket path. Most Docker installations set this automatically. If you need to point TSDProxy at a remote Docker host, set this variable or configure docker.<name>.host in your config file.

Legacy Variables

The following environment variables are from versions prior to v0.6.0. They are read only during initial config generation when no config file exists yet. Once a config file has been generated, these variables have no effect.

VariablePurposeReplaced By
TSDPROXY_HOSTNAMEHTTP hostname for Docker target resolutiondocker.<name>.targetHostname in config
TSDPROXY_AUTHKEYTailscale auth keytailscale.providers.<name>.authKey in config
TSDPROXY_AUTHKEYFILEPath to file containing a Tailscale auth keytailscale.providers.<name>.authKeyFile in config
TSDPROXY_CONTROLURLTailscale control server URLtailscale.providers.<name>.controlUrl in config
TSDPROXY_DATADIRTailscale data directorytailscale.dataDir in config

Caution

These variables are deprecated and will be removed in a future release. Migrate to the config file options described in Server Configuration.

Docker Compose Example

docker-compose.yaml
services:
  tsdproxy:
    image: almeidapaulopt/tsdproxy:2
    container_name: tsdproxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./tsdproxy.yaml:/config/tsdproxy.yaml
      - ./data:/data
    environment:
      # Optional: enable pprof for debugging (do not use in production)
      TSDPROXY_PPROF: "true"
      # Optional: override Docker daemon address
      DOCKER_HOST: "unix:///var/run/docker.sock"
    ports:
      - "8080:8080"
    restart: unless-stopped

TSDPROXY_HTTP_PORT does not appear in this example because the server binary sets it automatically. It only needs to be present in the environment that the healthcheck binary runs in, which Docker handles through the same container environment.

Last updated on