Files
skyg-linux-tracker/config.example.toml
T

83 lines
5.2 KiB
TOML

# skyg-linux-tracker example configuration.
#
# Precedence, lowest to highest: built-in defaults < this file < SKYG_* env vars < CLI flags.
# Default path: /etc/skyg-linux-tracker.toml (override with --config or SKYG_CONFIG).
# Every value below is the default. Env var names use the SKYG_ prefix and a
# double underscore for nesting, e.g. SKYG_SERVER__PORT.
# List values in env vars use array syntax: SKYG_OTEL__METRICS__UNITS='["nginx.service"]'.
[server]
bind = "127.0.0.1" # listen address; non-loopback requires auth.enabled = true; SKYG_SERVER__BIND
port = 1984 # listen port; SKYG_SERVER__PORT
allowed_hosts = [] # extra Host header values accepted on /mcp, added to loopback names and bind; SKYG_SERVER__ALLOWED_HOSTS
allowed_origins = [] # extra Origin values accepted on /mcp, must include scheme, e.g. "https://app.example.com"; SKYG_SERVER__ALLOWED_ORIGINS
# Native TLS for REST and /mcp. Optional and off by default: when enabled = false the
# server speaks plain HTTP and the file paths are ignored and never read.
# Certificate and key are re-read on SIGHUP (a bad new pair is rejected and the old one kept).
[server.tls]
enabled = false # serve HTTPS; requires cert_file and key_file; SKYG_SERVER__TLS__ENABLED
cert_file = "" # PEM certificate chain, leaf first; SKYG_SERVER__TLS__CERT_FILE
key_file = "" # PEM private key (PKCS#8, PKCS#1 or SEC1); SKYG_SERVER__TLS__KEY_FILE
[auth]
enabled = true # false is rejected at startup unless server.bind is loopback; SKYG_AUTH__ENABLED
db_path = "/var/lib/skyg-linux-tracker/db.sqlite" # SQLite database holding hashed API tokens; SKYG_AUTH__DB_PATH
[otel]
enabled = false # master switch for OTLP export; SKYG_OTEL__ENABLED
endpoint = "http://localhost:4317" # OTLP gRPC; use http://host:4318 with protocol "http/protobuf"; SKYG_OTEL__ENDPOINT
protocol = "grpc" # "grpc" or "http/protobuf"; SKYG_OTEL__PROTOCOL
service_name = "skyg-linux-tracker" # OTel resource attribute service.name; SKYG_OTEL__SERVICE_NAME
export_unit_metrics = true # poll systemd units and containers and export gauges; SKYG_OTEL__EXPORT_UNIT_METRICS
export_logs = false # fan journal and docker logs out as OTel logs; SKYG_OTEL__EXPORT_LOGS
metrics_interval_secs = 30 # metrics poll interval; SKYG_OTEL__METRICS_INTERVAL_SECS
# Extra OTLP headers (gRPC metadata for the grpc protocol).
# Env form: SKYG_OTEL__HEADERS__AUTHORIZATION. Values are redacted by --print-config.
[otel.headers]
# authorization = "Bearer <token>"
[otel.logs]
journal_units = [] # journal units to export as logs, empty = all; SKYG_OTEL__LOGS__JOURNAL_UNITS
docker_containers = [] # containers to export logs for, empty = all; SKYG_OTEL__LOGS__DOCKER_CONTAINERS
[otel.metrics]
units = [] # glob allowlist of units; empty = *.service and *.timer only; SKYG_OTEL__METRICS__UNITS
containers = [] # glob allowlist of containers; empty = all; SKYG_OTEL__METRICS__CONTAINERS
[sources]
docker_socket = "/var/run/docker.sock" # point at a read-only socket proxy for a hardened setup; SKYG_SOURCES__DOCKER_SOCKET
journal_namespace = "" # journal namespace, empty = default journal; SKYG_SOURCES__JOURNAL_NAMESPACE
[limits]
max_lines = 1000 # max journal lines per request; SKYG_LIMITS__MAX_LINES
max_tail = 1000 # max container log lines per request; SKYG_LIMITS__MAX_TAIL
max_follow_secs = 60 # max duration of a bounded follow (MCP tail_journal); SKYG_LIMITS__MAX_FOLLOW_SECS
# Other slinuxm instances this process can health-check and proxy.
# Off by default: no peer routes, tools, background tasks or metrics.
# Scalar keys accept SKYG_PEERS__* (SKYG_PEERS__ENABLED, SKYG_PEERS__TCP_INTERVAL_SECS, ...).
# [[peers.peer]] entries are file-only. token_file is a path; the file is read
# into memory and never written back, logged, or shown by --print-config.
[peers]
enabled = false # SKYG_PEERS__ENABLED
tcp_interval_secs = 10 # SKYG_PEERS__TCP_INTERVAL_SECS
tcp_timeout_secs = 3 # must be below tcp_interval_secs; SKYG_PEERS__TCP_TIMEOUT_SECS
api_interval_secs = 30 # SKYG_PEERS__API_INTERVAL_SECS
api_timeout_secs = 5 # must be below api_interval_secs; SKYG_PEERS__API_TIMEOUT_SECS
fail_threshold = 2 # consecutive failures before a check flips down; SKYG_PEERS__FAIL_THRESHOLD
request_timeout_secs = 10 # SKYG_PEERS__REQUEST_TIMEOUT_SECS
max_response_bytes = 8388608 # SKYG_PEERS__MAX_RESPONSE_BYTES
max_concurrent_per_peer = 4 # SKYG_PEERS__MAX_CONCURRENT_PER_PEER
max_concurrent_total = 16 # SKYG_PEERS__MAX_CONCURRENT_TOTAL
deny_cidrs = ["169.254.0.0/16", "0.0.0.0/8"] # resolved peer addresses in these ranges are refused; SKYG_PEERS__DENY_CIDRS
# [[peers.peer]]
# name = "minipc1" # ^[a-z0-9][a-z0-9_-]{0,31}$, unique, at most 64
# url = "https://minipc1:1984" # http or https, no userinfo, query or fragment
# token_file = "/run/credentials/skyg-linux-tracker.service/peer-minipc1" # absolute path
# ca_file = "/etc/ssl/private-ca.pem" # optional extra trust anchor
# allow_plain_http = false # required for http:// to a host that is not loopback
# enabled = true