Configuration
Configuration Guide
Section titled “Configuration Guide”This guide covers all configuration options for both components of the License Management project. Proper configuration is essential for optimal performance and security.
License Monitor Configuration
Section titled “License Monitor Configuration”License Monitor uses TOML configuration files with comprehensive settings for all operational modes.
Configuration File Location
Section titled “Configuration File Location”License Monitor looks for configuration files in the following order:
- Command-line specified file (
--config) config.tomlin the current directory~/.config/license_monitor/config.toml(Linux/macOS)%APPDATA%\license_monitor\config.toml(Windows)
Basic Configuration Structure
Section titled “Basic Configuration Structure”# Command mode configuration[command_mode]command = "lmstat -a"interval_seconds = 300python_script = "parse.py" # Optional: custom parsing script
# Tail mode configuration[tail_mode]log_file = "/var/log/lmstat.log"regex_pattern = "^(\\d{4}-\\d{2}-\\d{2}\\s\\d{2}:\\d{2}:\\d{2})\\s+(\\w+)\\s+(.*)$"batch_size = 10
# API server configuration[api]enabled = truebind_address = "127.0.0.1"bind_port = 8080allow_public_bind = falseenable_websockets = truemax_connections = 100cors_origins = [ "http://localhost:3000", "http://127.0.0.1:3000"]rate_limit_requests = 60rate_limit_window_seconds = 60
# Daemon mode configuration[daemon]log_file = "logs/daemon.log"log_level = "info" # Options: error, warning, info, debug
# Self-update configuration[update]channel = "stable"auto_check = truerequire_signature = trueendpoint = "https://api.github.com"owner = "keithce"repo = "license_monitor"telemetry = falseCommand Mode Configuration
Section titled “Command Mode Configuration”[command_mode]# Command to execute periodicallycommand = "lmstat -a"
# Interval between command executions (seconds)interval_seconds = 300
# Python script for parsing command output (optional)python_script = "parse.py"
# Working directory for command executionworking_directory = "/opt/license_manager"
# Environment variables for command executionenvironment = { "LM_LICENSE_FILE" = "/opt/licenses/license.dat", "PATH" = "/opt/license_manager/bin:/usr/bin:/bin"}Tail Mode Configuration
Section titled “Tail Mode Configuration”[tail_mode]# Log file to monitorlog_file = "/var/log/lmstat.log"
# Regex pattern for parsing log entriesregex_pattern = "^(\\d{4}-\\d{2}-\\d{2}\\s\\d{2}:\\d{2}:\\d{2})\\s+(\\w+)\\s+(.*)$"
# Batch size for processing log entriesbatch_size = 10
# File encoding (default: utf-8)encoding = "utf-8"
# Follow file rotation (default: true)follow_rotation = trueAPI Server Configuration
Section titled “API Server Configuration”[api]# Enable/disable API serverenabled = true
# Bind address (use 0.0.0.0 for public access)bind_address = "127.0.0.1"
# Bind portbind_port = 8080
# Allow binding to public addresses (security setting)allow_public_bind = false
# Enable WebSocket supportenable_websockets = true
# Maximum concurrent connectionsmax_connections = 100
# CORS origins (for web applications)cors_origins = [ "http://localhost:3000", "https://your-domain.com"]
# Rate limitingrate_limit_requests = 60rate_limit_window_seconds = 60
# Request timeout (seconds)request_timeout = 30
# Enable request logginglog_requests = trueSelf-Update Configuration
Section titled “Self-Update Configuration”[update]# Update channel (stable or beta)channel = "stable"
# Automatically check for updates on startupauto_check = true
# Require signature verificationrequire_signature = true
# GitHub API endpointendpoint = "https://api.github.com"
# Repository ownerowner = "keithce"
# Repository namerepo = "license_monitor"
# Enable telemetry loggingtelemetry = false
# Mirror URL for assets (optional)mirror_url = ""License Server Detail Configuration
Section titled “License Server Detail Configuration”License Server Detail uses environment variables for configuration, with separate settings for client-side and server-side variables.
Environment Variables
Section titled “Environment Variables”Public Client Variables (NEXT_PUBLIC_*)
Section titled “Public Client Variables (NEXT_PUBLIC_*)”These variables are bundled to the client and should not contain secrets:
# API ConfigurationNEXT_PUBLIC_API_BASE_URL=http://localhost:8080NEXT_PUBLIC_API_TIMEOUT_MS=10000NEXT_PUBLIC_API_RETRY_MAX_ATTEMPTS=3NEXT_PUBLIC_API_RETRY_BASE_DELAY_MS=250NEXT_PUBLIC_API_RETRY_MAX_DELAY_MS=3000NEXT_PUBLIC_API_RETRY_JITTER=true
# Circuit Breaker ConfigurationNEXT_PUBLIC_API_CIRCUIT_FAILURES=5NEXT_PUBLIC_API_CIRCUIT_COOLDOWN_MS=10000
# Logging ConfigurationNEXT_PUBLIC_LOG_LEVEL=debugServer-side Variables (Secrets)
Section titled “Server-side Variables (Secrets)”These variables are only available on the server:
# License Monitor API ConfigurationLICENSE_MONITOR_API_KEY=your-license-monitor-api-keyLICENSE_MONITOR_BASE_URL=http://localhost:8080LICENSE_MONITOR_TIMEOUT=30000
# Okta Authentication ConfigurationAUTH_OKTA_ID=your-okta-client-idAUTH_OKTA_SECRET=your-okta-client-secretAUTH_OKTA_ISSUER=https://your-okta-domain.okta.com/oauth2/default
# NextAuth ConfigurationAUTH_SECRET=replace-with-strong-random-stringAUTH_TRUST_HOST=falseNEXTAUTH_URL=http://localhost:3000Configuration File Structure
Section titled “Configuration File Structure”Create a .env.local file in the License Server Detail root directory:
# Public client variablesNEXT_PUBLIC_API_BASE_URL=http://localhost:8080NEXT_PUBLIC_API_TIMEOUT_MS=10000NEXT_PUBLIC_API_RETRY_MAX_ATTEMPTS=3NEXT_PUBLIC_API_RETRY_BASE_DELAY_MS=250NEXT_PUBLIC_API_RETRY_MAX_DELAY_MS=3000NEXT_PUBLIC_API_RETRY_JITTER=trueNEXT_PUBLIC_API_CIRCUIT_FAILURES=5NEXT_PUBLIC_API_CIRCUIT_COOLDOWN_MS=10000NEXT_PUBLIC_LOG_LEVEL=debug
# Server-side variables (secrets)LICENSE_MONITOR_API_KEY=your-license-monitor-api-keyLICENSE_MONITOR_BASE_URL=http://localhost:8080LICENSE_MONITOR_TIMEOUT=30000AUTH_OKTA_ID=your-okta-client-idAUTH_OKTA_SECRET=your-okta-client-secretAUTH_OKTA_ISSUER=https://your-okta-domain.okta.com/oauth2/defaultAUTH_SECRET=replace-with-strong-random-stringAUTH_TRUST_HOST=falseNEXTAUTH_URL=http://localhost:3000Advanced Configuration
Section titled “Advanced Configuration”License Monitor Advanced Settings
Section titled “License Monitor Advanced Settings”OpenTelemetry Configuration
Section titled “OpenTelemetry Configuration”[opentelemetry]# Enable OpenTelemetry exportenabled = true
# Metrics endpointmetrics_endpoint = "http://docker.ringling.edu:4318/v1/metrics"
# Logs endpoint (auto-derived from metrics endpoint)logs_endpoint = "http://docker.ringling.edu:4318/v1/logs"
# Service nameservice_name = "license-monitor"
# Service versionservice_version = "1.0.0"Security Configuration
Section titled “Security Configuration”[security]# Enable API key authenticationapi_key_auth = true
# API key validationapi_key_header = "X-API-Key"
# Rate limiting per IPrate_limit_per_ip = 100
# Block suspicious IPsblock_suspicious_ips = true
# Enable request logginglog_requests = trueLicense Server Detail Advanced Settings
Section titled “License Server Detail Advanced Settings”HTTP Client Configuration
Section titled “HTTP Client Configuration”export const env = { api: { baseURL: process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:8080', timeoutMs: parseInt(process.env.NEXT_PUBLIC_API_TIMEOUT_MS || '10000'), retry: { maxAttempts: parseInt(process.env.NEXT_PUBLIC_API_RETRY_MAX_ATTEMPTS || '3'), baseDelayMs: parseInt(process.env.NEXT_PUBLIC_API_RETRY_BASE_DELAY_MS || '250'), maxDelayMs: parseInt(process.env.NEXT_PUBLIC_API_RETRY_MAX_DELAY_MS || '3000'), jitter: process.env.NEXT_PUBLIC_API_RETRY_JITTER !== 'false', }, circuit: { failureThreshold: parseInt(process.env.NEXT_PUBLIC_API_CIRCUIT_FAILURES || '5'), cooldownMs: parseInt(process.env.NEXT_PUBLIC_API_CIRCUIT_COOLDOWN_MS || '10000'), }, },};Authentication Configuration
Section titled “Authentication Configuration”export const authConfig = { providers: [ { id: 'okta', name: 'Okta', type: 'oauth', authorization: { url: `${process.env.AUTH_OKTA_ISSUER}/v1/authorize`, params: { scope: 'openid profile email', }, }, token: `${process.env.AUTH_OKTA_ISSUER}/v1/token`, userinfo: `${process.env.AUTH_OKTA_ISSUER}/v1/userinfo`, clientId: process.env.AUTH_OKTA_ID!, clientSecret: process.env.AUTH_OKTA_SECRET!, }, ], callbacks: { jwt: async ({ token, account }) => { // Token refresh logic }, session: async ({ session, token }) => { // Session management }, },};Security Considerations
Section titled “Security Considerations”License Monitor Security
Section titled “License Monitor Security”- Network Security: Use
bind_address = "127.0.0.1"for local-only access - API Authentication: Enable API key authentication for production
- Rate Limiting: Configure appropriate rate limits
- CORS: Restrict CORS origins to trusted domains
- Logging: Enable request logging for security monitoring
License Server Detail Security
Section titled “License Server Detail Security”- Environment Variables: Never commit secrets to version control
- Authentication: Use strong Okta configuration
- HTTPS: Always use HTTPS in production
- Token Storage: Use secure token storage mechanisms
- API Keys: Rotate API keys regularly
Performance Tuning
Section titled “Performance Tuning”License Monitor Performance
Section titled “License Monitor Performance”[performance]# Maximum memory usage (MB)max_memory_mb = 512
# Thread pool sizethread_pool_size = 4
# Batch processing sizebatch_size = 100
# Connection pool sizeconnection_pool_size = 10License Server Detail Performance
Section titled “License Server Detail Performance”# Enable Next.js optimizationsNEXT_PUBLIC_OPTIMIZE_BUNDLE=true
# Configure cachingNEXT_PUBLIC_CACHE_TTL=300
# Enable compressionNEXT_PUBLIC_COMPRESS=trueProduction Configuration
Section titled “Production Configuration”License Monitor Production
Section titled “License Monitor Production”# Production config.toml[command_mode]command = "lmstat -a"interval_seconds = 60
[api]enabled = truebind_address = "0.0.0.0"bind_port = 8080allow_public_bind = trueenable_websockets = truemax_connections = 1000cors_origins = ["https://your-domain.com"]rate_limit_requests = 1000rate_limit_window_seconds = 60
[daemon]log_file = "/var/log/license_monitor/daemon.log"log_level = "warning"
[update]channel = "stable"auto_check = truerequire_signature = truetelemetry = trueLicense Server Detail Production
Section titled “License Server Detail Production”# Production .env.localNEXT_PUBLIC_API_BASE_URL=https://license-monitor.your-domain.comNEXT_PUBLIC_API_TIMEOUT_MS=30000NEXT_PUBLIC_LOG_LEVEL=info
LICENSE_MONITOR_API_KEY=production-api-keyLICENSE_MONITOR_BASE_URL=https://license-monitor.your-domain.comAUTH_OKTA_ID=production-okta-client-idAUTH_OKTA_SECRET=production-okta-client-secretAUTH_OKTA_ISSUER=https://your-okta-domain.okta.com/oauth2/defaultAUTH_SECRET=production-secret-keyAUTH_TRUST_HOST=trueNEXTAUTH_URL=https://your-domain.comNext Steps
Section titled “Next Steps”- License Monitor Documentation: Complete License Monitor guide
- License Server Detail Documentation: Complete License Server Detail guide
- Deployment Guide: Production deployment instructions
- Security Guide: Security best practices