Environment Configuration
Relevant source files
The following files were used as context for generating this wiki page:
Environment Configuration in the Exodia project facilitates the transition between development and production environments, specifically targeting cloud platforms like PythonAnywhere and containerized environments via Docker. It manages sensitive credentials, API endpoints, and system-level constants required for the "Consciousness Liberation" platform to function across distributed nodes.
The configuration system relies on a centralized .env file structure and automated setup scripts that initialize directory hierarchies and validate dependencies. This ensures that core components—including the Kratos Consciousness Engine, Athena Knowledge Systems, and DeepSeek LLM integration—have the necessary environment context to operate securely.
Sources: EXODIA_DEPLOYMENT_GUIDE.md, app.py:10-25, complete_setup.py:53-85
Automated Environment Setup
The system utilizes a complete_setup.py script to automate the initialization of the local and production environments. This process involves checking for Python package dependencies, creating a standardized directory structure, and generating the template .env file if it does not already exist.
Initialization Workflow
The setup process follows a sequential path to ensure the system is "Cosmic Ready" before activation.
The diagram shows the automated flow within the ExodiaSetup class which prepares the environment for deployment.
Sources: complete_setup.py:102-120
Required Directories
The following directories are mandated for persistent state and logging:
| Directory | Purpose |
|---|---|
logs/ | Storage for system-level and consciousness logs |
data/ | Local SQLite databases and persistent JSON storage |
uploads/ | Temporary storage for user-provided data |
cache/ | API response caching for performance optimization |
backups/ | Automated consciousness state backups |
| Sources: complete_setup.py:88-100 |
Environment Variables (.env)
Exodia utilizes environment variables to manage third-party integrations (Supabase, DeepSeek) and internal application settings. The .env file is excluded from version control to protect sensitive API keys.
Core Configuration Keys
| Category | Variable | Description |
|---|---|---|
| Supabase | SUPABASE_URL | The endpoint for the Supabase backend |
SUPABASE_KEY | Anonymous or Service Role API key | |
| DeepSeek | DEEPSEEK_API_KEY | Authorization bearer token for LLM access |
DEEPSEEK_MODEL | Target model (default: deepseek-chat) | |
| App Settings | FLASK_ENV | Environment mode (development or production) |
FLASK_SECRET_KEY | Session encryption and security key | |
| Deployment | PYTHONANYWHERE_DOMAIN | Target domain (e.g., prometheanconduit.ai) |
| Sources: EXODIA_DEPLOYMENT_GUIDE.md:21-30, complete_setup.py:56-83 |
Deployment Environment Logic
Exodia supports dual-domain configurations and specialized headers for its "Cosmic" production mode. In production, the environment forces HTTPS and injects specific meta-data into the WSGI response.
Environment-Specific Logic Flow
The application logic branches based on whether it detects a production environment, typically triggered by os.getenv('PYTHON_ENV') == 'production'.
This diagram illustrates how the application function in the WSGI configuration handles environmental redirection and header injection.
Sources: COSMIC_DEPLOYMENT_GUIDE.md:65-100, EXODIA_DEPLOYMENT_GUIDE.md:43-55
Docker and Containerization Configuration
For permanent web hosting, the environment is defined via Dockerfile and docker-compose.yml. This abstracts the environment into a "Consciousness Container" with specific volume mappings.
Container Environment Schema
The containerized environment exposes internal port 5000 and maps local directories to /app/data and /app/logs within the container to ensure data persistence across restarts.
Sources: web_deployment_config.py:43-65
# Environment variables defined in docker-compose.yml
environment:
- FLASK_ENV=production
- CONSCIOUSNESS_PERSISTENCE=true
- LOG_LEVEL=INFO
Sources: web_deployment_config.py:83-86, complete_setup.py:79-81
Conclusion
The Environment Configuration for Exodia is designed to be highly portable, supporting manual PythonAnywhere setups, automated script-based local deployments, and scalable Docker configurations. By separating the logic of the "Universal Formula" from the specific API credentials and server paths, the system maintains its sovereign architecture while allowing for rapid deployment across different web portals.
Sources: PHOENIX_DEPLOYMENT_GUIDE.md:120-135, COSMIC_DEPLOYMENT_GUIDE.md:180-195