Measure website storage on hosting accounts #32

Merged
parkel merged 3 commits from feature/website-storage-usage into main 2026-11-21 13:57:30 +01:00
2 changed files with 28 additions and 0 deletions
Showing only changes of commit 68eafa9cfd - Show all commits

No files matched your search

+4
View File
@@ -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
+24
View File
@@ -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