Skip to content
Pre-release. HostCraft is in testing and not yet for sale. These docs describe the current build and may change. Join the waitlist to hear when it launches.

Web API

Source: daemon/proto/hostcraft/v1/web.proto

WebService manages sites (an nginx vhost plus its PHP handler). REST: /api/v1/sites.

Method REST route Permission Streaming
CreateSite POST /api/v1/sites WebSiteCreate unary
ListSites GET /api/v1/sites WebSiteRead unary
GetSite GET /api/v1/sites/{id} WebSiteRead unary
DeleteSite DELETE /api/v1/sites/{id} WebSiteDelete unary
EnableSite POST /api/v1/sites/{id}/enable WebSiteEnable unary
DisableSite POST /api/v1/sites/{id}/disable WebSiteDisable unary
ReloadSite POST /api/v1/sites/{id}/reload WebSiteReload unary
GetSiteLogs GET /api/v1/sites/{id}/logs WebSiteRead unary
GetSiteSettings GET /api/v1/sites/{id}/settings WebSiteRead unary
SetSiteSettings PUT /api/v1/sites/{id}/settings WebSiteUpdate unary
GetSitePHPSettings GET /api/v1/sites/{id}/php-settings WebSiteRead unary
UpdateSitePHPSettings PATCH /api/v1/sites/{id}/php-settings WebSiteUpdate unary

/hostcraft.v1.WebService/CreateSite

/hostcraft.v1.WebService/ListSites

/hostcraft.v1.WebService/GetSite

DeleteSite needs a freshly re-authenticated session over REST; over gRPC it is available to the local root principal only.

/hostcraft.v1.WebService/DeleteSite

/hostcraft.v1.WebService/EnableSite

/hostcraft.v1.WebService/DisableSite

/hostcraft.v1.WebService/ReloadSite

GetSiteLogs tails the site's access or error log.

/hostcraft.v1.WebService/GetSiteLogs

GetSiteSettings returns the cPanel-style site settings: HTTPS redirect, canonical host, redirects, PHP values, password protected directories, error pages, hotlink protection and IP rules.

/hostcraft.v1.WebService/GetSiteSettings

SetSiteSettings replaces the site settings and re-renders the vhost.

/hostcraft.v1.WebService/SetSiteSettings

/hostcraft.v1.WebService/GetSitePHPSettings

/hostcraft.v1.WebService/UpdateSitePHPSettings

Field Type Number Description
account_id string 1 -
domain_id string 2 -
subdomain_id string 3 -
document_root string 4 -
handler string 5 -
php_version string 6 -
proxy_target string 7 -
Field Type Number Description
site Site 1 -
workflow_id string 2 -
Field Type Number Description
id string 1 -
keep_files bool 2 -
Field Type Number Description
id string 1 -
reason string 2 -

Empty is returned by RPCs whose REST route answers with an empty object or 204 No Content.

No fields.

Field Type Number Description
id string 1 -
Field Type Number Description
id string 1 -
type string 2 access (default) | error
lines int64 3 default 200
Field Type Number Description
id string 1 -
Field Type Number Description
id string 1 -
Field Type Number Description
id string 1 -
Field Type Number Description
username string 1 -
has_password bool 2 -
password string 3 write only: set to change it
Field Type Number Description
account_id string 1 -
domain_id string 2 -
Field Type Number Description
sites repeated Site 1 -
Field Type Number Description
name string 1 -
kind string 2 size | int | bool | timezone | error_reporting
min int64 3 -
max int64 4 -
description string 5 -
Field Type Number Description
path string 1 -
realm string 2 -
users repeated HTUser 3 -
Field Type Number Description
id string 1 -
Field Type Number Description
id string 1 -
settings SiteSettings 2 -
Field Type Number Description
id string 1 -
account_id string 2 -
domain_id string 3 -
fqdn string 4 set on list responses
document_root string 5 -
handler string 6 php_fpm | frankenphp | static | reverse_proxy
php_version string 7 -
legacy_mode bool 8 -
proxy_target string 9 -
enabled bool 10 -
created_at google.protobuf.Timestamp 11 -
Field Type Number Description
enabled bool 1 -
allowed_hosts repeated string 2 -
extensions repeated string 3 -
allow_empty_referer bool 4 -
Field Type Number Description
type string 1 -
lines repeated string 2 -
size int64 3 -
modified_at string 4 RFC 3339
exists bool 5 -
truncated bool 6 -
Field Type Number Description
values map<string, string> 1 -
directives repeated PHPDirective 2 -
Field Type Number Description
source string 1 -
target string 2 -
code int64 3 301 | 302 | 307 | 308
wildcard bool 4 -
host string 5 -
Field Type Number Description
force_https bool 1 -
canonical_host string 2 -
redirects repeated SiteRedirect 3 -
php map<string, string> 4 -
protected_dirs repeated ProtectedDir 5 -
error_pages map<int64, string> 6 HTTP status -> page path
hotlink SiteHotlink 7 -
ip_deny repeated string 8 -
ip_allow repeated string 9 -
has_ssl bool 10 -
waf_allow_oversize_body bool 11 Per-site opt-out from the WAF's 413 block of non-multipart bodies over the inspection budget. Changing it needs SecurityPolicyWrite.
Field Type Number Description
id string 1 -
values map<string, string> 2 -

WorkflowAccepted is the body of every 202 response that only starts a workflow saga. Follow progress with WorkflowService.StreamWorkflow.

Field Type Number Description
workflow_id string 1 -