@serve.zone/dcstorage
@serve.zone/dcstorage is the serve.zone dcstorage node supervisor (AGL-2259, Epic AGL-2258). It runs on a dedicated Linux host or VM, verifies the operator-provisioned filesystem Cloudly assigned to the node, and supervises one native @lossless.org/objectstorage cluster member per pool slot on that verified volume. Cloudly owns enrollment, placement, the assignment ledger and every pool edge; ObjectStorage owns data I/O, shard placement, quorum and repair; dcstorage is the node side in between.
Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit community.foss.global/. This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a code.foss.global/ account to submit Pull Requests directly.
Install
pnpm add @serve.zone/dcstorage
The package installs the dcstorage command. It runs on Linux only (it reads /proc/self/mountinfo, /proc/self/fdinfo and /sys/dev/block).
Running a node
Configuration comes from the environment:
| Variable | Default | Meaning |
|---|---|---|
DCSTORAGE_STATE_DIR |
/var/lib/dcstorage |
Private state directory (mode 0700, owned by the process user). Holds the embedded NoSQLDB with the node credential and the assignment/ownership ledger. |
DCSTORAGE_MOUNT_ROOTS |
/srv/dcstorage |
Comma-separated approved mount roots. An assigned mount path must lie strictly below one of them. |
DCSTORAGE_RECHECK_INTERVAL_MS |
30000 |
How often running members' pinned volumes are rechecked and telemetry is reported. |
# 1. Enroll with the pairing code the administrator handed over (read from stdin, never argv).
dcstorage enroll --origin https://cloudly.example.com < pairing-code.txt
# 2. Inspect an operator-provisioned volume exactly as the node will judge it.
dcstorage verify-volume --volume-id vol-a --generation 1 \
--mount-path /srv/dcstorage/vol-a --fs-uuid <filesystem uuid> --marker-id <marker uuid>
# 3. Local state: identity (never the bearer) and ledger.
dcstorage status
# 4. The daemon.
dcstorage serve
verify-volume exits 0 when the volume verifies and 3 when it is refused; its JSON is the private administrator view (paths, UUIDs and the local finding). enroll is the only command that creates the state directory; status and serve refuse a missing or loosened one.
Provisioning a volume
Provisioning is an operator workflow; dcstorage never performs it. Format and mount one local ext4 or XFS filesystem (an encrypted device after unlock qualifies) at a directory below an approved mount root, then create the marker at the filesystem root:
uuidgen | tr 'A-Z' 'a-z' > /srv/dcstorage/vol-a/.dcstorage-volume-id # root-owned, 0644, one line
chown root:root /srv/dcstorage/vol-a/.dcstorage-volume-id
Register the mount path, the filesystem UUID of the backing device and the marker UUID with Cloudly. A cloned filesystem needs fresh identities before it is assigned.
What the verifier checks
For each assignment { mountPath, fsUuid, markerId } the verifier, read-only and fail-closed:
- accepts only a path strictly below an approved mount root and walks it with
lstat, following no symlink; - opens it with
O_DIRECTORY | O_NOFOLLOW, binds the descriptor to the walked path and to its live mount ID (/proc/self/fdinfo); - requires the directory to be the root of its own mount in
/proc/self/mountinfo: mount root/, ext4 or XFS, block-backed, no stacked or nested mount and no other mount of the same backing device (bind aliases); - reads the filesystem UUID from the backing device's own superblock (the device node is proven to be the mount's
major:minor); - opens
.dcstorage-volume-idbeneath the pinned descriptor without following links and requires a root-owned, single-link, not group/world-writable regular file of exactly one canonical lowercase UUID plus a newline; - reports capacity and the read-only flag from the same mount.
A missing mount (even with the parent directory present), a wrong target, an absent or different filesystem UUID or marker, or an unreadable or untrusted probe is a refusal with the contract's reason, no capacity, readOnly: true and unavailable. The verifier never writes a marker, creates a root, uses the parent disk or formats anything. A verified volume stays pinned through its descriptor while a member runs; every recheck compares mount ID, device and inode, so lazy unmount or substitution stops the member.
Member supervision
The supervisor keeps a durable ledger of the node's volume assignments and pool slots with their generation high-water marks, and applies the edges Cloudly records (pending → admitting → active → draining → drained → replacing → retired, and faulted):
- admission verifies the volume writable, pins it and starts the native member on it (the verified mount root is both drive and control root);
drained,replacingandretiredrequire the local writer to be stopped first;faultedstops it;- a stale volume or slot generation, a controller epoch above the current authority or below the slot's, or a missing authority is refused, and nothing starts;
- after a restart nothing runs until a current controller scope states the same generations and a fresh probe verifies the volume.
ObjectStorage 11.9.0 has no controller-fenced drain or replacement and no pinned-volume handoff; the real runner states both workflows unsupported, so those edges are refused on production members until the engine qualifies them.
Telemetry
Reports carry inventory IDs, generations, closed states, flags, capacity and repair counters only, built field by field and rebuilt by the contract's exact-key snapshot; a scan refuses any report string that contains a path separator or a protected value (mount paths, filesystem UUIDs, marker IDs, the bearer, controller origins). Sequences start at 0 per authenticated session and strictly advance.
Programmatic use
import { DcStorageNode, DcStorageObjectStorageRunner } from '@serve.zone/dcstorage';
const node = new DcStorageNode({
stateDir: '/var/lib/dcstorage',
approvedMountRoots: ['/srv/dcstorage'],
runner: new DcStorageObjectStorageRunner({ endpoints, rootCredential }),
controllerSession, // the authenticated reverse session to Cloudly
});
await node.start();
DcStorageVolumeVerifier, DcStorageMemberSupervisor, DcStorageEnrollmentClient, DcStorageIdentityStore and DcStorageTelemetryReporter are exported for embedding and testing; IDcStorageSystemProbe and IDcStorageMemberRunner are the injection points for a deterministic host model and an in-process runner.
Wire data and validators come from @serve.zone/interfaces/data/dcstorage. Node-facing TypedRequest types come from @serve.zone/interfaces/requests/dcstorage. The node offers Interfaces 32.115.0 as its minimum controller protocol version.
Not yet
- Cloudly does not serve the dcstorage node router yet, so
dcstorage serveruns without a controller session: it reconciles with no authority and every member stays stopped. - Native member credentials need their credential authority;
servestarts no member on a default credential.
License and Legal Information
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the repository license file.
Please note: The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
Company Information
Task Venture Capital GmbH
Registered at District Court Bremen HRB 35230 HB, Germany
For any legal inquiries or further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.