Test mode: paid plans aren't on sale yet, so nothing is charged. Every plan's limits apply.

← Docs

Running Nod

Storage

--store (or NOD_STORE) chooses where everything lives:

StoreSpecFor
PostgreSQL 15+postgres:host=db user=harpora dbname=harpora (libpq string or URL)Most deployments. Nod creates its one table on first start
TwilightDBtwilightdb:https://twilightdb.example#harpora (token in NOD_TWILIGHTDB_TOKEN)Nelm's own database
MemorymemoryTrying it out. Everything is lost on exit

Every feature behaves the same on each store: one test suite runs against all three. Transactions are serializable, and replicas need no coordination beyond the database, except for the rate limits, which each replica counts on its own.

The secret key

NOD_SECRET_KEY is base64 of 32 random bytes (openssl rand -base64 32). Signing keys, outside providers' client secrets and per-realm secrets are sealed with it before they reach the database, so a database copy alone can't sign tokens.

harpora refuses to use a real store without it.

TLS and the public URL

--public-url is what people and apps use, for example https://auth.example.com. Issuers, redirects and the passkey RP ID all come from it, never from request headers. Either:

OpenID Connect requires https issuers, except on localhost while developing.

Billing through Ducat

Lunaor's own deployment can take payments per organization through Ducat (organizations). Four settings, all or none: NOD_DUCAT_URL (https, a public address), NOD_DUCAT_CLIENT_ID, NOD_DUCAT_REALM (the realm that issues Ducat's tokens) and NOD_DUCAT_KEY_FILE (an Ed25519 private key, PEM; Nod signs a private_key_jwt assertion with it, so no secret exists), and NOD_DUCAT_AUDIENCE if Ducat's isn't urn:payments:api. nod ducat-jwks KEY_FILE prints the public half to register the client with. Setup in docs/operating.md.

Behind a proxy

Behind a load balancer, or the Astropause edge in front of the sign-in pages, the socket's peer is the proxy, and every client would share its address in rate limits, throttling and the security log. Tell Nod which proxies are yours:

nod serve … --trusted-proxies 10.0.0.0/8,fd00::/8     # or NOD_TRUSTED_PROXIES

When a request comes from one of them, the client is the rightmost X-Forwarded-For address that isn't one of your proxies: addresses to its left were written by the client and prove nothing. An X-Forwarded-For that doesn't parse is ignored. Without --trusted-proxies the header is never read, so don't set it for proxies you don't run, and make sure your proxies append to X-Forwarded-For (or overwrite it) rather than passing a client's through alone.

For TLS client certificates (mTLS clients), the proxy also passes the client's certificate as Client-Cert (RFC 9440). With nginx, for example: ssl_verify_client optional_no_ca; and proxy_set_header Client-Cert ":$ssl_client_cert_b64:"; (or your proxy's equivalent), and nothing else sets that header. Nod ignores it from anyone who isn't a trusted proxy.

Rate limits

Per client IP, per replica: passkey and password requests and starting a sign-in through an outside provider 30 a minute, completing a sign-in 60, and the token, pushed-request, revocation, introspection, device and backchannel (CIBA) endpoints 300. Sign-in starts are also limited to 10 a minute per account name, from anywhere, and CIBA requests to 3 a minute and 10 an hour per person. Over the limit is HTTP 429 with Retry-After. The client IP is the socket's peer, unless the peer is a trusted proxy (below).

With several replicas, each limit applies per replica. The counters live in each process's memory, so N replicas behind a load balancer allow up to N times each limit, and a restart starts the counts again. So does the bot challenge's record of spent proofs: a solved proof works once on each replica. If that matters for you (credential stuffing at scale, say), enforce limits at the edge in front of Nod as well, or route each client IP to one replica (sticky by address).

Suspicious addresses: an address with 20 failed sign-ins in 15 minutes may not try again until those 15 minutes are up. Failures are wrong passwords, rejected passkeys and wrong second-factor codes, across every account and realm. That stops one address spraying a password over many accounts, where no account's own limit would trip. Right passwords don't count. When an address crosses the line, the realm's security log records ip.throttled. --no-rate-limits turns this off too.

