Asynchronous job queue with audited execution
Every provisioning operation — website creation, SSL issuance, mail setup, database provisioning — flows through an asynchronous job queue. Worker threads claim jobs atomically, execute them through SpeedyCTL, and record every outcome in the audit trail.
How the job queue works
PENDING → RUNNING → COMPLETED/FAILED
Jobs transition through defined states. The panel enqueues PENDING jobs, workers claim them atomically, execute, and mark them COMPLETED or FAILED.
Worker thread pool
Multiple dispatcher workers run as daemon threads inside the panel process. Configurable worker count controls parallelism.
Claim-by-update
Workers claim jobs using atomic UPDATE ... WHERE status = PENDING. Two workers can never execute the same job — the database enforces exclusivity.
Stale job recovery
At startup, the dispatcher requeues any jobs left in RUNNING state from a previous crash. No job is ever lost or stuck forever.
Dependency chaining
Jobs can depend on each other: create site → issue SSL → create FTP. Dependent jobs wait until their parent completes. If the parent fails, dependents are automatically cancelled.
Progress logging
Each job accumulates a log of INFO/ERROR messages. The dashboard shows real-time progress with timestamped entries.
Failure handling
Failed jobs record the error message and can be retried (requeue as PENDING) or resolved (mark as COMPLETED without retry).
Action whitelisting
Before enqueueing, the panel validates the action against the module registry whitelist. Unknown actions are rejected immediately.
SpeedyCTL privileged execution
Signed requests
Every job request is signed with HMAC-SHA256 using a shared panel token. The SpeedyCTL agent verifies the signature before executing any action.
Privilege separation
The panel web application runs unprivileged. Only the SpeedyCTL agent runs as root. The panel can only request work — never execute privileged commands directly.
Transport selection
Local servers use Unix domain sockets. Remote servers use SSH with forced commands. The panel key can only talk to the agent, never obtain a shell.
Resource sync
After job completion, the dispatcher syncs the resource state: websites go from "provisioning" to "active", SSL certificates get issued_at timestamps, backups record size and path.
Audit trail
Every job enqueue, execution start, and outcome is recorded in the HMAC-SHA256 chained audit log. Complete accountability for every automated operation.
Timeout handling
Jobs have configurable timeouts. If the agent does not respond in time, the job is marked FAILED with a timeout error.
What gets automated
Create website
Job: hosting.create_site. Agent creates document root, configures Apache/Nginx virtual host, sets ownership. Resource syncs to active.
Issue SSL certificate
Dependent job: ssl.issue_certificate. Agent runs Let's Encrypt ACME challenge, obtains certificate, configures HTTPS.
Create FTP account
Dependent job: hosting.create_ftp. Agent creates ProFTPD virtual user, sets directory permissions. FTP account syncs to active.
Provision database
Job: hosting.create_database. Agent creates MariaDB schema and user, grants permissions. Database syncs to active.
Create mailbox
Job: mail.create_mailbox. Agent creates Dovecot user, maildir, configures quotas. Mailbox syncs to active.
Create backup
Job: backup.create_backup. Agent archives website files and database, stores in backup directory. Backup records size and timestamp.
Why asynchronous automation matters
Non-blocking operations
The panel UI never waits for long-running operations. Jobs run in the background, users see progress in real-time.
Crash resilience
If the panel crashes mid-job, stale jobs are requeued on restart. No provisioning operation is ever lost.
Parallel execution
Multiple workers process jobs concurrently. Provisioning 50 websites does not take 50x longer.
Dependency management
Complex workflows (site → SSL → FTP) execute in the right order automatically. Failures cascade correctly.
Complete audit trail
Every automated operation is logged with actor, tenant, action, result and HMAC chain. Compliance-ready from day one.
Retry & resolve
Failed jobs can be retried or resolved. Platform staff can clear failures without re-executing.
Automate your provisioning
Replace manual server administration with an audited job queue. Get in touch to learn how Speedy Hosting automation works.