Configuration Reference

statfyr is configured entirely through plugins/statfyr/config.yml. This page documents every key in the shipped default file and what each one actually does in v1.0.0-BETA.

File location

plugins/statfyr/config.yml, created automatically on first boot with the defaults shown below. config-version is managed by the plugin; do not edit it.

Full example

This is the file the plugin ships, verbatim:

plugins/statfyr/config.yml (default)yaml
# Statfyr Configuration
config-version: 1

http:
  port: 8080
  bind-address: "0.0.0.0"     # 0.0.0.0 = public, 127.0.0.1 = localhost only
  request-timeout-seconds: 15
  max-request-body-kb: 512

https:
  enabled: false
  keystore-path: "plugins/statfyr/keystore.jks"
  keystore-password: "changeit"

compression:
  enabled: true

async:
  enabled: true

docs:
  enabled: true

debug: false

security:
  enable-api-key: false
  api-key: ""

  enable-rate-limit: true
  rate-limit-requests: 120
  rate-limit-window-seconds: 60

  enable-cors: true
  allowed-origins:
    - "*"

  enable-ip-whitelist: false
  allowed-ips: []

query:
  max-limit: 100

pagination:
  default-limit: 25
  max-limit: 100

sorting:
  default-order: "desc"       # asc | desc

cache:
  ttl-seconds: 60
  refresh-seconds: 10

Key reference

Status reflects v1.0.0-BETA behavior: enforced keys change runtime behavior today; reserved keys are read into the config but not yet wired to the feature they name.

KeyDefaultStatusBehavior
http.port8080EnforcedPort the embedded HTTP server binds (clamped to 1–65535).
http.bind-address0.0.0.0EnforcedBind address. Use 127.0.0.1 to keep the API local-only.
http.request-timeout-seconds15ReservedLoaded but not applied to exchanges yet.
http.max-request-body-kb512ReservedLoaded but not applied (all routes are GET with no body).
https.enabledfalseEnforcedServe over HTTPS using the JKS keystore instead of plain HTTP.
https.keystore-pathplugins/statfyr/keystore.jksEnforcedPath to the JKS keystore.
https.keystore-passwordchangeitEnforcedKeystore password; STATFYR_KEYSTORE_PASSWORD wins if set.
compression.enabledtrueReservedReported in /api/health features. Gzip is actually driven by each client's Accept-Encoding.
async.enabledtrueReservedReported in /api/health features. Request handling is always asynchronous.
docs.enabledtrueReservedReported in /api/health features. /api and /api/docs are always registered.
debugfalseEnforcedVerbose request logging (method, path, status) to the server console.
security.enable-api-keyfalseEnforcedRequire Authorization: Bearer <key>. Auth only activates when a non-blank key is configured.
security.api-key(empty)EnforcedThe Bearer key. STATFYR_API_KEY wins if set.
security.enable-rate-limittrueEnforcedPer-IP fixed-window rate limiting; excess requests get HTTP 429.
security.rate-limit-requests120EnforcedRequests allowed per window per IP.
security.rate-limit-window-seconds60EnforcedWindow length in seconds.
security.enable-corstrueEnforcedSends CORS headers and answers OPTIONS preflights with 204.
security.allowed-origins["*"]ReservedLoaded but not used for matching: when CORS is on, Access-Control-Allow-Origin: * is always sent.
security.enable-ip-whitelistfalseEnforcedReject clients whose IP is not in allowed-ips with HTTP 403.
security.allowed-ips[]EnforcedWhitelist entries (exact IPs).
query.max-limit100ReservedLoaded but unused; pagination.max-limit is what clamps limit.
pagination.default-limit25EnforcedDefault page size for /api/players and leaderboards.
pagination.max-limit100EnforcedMaximum accepted limit; larger values are clamped.
sorting.default-orderdescEnforcedDefault sort direction when order is omitted.
cache.ttl-seconds60ReservedLoaded but unused; the statistic cache TTL is hard-coded at 30 seconds.
cache.refresh-seconds10ReservedLoaded but unused; the background refresh runs every 5 seconds.

Environment overrides

Two secrets can be supplied through the environment instead of the config file:

VariableOverridesUse
STATFYR_API_KEYsecurity.api-keyKeep the Bearer key out of config.yml and backups.
STATFYR_KEYSTORE_PASSWORDhttps.keystore-passwordKeep the keystore password out of config.yml and backups.

HTTPS setup

statfyr serves HTTPS from a Java JKS keystore. Generate one with keytool(ships with your JDK), then flip https.enabled to true and restart:

keytool -genkeypair -alias statfyr \
  -keyalg RSA -keysize 2048 \
  -storetype JKS \
  -keystore keystore.jks \
  -validity 3650

Reserved keys

Applying changes

Run /statfyr reload (permission statfyr.admin) to re-read the file without a restart, or /statfyr status to confirm what the server picked up: bind address, port, HTTPS, auth, rate limiting, and cache state.