Interactive configuration management for Docker Compose projects with intelligent discover### Phase 4: Final Configuration Export
Export for Deployment
├── Generate primary .cfg file (interactive_config.cfg)
├── Convert .cfg to .env format (for Docker Compose)
├── Create template variables (for Jinja2 rendering)
└── Hand off to Deploy Manager
```ve validation.
## Features
- **Auto-Discovery**: Automatically detects OS, network configuration, Docker installation, available ports, and existing certificates
- **Interactive UI**: Beautiful Rich-based terminal interface with smart defaults
- **Live Validation**: Integrates with docker-prober-utility for real-time configuration testing
- **Configuration Persistence**: Generates `.env` and `.cfg` files for deployment
- **Resumable Sessions**: Can resume interrupted configuration sessions
- **Template Support**: Supports predefined configuration templates for common scenarios
## Purpose
This is a generic, reusable configuration tool designed to work with any Docker Compose project. It eliminates the need for manual configuration file editing by providing an intelligent, interactive setup experience.
## Installation
```bash
pip install openproject-config-manager
Or install from source:
git clone https://github.com/JustinCBates/openproject-config-manager.git
cd openproject-config-manager
pip install -e .from openproject_config_manager import ConfigurationManager
# Run interactive configuration
config_manager = ConfigurationManager()
result = config_manager.run_interactive(
template="docker-compose",
prober_enabled=True
)
# Result includes paths to generated files
print(f"Configuration saved to {result.env_path}")# Run interactive configuration
config-manager configure --interactive
# Resume interrupted session
config-manager configure --resume
# Use predefined template
config-manager configure --template=production
# Show current configuration
config-manager show
# Validate existing configuration
config-manager validateThe Configuration Manager follows a 4-phase control flow designed for maximum automation and validation:
OS Probe → Generate .cfg.defaults
├── Detect OS (Linux distro, version, architecture)
├── Scan network interfaces & available IPs
├── Check Docker installation & version
├── Scan available ports (80, 443, 8080, etc.)
├── Detect existing SSL certificates
├── Check system resources (RAM, disk space)
└── Write .cfg.defaults with intelligent defaults
Rich Interactive UI → Generate .cfg
├── Load .cfg.defaults as starting point
├── Present Rich-based prompts with smart defaults
├── Collect user preferences:
│ ├── Domain name & SSL preferences
│ ├── Port configurations
│ ├── Database settings
│ ├── Email/IMAP configuration
│ └── Advanced options (if requested)
├── Real-time validation during input
└── Save final .cfg file
Validation Pass → Prober Integration
├── Load .cfg file
├── Validate configuration completeness
├── Use Prober utility for live testing:
│ ├── DNS resolution checks
│ ├── Port availability testing
│ ├── SSL certificate validation
│ └── Network connectivity tests
├── Present validation results
└── Option to loop back to Phase 2 if issues found
Export for Deployment
├── Convert .cfg to .env format
├── Generate Docker Compose overrides
├── Prepare Jinja2 template variables
└── Hand off to Deploy Manager
Key Design Principle: The user can loop between Phases 2 and 3 until all validation passes, ensuring a bulletproof configuration before deployment.
Purpose: Automatically detect environment characteristics to provide intelligent defaults
Discovers:
- Operating system (family, version, distribution)
- Network configuration (hostname, IP addresses, DNS settings)
- Docker installation (version, daemon status, available images)
- Port availability (detect conflicts, suggest alternatives)
- Existing certificates (for HTTPS/TLS configuration)
Output: DiscoveryResults object with all detected information
Purpose: Guide users through configuration with beautiful terminal UI
Features:
- Rich-based UI with colors, tables, and panels
- Progressive disclosure (7 configuration sections)
- Real-time input validation
- Smart defaults from discovery results
- Navigation (back, skip, resume)
Configuration Sections:
- Environment Type (production, development, staging)
- Repository & Version
- Network Configuration (domain, ports)
- URL Configuration (prefixes, namespaces)
- Proxy Configuration (TLS, redirects)
- Database Configuration
- Application Storage
Purpose: Validate configuration completeness and consistency
Validates:
- Required fields present
- No conflicting values
- Port availability
- Network reachability
- Live endpoint testing (via prober integration)
Live Validation:
- Launches minimal test environment
- Tests HTTP/HTTPS endpoints
- Validates TLS configuration
- Tests URL rewriting
- Returns actionable recommendations
Purpose: Interface to external docker-prober-utility for live validation
Modes:
- Quick Mode: Lightweight validation during configuration (fast iteration)
- Thorough Mode: Comprehensive validation before finalization
Integration: Uses docker-prober-utility as external dependency
Purpose: Generate final configuration files
Primary Output: interactive_config.cfg file
- Format: Bash-style key="value" pairs
- Content: Complete deployment configuration
- Usage: Consumed by Deployment Manager for build process
Secondary Outputs:
.envfile (Docker Compose environment variables)- Template variables (for Jinja2 rendering)
- Configuration backup and metadata
Configuration File Structure:
# interactive_config.cfg
# Core OpenProject Configuration
DOMAIN_NAME="myproject.example.com"
OPENPROJECT_HTTPS="true"
PORT="8080"
# Database Configuration
DATABASE_URL="postgres://..."
POSTGRES_PASSWORD="secure_password"
# Deployment Settings
PROXY_TYPE="caddy"
PROBER_ENABLED="true"
# ... (see interactive_config.cfg.example for complete format)- Provide next-step instructions
Purpose: Low-level configuration file operations
Features:
- Load from multiple sources (.env, .cfg, environment variables)
- Override chain (env vars > .env > .cfg > defaults)
- Validate configuration schema
- Mask sensitive values in output
- Save to disk with proper formatting
- Implement
core.pyfor basic config operations - Support .env and .cfg file formats
- Implement override chain
- Add validation framework
- Implement OS detection (platform module)
- Implement network discovery (socket, netifaces)
- Implement Docker detection (docker-py)
- Implement port scanning
- Implement certificate detection
- Implement Rich-based UI
- Implement section-based flow
- Add smart defaults from discovery
- Add navigation (back, skip, resume)
- Add session persistence
- Implement completeness validation
- Implement consistency checks
- Add prober integration for live testing
- Generate actionable recommendations
- Implement Configuration Finalizer
- Add CLI wrapper
- Add comprehensive tests
- Add documentation
- Add examples
Required:
click>=8.1.0- CLI frameworkrich>=13.0.0- Terminal UI/formattingpydantic>=2.0.0- Data validationpython-dotenv>=1.0.0- Environment variablespyyaml>=6.0.0- YAML parsing
Optional Features:
docker>=7.0.0- Docker integration (if using docker features)requests>=2.31.0- HTTP requests (if using external services)psutil>=5.9.0- System monitoring (if using system discovery)cryptography>=41.0.0- SSL/crypto (if generating certificates)netifaces>=0.11.0- Network interfaces (if doing network discovery)
Required:
pytest>=7.0.0- Testing frameworkpytest-json-report- Test reportingblack>=23.0.0- Code formattingflake8>=6.0.0- Code lintingmypy>=1.0.0- Type checking
Optional Tools:
pytest-cov>=4.0.0- Test coverage (if doing coverage analysis)pytest-mock>=3.11.0- Test mocking (if doing advanced testing)bandit>=1.7.0- Security linting (if doing security analysis)safety>=2.3.0- Security scanning (if scanning dependencies)sphinx>=5.0.0- Documentation (if generating docs)git- Version controlpython>=3.8- Python runtime
# Clone repository
git clone https://github.com/JustinCBates/openproject-config-manager.git
cd openproject-config-manager
# Install in development mode
pip install -e ".[dev]"# Run tests
pytest
# Run tests with coverage
pytest --cov=openproject_config_manager --cov-report=term-missing
# Run specific test
pytest tests/test_discovery.py# Format code
black src tests
# Lint code
flake8 src tests
# Type checking
mypy srcGitHub Actions workflows are configured for:
- Linting (black, flake8)
- Testing (Python 3.8-3.12)
- Coverage reporting
- Automated releases
openproject-config-manager/
├── README.md
├── LICENSE
├── pyproject.toml
├── requirements.txt
├── .gitignore
│
├── src/
│ └── openproject_config_manager/
│ ├── __init__.py
│ ├── core.py # Core configuration operations
│ ├── discovery.py # Environment discovery
│ ├── collector.py # Interactive UI
│ ├── validation.py # Validation engine
│ ├── prober_client.py # Prober integration
│ ├── finalizer.py # Configuration finalization
│ ├── cli.py # CLI interface
│ └── utils/
│ ├── __init__.py
│ ├── logging.py
│ └── errors.py
│
├── tests/
│ ├── __init__.py
│ ├── test_core.py
│ ├── test_discovery.py
│ ├── test_collector.py
│ ├── test_validation.py
│ ├── test_finalizer.py
│ └── fixtures/
│ └── sample_configs/
│
└── .github/
└── workflows/
└── ci.yml
MIT
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Ensure all tests pass and code is formatted
- Submit a pull request
- Issues: https://github.com/JustinCBates/openproject-config-manager/issues
- Discussions: https://github.com/JustinCBates/openproject-config-manager/discussions
- Phase 1: Core Configuration (v0.1.0)
- Phase 2: Discovery Engine (v0.2.0)
- Phase 3: Interactive Collector (v0.3.0)
- Phase 4: Validation Engine (v0.4.0)
- Phase 5: Integration & Polish (v1.0.0)
- Future: Template library for common projects
- Future: Configuration import/export
- Future: Multi-language support