Version: 0.5.0
Pabawi is designed to work with minimal configuration by using your existing Bolt project setup. This guide covers all configuration options, from basic setup to advanced deployment scenarios.
- Quick Start
- Environment Variables
- Bolt Project Requirements
- Command Whitelist Configuration
- Package Installation Configuration
- Ansible Integration
- Expert Mode
- Streaming Configuration
- Caching Configuration
- Performance Configuration
- Deployment Scenarios
- Troubleshooting
The minimal configuration requires only a Bolt project directory:
# Set the Bolt project path (defaults to current directory)
export BOLT_PROJECT_PATH=/path/to/bolt-project
# Start the server
npm startPabawi will automatically discover:
- Node inventory from
inventory.yaml - Available tasks from the
modulesdirectory - Bolt configuration from
bolt-project.yaml
All configuration is managed through environment variables. You can set these in:
- System environment
.envfile in the backend directory- Docker environment variables
- Type: Integer
- Default:
3000 - Description: HTTP port for the API server
- Example:
PORT=8080
- Type: String
- Default:
localhost - Description: Host address to bind the server
- Example:
HOST=0.0.0.0(listen on all interfaces)
- Type: String (path)
- Default: Current working directory (
.) - Description: Path to the Bolt project directory containing
inventory.yaml,bolt-project.yaml, and modules - Example:
BOLT_PROJECT_PATH=/opt/bolt-project - Notes:
- Must be an absolute path or relative to the server's working directory
- The directory must contain a valid Bolt project structure
- Read-only access is sufficient
- Type: Enum (
error,warn,info,debug) - Default:
info - Description: Logging verbosity level for backend services
- Example:
LOG_LEVEL=debug - Notes:
error: Only log errorswarn: Log warnings and errorsinfo: Log informational messages, warnings, and errors (recommended for production)debug: Log all messages including debug information (useful for troubleshooting)
- New in v0.5.0: Centralized logging system with consistent log levels across all integration modules
- Type: String (path)
- Default:
./data/pabawi.db - Description: Path to SQLite database file for execution history
- Example:
DATABASE_PATH=/var/lib/pabawi/pabawi.db - Notes:
- Directory must exist and be writable
- Database file will be created automatically if it doesn't exist
- Consider using a persistent volume in Docker deployments
- Type: Integer (milliseconds)
- Default:
300000(5 minutes) - Description: Maximum execution time for Bolt commands and tasks
- Example:
BOLT_EXECUTION_TIMEOUT=600000(10 minutes) - Notes:
- Executions exceeding this timeout will be terminated
- Set higher for long-running tasks (e.g., system updates, large deployments)
- Minimum recommended: 60000 (1 minute)
For detailed Bolt configuration, security whitelisting, and package task setup, please refer to the dedicated Bolt Integration Setup Guide.
For detailed Ansible configuration, inventory requirements, playbook usage, and troubleshooting, please refer to the dedicated Ansible Integration Setup Guide.
For detailed Hiera configuration, hierarchy setup, and code analysis features, please refer to the dedicated Hiera Integration Setup Guide.
Configure real-time output streaming for command and task execution.
- Type: Integer (milliseconds)
- Default:
100 - Description: Buffer time for batching streaming output events
- Example:
STREAMING_BUFFER_MS=200 - Notes:
- Lower values provide more real-time updates but increase network traffic
- Higher values reduce network traffic but delay updates
- Recommended range: 50-500ms
- Type: Integer (bytes)
- Default:
10485760(10 MB) - Description: Maximum total output size per execution
- Example:
STREAMING_MAX_OUTPUT_SIZE=52428800(50 MB) - Notes:
- Prevents memory exhaustion from extremely verbose output
- Output exceeding this limit will be truncated
- Consider increasing for tasks with large output (e.g., package installations)
- Type: Integer (characters)
- Default:
10000 - Description: Maximum length of a single output line
- Example:
STREAMING_MAX_LINE_LENGTH=5000 - Notes:
- Very long lines will be truncated with an indicator
- Prevents browser performance issues with extremely long lines
- Typical log lines are under 1000 characters
Configure caching to improve performance and reduce load on target nodes.
- Type: Integer (milliseconds)
- Default:
30000(30 seconds) - Description: Time-to-live for cached inventory data
- Example:
CACHE_INVENTORY_TTL=60000(1 minute) - Notes:
- Reduces repeated Bolt CLI calls for inventory
- Set to 0 to disable caching
- Increase for static inventories, decrease for dynamic inventories
- Type: Integer (milliseconds)
- Default:
300000(5 minutes) - Description: Time-to-live for cached facts per node
- Example:
CACHE_FACTS_TTL=600000(10 minutes) - Notes:
- Reduces load on target nodes from repeated fact gathering
- Set to 0 to disable caching
- Facts are cached per node independently
Configure execution queue and concurrency limits.
- Type: Integer
- Default:
5 - Description: Maximum number of concurrent Bolt executions
- Example:
CONCURRENT_EXECUTION_LIMIT=10 - Notes:
- Prevents resource exhaustion from too many simultaneous executions
- Additional executions are queued until a slot becomes available
- Consider system resources (CPU, memory, network) when setting
- Higher values allow more parallelism but increase resource usage
- Type: Integer
- Default:
50 - Description: Maximum number of executions that can be queued
- Example:
MAX_QUEUE_SIZE=100 - Notes:
- Executions beyond this limit are rejected with an error
- Prevents unbounded queue growth
- Should be set based on expected workload and acceptable wait times
Configure user interface features and behavior.
- Type: Boolean (
trueorfalse) - Default:
true - Description: Show aggregated Puppet run history chart on the home page
- Example:
UI_SHOW_HOME_PAGE_RUN_CHART=false - Notes:
- When enabled, displays a 7-day aggregated run history chart for all nodes on the home page
- Requires PuppetDB integration to be enabled and active
- Chart data is fetched on page load and refreshed every 5 minutes
- Disable if data collection takes too long or to reduce API load
- Individual node run history charts on node detail pages are not affected by this setting
- New in v0.5.0: Puppet run visualization feature
Enhanced in v0.5.0: Expert mode now includes unified logging, frontend log collection, and comprehensive debugging information.
Expert mode provides detailed diagnostic information for troubleshooting. When enabled, API responses include:
- Full error stack traces
- Request and correlation IDs
- Frontend logs with automatic sensitive data obfuscation
- Backend debug information
- Performance metrics (memory, CPU, cache stats)
- External API error details
- Complete request lifecycle visibility
Enabling Expert Mode:
- Via UI: Toggle "Expert Mode" in the navigation bar
- Via API: Include
X-Expert-Mode: trueheader in requests - Via Request Body: Set
expertMode: truein request body
Frontend Logger Configuration:
Frontend logs are automatically collected when expert mode is enabled:
- Buffer Size: 100 log entries (circular buffer)
- Sync Throttle: 1 request per second to backend
- TTL: 5 minutes in-memory storage on backend
- Obfuscation: Automatic sensitive data obfuscation (passwords, tokens, API keys)
- Correlation IDs: Link frontend actions to backend processing
Security Considerations:
- Expert mode may expose internal system details
- Only enable for trusted users in production
- Frontend logs are obfuscated but may still contain sensitive context
- Backend stores logs in-memory only (no persistent storage)
- Automatic cleanup after 5 minutes
For detailed requirements on project structure, bolt-project.yaml best practices, and inventory configuration, please refer to the dedicated Bolt Integration Setup Guide.
For detailed command whitelist configuration, security modes, and examples, please refer to the dedicated Bolt Integration Setup Guide.
For detailed package installation configuration, including how to define available tasks and parameter mappings, please refer to the dedicated Bolt Integration Setup Guide.
Pabawi supports Ansible as an execution integration for commands, package operations, and playbooks.
For the complete setup process and environment variable reference (ANSIBLE_ENABLED, ANSIBLE_PROJECT_PATH, ANSIBLE_INVENTORY_PATH, ANSIBLE_EXECUTION_TIMEOUT), see the Ansible Integration Setup Guide.
Expert mode provides detailed diagnostic information for troubleshooting. It can be enabled globally or per-request.
- Click the "Expert Mode" toggle in the navigation bar
- The setting is persisted in browser localStorage
- All subsequent requests will include expert mode headers
Include the X-Expert-Mode: true header:
curl -X POST http://localhost:3000/api/nodes/node1/command \
-H "Content-Type: application/json" \
-H "X-Expert-Mode: true" \
-d '{"command": "ls -la"}'Or in the request body:
curl -X POST http://localhost:3000/api/nodes/node1/command \
-H "Content-Type: application/json" \
-d '{"command": "ls -la", "expertMode": true}'When expert mode is enabled, error responses include:
- Full stack traces: Complete error stack for debugging
- Request IDs: Unique identifiers for correlating logs
- Execution context: Endpoint, method, timestamp
- Raw Bolt output: Unprocessed CLI output
- Bolt commands: The exact command executed
- Additional diagnostics: Environment details, configuration
Example error response:
{
"error": {
"code": "BOLT_EXECUTION_FAILED",
"message": "Command execution failed",
"details": "Connection timeout",
"stackTrace": "Error: Command execution failed\n at BoltService.runCommand...",
"requestId": "req-abc123",
"timestamp": "2024-01-01T00:00:00.000Z",
"rawResponse": "Error: Connection timeout after 30s\n...",
"executionContext": {
"endpoint": "/api/nodes/node1/command",
"method": "POST",
"requestId": "req-abc123",
"boltCommand": "bolt command run 'ls -la' --targets node1 --format json"
}
}
}- Development: Always enable for detailed debugging
- Troubleshooting: Enable when investigating issues
- Support: Provide expert mode output when reporting bugs
- Production: Disable by default, enable only when needed
Expert mode may expose:
- Internal file paths
- System configuration details
- Bolt project structure
Only enable expert mode for trusted users in production environments.
Characteristics:
- Local Bolt project
- Allow all commands
- Verbose logging
- No caching
Configuration:
# .env file
PORT=3000
HOST=localhost
BOLT_PROJECT_PATH=./bolt-project
COMMAND_WHITELIST_ALLOW_ALL=true
LOG_LEVEL=debug
DATABASE_PATH=./data/pabawi.db
BOLT_EXECUTION_TIMEOUT=600000
# Disable caching for immediate updates
CACHE_INVENTORY_TTL=0
CACHE_FACTS_TTL=0
# Lower concurrency for local testing
CONCURRENT_EXECUTION_LIMIT=2Starting the server:
# Install dependencies
cd backend
npm install
# Start in development mode
npm run devCharacteristics:
- Shared Bolt project
- Restricted command whitelist
- Moderate logging
- Short cache TTLs
Configuration:
# .env file
PORT=3000
HOST=0.0.0.0
BOLT_PROJECT_PATH=/opt/bolt-project
COMMAND_WHITELIST_ALLOW_ALL=false
COMMAND_WHITELIST='["ls","pwd","uptime","systemctl status","journalctl"]'
COMMAND_WHITELIST_MATCH_MODE=prefix
LOG_LEVEL=info
DATABASE_PATH=/var/lib/pabawi/pabawi.db
BOLT_EXECUTION_TIMEOUT=300000
# Short cache for testing
CACHE_INVENTORY_TTL=30000
CACHE_FACTS_TTL=60000
# Moderate concurrency
CONCURRENT_EXECUTION_LIMIT=5Starting the server:
# Build the application
npm run build
# Start with PM2 or systemd
pm2 start dist/server.js --name pabawiCharacteristics:
- Strict security
- Minimal logging
- Optimized caching
- High concurrency
Configuration:
# .env file
PORT=3000
HOST=0.0.0.0
BOLT_PROJECT_PATH=/opt/bolt-project
COMMAND_WHITELIST_ALLOW_ALL=false
COMMAND_WHITELIST='["uptime","df -h","free -m","systemctl status"]'
COMMAND_WHITELIST_MATCH_MODE=exact
LOG_LEVEL=warn
DATABASE_PATH=/var/lib/pabawi/pabawi.db
BOLT_EXECUTION_TIMEOUT=300000
# Optimize caching
CACHE_INVENTORY_TTL=60000
CACHE_FACTS_TTL=300000
# Higher concurrency for production load
CONCURRENT_EXECUTION_LIMIT=10
MAX_QUEUE_SIZE=100
# Streaming optimization
STREAMING_BUFFER_MS=100
STREAMING_MAX_OUTPUT_SIZE=10485760Deployment with systemd:
# /etc/systemd/system/pabawi.service
[Unit]
Description=Pabawi - Unified Remote Execution Interface
After=network.target
[Service]
Type=simple
User=pabawi
WorkingDirectory=/opt/pabawi
EnvironmentFile=/opt/pabawi/.env
ExecStart=/usr/bin/node /opt/pabawi/dist/server.js
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target# Enable and start
sudo systemctl enable pabawi
sudo systemctl start pabawiFor detailed Docker deployment instructions, including volume mounts, docker-compose examples, and environment configuration, please refer to the dedicated Docker Deployment Guide.
For detailed Kubernetes configuration including Deployments, Services, ConfigMaps, and Persistent Volumes, please refer to the dedicated Kubernetes Deployment Guide.
For a comprehensive guide on diagnosing and resolving issues, including installation problems, connectivity errors, and performance tuning, please refer to the dedicated Troubleshooting Guide.
Pabawi performs validation on startup:
- Bolt project exists: Verifies
BOLT_PROJECT_PATHdirectory - Required files present: Checks for
inventory.yamlandbolt-project.yaml - Database accessible: Tests database file creation/access
- Configuration valid: Validates all environment variables
If validation fails, the server will not start and will log detailed error messages.
Test your configuration before deployment:
# Test Bolt CLI access
bolt inventory show --format json
# Test command execution
bolt command run 'uptime' --targets localhost --format json
# Test task listing
bolt task show --format json
# Test database access
sqlite3 $DATABASE_PATH "SELECT 1"Before deploying to production:
-
BOLT_PROJECT_PATHpoints to valid Bolt project -
inventory.yamlcontains all target nodes -
bolt-project.yamlhascolor: false - Command whitelist configured appropriately
- Database path is writable
- Execution timeout is reasonable
- Caching configured for your use case
- Concurrency limits set based on resources
- Streaming limits configured
- Log level appropriate for environment
- Expert mode disabled in production (or restricted)
- UI features configured (run chart visibility)
- Integration colors displaying correctly