Some checks failed
Documentation Validation / validate-docs (push) Has been cancelled
- Move production configs from /opt/aitbc/production/config to /etc/aitbc/production - Move production services from /opt/aitbc/production/services to /var/lib/aitbc/production - Centralize production logs in /var/log/aitbc/production - Remove redundant /opt/aitbc/production directory - Add production launcher script at /opt/aitbc/scripts/production_launcher.py - Update production services to use system configuration paths - Create comprehensive production architecture documentation - Achieve proper FHS compliance with clean separation of concerns
77 lines
2.6 KiB
Markdown
77 lines
2.6 KiB
Markdown
# AITBC Production Environment
|
|
|
|
## 🏗️ Proper System Architecture
|
|
|
|
The AITBC production environment follows Linux Filesystem Hierarchy Standard (FHS) compliance:
|
|
|
|
### 📁 System Directory Structure
|
|
|
|
```
|
|
/etc/aitbc/production/ # Production configurations
|
|
├── .env # Production environment variables
|
|
├── blockchain.py # Blockchain service config
|
|
├── database.py # Database configuration
|
|
├── services.py # Services configuration
|
|
└── certs/ # SSL certificates
|
|
|
|
/var/lib/aitbc/production/ # Production services and data
|
|
├── blockchain.py # Production blockchain service
|
|
├── marketplace.py # Production marketplace service
|
|
├── unified_marketplace.py # Unified marketplace service
|
|
├── openclaw_ai.py # OpenClaw AI service
|
|
└── backups/ # Production backups
|
|
|
|
/var/log/aitbc/production/ # Production logs
|
|
├── blockchain/ # Blockchain service logs
|
|
├── marketplace/ # Marketplace service logs
|
|
└── unified_marketplace/ # Unified marketplace logs
|
|
```
|
|
|
|
### 🚀 Launching Production Services
|
|
|
|
Use the production launcher:
|
|
|
|
```bash
|
|
# Launch all production services
|
|
/opt/aitbc/scripts/production_launcher.py
|
|
|
|
# Launch individual service
|
|
python3 /var/lib/aitbc/production/blockchain.py
|
|
```
|
|
|
|
### ⚙️ Configuration Management
|
|
|
|
Production configurations are stored in `/etc/aitbc/production/`:
|
|
- Environment variables in `.env`
|
|
- Service-specific configs in Python modules
|
|
- SSL certificates in `certs/`
|
|
|
|
### 📊 Monitoring and Logs
|
|
|
|
Production logs are centralized in `/var/log/aitbc/production/`:
|
|
- Each service has its own log directory
|
|
- Logs rotate automatically
|
|
- Real-time monitoring available
|
|
|
|
### 🔧 Maintenance
|
|
|
|
- **Backups**: Stored in `/var/lib/aitbc/production/backups/`
|
|
- **Updates**: Update code in `/opt/aitbc/`, restart services
|
|
- **Configuration**: Edit files in `/etc/aitbc/production/`
|
|
|
|
### 🛡️ Security
|
|
|
|
- All production files have proper permissions
|
|
- Keystore remains at `/var/lib/aitbc/keystore/`
|
|
- Environment variables are protected
|
|
- SSL certificates secured in `/etc/aitbc/production/certs/`
|
|
|
|
## 📋 Migration Complete
|
|
|
|
The "box in box" structure has been eliminated:
|
|
- ✅ Configurations moved to `/etc/aitbc/production/`
|
|
- ✅ Services moved to `/var/lib/aitbc/production/`
|
|
- ✅ Logs centralized in `/var/log/aitbc/production/`
|
|
- ✅ Repository cleaned of production runtime files
|
|
- ✅ Proper FHS compliance achieved
|