# HTTP Server Configuration Fragment
# Used by all services: orchestrator, control-center, mcp-server

[[elements]]
border_top = true
border_bottom = false
name = "server_section_header"
title = "🌐 HTTP Server Configuration"
type = "section_header"

[[elements]]
default = "127.0.0.1"
help = "Address to bind the HTTP server to (127.0.0.1=local, 0.0.0.0=all interfaces)"
name = "server_host"
nickel_path = ["server", "host"]
prompt = "Server Host/Address"
required = true
type = "text"

[[elements]]
default = 9090
help = "HTTP server port number (range: ${constraint.common.server.port.min}-${constraint.common.server.port.max})"
max = "${constraint.common.server.port.max}"
min = "${constraint.common.server.port.min}"
name = "server_port"
nickel_path = ["server", "port"]
prompt = "Server Port"
required = true
type = "number"

[[elements]]
default = 4
help = "Number of worker threads for HTTP server (range: ${constraint.common.server.workers.min}-${constraint.common.server.workers.max})"
min = "${constraint.common.server.workers.min}"
max = "${constraint.common.server.workers.max}"
name = "server_workers"
nickel_path = ["server", "workers"]
prompt = "Worker Threads"
type = "number"

[[elements]]
default = 75
help = "TCP keep-alive timeout in seconds (0 = disabled, range: ${constraint.common.server.keep_alive.min}-${constraint.common.server.keep_alive.max})"
min = "${constraint.common.server.keep_alive.min}"
max = "${constraint.common.server.keep_alive.max}"
name = "server_keep_alive"
nickel_path = ["server", "keep_alive"]
prompt = "Keep-Alive Timeout (seconds)"
type = "number"

[[elements]]
default = 100
help = "Maximum number of concurrent TCP connections (range: ${constraint.common.server.max_connections.min}-${constraint.common.server.max_connections.max})"
min = "${constraint.common.server.max_connections.min}"
max = "${constraint.common.server.max_connections.max}"
name = "server_max_connections"
nickel_path = ["server", "max_connections"]
prompt = "Max Connections"
type = "number"

[[elements]]
default = 30000
help = "Request timeout in milliseconds"
min = 1000
name = "server_request_timeout"
nickel_path = ["server", "request_timeout"]
prompt = "Request Timeout (ms)"
type = "number"

[[elements]]
default = true
help = "Enable graceful shutdown to allow in-flight requests to complete"
name = "server_graceful_shutdown"
nickel_path = ["server", "graceful_shutdown"]
prompt = "Graceful Shutdown"
type = "confirm"

[[elements]]
default = 30
help = "Graceful shutdown timeout in seconds"
min = 1
name = "server_shutdown_timeout"
nickel_path = ["server", "shutdown_timeout"]
prompt = "Shutdown Timeout (seconds)"
type = "number"
