1
Getting Started
WMJ Ismail edited this page 2026-07-03 09:00:59 +02:00

Getting Started

This guide covers everything you need to develop and deploy the Hermes cPanel Agent.

Prerequisites

  • Gitea account with push access to wmj/hermes-cpanel-agent
  • WordPress admin access to ummah.falahos.my
  • (For CI/CD) cPanel Git SSH key

Development Setup

# Clone the repo
git clone https://git.falahos.my/wmj/hermes-cpanel-agent.git
cd hermes-cpanel-agent

# All PHP files — no build step needed
# Install WordPress locally for testing, or use the staging site

Plugin Structure

hermes-cpanel-agent/
├── hermes-ai-bridge.php        # Main plugin (WordPress header)
├── includes/
│   ├── class-autoloader.php    # PSR-4 autoloader
│   ├── core.php                # Bootstrap + hooks
│   ├── installer.php           # Activation/deactivation
│   ├── rest-controller.php     # REST API: hermes/v1/*
│   ├── ai-provider.php         # OpenClaw AI integration
│   ├── scheduler.php           # WP-Cron tasks
│   └── nextcloud-bridge.php    # Nextcloud sync
├── assets/
│   └── admin.css
└── .gitea/
    ├── workflows/              # CI/CD pipelines
    └── scripts/                # Helper scripts

Security Rules

NEVER use these in plugin code (cPanel blocks them anyway):

exec(), shell_exec(), system(), passthru(),
popen(), proc_open(), eval(), assert()

Making Changes

  1. Branch from main
  2. Make changes
  3. Push and open PR
  4. CI runs: PHP lint, security scan, schema validation
  5. Merge → auto-deploys via Gitea Actions

API Key Setup

The plugin needs an OpenClaw API key configured via WP Admin:

  1. Go to Settings → Hermes AI Bridge
  2. Enter OpenClaw API key
  3. Save

Or via REST API:

curl -X PATCH -u "wmj:APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"openclaw_api_key":"..."}' \
  "https://ummah.falahos.my/wp-json/hermes/v1/settings"

Troubleshooting

  • HTTP 401: Need valid Application Password
  • HTTP 403 Nonce: Cookie session expired — re-login
  • HTTP 404: Endpoint not deployed — check plugin is active
  • Plugin not found: Check /wp-admin/plugins.php — manually activate