Skip to content

Configuration

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 uses TOML configuration files with comprehensive settings for all operational modes.

License Monitor looks for configuration files in the following order:

  1. Command-line specified file (--config)
  2. config.toml in the current directory
  3. ~/.config/license_monitor/config.toml (Linux/macOS)
  4. %APPDATA%\license_monitor\config.toml (Windows)
# Command mode configuration
[command_mode]
command = "lmstat -a"
interval_seconds = 300
python_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 = true
bind_address = "127.0.0.1"
bind_port = 8080
allow_public_bind = false
enable_websockets = true
max_connections = 100
cors_origins = [
"http://localhost:3000",
"http://127.0.0.1:3000"
]
rate_limit_requests = 60
rate_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 = true
require_signature = true
endpoint = "https://api.github.com"
owner = "keithce"
repo = "license_monitor"
telemetry = false
[command_mode]
# Command to execute periodically
command = "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 execution
working_directory = "/opt/license_manager"
# Environment variables for command execution
environment = {
"LM_LICENSE_FILE" = "/opt/licenses/license.dat",
"PATH" = "/opt/license_manager/bin:/usr/bin:/bin"
}
[tail_mode]
# Log file to monitor
log_file = "/var/log/lmstat.log"
# Regex pattern for parsing log entries
regex_pattern = "^(\\d{4}-\\d{2}-\\d{2}\\s\\d{2}:\\d{2}:\\d{2})\\s+(\\w+)\\s+(.*)$"
# Batch size for processing log entries
batch_size = 10
# File encoding (default: utf-8)
encoding = "utf-8"
# Follow file rotation (default: true)
follow_rotation = true
[api]
# Enable/disable API server
enabled = true
# Bind address (use 0.0.0.0 for public access)
bind_address = "127.0.0.1"
# Bind port
bind_port = 8080
# Allow binding to public addresses (security setting)
allow_public_bind = false
# Enable WebSocket support
enable_websockets = true
# Maximum concurrent connections
max_connections = 100
# CORS origins (for web applications)
cors_origins = [
"http://localhost:3000",
"https://your-domain.com"
]
# Rate limiting
rate_limit_requests = 60
rate_limit_window_seconds = 60
# Request timeout (seconds)
request_timeout = 30
# Enable request logging
log_requests = true
[update]
# Update channel (stable or beta)
channel = "stable"
# Automatically check for updates on startup
auto_check = true
# Require signature verification
require_signature = true
# GitHub API endpoint
endpoint = "https://api.github.com"
# Repository owner
owner = "keithce"
# Repository name
repo = "license_monitor"
# Enable telemetry logging
telemetry = false
# Mirror URL for assets (optional)
mirror_url = ""

License Server Detail uses environment variables for configuration, with separate settings for client-side and server-side variables.

These variables are bundled to the client and should not contain secrets:

Terminal window
# API Configuration
NEXT_PUBLIC_API_BASE_URL=http://localhost:8080
NEXT_PUBLIC_API_TIMEOUT_MS=10000
NEXT_PUBLIC_API_RETRY_MAX_ATTEMPTS=3
NEXT_PUBLIC_API_RETRY_BASE_DELAY_MS=250
NEXT_PUBLIC_API_RETRY_MAX_DELAY_MS=3000
NEXT_PUBLIC_API_RETRY_JITTER=true
# Circuit Breaker Configuration
NEXT_PUBLIC_API_CIRCUIT_FAILURES=5
NEXT_PUBLIC_API_CIRCUIT_COOLDOWN_MS=10000
# Logging Configuration
NEXT_PUBLIC_LOG_LEVEL=debug

These variables are only available on the server:

Terminal window
# License Monitor API Configuration
LICENSE_MONITOR_API_KEY=your-license-monitor-api-key
LICENSE_MONITOR_BASE_URL=http://localhost:8080
LICENSE_MONITOR_TIMEOUT=30000
# Okta Authentication Configuration
AUTH_OKTA_ID=your-okta-client-id
AUTH_OKTA_SECRET=your-okta-client-secret
AUTH_OKTA_ISSUER=https://your-okta-domain.okta.com/oauth2/default
# NextAuth Configuration
AUTH_SECRET=replace-with-strong-random-string
AUTH_TRUST_HOST=false
NEXTAUTH_URL=http://localhost:3000

