Skip to content

Contributing

Making Changes

Local Development

  1. Edit files in control-center/
  2. Commit changes:
    cd control-center
    git add -A
    git commit -m "Description of change"
    

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

  1. Create app/services/newservice.py with business logic
  2. Create app/routers/newservice.py with API endpoints
  3. Register the router in app/main.py:
    from app.routers import newservice as newservice_router
    app.include_router(newservice_router.router)
    
  4. Add a tab in app/static/index.html
  5. 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