# mentisdbd environment configuration
# Copy this file to .env and adjust values as needed.
# All variables are optional — defaults are shown in comments.

# ---------------------------------------------------------------------------
# Storage
# ---------------------------------------------------------------------------

# Root directory where MentisDB stores chain data and the skill registry.
# Default: ~/.cloudllm/mentisdb
# MENTISDB_DIR=/path/to/your/mentisdb/data

# Default chain key used when no chain_key is specified in requests.
# Default: borganism-brain
# MENTISDB_DEFAULT_CHAIN_KEY=borganism-brain
# MENTISDB_DEFAULT_KEY=borganism-brain  # deprecated alias for MENTISDB_DEFAULT_CHAIN_KEY; still accepted

# Storage adapter for new chains. Options: binary (fast, default), jsonl (human-readable).
# Default: binary
# MENTISDB_DEFAULT_STORAGE_ADAPTER=binary

# When false, the BinaryStorageAdapter buffers up to 16 writes before flushing
# to disk, trading some durability for higher append throughput.
# Set to false only in high-throughput scenarios where losing the last few
# thoughts on a hard crash is acceptable.
# Default: true
# MENTISDB_AUTO_FLUSH=true

# ---------------------------------------------------------------------------
# Networking — HTTP (plain)
# ---------------------------------------------------------------------------

# IP address the daemon binds to for both HTTP and HTTPS listeners.
# Use 0.0.0.0 to accept connections from other machines on the network.
# Default: 127.0.0.1 (localhost only)
# MENTISDB_BIND_HOST=127.0.0.1

# Port for the HTTP MCP server (standard streamable HTTP MCP + legacy CloudLLM endpoints).
# Default: 9471
# MENTISDB_MCP_PORT=9471

# Port for the HTTP REST server.
# Default: 9472
# MENTISDB_REST_PORT=9472

# ---------------------------------------------------------------------------
# Networking — HTTPS (TLS)
# ---------------------------------------------------------------------------

# Port for the HTTPS MCP server.
# Set to 0 to disable the HTTPS MCP listener entirely.
# Default: 9473
# MENTISDB_HTTPS_MCP_PORT=9473

# Port for the HTTPS REST server.
# Set to 0 to disable the HTTPS REST listener entirely.
# Default: 9474
# MENTISDB_HTTPS_REST_PORT=9474

# ---------------------------------------------------------------------------
# TLS Certificates
# ---------------------------------------------------------------------------

# Path to the TLS certificate PEM file.
# On first startup, mentisdbd auto-generates a self-signed certificate at the
# default path if neither cert nor key exist. The cert includes SANs for:
#   my.mentisdb.com, localhost, 127.0.0.1
# my.mentisdb.com is a public DNS A-record → 127.0.0.1, so you can use it as
# a friendly hostname for this local daemon once you trust the cert.
# Default: ~/.cloudllm/mentisdb/tls/cert.pem
# MENTISDB_TLS_CERT=/path/to/cert.pem

# Path to the TLS private key PEM file.
# Default: ~/.cloudllm/mentisdb/tls/key.pem
# MENTISDB_TLS_KEY=/path/to/key.pem

# ---------------------------------------------------------------------------
# Logging
# ---------------------------------------------------------------------------

# Enable verbose output in the daemon (startup config, chain summaries, etc.).
# Default: true
# MENTISDB_VERBOSE=true

# Optional path to a log file. When set, structured logs are written here in
# addition to stdout.
# MENTISDB_LOG_FILE=/var/log/mentisdb/mentisdbd.log

# Log level filter for the env_logger / tracing backend.
# Examples: info, debug, warn, mentisdb=debug, mentisdb::server=trace
# Default: info
# RUST_LOG=info

# ── Audio ─────────────────────────────────────────────────────────────────────

# Play the 4-note "men-tis-D-B" startup jingle when mentisdbd launches.
# Set to 0 / false / no / off to silence. Default: true.
# MENTISDB_STARTUP_SOUND=true

# Play a unique short sound (< 200 ms, square-wave) for each thought type
# whenever a thought is appended to any chain. Each ThoughtType has its own
# melodic signature (e.g. Surprise plays a rapid MGS-style ascending arpeggio).
# Set to 1 / true / yes / on to enable. Default: false.
# MENTISDB_THOUGHT_SOUNDS=false

# ---------------------------------------------------------------------------
# Web Dashboard
# ---------------------------------------------------------------------------

# Port for the built-in web dashboard (served at /dashboard).
# Set to 0 to disable the dashboard entirely.
# Default: 9475
# MENTISDB_DASHBOARD_PORT=9475

# Optional PIN to protect the dashboard.
# If set, all dashboard requests require either:
#   - Authorization: Bearer <pin> header, OR
#   - mentisdb_pin=<pin> cookie (set automatically by the login page)
# If not set, the dashboard is open (suitable for local-only deployments).
# MENTISDB_DASHBOARD_PIN=your-secret-pin