Create a .env.local file in the License Server Detail root directory:

.env.local
# Public client variables
NEXT_PUBLIC_API_BASE_URL=http://localhost:8080
NEXT_PUBLIC_API_TIMEOUT_MS=10000
NEXT_PUBLIC_API_RETRY_MAX_ATTEMPTS=3
NEXT_PUBLIC_API_RETRY_BASE_DELAY_MS=250
NEXT_PUBLIC_API_RETRY_MAX_DELAY_MS=3000
NEXT_PUBLIC_API_RETRY_JITTER=true
NEXT_PUBLIC_API_CIRCUIT_FAILURES=5
NEXT_PUBLIC_API_CIRCUIT_COOLDOWN_MS=10000
NEXT_PUBLIC_LOG_LEVEL=debug
# Server-side variables (secrets)
LICENSE_MONITOR_API_KEY=your-license-monitor-api-key
LICENSE_MONITOR_BASE_URL=http://localhost:8080
LICENSE_MONITOR_TIMEOUT=30000
AUTH_OKTA_ID=your-okta-client-id
AUTH_OKTA_SECRET=your-okta-client-secret
AUTH_OKTA_ISSUER=https://your-okta-domain.okta.com/oauth2/default
AUTH_SECRET=replace-with-strong-random-string
AUTH_TRUST_HOST=false
NEXTAUTH_URL=http://localhost:3000
[opentelemetry]
# Enable OpenTelemetry export
enabled = true
# Metrics endpoint
metrics_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 name
service_name = "license-monitor"
# Service version
service_version = "1.0.0"
[security]
# Enable API key authentication
api_key_auth = true
# API key validation
api_key_header = "X-API-Key"
# Rate limiting per IP
rate_limit_per_ip = 100
# Block suspicious IPs
block_suspicious_ips = true
# Enable request logging
log_requests = true
lib/config/env.ts
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'),
},
},
};
lib/auth.config.ts
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
},
},
};
  1. Network Security: Use bind_address = "127.0.0.1" for local-only access
  2. API Authentication: Enable API key authentication for production
  3. Rate Limiting: Configure appropriate rate limits
  4. CORS: Restrict CORS origins to trusted domains
  5. Logging: Enable request logging for security monitoring
  1. Environment Variables: Never commit secrets to version control
  2. Authentication: Use strong Okta configuration
  3. HTTPS: Always use HTTPS in production
  4. Token Storage: Use secure token storage mechanisms
  5. API Keys: Rotate API keys regularly
[performance]
# Maximum memory usage (MB)
max_memory_mb = 512
# Thread pool size
thread_pool_size = 4
# Batch processing size
batch_size = 100
# Connection pool size
connection_pool_size = 10
Terminal window
# Enable Next.js optimizations
NEXT_PUBLIC_OPTIMIZE_BUNDLE=true
# Configure caching
NEXT_PUBLIC_CACHE_TTL=300
# Enable compression
NEXT_PUBLIC_COMPRESS=true
# Production config.toml
[command_mode]
command = "lmstat -a"
interval_seconds = 60
[api]
enabled = true
bind_address = "0.0.0.0"
bind_port = 8080
allow_public_bind = true
enable_websockets = true
max_connections = 1000
cors_origins = ["https://your-domain.com"]
rate_limit_requests = 1000
rate_limit_window_seconds = 60
[daemon]
log_file = "/var/log/license_monitor/daemon.log"
log_level = "warning"
[update]
channel = "stable"
auto_check = true
require_signature = true
telemetry = true
Terminal window
# Production .env.local
NEXT_PUBLIC_API_BASE_URL=https://license-monitor.your-domain.com
NEXT_PUBLIC_API_TIMEOUT_MS=30000
NEXT_PUBLIC_LOG_LEVEL=info
LICENSE_MONITOR_API_KEY=production-api-key
LICENSE_MONITOR_BASE_URL=https://license-monitor.your-domain.com
AUTH_OKTA_ID=production-okta-client-id
AUTH_OKTA_SECRET=production-okta-client-secret
AUTH_OKTA_ISSUER=https://your-okta-domain.okta.com/oauth2/default
AUTH_SECRET=production-secret-key
AUTH_TRUST_HOST=true
NEXTAUTH_URL=https://your-domain.com