Server Configuration

This page owns the gonemaster-server configuration model.

Precedence

Configuration is applied in this order:

  1. Command-line flags
  2. GONEMASTER_* environment variables
  3. JSON config file passed with --config
  4. Built-in defaults

Use environment variables for secrets such as database connection strings.

Print the effective config and exit:

gonemaster-server --dump-config

Core Settings

SettingPurpose
listen_addrAddress and port for the HTTP listener.
max_body_sizeMaximum request body size.
worker_countNumber of workers that dequeue jobs.
max_concurrent_jobsMaximum number of engine runs at once.
cross_job_hot_cacheEnables cross-job nameserver cache sharing.
cross_job_hot_cache_ttl_secondsTTL for cross-job hot-cache entries.
min_levelMinimum log level stored and returned in results.
profile_pathDefault engine profile file.
public_urlCanonical public base URL for public pages, robots, and sitemap.
scoring_config_pathOptional JSON scoring configuration file.
debugEnables more verbose server logging.
trusted_proxy_cidrsCIDRs (or bare IPs) of reverse proxies allowed to set X-Forwarded-For. Empty (default) trusts nothing and uses RemoteAddr. See public-api-and-proxy.md .
read_timeoutPer-connection read timeout (default 30s).
write_timeoutPer-connection write timeout (default 60s). Must exceed public_api.analysis_request_timeout.
idle_timeoutIdle keep-alive timeout (default 60s).
public_api.allow_private_undelegated_ipAllow loopback / link-local / private / CGNAT / multicast / broadcast IPs as undelegated NS targets on the public API. Default false; enable on private/internal deployments.

Environment Variables

VariableConfig field
GONEMASTER_LISTENlisten_addr
GONEMASTER_WORKER_COUNTworker_count
GONEMASTER_MAX_CONCURRENT_JOBSmax_concurrent_jobs
GONEMASTER_MIN_LEVELmin_level
GONEMASTER_PROFILEprofile_path
GONEMASTER_DEBUGdebug
GONEMASTER_DB_DRIVERdatabase.driver
GONEMASTER_DB_DSNdatabase.dsn
GONEMASTER_DB_RETENTION_DAYSdatabase.retention_days
GONEMASTER_PUBLIC_API_RATE_LIMIT_ENABLEDpublic_api.rate_limit_enabled
GONEMASTER_PUBLIC_API_RATE_LIMIT_MAXpublic_api.rate_limit_max
GONEMASTER_PUBLIC_API_RATE_LIMIT_WINDOWpublic_api.rate_limit_window
GONEMASTER_PUBLIC_API_ALLOW_PRIVATE_UNDELEGATED_IPpublic_api.allow_private_undelegated_ip
GONEMASTER_TRUSTED_PROXY_CIDRStrusted_proxy_cidrs (comma-separated)
GONEMASTER_READ_TIMEOUTread_timeout
GONEMASTER_WRITE_TIMEOUTwrite_timeout
GONEMASTER_IDLE_TIMEOUTidle_timeout
GONEMASTER_CROSS_JOB_HOT_CACHEcross_job_hot_cache
GONEMASTER_CROSS_JOB_HOT_CACHE_TTLcross_job_hot_cache_ttl_seconds

Invalid integer, boolean, or duration values emit a warning and are ignored.

Flags

Common flags:

--config PATH
--listen ADDR
--max-body-size BYTES
--debug
--dump-config
--version
--shutdown-timeout DURATION
--workers N
--max-concurrent-jobs N
--cross-job-hot-cache
--no-cross-job-hot-cache
--cross-job-hot-cache-ttl N
--profile PATH
--min-level LEVEL
--trusted-proxy-cidrs LIST
--read-timeout DURATION
--write-timeout DURATION
--idle-timeout DURATION
--public-api-allow-private-undelegated-ip

Resolver override flags:

--positive-cache-ttl N
--negative-cache-ttl N
--timeout N
--retry N
--retrans N
--fallback
--no-fallback
--sourceaddr4 IPADDR
--sourceaddr6 IPADDR

Database and public API flags are covered in database.md and public-api-and-proxy.md .

Config File Example

{
  "listen_addr": "127.0.0.1:8080",
  "max_body_size": 1048576,
  "debug": false,
  "worker_count": 16,
  "max_concurrent_jobs": 16,
  "cross_job_hot_cache": true,
  "cross_job_hot_cache_ttl_seconds": 60,
  "timeout": 5,
  "retry": 2,
  "retrans": 3,
  "fallback": true,
  "min_level": "INFO",
  "profile_path": "/etc/gonemaster/profile.json",
  "database": {
    "driver": "sqlite",
    "dsn": "/var/lib/gonemaster/gonemaster.db",
    "retention_days": 90
  },
  "public_api": {
    "rate_limit_enabled": true,
    "rate_limit_max": 10,
    "rate_limit_window": "10m",
    "allow_private_undelegated_ip": false
  },
  "trusted_proxy_cidrs": ["127.0.0.1/32"],
  "read_timeout": "30s",
  "write_timeout": "60s",
  "idle_timeout": "60s"
}

Profiles

The server has two profile sources:

  • A process-wide base profile from the built-in default plus profile_path.
  • Stored profiles in the database, referenced by jobs, batches, public profiles, and tag defaults.

Stored profiles are sparse overrides. They contain only the settings that differ from the engine default.

Example stored profile config:

{
  "resolver": {
    "defaults": {
      "timeout": 5
    }
  }
}

Stored profiles can be referenced from jobs, batches, public profiles, and tag defaults. The server validates stored profile JSON on create and update.

Profile Compatibility

Stored profiles record the engine schema version used when they were last edited. When engine defaults gain new test cases or test-level tags, the compatibility endpoints and admin UI can show profiles that need review.

Available repair operations include:

  • add missing test cases
  • add missing test-level tags
  • reset test cases to inherited defaults
  • reset one test-level module
  • mark a profile as reviewed

Deterministic Resolver Behavior

The built-in profile uses parallel and unordered resolver behavior for speed. For deterministic ordered output, use a profile with:

{
  "resolver": {
    "defaults": {
      "unordered": false,
      "parallel": 1
    }
  }
}

Result Display Settings

The config file can hide score and nameserver timing UI elements:

{
  "show_score_admin": true,
  "show_score_public": true,
  "show_nameserver_timings_admin": true,
  "show_nameserver_timings_public": true
}

These settings affect UI display. They do not remove stored data.