✅ Resolved Fernet key error: "Fernet key must be 32 url-safe base64-encoded bytes"
The web interface now properly generates and handles Fernet encryption keys.
The web interface requires additional Python packages:
# If you're in a virtual environment (recommended)
pip install aiohttp aiohttp-cors aiohttp-session cryptography
# If not in a virtual environment
pip3 install --user aiohttp aiohttp-cors aiohttp-session cryptographypython3 -c "from cryptography.fernet import Fernet; from aiohttp_session.cookie_storage import EncryptedCookieStorage; print('✓ All dependencies available')"codegenie web startThe system will:
- Auto-generate a secure Fernet key
- Display a warning about using a generated key
- Start the web interface on http://localhost:8080
- Generate a secure key:
python3 -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"- Set the environment variable:
export CODEGENIE_SECRET_KEY="your-generated-key-here"- Start the web interface:
codegenie web start# Custom port
codegenie web start --port 8000
# Custom host (for network access)
codegenie web start --host 0.0.0.0 --port 8080
# With project path
codegenie web start --project-path /path/to/projectCODEGENIE_SECRET_KEY: Fernet encryption key for session storage (required for production)
Add to your .env file:
CODEGENIE_SECRET_KEY=cQItfMYmVGWDtVbtnyvYbICMcVM37l5wIDiR_RkHIy4=Or in docker-compose.yml:
services:
codegenie:
environment:
- CODEGENIE_SECRET_KEY=cQItfMYmVGWDtVbtnyvYbICMcVM37l5wIDiR_RkHIy4=✅ Fixed in latest version. Update your code:
git pull origin mainInstall the missing dependencies:
pip install aiohttp aiohttp-cors aiohttp-session cryptographyYou're using a system Python. Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Linux/Mac
# or
venv\Scripts\activate # On Windows
# Then install dependencies
pip install aiohttp aiohttp-cors aiohttp-session cryptographyUse --host 0.0.0.0 to bind to all interfaces:
codegenie web start --host 0.0.0.0 --port 8080- Development: Auto-generated keys are fine for local testing
- Production: Always set
CODEGENIE_SECRET_KEYenvironment variable - Key Rotation: Generate new keys periodically
- Key Storage: Never commit keys to version control
- HTTPS: Use HTTPS in production (reverse proxy recommended)
The web interface provides:
- 📊 Real-time workflow visualization
- 🔄 Live progress updates via WebSocket
- 📝 Interactive code diff viewer
- ✅ Approval interface for file operations
- 📈 Progress dashboard and metrics
- 🎯 Command output streaming
- 🔍 Project context visualization
Once started, the web interface exposes:
GET /- Main dashboardGET /api/status- Server statusGET /api/workflows- List active workflowsPOST /api/workflows- Create new workflowWS /ws- WebSocket for real-time updates
- Install dependencies (see Installation section)
- Start the web interface:
codegenie web start - Open http://localhost:8080 in your browser
- Explore the interactive features
For issues or questions:
- Check the troubleshooting section above
- Review the main README.md
- Check the GitHub issues page
Status: ✅ Web interface ready to use with proper Fernet key handling