Contributing¶
Making Changes¶
Local Development¶
- Edit files in
control-center/ - Commit changes:
Deploying Changes¶
# Copy changed files to host
scp -o IdentitiesOnly=yes -i ~/.ssh/openclaw_strato_key \
-r control-center/app admin@10.0.0.1:~/docker/control-center/
# Rebuild container
ssh admin@10.0.0.1 "cd ~/docker/control-center && docker compose up -d --build"
For changes to Dockerfile, docker-compose.yml, or requirements.txt, copy the entire directory.
Code Style¶
- Python: Standard library conventions, type hints on public functions
- Frontend: Vanilla JS, no build step, all in one HTML file
- Config: Environment variables for deployment-specific values
Adding a New Service¶
- Create
app/services/newservice.pywith business logic - Create
app/routers/newservice.pywith API endpoints - Register the router in
app/main.py: - Add a tab in
app/static/index.html - Add audit events for state-changing operations
Testing¶
Currently no automated tests. Verify manually:
# API health check
curl -s http://localhost:8089/api/status | python3 -m json.tool
# Check specific endpoints
curl -s http://localhost:8089/api/vpn/status | python3 -m json.tool
curl -s http://localhost:8089/api/audit/events | python3 -m json.tool
curl -s http://localhost:8089/api/rules | python3 -m json.tool
# Container logs
docker logs openclaw-control-center --tail 20