Api

CLI Reference

Complete reference for the ra_server.py command-line interface.

CLI Reference

Global flags

These flags apply to all commands:

FlagShortDefaultEnv variableDescription
--dir <path>-d~/.upki/raUPKI_DATA_DIRData directory
--ip <host>-i127.0.0.1UPKI_CA_HOSTCA ZMQ host
--port <int>-p5000UPKI_CA_PORTCA ZMQ port
--web-ip <host>127.0.0.1UPKI_RA_HOSTRA bind address
--web-port <int>8000UPKI_RA_PORTRA HTTP/HTTPS port
--debugfalseEnable debug logging

Commands

init

Initialise the RA data directory structure. Idempotent.

python ra_server.py init

Prints the path to the data directory and the next steps.


register

Register the RA with the CA. Connects to CA port 5001, presents the seed, and receives a signed certificate.

python ra_server.py register -s <seed> [-c <cn>]
OptionShortRequiredDescription
--seed <seed>-sYesCA registration seed
--cn <name>-cNoRA Common Name (default: RA)

listen

Start the RA HTTP/HTTPS server. The RA must already be registered.

python ra_server.py listen

Uses --web-ip / --web-port for the bind address. TLS is enabled when UPKI_RA_TLS=true.


start

Auto-bootstrap mode — the Docker default entrypoint.

  • If the RA is not registered (no ra.crt / ra.key): reads UPKI_CA_SEED, calls register, then starts the server.
  • If already registered: starts the server directly.
python ra_server.py start

Requires UPKI_CA_SEED environment variable on first boot.


crl

Fetch a new CRL from the CA and save it to $UPKI_DATA_DIR/crl.pem.

python ra_server.py crl

Environment variables

VariableCLI flagDescription
UPKI_DATA_DIR-dData directory path
UPKI_CA_HOST-iCA ZMQ host
UPKI_CA_PORT-pCA ZMQ port
UPKI_RA_HOST--web-ipRA bind address
UPKI_RA_PORT--web-portRA HTTP/HTTPS port
UPKI_CA_SEEDCA registration seed (used by start)
UPKI_RA_CNRA Common Name for auto-registration (default: RA)
UPKI_RA_TLSEnable HTTPS: true / false (default in Docker: true)
UPKI_RA_SANSComma-separated DNS SANs for the RA certificate (first boot only)

Exit codes

CodeMeaning
0Success
1Error (registration failure, server startup error, missing seed)
Copyright © 2026