diff --git a/docs/deployment.md b/docs/deployment.md index 4ef32aa..990ea85 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -212,6 +212,10 @@ The worker applies the domain shown in the preview. If the account's primary domain changes before the worker starts, create a preview for the new domain. An existing web node reservation stays bound to the domain it was created for. +The same worker measures allocated space in a website's document root. Use +**Measure website storage** on a deployed hosting account and reload the page +to see the latest result. [Website storage measurement](development.md#measure-website-storage) + ## Enable HTTPS for hosted websites Once a site is active, obtain the website certificate with Certbot on the diff --git a/docs/development.md b/docs/development.md index fe5a49e..f8e5d35 100644 --- a/docs/development.md +++ b/docs/development.md @@ -890,6 +890,30 @@ read the JSON reply to EOF. A `configured` reply includes the account ID and domain. A `failed` reply includes a diagnostic in `problem`. Retry the same manifest if the connection closes before a reply arrives. +The socket also accepts a storage request with +`"operation": "measure_storage"` and the deployment manifest under `"site"`. +A successful reply includes the request identity and `used_bytes`. + +### Measure website storage + +Use the deployed site manifest to measure the document root on its web node. + +```sh +sudo /opt/coulobre/bin/coulobre-web-node storage-usage coulobre-web-plan-1.json +``` + +The command reports allocated space in bytes as reported by GNU `du` for the +site's document root. The scan runs as the site user, counts hard-linked +files once, and skips other filesystems. Symbolic links contribute their +own allocated space. The scan measures files as it encounters them, so +the total may change on a busy site. [GNU du manual](https://www.gnu.org/software/coreutils/manual/html_node/du-invocation.html) + +With local web activation enabled, an operator with **Can add site storage +usage** can select **Measure website storage** on the hosting account. +Reload the page to see the result and timestamp. The account shows the most +recent successful result even if a later attempt fails. Customers and +resellers can see measurements on their assigned accounts. + ## Install SFTP keys on a web node Generate an Ed25519 key on the computer that will connect and choose a