The command line

nod serve --public-url URL [--listen ADDR] [--tls-cert PEM --tls-key PEM] [--smtp URL | --mail-dir DIR] [--mail-from ADDR] [--breached-passwords URL|off] [--log-retention-days N] [--insecure-dev-outbound]
nod realm create ID [--name NAME]
nod realm set ID [--name NAME] [--passwords on|off] [--sign-up on|off] [--domain-roles DOMAIN=ROLE,…]
nod user create REALM USERNAME [--name NAME]
nod user set REALM USERNAME [--email E] [--given-name G] [--family-name F] [--nickname N] [--picture URL] [--locale L] [--zoneinfo Z]
nod user verify-email REALM USERNAME                 (an administrator's mark: not counted for org roles)
nod user verified-by-admin REALM                     (lists addresses only an administrator verified)
nod user password REALM USERNAME                      (password on stdin)
nod user delete REALM USERNAME                       (every grant revoked first; or DELETE /api/v1/users/{id}, users:write)
nod client register REALM CLIENT_ID --redirect URI … [--post-logout URI …] [--backchannel URI] [--confidential] [--eddsa]
nod client register REALM CLIENT_ID --machine
nod client name REALM CLIENT_ID NAME                 (the name its sign-in page shows; or PATCH /clients/{id})
nod client grant REALM CLIENT_ID API --scope S …       (adds to what it has; --replace: exactly these; no --scope: revoke)
nod api register REALM IDENTIFIER --scope S … [--name N] [--ttl SECONDS]
nod connection add REALM ID --issuer URL --client-id ID [--scope S …] [--name N] [--verified-domain D …]   (secret on stdin)
nod connection add REALM ID --github [--issuer https://ghe.example] --client-id ID   (GitHub, secret on stdin)
nod connection add REALM ID --oauth2 --issuer URL --authorize URL --token URL --userinfo URL --client-id ID [--id-pointer P] [--name-pointer P] [--token-auth post]
nod connection add-ldap REALM ID --url ldaps://… --base-dn DN --domain D … [--bind-dn DN] [--filter F] [--ca PEM]   (password on stdin)
nod connection disable|enable REALM ID
nod connection list REALM   (every connection with its id, kind, name, state, issuer and domains)
nod connection verified-domains REALM ID [--domain D …]   (OpenID Connect: the email domains it may verify; none: no address)
nod import auth0 REALM FILE                            (Auth0's user export, NDJSON or JSON array)
nod org create REALM ID [--name N] | org list REALM | org delete REALM ID
nod org add|remove REALM ORG USERNAME
nod org connections REALM ORG [--connection ID …] [--join]
nod org roles REALM ORG USERNAME [--role R …]
nod scim token REALM [--organization ORG] [--label L] | scim tokens REALM | scim revoke REALM ID
nod export REALM [--with-password-hashes]              (every user, the same format, to stdout)
nod role create REALM NAME [--description D]
nod role grant REALM NAME API --scope S …               (no --scope: nothing on that API)
nod role grant REALM NAME --all [--remove]           (every scope of every API, those added later too; CLI and config only)
nod user role REALM USERNAME ROLE [--remove]

Secrets are never taken on the command line, where shell history and process lists would keep them.

A flag the command doesn't take is refused, named with the flags it does take (exit 2), and nothing changes.

Configuration as code

Keep a realm's configuration in git and promote it from one environment to the next:

nod config export acme > acme.yaml                  # realm settings and branding, APIs, roles, clients,
                                                        # connections, organizations, the authorization model,
                                                        # the sign-in page's custom text
GOOGLE_CLIENT_SECRET=… nod config apply acme-prod acme.yaml --dry-run   # what would change
GOOGLE_CLIENT_SECRET=… nod config apply acme-prod acme.yaml

A connection the file marks insecure_dev: true (no TLS verification, private addresses allowed: for a provider on your own machine) is applied only with --insecure-dev on the command line, never on the file's say alone.