CBFiles Infrastructure Setup Required¶
Date: 2025-12-23 Priority: High Affects: Files feature in all tenant applications (testsite, etc.)
Summary¶
The CBFiles file storage service is not fully operational. The API is responding but cannot store or retrieve files because the MinIO backend is not configured/running and tenant buckets have not been created.
Current State¶
What's Working¶
- CBFiles API is deployed at
https://files.nominate.ai - API responds to health checks
- API keys can be generated and validated
- Database (user/key storage) is working at
/var/lib/cbfiles
What's Broken¶
- MinIO storage backend is not running/configured
- No buckets exist for any tenant
- File upload/download operations fail with 500 errors
- Bucket creation via API returns 500 Internal Server Error
Evidence¶
# API key exists and authenticates, but has no bucket access
$ curl -s "https://files.nominate.ai/api/v1/buckets" \
-H "X-API-Key: cbfiles_nJHqRAZQ8zgDvGYa3CmJX0wEtwtoVM9ni_RYNpFoYoM"
[] # Empty array - no buckets accessible
# Attempting to create a bucket fails
$ curl -s -X POST "https://files.nominate.ai/api/v1/buckets" \
-H "X-API-Key: cbfiles_nJHqRAZQ8zgDvGYa3CmJX0wEtwtoVM9ni_RYNpFoYoM" \
-H "Content-Type: application/json" \
-d '{"name": "testsite"}'
Internal Server Error # HTTP 500
# Listing files in a bucket returns 403
$ curl -s "https://files.nominate.ai/api/v1/buckets/testsite/files?prefix=shared/&recursive=false" \
-H "X-API-Key: cbfiles_nJHqRAZQ8zgDvGYa3CmJX0wEtwtoVM9ni_RYNpFoYoM"
{"detail":"Forbidden"} # HTTP 403
Required Actions¶
1. Install and Configure MinIO¶
MinIO is the S3-compatible object storage backend for CBFiles.
# Install MinIO (if not installed)
wget https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
sudo mv minio /usr/local/bin/
# Create data directory
sudo mkdir -p /var/lib/minio/data
sudo chown -R minio:minio /var/lib/minio
# Create systemd service (if not exists)
# See: /home/bisenbek/projects/nominate/cbfiles/infra/ for service templates
2. Configure MinIO Credentials¶
CBFiles needs MinIO credentials in its environment:
# In CBFiles .env or systemd service environment:
MINIO_ENDPOINT=localhost:9000 # or wherever MinIO is running
MINIO_ACCESS_KEY=minioadmin # MinIO root user
MINIO_SECRET_KEY=minioadmin # MinIO root password
MINIO_SECURE=false # true if using HTTPS to MinIO
3. Start MinIO Service¶
# Start MinIO
sudo systemctl start minio
sudo systemctl enable minio
# Verify it's running
curl http://localhost:9000/minio/health/live
4. Create Tenant Buckets¶
After MinIO is running, create buckets for each tenant:
# Using CBFiles CLI (from cbfiles project directory)
cd /home/bisenbek/projects/nominate/cbfiles
source venv/bin/activate # or appropriate virtualenv
CBFILES_DATA_DIR=/var/lib/cbfiles python -m cbfiles.cli bucket create testsite
# Or via MinIO CLI (mc)
mc alias set local http://localhost:9000 minioadmin minioadmin
mc mb local/testsite
5. Grant API Key Access to Bucket¶
The testsite API key needs permission to access its bucket:
# Using CBFiles CLI
CBFILES_DATA_DIR=/var/lib/cbfiles python -m cbfiles.cli bucket grant-access testsite <api_key_id>
# Find the API key ID:
CBFILES_DATA_DIR=/var/lib/cbfiles python -m cbfiles.cli apikey list
6. Restart CBFiles Service¶
Testsite Configuration¶
The testsite tenant is configured with:
| Setting | Value |
|---|---|
| API Key | cbfiles_nJHqRAZQ8zgDvGYa3CmJX0wEtwtoVM9ni_RYNpFoYoM |
| Bucket Name | testsite |
| Base URL | https://files.nominate.ai/api/v1 |
These are set in /home/bisenbek/projects/nominate/testsite/.env:
FILES_API_KEY="cbfiles_nJHqRAZQ8zgDvGYa3CmJX0wEtwtoVM9ni_RYNpFoYoM"
FILES_BASE_URL="https://files.nominate.ai/api/v1"
FILES_TENANT_BUCKET="testsite"
Verification Steps¶
After setup, verify with:
# 1. Check MinIO is running
curl http://localhost:9000/minio/health/live
# 2. Check bucket exists and is accessible
curl -s "https://files.nominate.ai/api/v1/buckets/testsite/files?prefix=&recursive=false" \
-H "X-API-Key: cbfiles_nJHqRAZQ8zgDvGYa3CmJX0wEtwtoVM9ni_RYNpFoYoM"
# Should return: {"items": [], "prefix": "", "bucket": "testsite"}
# 3. Test file upload
curl -X POST "https://files.nominate.ai/api/v1/buckets/testsite/files" \
-H "X-API-Key: cbfiles_nJHqRAZQ8zgDvGYa3CmJX0wEtwtoVM9ni_RYNpFoYoM" \
-F "file=@testfile.txt" \
-F "path=shared/"
# Should return file metadata with URL
# 4. Check Settings > Integrations in testsite UI
# CBFiles should show green "Connected" status
CBFiles Project Location¶
- Code:
/home/bisenbek/projects/nominate/cbfiles - Data:
/var/lib/cbfiles(database, config) - Docs:
/home/bisenbek/projects/nominate/cbfiles/docs/ - Infra templates:
/home/bisenbek/projects/nominate/cbfiles/infra/
Related Services¶
| Service | URL | Status |
|---|---|---|
| CBFiles API | https://files.nominate.ai | Running (no storage backend) |
| MinIO | localhost:9000 | Not running |
| MinIO Console | localhost:9001 | Not running |
Contact¶
For questions about the CBFiles codebase or API, check:
- /home/bisenbek/projects/nominate/cbfiles/CLAUDE.md
- /home/bisenbek/projects/nominate/cbfiles/docs/
Expected Outcome¶
Once complete: 1. Files page in testsite will load without errors 2. Users can upload/download files 3. Settings > Integrations will show CBFiles as "Connected" (green) 4. All file operations (create folder, upload, delete, download) will work