import Foundation /// Server configuration loaded from environment variables struct Config { /// Host to bind the server to (default: 0.0.0.0 for LAN access) let host: String /// Port to listen on (default: 50051) let port: Int /// Optional API key for authentication via gRPC metadata let apiKey: String? /// Initialize configuration from environment variables init() { self.host = ProcessInfo.processInfo.environment["GRPC_HOST"] ?? "0.0.0.0" self.port = Int(ProcessInfo.processInfo.environment["GRPC_PORT"] ?? "50051") ?? 50051 self.apiKey = ProcessInfo.processInfo.environment["API_KEY"] } /// Initialize with explicit values (for testing) init(host: String, port: Int, apiKey: String? = nil) { self.host = host self.port = port self.apiKey = apiKey } }