Skip to main content

Appendices

This chapter collects reference tables for environment variables, Redis key schema, API endpoints, and common commands. Use it as a quick lookup during onboarding and day-to-day operations.

Environment Variables

VariableDescriptionDefault / Example
ALLOW_ORIGINSComma-separated list for CORS.Empty (CORS disabled).
ENABLE_TEST_ENDPOINTSExpose /__test__ helpers.false (enabled in docker-compose).
MASTER_API_TOKENMaster bearer token for privileged operations.dev-master-token (docker-compose).
SESSION_COOKIE_NAMESession cookie identifier.cirrus_session.
SESSION_TTL_SECONDSSession lifespan in seconds.604800 (7 days).
COOKIE_SECURESet Secure attribute on session cookie.false.
COOKIE_DOMAINDomain scope for cookie.Empty (host-only).
COOKIE_SAMESITESameSite policy (lax, none, strict).lax.
ENABLE_PASSWORD_AUTHToggle password login endpoints.true.
REDIS_HOST / REDIS_PORT / REDIS_PASSWORDRedis connection parameters shared across components.redis / 6379 / empty.
ACMEDNS_BASE_URLBase URL for acme-dns service.http://acmedns.
ACME_DIRECTORYACME directory URL (e.g., Caddy internal CA).https://caddy:4431/acme/local/directory.
ACME_RENEW_CRONCron expression for renewal scans.0 * * * *.
ACME_RENEW_BEFORE_DAYSRenewal threshold in days.30.
ACME_RENEW_MAX_PER_SCANMax domains queued per scan.10.
ACME_LOCK_TTLLock TTL for issuance tasks.900.
ACME_CERT_KEY_TYPESewer key type (rsa2048, ecdsa256, etc.).rsa2048.
ENFORCE_ACME_CNAME_CHECKRequire _acme-challenge CNAME before issuing.true (non-local CA) / false.
WAIT_FOR_CNAMEPoll for CNAME propagation before issuing.true.
CNAME_WAIT_SECSWait duration for CNAME readiness.10.
CNAME_BASE_DOMAINRoot domain for access FQDNs.cdn.local.test.
CNAME_REPLICAS_PER_SITENumber of nodes per domain.2.
CNAME_DEFAULT_TTLTTL for generated DNS records.60.
DNS_MASTER_BIND_ADDR / DNS_MASTER_PORTHidden master listener address/port.0.0.0.0 / 10053.
DNS_SOA_MNAME / DNS_SOA_RNAME / DNS_SOA_REFRESH / DNS_SOA_RETRY / DNS_SOA_EXPIRE / DNS_SOA_MINIMUMZone SOA parameters.Derived defaults based on base domain.
DNS_NS1_A / DNS_NS1_AAAAGlue records for authoritative nameserver.127.0.0.1 / empty.
CNAME_DNS_SLAVESComma-separated slave endpoints (host:port).172.28.0.12:10054.
NODE_HEALTH_PORT / NODE_HEALTH_INTERVAL_SECS / NODE_HEALTH_TIMEOUT_SECS / NODE_HEALTH_FAILS_TO_DOWN / NODE_HEALTH_SUCCS_TO_UPHealth check configuration.9145 / 5 / 1 / 3 / 1.
CDN_PURGE_CHANNELRedis channel for purge messages.cdn:purge.
FRONTEND_STATIC_DIRDirectory for static frontend assets./app/static.
INTERNAL_PURGE_BASE_URLBase URL used by Redis subscriber to issue PURGE requests.http://127.0.0.1:8080.
NGX_METRICS_ALLOW (build arg)CIDR for metrics access beyond loopback.172.28.0.0/16 (dev).

Redis Key Reference

KeyTypeDescription
cdn:domainsSetAll managed domain names.
cdn:dom:{domain}String (JSON)Domain configuration (DomainConf).
cdn:nodesSetRegistered node IDs.
cdn:node:{id}HashNode metadata (IP addresses, active flag, health counters).
cdn:cert:{domain}HashTLS certificate fullchain, key, issued timestamp.
cdn:acme:{domain}HashACME registration state (username, password, fulldomain, status).
cdn:acme:lock:{domain}StringDomain-specific issuance lock (value is task token).
cdn:acme:task:{domain}StringTracks queueing/running task ID.
cdn:acmeacct:globalHashGlobal ACME account key material (PEM, KID).
cdn:acmecertkey:{domain}StringStored PEM for domain certificate private key.
cdn:acme:renew:scan_lockStringRenewal scan lock.
cdn:user:{username}HashUser metadata (password hash, email, status, last_login).
cdn:usersSetUsernames.
cdn:tokensSetService token IDs.
cdn:token:{id}HashToken metadata (label, created_at, hash, suffix).
cdn:token_hash:{hash}StringReverse lookup from token hash to ID.
cdn:cname:dirtyPub/Sub channelDNS rebuild notifications.
cdn:purgePub/Sub channelCache purge notifications.

Core API Endpoints (Summary)

Method & PathDescription
POST /api/v1/auth/loginAuthenticate user (password-based).
POST /api/v1/auth/logoutTerminate session.
GET /api/v1/auth/meInspect current user context.
POST /api/v1/auth/change-passwordUpdate own password.
GET /api/v1/domainsList managed domains.
POST /api/v1/domains/{domain}Create domain configuration.
GET /api/v1/domains/{domain}Retrieve configuration.
PUT /api/v1/domains/{domain}Update configuration.
DELETE /api/v1/domains/{domain}Remove domain.
GET /api/v1/domains/{domain}/cnameReturn assigned edge nodes and TTL.
PUT /api/v1/domains/{domain}/upstreamsUpdate origin list.
PUT /api/v1/domains/{domain}/cache-rulesUpdate cache settings.
PUT /api/v1/domains/{domain}/upstream-headersUpdate headers forwarded to origin.
PUT /api/v1/domains/{domain}/certUpload manual certificate.
GET /api/v1/domains/{domain}/acmeInspect ACME state.
POST /api/v1/domains/{domain}/acmeQueue ACME issuance.
DELETE /api/v1/domains/{domain}/acmeClear ACME state.
PUT /api/v1/nodesUpdate node inventory.
POST /api/v1/purgeEnqueue cache purge event.
GET /api/v1/usersList users.
POST /api/v1/usersCreate user.
PUT /api/v1/users/{username}Update user.
DELETE /api/v1/users/{username}Delete user.
GET /api/v1/auth/tokensList service tokens (master token required).
POST /api/v1/auth/tokensCreate service token.
DELETE /api/v1/auth/tokens/{id}Delete service token.

Command Cheat Sheet

CommandPurpose
just upBuild and start entire stack (Docker compose).
just downStop stack and remove resources (including volumes).
just down-no-volumesStop stack but preserve volumes.
just pytestRun backend test suite.
just quicktestRun expedited test subset.
just fresh-testRebuild containers and run full test suite.
just fmtAuto-format Python sources.
just deployExecute Ansible deployment (requires INVENTORY/PLAYBOOK).

Documentation Maintenance

Keep this white paper synchronized with the codebase:

  • Update chapter references when modules move or APIs change.
  • Record new environment variables and Redis keys here.
  • Capture significant architectural shifts (e.g., migration to Kubernetes) as new subsections or appendices.

Cirrus CDN is engineered for extensibility and operational clarity. With a shared understanding of architecture, security, automation, and operational practices, teams can evolve the platform confidently while meeting performance and compliance targets.