Configuration Reference
Table of Contents
- Configuration Sources and Precedence
- Removed Settings
- Trust Anchors (Required for a Normal Start)
- Network
- Identity and Auth
- DNS
- TLS / ACME
- DDNS
- Onboarding
- Tree Operations
- Threshold Storage Key
- JSON Config Example
- Command-Mode Flags
- Retired and Inert Settings
Configuration Sources and Precedence
The packaged service starts the server with --config
/var/lib/lemonade-nexus/lemonade-nexus.json --tier1-authority-contract. Under
that contract:
- The JSON file must be the fixed path above, and it must exist.
- Inherited
SP_*variables are ignored. /etc/lemonade-nexus/lemonade-nexus.envmust exist and may contain onlySP_LOG_LEVEL. Any other entry refuses startup.--root-pubkeyand--genesis-pubkeyon the command line refuse startup.
Outside the contract, a normal start reads settings from four sources. Highest priority first:
- Environment variables —
SP_* - CLI arguments — for example
--http-port 8443 - JSON config file —
lemonade-nexus.json(packaged default location:/var/lib/lemonade-nexus/lemonade-nexus.json) - Defaults
Two deliberate exceptions to “environment wins”:
- Explicit trust anchors win over the environment. If you pass
--root-pubkeyor--genesis-pubkeyon the command line, the correspondingSP_ROOT_PUBKEY/SP_GENESIS_PUBKEYenvironment values are ignored (with a warning). An environment variable must not silently replace an anchor the operator pinned in the start command. - Environment seed peers append.
SP_SEED_PEERS(comma-separated) is added to the seed list from the config file and--seed-peer; it does not replace it.
Note: an environment variable overrides a CLI value for every other setting
(for example SP_HTTP_PORT overrides --http-port).
Boolean environment variables (SP_DDNS_ENABLED) take 1, true,
yes, or on for true and 0, false, no, or off for false, in any
letter case. The server logs any other value at error level and turns the
setting off.
Removed Settings
Nexus has no optional features. These settings switched features that now always run. A configuration file, command line, or environment that still names one starts normally: the server logs a warning that the setting no longer exists and ignores its value.
| Removed setting (JSON key, CLI, env) | Now |
|---|---|
tree_ops_enabled, --tree-ops, SP_TREE_OPS |
Tree operations always run (Tree Operations) |
tree_log_enabled, --tree-log, SP_TREE_LOG |
The tree log always runs on Tier 1 |
open_registration, --closed-registration, SP_CLOSED_REGISTRATION |
Registration is open: a new identity joins into a group of its own; a link token places a device in the inviter’s group |
onboard_enabled, --no-onboard |
A server that holds the root key accepts onboarding requests |
dns_seed_discovery, --no-dns-seed-discovery, SP_DNS_SEED_DISCOVERY |
Seed peers are also discovered from tier/region DNS records at startup |
ddns_enabled stays a setting (default off).
Trust Anchors (Required for a Normal Start)
A normal daemon start refuses to run without both values:
| Setting | Purpose | Accepted encoding |
|---|---|---|
root_pubkey |
Mesh root management key. Verifies server admission certificates; without it no certificate can be verified. | Hex Ed25519 public key (64 hex characters) |
genesis_pubkey |
Pins the Genesis bootstrap anchor. The network identity derives from it, and the epoch authority chain verifies from it. Its unilateral authority ends at Epoch 1 activation. | Base64 Ed25519 public key (32 bytes) |
--root-pubkey <hex> SP_ROOT_PUBKEY
--genesis-pubkey <b64> SP_GENESIS_PUBKEY
On the Genesis server, nexus-bootstrap writes both (see
Getting Started). On a joining server, the operator sets
root_pubkey and genesis_pubkey in the config before start; onboarding
verifies the bundle against them and never writes the config.
Release authority is not a setting. Genesis signs a release authority
(network ID and release key), and that key signs each release approval. The
server reads the approval from
/usr/lib/lemonade-nexus/release/release-approval.json and accepts it only
when both signatures verify against the pinned Genesis key. The JSON key
release_signing_pubkey is deprecated and parse-only: the server never uses
it as a trust input, and it has no CLI flag or environment variable.
These are the only trust inputs. There is no supported configuration switch to force Tier 1, skip evidence, or change quorums or thresholds: those are compiled protocol rules, not settings.
Network
| CLI Flag | Env Var | JSON Key | Default | Description |
|---|---|---|---|---|
--http-port <N> |
SP_HTTP_PORT |
http_port |
9100 |
Public HTTPS API |
--udp-port <N> |
SP_UDP_PORT |
udp_port |
51940 |
Mesh tunnel and hole punching (shared) |
--gossip-port <N> |
SP_GOSSIP_PORT |
gossip_port |
9102 |
Gossip and security protocol |
--stun-port <N> |
SP_STUN_PORT |
stun_port |
3478 |
STUN NAT traversal |
--relay-port <N> |
SP_RELAY_PORT |
relay_port |
9103 |
Relay forwarding |
--dns-port <N> |
SP_DNS_PORT |
dns_port |
5335 |
Local authoritative DNS, UDP+TCP |
--public-dns-port <N> |
SP_PUBLIC_DNS_PORT |
public_dns_port |
53 |
DNS port advertised to clients (NAT-mapped to dns_port) |
--private-http-port <N> |
SP_PRIVATE_HTTP_PORT |
private_http_port |
9101 |
Private API (virtual mesh addresses; loopback-backed) |
--bind-address <addr> |
SP_BIND_ADDRESS |
bind_address |
0.0.0.0 |
Listen address |
--public-ip <addr> |
SP_PUBLIC_IP |
public_ip |
(auto) | Public IP for DNS records and discovery |
--region <code> |
SP_REGION |
region |
(auto) | Cloud region code (lowercase DNS label) |
--mesh-interface <name> |
SP_MESH_INTERFACE |
mesh_interface |
nexus0 |
BoringTun dataplane instance name |
All six service ports plus the private port must be unique. Every port the
server binds is unprivileged; public 53 and 443 are reached by
firewall/NAT mapping (53 → dns_port, 443 → http_port), not by the server
binding them.
Identity and Auth
| CLI Flag | Env Var | JSON Key | Default | Description |
|---|---|---|---|---|
--data-root <path> |
SP_DATA_ROOT |
data_root |
data |
Data directory (identity, state, security stores) |
--log-level <level> |
SP_LOG_LEVEL |
log_level |
info |
trace, debug, info, warn, error |
--rp-id <domain> |
SP_RP_ID |
rp_id |
lemonade-nexus.local |
WebAuthn relying party ID |
--seed-peer <host:port> |
SP_SEED_PEERS |
seed_peers |
Gossip seed peers (repeatable / comma-separated; env appends) | |
--server-hostname <name> |
SP_SERVER_HOSTNAME |
server_hostname |
(auto) | Server hostname for the TLS certificate |
DNS
| CLI Flag | Env Var | JSON Key | Default | Description |
|---|---|---|---|---|
--dns-base-domain <dom> |
SP_DNS_BASE_DOMAIN |
dns_base_domain |
lemonade-nexus.io |
Discovery zone suffix |
--dns-ns-hostname <fqdn> |
SP_DNS_NS_HOSTNAME |
dns_ns_hostname |
(auto) | This server’s NS hostname (pins its NS slot) |
--dns-provider <name> |
SP_DNS_PROVIDER |
dns_provider |
local |
local (self-hosted authoritative) or cloudflare |
TLS / ACME
| CLI Flag | Env Var | JSON Key | Default | Description |
|---|---|---|---|---|
--acme-provider <name> |
SP_ACME_PROVIDER |
acme_provider |
letsencrypt |
letsencrypt, letsencrypt_staging, zerossl |
--acme-eab-kid <kid> |
SP_ACME_EAB_KID |
acme_eab_kid |
ZeroSSL External Account Binding key ID | |
--acme-eab-hmac-key <key> |
SP_ACME_EAB_HMAC_KEY |
acme_eab_hmac_key |
ZeroSSL EAB HMAC key (base64url) |
Listeners are withheld until a usable certificate exists for the server’s FQDNs; the background ACME thread retries with backoff and upgrades the listener in place. There is no plaintext fallback.
DDNS
| CLI Flag | Env Var | JSON Key | Default | Description |
|---|---|---|---|---|
--ddns-domain <dom> |
SP_DDNS_DOMAIN |
ddns_domain |
Base domain for DDNS (Namecheap) | |
--ddns-password <pw> |
SP_DDNS_PASSWORD |
ddns_password |
DDNS password | |
--ddns-enabled |
SP_DDNS_ENABLED=1 |
ddns_enabled |
false |
Enable dynamic DNS updates |
Release manifest fetching (SP_GITHUB_RELEASES_URL,
SP_MANIFEST_FETCH_INTERVAL, SP_MINIMUM_VERSION) controls how the server
checks for signed manifests of other versions.
Onboarding
Server-side (a server that holds the root key always accepts onboarding):
| CLI Flag | Env Var | JSON Key | Default | Description |
|---|---|---|---|---|
--mint-admission-token |
mint_admission_token |
Mint a single-use enrollment token and exit (root holder only) | ||
--token-candidate <b64> |
mint_token_candidate |
Candidate gossip pubkey the token binds to (required with mint) | ||
--token-ttl <sec> |
mint_token_ttl_sec |
600 |
Minted-token lifetime (60–3600) |
Candidate-side:
| CLI Flag | Env Var | Description |
|---|---|---|
--onboard-server [fqdn[:port]] |
Run the onboarding client against an existing server (verified HTTPS by FQDN). Requires --root-pubkey. |
|
--onboard-addr <ip> |
Pin the connect IP while still verifying the FQDN certificate | |
--onboard-id <label> |
Requested DNS label for the new server | |
--onboard-timeout <sec> |
Give up waiting for admission after this (default 900) | |
--onboard-token <tok> |
SP_ONBOARD_TOKEN |
Single-use enrollment token for immediate admission |
Tree Operations
Tree operations always run. There is no setting for them: Tier 1 consensus orders every tree write, and every Tier 1 server applies the committed tree log. There is no other tree write path. They implement Phases 1 to 3 of Design: Tree Consensus and Threshold Storage Key.
Removed settings. tree_ops_enabled and tree_log_enabled no longer
exist (see Removed Settings).
The one-time merge. A server whose tree was written before tree
operations awaits the Tree Merge Ceremony commit. It
keeps serving that tree for reads, answers every tree write with 503 and a
Retry-After header, and votes for no tree block. The root server’s operator
runs the merge once, after every server runs a release with tree operations.
- Every tree write builds one signed tree operation (
TreeOp). The routes arePOST /api/join,/api/tree/delta,/api/tree/node,/api/tree/node/update/{id},/api/tree/node/assignments/{id},/api/tree/node/delete/{id},/api/tree/node/move/{id}(aMoveNodeoperation),/api/link/accept(anAcceptInviteoperation; also sent byPOST /api/joinwhen an existing device presents a link token),/api/account/delete(aDeleteAccountoperation), and/api/mesh/heartbeat(aSetEndpointoperation, sent only when the endpoint changed). AJoinwith a link token and anAcceptInvitecarry a link extension (the invite’s signed grant, which makes the redemption single use on every replica). The application root is anEstablishRootoperation that names the configuredroot_pubkey, or it comes with the merge commit.POST /api/ipam/allocatewrites no tree node. It refuses atunnelblock with409, because the join operation assigns tunnel addresses;privateandsharedblocks do not change. AJoin, aCreateNode, or anUpdateFieldsthat gives a device a name whose mesh-port label another device of the same group holds is refused with409(see Security).POST /api/tree/device-name/check(public API, session required) answers that question in advance and writes nothing. - Start. A server that has no tree log starts a new log on the empty base.
With an empty tree it runs normally and requests the
EstablishRootoperation forroot_pubkey, so Tier 1 reaches height 1 with the application root alone. With a populated tree it awaits the merge commit (see above): a log based on the local tree would differ from every other server’s log and would foreclose the merge commit, which is valid only as height 1 on the empty base. - The server signs each operation with its gossip identity key, with the
domain tag
lemonade-nexus/tree-op-signature:v1. Replicas trust a signature only from a member of the block epoch’s frozen Tier 1 set. The signature identifies the submitting server only; the principal’s tree assignments still decide whether the change is allowed. - Submission. A Tier 1 server checks the operation against its committed
tree, adds it to its pending pool (at most 1,024 operations, 512 per
submitting server, 32 per principal), and forwards it to the other Tier 1
members with the
TreeOpSubmitsecurity message. A server outside Tier 1, and a server that awaits the merge, answers tree writes with503andRetry-After: 30. The write was not applied, so a retry is safe. - Ordering. When a Tier 1 server leads a view and no epoch-boundary stage
is pending, it proposes a batch from its pool: at most 128 operations and
48,000 bytes of operation encodings. The batch travels with the proposal;
the proposal’s
transitions_digestcommits to it. - Validation. A replica votes for a batch only if every operation
validates in order against the tree of the block’s parent (the committed
tree plus the uncommitted ancestors). The rules are the permission and
content rules, a
base_versionmatch, replay against the committed operation ids, and freshness against the block time (signed time at most 300 s older or 60 s newer). The block time is binding: it must be later than the parent’s and than the previous tree block’s, and within 60 s of the replica’s clock. The state root must match (see below). - Commit, then apply. A committed batch is written to the tree log
(
data/tree/log/<height>.json, with its commit proof) before the tree changes. The log height continues across epochs. A snapshot is written every 1,000 heights. At startup the server verifies the log, and restores the tree from the log when an apply was interrupted. - Wait, then pending. A write route waits up to 8 s for the commit.
After 8 s the route answers
202with{"status": "pending", "op_id": ...}; the client pollsGET /api/tree/op/{op_id}(pending,committed, orrefusedwith a reason). A pending join answers202without a tunnel address; the client joins again after the commit. A heartbeat does not wait. - Tunnel addresses. The join operation’s apply step derives the endpoint
address from the tree: the first free
/32at or after a start offset derived from the node id, inside10.65.0.0–10.127.255.254. A deleted node’s address is free again at once. IPAM keeps10.64.0.0/16: each server takes its own address in10.64.252.0/22from its backbone address (see IP Ranges). - Server-assigned fields. For every writer that is not an admin of the
root node,
tunnel_ipandprivate_subnetare server-assigned andtypeis fixed: a create cannot set the addresses or make a Relay node, and an update cannot change the addresses or the type. A group admin is not a root admin: tunnel addresses and relays act on the whole plane. - Forwarding. The server forwards between two tunnel addresses only for nodes that the dataplane binds to them: the peer the server installed for the address at join must have the node’s mesh key. A Relay node is open to every peer only when its management key is a root admin.
- Delete cleanup. Every Tier 1 server that applies a committed delete runs the post-delete cleanup itself: it revokes the device credential (unless another node still holds the key), releases the node’s IPAM records, removes the dataplane peer, and removes the private DNS record.
- Each node that an operation writes gets
version= previous version + 1 (1 for a new node). Node JSON includesversiononly when it is not 0, so records written before tree operations keep their exact bytes.canonical_node_jsonand the tree hash never includeversion. - Committed operation ids are persisted (
data/tree/committed-ops.json, and the tree log under consensus), so replay stays refused after a restart. - State root. A tree block’s
proposed_state_rootisH(previous_root ‖ ops_digest ‖ tree_digest ‖ committed_digest), whereprevious_rootis the root of the previous tree block,tree_digestcovers every node’s canonical encoding and version, andcommitted_digestcovers the committed operation ids. The tree log is therefore a hash chain: a server that missed a tree block cannot match the next one. Tree log format 2 uses this root; a format 1 log (from an earlier build) does not open, and the server halts tree operations until the log is moved aside. - Replication. Every Tier 1 server runs the
"tree"sync stream over the backbone, with the same digest and catch-up exchange as DNS records and account envelopes. Entries are committed log blocks keyed by height. Tier 1 servers serve them, and only a Tier 1 member pulls them, from Tier 1 only. An entry larger than one datagram travels as 16 KiB chunks. Consensus fixes the order; the stream only carries it. - Verification. A receiving server applies an entry only when it is the
next height, its commit proof verifies under the frozen vote keys and
quorum of the epoch the entry names, and it chains to the server’s own log
(
previous_root). The server takes each epoch’s vote keys from its own verified authority chain (the Genesis certificate, then every finalized handoff), so it follows the chain across epochs. An entry from an epoch the server has not verified yet is held (at most 64 entries) until the chain reaches it. An entry that does not verify or does not chain is refused and logged, and nothing after it applies. The merge commit verifies under the configured root management key instead. - Tier 2 servers hold no tree: they run no tree log, take no replicated
entry, and keep no tree file. A server that joins Tier 1 starts its log on
its first Tier 1 tick and catches up from Tier 1; a server that leaves
Tier 1 stops its log and deletes it with the rest of
data/tree/. See Architecture. - Lagging servers. A Tier 1 server that missed a tree block does not halt. It applies nothing out of order, catches up through replication, and resumes with the next committed block.
- Transfer pool. The gossip record transfer pool carries no tree records
(
Digest,DeltaRequest, andDeltaResponseare dropped), because the committed log does. - IPAM records. Each committed block updates the tunnel records in
data/ipam/allocations.jsonfor tree-derived addresses (10.65.0.0and above). These records never expire through the lease sweep and never move IPAM’s sequential cursor. - Status.
GET /api/tree/sync(private API, authenticated) reports the mode (ops, orawaiting-mergewithpre_merge_nodes), log height, state root, health and halt reason, whether the server is behind, held entries, the last refused entry, and per-peer sync status. - Fail closed. A server whose log does not verify, whose tree changed outside the log, or whose state disagrees with a certified entry that chains to its log halts tree operations: it applies, votes for, proposes, and accepts no tree operation, and keeps serving its last committed tree.
- Other rules of the write routes:
- A join, and any other write that changes several nodes, is all or nothing.
- A delete through
/api/tree/deltaalso removes the link grants that named the deleted key. - No route deletes the root node.
- A create or update through
/api/tree/deltaenforces one endpoint identifier and one mesh key per node. - An operation larger than 48,000 bytes is refused.
- A join without the Ed25519 challenge (
methodother thaned25519) answers 403. - Without a configured submitter the write routes answer 500.
Limits:
- Tree on Tier 1 only. A Tier 2 server answers every tree route, reads
and writes alike, with
421and no data. It cannot forward a write: replicas trust operation signatures from the frozen Tier 1 set only, and no finalized list of admitted submitters exists. A root-signed admission certificate is identity, not authority. - Same starting tree. Servers agree on state roots only if every server started from the same tree: an empty one, or the merge commit. A new tree log therefore always starts on the empty base (see Start). A server whose log base differs, for example a log an earlier build started from a populated tree, refuses every replicated entry (the status names it).
- Unproved commits. A block that committed while the three blocks behind its commit were no longer held is logged without a commit proof. Peers refuse that copy and take the entry from another Tier 1 server.
- Height is not certified. The log height is not inside the commit proof. A replicated entry is applied only when it chains to the log head, so a renumbered entry is refused, not applied.
- Replication index. The sync stream indexes at most 1,048,576 heights; later heights are not offered.
- Server-filled base version. Current clients send no base version, so the server reads it from the committed tree. When a concurrent write makes an operation stale, the server rebuilds it from the new state, at most three times. This keeps last-writer-wins behavior.
- Asserted principals. Session routes (
/api/tree/node*, the heartbeat) carry no signature by the principal; the submitting Tier 1 server asserts the principal. The join device signature covers only the server challenge. The join parameters, including the link-token group, are asserted by the submitting server, and link-token validity is local state. - Root key from configuration. Replicas accept an
EstablishRootoperation only for their own configuredroot_pubkey. Tier 1 servers with different configured keys establish no root.
Threshold Storage Key
Storage encryption is always on. There is no CLI flag, environment variable,
or JSON key for it. --storage-key, --storage-files, SP_STORAGE_KEY,
SP_STORAGE_FILES, and the storage_key_enabled and storage_files_enabled
JSON keys were removed. A unit file or config that still names them starts
normally and ignores them.
A node with fewer than five storage holders never creates a data key. It
starts and runs normally with its files unchanged. This is the pre-key state,
not an error and not a reduced-security mode. /api/storage/status reports
the vault mode and phase; it does not report the holder count.
The B3 external review of the storage-threshold library paths was not
commissioned. The flag was removed with that gate waived, not satisfied. The
design cites an audit of frost v0.6.0, while the lockfile ships
frost-core and frost-ristretto255 2.2.0, which that audit does not cover.
The native CI job runs cargo test --locked for the crate.
How it works:
- Holder plans in consensus. Tier 1 finalizes storage records as block
payloads (
StorageHolderPlan,StorageKeyRotation). At each epoch boundary the holders are the finalized eligible servers (Tier 1 and Tier 2), at most 50, ranked by the finalized checkpoint. The first key needs at least 5 holders. The shares refresh every epoch; the key rotates when the holder set grows, whentchanges, and when block time is 24 h past the key’s creation. A rotation keeps at least 3 holders; below 3 the last plan stays. - Records outside Tier 1. Every server receives each finalized record
with its commit proof (
StoragePlanProof) and verifies it against the committing epoch’s vote keys. A server asks a Tier 1 member for the live records every 30 s (StoragePlanRequest). A record whose commit produced no proof is kept on disk but served to nobody. A Tier 1 member rebuilds its proof from the certified chain that the other members’ consensus still serves (SyncRequestpages of the current epoch), verifies it, and then serves the record. A record finalized in an earlier epoch cannot be rebuilt this way. - Key sessions. Holders run the key generation or refresh over the
security transport (
StorageKeyPackage). Secret packages are sealed to their recipient with the session bound inside the seal. A session without a finalized plan after 120 s of block time is replaced; a retry leaves out the holders that never sent their round-1 package. - Unlock. A server unlocks its data key by sending
StorageUnlockRequestto the holders of the plan its wrapped key names. Each holder first challenges the server with theStorageUnlockattestation purpose, bound to that request, and answers only a passing verdict, with a partial sealed to the server (StorageUnlockPartial). A holder outside Tier 1 may challenge for this purpose only. Per holder: one pending request per requester, 8 served partials and 64 issued challenges per requester per epoch, 64 pending requests in all; replayed requests are refused. A failed attestation spends a challenge, not a partial, so a holder logs which attestation failure refused a requester and the requester can retry. A served partial is charged when the holder sends it, so the server waits for the holders’ pending window (30 s) plus margin before an attempt times out, keeps a timed-out request usable for late partials for one more window, and sends no new request while a holder may still hold the previous one pending. With fewer thantpartials the server retries with backoff (5 s to 60 s) and stays locked. - Data key. On first use the server creates a 32-byte data key, wraps it to the storage public key, and proves the unwrap through the holders. After a rotation it rewraps the key from memory. A key wrapped to the previous storage key still unlocks through the epoch after the rotation’s effective epoch, then never. Covered files are encrypted whenever a data key exists (below).
- Share storage. Every holder keeps its shares in
data/security/storage/sealed/storage-share.share(mode 600, under the machine-bound wrapping that the epoch vote keys use on a host without sealing). When the host can seal (nexus-attestd with Seal and Unseal), the same shares are also sealed beside the gossip identity under the domainstorage-share:data/sealed/storage-share.sealed, with the same upgrade staging (storage-share.next.sealed). At start the holder reads the sealed copy first. When it reports Missing, PolicyMismatch, Corrupt, or no sealing, the holder reads the file copy and seals it again under the running platform state. When the sealed copy opens and the file copy is missing or does not open, the file copy is rewritten from it. A TPM that loses its state, as a virtual TPM without persistence does at every reboot, therefore costs the holder nothing. Only when neither copy opens does the holder run without its share. - Files.
data/security/storage/records.json(the live records and their proofs; a live record without a proof is underunproven) anddata/security/storage/data-key.json(the wrapped data key). A share whose planrecords.jsondoes not name is kept until a verified record names that plan. - nexus-attestd. The daemon must know the
StorageUnlockpurpose (value 4). An older daemon refuses the challenge, so the holder’s attestation fails closed and the requester stays locked.
Limits:
- The file copy is on the disk. The machine-bound wrapping keys off
identity/wrap_local.keyand/etc/machine-idon the same disk, so a reader of a holder’s whole disk learns that holder’s share (design B6 limit, on every host). One share is useless alone: the storage secret needstholders’ shares. The sealed copy adds protection only while nobody has the disk. - Holder loss is found by sessions. A holder that goes away is replaced when a session runs: at the next epoch boundary, at the daily rotation, or after a session timeout. A holder that sends round 1 and then withholds its round-2 packages is not left out by the retry rule; the session fails until the next boundary or rotation.
- Records need the epoch authority. A server verifies a record only for an epoch whose authority its driver verified. A server whose authority lags falls behind on records and drops out of later holder sets by silence.
- Records read from disk. After a restart the server uses its stored records to unlock, but it wraps no new data key until a fresh proof confirms the current record.
- Restart during a session. A holder that restarts during a session does not resume it; the session retries.
- Payload order. Tier 1 asks the tree-batch handler before the storage handlers, so a constant tree backlog delays storage records.
- Grace period. A server that stays offline past the grace period after a rotation cannot unlock the data key wrapped to the old storage key.
JSON Config Example
{
"http_port": 9100,
"udp_port": 51940,
"gossip_port": 9102,
"stun_port": 3478,
"relay_port": 9103,
"dns_port": 5335,
"public_dns_port": 53,
"private_http_port": 9101,
"data_root": "/var/lib/lemonade-nexus/data",
"region": "us-west",
"dns_base_domain": "lemonade-nexus.io",
"server_hostname": "ns1",
"acme_provider": "letsencrypt",
"log_level": "info",
"root_pubkey": "<hex ed25519 root management key>",
"genesis_pubkey": "<base64 ed25519 genesis anchor>",
"seed_peers": ["<server-ip>:9102"]
}
The packaged bootstrap writes this file for you. Edit it with sudoedit; the
service unit mounts it read-only.
Command-Mode Flags
These flags select a one-shot command instead of running the daemon:
| Flag | Description |
|---|---|
--first-run |
Bootstrap the node identity and print the trust anchors to pin (Identity pubkey = root, Gossip pubkey = Genesis). One-time, per node. |
--verify-platform [blob] |
Verify this host’s platform evidence (AMD signature chain, guest policy, memory-encryption guarantees) and exit. Optional: a pre-captured evidence blob instead of the local helper. |
--enroll-server <pubkey> <id> |
Root-side: enroll a server identity (used by the onboarding approve path and manual enrollment). |
--revoke-server <pubkey> |
Root-side: revoke a server identity. |
--enroll-tpm-ak <b64> |
With enrollment: pin the server’s platform binding key (base64 DER SPKI) in its certificate. |
--enroll-tpm-ek-cert <path> |
With enrollment: attach the server’s TPM EK certificate (PEM) for audit/validation. |
--add-manifest <path> |
Load a signed release manifest from a local file and exit. |
--sign-tree-merge <preimage> <out> |
Root-side: sign a canonical tree merge preimage for this network with the root management key, write the base64 signature to <out>, and exit. See Tree Merge Ceremony. |
--install-tree-merge <commit.json> |
Verify a signed tree merge commit against the configured root_pubkey and network, write it as tree log height 1, and exit. Run with the service stopped. |
--github-releases-url <url> |
Override the GitHub releases URL for manifest fetching (env: SP_GITHUB_RELEASES_URL). |
--manifest-fetch-interval <sec> |
Manifest fetch interval (env: SP_MANIFEST_FETCH_INTERVAL). |
--minimum-version <ver> |
Minimum client version gate (env: SP_MINIMUM_VERSION). |
--config <path>, --data-root <path>, --log-level <level>, and the
port flags apply to the command as well where relevant. Note two current
mismatches in the --help text: it still lists --require-peer-confirmation,
which the binary does not accept (see
Retired and Inert Settings), and it does not
list the parsed --onboard-timeout flag.
Retired and Inert Settings
The following settings no longer do anything and are not recognized:
require_tee_attestation,tee_platform_override,require_binary_attestation,tee_attestation_validity_sec— the old TEE knobs were unreachable, inert, or dead. Attestation is enforced by the compiled protocol, not by configuration.admission_quorum_ratio,enrollment_*,onboard_min_tier1_for_vote,--require-peer-confirmation— the old quorum/enrollment votes were removed with the retired governance system. Admission is root-gated approval or a single-use token.
These inert settings are listed so that older runbooks and environment files can be read correctly; remove them from your configuration when you touch it.
Settings of features that now always run (tree operations, open registration, onboarding, DNS seed discovery) are accepted with a warning; see Removed Settings.
Files under the data key (Phase 7)
It implements Phase 7 of the design (sections B9, B10, B5a) and runs on every node. There is no way to turn it off.
Migration is one-way. Once the vault records encrypted, a node that cannot
reassemble the data key serves nothing that reads covered files, with no
plaintext fallback and no timeout. Back up data/security/storage/ and
data/sealed/ before upgrading a node. If those are lost after the migration
the data key cannot be recovered, and reinstalling an older binary does not
return the node to service.
Covered files, under the data root: identity/keypair.enc,
identity/jwt_secret.hex, identity/ddns_credentials.enc,
account/replica.json, tree/nodes/*.json, tree/deltas/*.json, and
tree/log/*.json. Each file is replaced in place by an encrypted object
(XChaCha20-Poly1305 under a key derived from the data key; the associated data
binds the purpose storage-file-at-rest, the file’s domain, its relative
path, and the data key id). The state is in
data/security/storage/vault-state.json.
Migration runbook:
- Start the server. Files stay plaintext until the data key exists and one unlock through the holders has proved it, which needs at least five holders.
- The server encrypts each covered file to
<file>.vault-new, asks the holders for a new unlock round trip, then decrypts every staged file and compares it with the plaintext. Only then does it recordencrypted, overwrite each plaintext (best effort), and replace it with the staged copy. The log linemigration complete; plaintext removedmarks the end. - A server that cannot reach
tholders keeps its plaintext and retries. A crash at any step resumes from the state file without data loss. - After the migration, each start waits for the data key before it starts
the services that read covered files (tree, node identity, auth, DDNS,
account data, HTTP API). Gossip, attestation, and holder duties run while
it waits, so a locked node still answers peer unlock requests using its own
share. With fewer than
tholders reachable the server serves nothing that needs the files and keeps waiting. It never reads them as plaintext.
Rotation runbook:
- The data key rotates 30 days after the last migration or rotation, on the server’s local clock. It is per server, not a consensus rule.
- On demand (for example after a suspected compromise), a root administrator
calls
POST /api/storage/rotate-data-keyon the private API.GET /api/storage/statusreports the mode, phase, and last rotation time. - The server creates a new data key, wraps it to the current storage public
key in
data-key.next.json, proves the unwrap through the holders, re-encrypts every file to<file>.vault-new, and verifies each. The replacement ofdata-key.jsonis the switch point. Before it, an interrupted rotation is discarded and starts again; after it, the staged files replace the old ciphertext.
Limits:
- Not covered yet: the TLS and ACME private keys (the HTTP server loads them
by path), the ACL rows (SQLite, keyed from the gossip identity), the epoch
vote keys, and
wrap_local.key. The vote keys and the file share store are read before the unlock, so moving them, or the local secret they depend on, under the data key would stop a cold start;wrap_local.keytherefore stays. A host that can seal protects the vote keys with a sealed wrapping key instead:data/sealed/vote-key-wrap.sealed, with the state indata/sealed/vote-key-wrap.state.jsonand each key indata/security/vote-key-<epoch>.sealed.json. The machine-bound copies (vote-key-<epoch>.json) are removed after the sealed key unseals in a later boot. If the sealed key does not unseal after that, startup stops with a recovery instruction, as for the gossip identity. - CLI modes do not unlock the data key. After the migration, CLI modes that
read the node identity or the tree log (
--enroll-server, release signing, tree merge tools) fail closed. - The gossip record transfer pool (
tree/retained_deltas) stays plaintext. - Rollback of a file to an older ciphertext under the same data key is not detected.
- Overwriting plaintext is best effort, as in Phase 6.