The previous DirectAdmin adapter used CMD_SUBDOMAIN to create subdomains
with a custom document root via the public_html parameter. Field testing
revealed that CMD_SUBDOMAIN is a browser-session endpoint that returns
HTTP 404 when called via Login Key authentication — the only supported
API auth method for VoxelSwarm operators.
Provisioning now uses a two-step approach:
1. CMD_API_SUBDOMAINS creates the subdomain (Login Key compatible)
2. CMD_API_CUSTOM_HTTPD injects an SDOCROOT token override to point
the subdomain at the provisioned VoxelSite instance directory
Other fixes in this patch:
- POST field for custom HTTPD save is 'config' (not 'custom') per the
DirectAdmin CMD_API_CUSTOM_HTTPD docs (version 1.26.0+)
- GET requests for existing custom HTTPD config use a new rawApiGet()
method that returns the raw response body, avoiding parse_str()
mangling of DA template syntax (pipes, equals, conditionals)
- Existing domain-level custom HTTPD config is preserved when appending
or removing Swarm SDOCROOT blocks (fenced with SWARM_DOCROOT markers)
- Both apiRequest() and rawApiGet() now validate HTTP status codes and
throw on 4xx/5xx, preventing error pages from being silently parsed
as valid API responses
- Subdomain deletion is resilient: custom HTTPD cleanup is wrapped in
try/catch so a failed or unauthorized CMD_API_CUSTOM_HTTPD call never
blocks the CMD_API_SUBDOMAINS delete
- The API logger redacts the 'config' field from log output to prevent
arbitrary domain-level HTTPD data from leaking into Swarm logs
Login Key permissions updated: operators must allow CMD_API_SUBDOMAINS,
CMD_API_CUSTOM_HTTPD, and CMD_API_SHOW_DOMAINS (previously CMD_SUBDOMAIN
was listed instead of CMD_API_CUSTOM_HTTPD).
Verification suite expanded from 53 to 85 behavioral assertions:
- POST field guard (config, not custom)
- rawApiGet method validation (GET method flag)
- Existing config preservation with DA template syntax
- SDOCROOT marker cleanup on removal
- Delete resilience when HTTPD cleanup throws
- HTTP status parsing (200, 404, 403, 500, HTTP/2)
- Create/delete behavior under simulated 404/403
- Log redaction structural verification via ReflectionMethod
DirectAdmin adapter status remains Testing until a field tester confirms
provisioning routes to the intended document root.