Skip to the content.

Configuration Reference

Table of Contents

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:

Outside the contract, a normal start reads settings from four sources. Highest priority first:

  1. Environment variables — SP_*
  2. CLI arguments — for example --http-port 8443
  3. JSON config file — lemonade-nexus.json (packaged default location: /var/lib/lemonade-nexus/lemonade-nexus.json)
  4. Defaults

Two deliberate exceptions to “environment wins”:

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.

Limits:

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:

Limits:

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:

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:

  1. 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.
  2. 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 record encrypted, overwrite each plaintext (best effort), and replace it with the staged copy. The log line migration complete; plaintext removed marks the end.
  3. A server that cannot reach t holders keeps its plaintext and retries. A crash at any step resumes from the state file without data loss.
  4. 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 t holders reachable the server serves nothing that needs the files and keeps waiting. It never reads them as plaintext.

Rotation runbook:

Limits: