Skip to content

Configuration Overview

Mantis components are configured through TOML files and environment variables.

Configuration values are resolved in this order (highest to lowest priority):

┌─────────────────────────────────────────────────────────────┐
│ Configuration Priority │
├─────────────────────────────────────────────────────────────┤
│ │
│ 1. Environment variables (highest priority) │
│ 2. TOML configuration file │
│ 3. Default values (lowest priority) │
│ │
└─────────────────────────────────────────────────────────────┘

Each component searches standard locations for its config file:

ComponentSearch OrderEnv Override
Mandiblemandible.toml (cwd), /etc/mantis/mandible.toml, ~/.config/mantis/mandible.tomlMANDIBLE_CONFIG
Thoraxthorax.toml, /etc/mantis/thorax.toml, ~/.config/mantis/thorax.tomlTHORAX_CONFIG
Tarsustarsus.toml, /etc/mantis/client.toml, ~/.config/mantis/client.tomlTARSUS_CONFIG

Components use different naming conventions:

ComponentConventionExample
MandibleMANDIBLE__SECTION__KEY (double underscore)MANDIBLE__JWT__SECRET
ThoraxTHORAX__SECTION__KEY (double underscore)THORAX__GRPC__PORT
TarsusTARSUS__SECTION__KEY (double underscore)TARSUS__LISTEN__PORT

All components use double underscore (__) as the separator for nested configuration sections. See Environment Variables for the complete reference.

The Mandible API server handles HTTP requests from Lens UI and external clients.

SectionPurpose
serverHTTP server settings
databasePostgreSQL connection
jwtAuthentication tokens
corsCross-origin settings
cookieRefresh token cookies
authLens login redirects
grpcThorax connection (outbound)
internal_grpcThorax connection (inbound)
rate_limitAPI rate limiting
identityServer identity/discovery
consoleTokio-console debugging
encryptionCredential encryption
auditAudit logging
sseServer-Sent Events
queueRabbitMQ dispatch
oidcOIDC/SSO settings
file_cacheS3/Git content caching
log_analyzerAI log analysis
wireguardWireGuard transport

See Mandible Configuration for details.

The Thorax server handles gRPC communication with agents and orchestrates deployments.

SectionPurpose
tlsServer TLS/mTLS settings
grpcgRPC server settings
sessionClient session management
tls_rate_limitTLS handshake rate limiting
auditAudit logging
consoleTokio-console debugging
encryptionCredential encryption
mandibleMandible gRPC client
queueRabbitMQ command consumption
clusterRedis cluster coordination

See Thorax Configuration for details.

The Tarsus agent runs on target servers and executes deployments.

SectionPurpose
tlsClient TLS settings
mandibleMandible connection (registration)
listenListen mode settings
pollPoll mode settings
registrationRegistration and heartbeat
retryConnection retry settings
consoleTokio-console debugging
transportWireGuard transport
securityProtected security settings

See Tarsus Configuration for details.

[server]
port = 3000
[database]
url = "postgres://mantis:password@localhost/mantis"
[jwt]
secret = "your-secret-key-at-least-32-characters"
[auth]
lens_base_url = "https://localhost:5173/login"
[grpc]
orchestration_url = "https://localhost:50051"
name = "thorax-01"
[tls]
cert_path = "/etc/mantis/certs/server.crt"
key_path = "/etc/mantis/certs/server.key"
[grpc]
port = 50051
[mandible]
endpoint = "https://mandible.example.com:50052"
tls_cert_path = "/etc/mantis/certs/client.crt"
tls_key_path = "/etc/mantis/certs/client.key"
tls_ca_cert_path = "/etc/mantis/certs/ca.crt"
name = "web-prod-01"
[tls]
ca_cert_path = "/etc/mantis/certs/ca.crt"
trust_server_thumbprint = "a1b2c3d4e5f6..."
[mandible]
endpoint = "mandible.example.com:50052"
/etc/mantis/
├── thorax.toml # Thorax configuration
├── certs/ # TLS certificates
│ ├── server.crt
│ ├── server.key
│ ├── ca.crt
│ └── ca.key
└── jwt/ # JWT keys (RS256)
├── private.pem
└── public.pem
/etc/mantis/
├── client.toml # Tarsus configuration

Mandible is the only component with a database. Mandible’s database is configured as:

[database]
url = "postgres://user:password@host:port/database"
max_connections = 10
min_idle = 2
connection_timeout_secs = 10

TLS is mandatory for all components. Thorax and Tarsus use mTLS:

[tls]
cert_path = "/path/to/cert.pem"
key_path = "/path/to/key.pem"
ca_cert_path = "/path/to/ca.crt"

Thorax and Tarsus take a top-level log_level in their TOML:

log_level = "info" # trace, debug, info, warn, error

Mandible has no log_level config key (its config uses deny_unknown_fields, so adding one fails startup). Control Mandible logging with the RUST_LOG environment variable, e.g. RUST_LOG=mandible=info.

Or via environment variable:

Terminal window
# Thorax
export MANTIS_LOG_LEVEL=debug
# Tarsus
export TARSUS__LOG_LEVEL=debug
# Fine-grained control
export RUST_LOG=info,mandible=debug
Terminal window
# Good: Secrets in environment
export DATABASE_URL="postgres://user:secret@localhost/mantis"
export MANDIBLE__JWT__SECRET="$(cat /run/secrets/jwt-secret)"
# Bad: Secrets in config file
# [database]
# url = "postgres://user:secret@localhost/mantis"
Terminal window
# Validate TOML syntax
python -c "import tomllib; tomllib.load(open('config/production.toml', 'rb'))" || exit 1

Components validate their configuration on startup and will report any errors.