Server and persistence settings

Server and persistence settings

Reference API, database, TLS, evidence storage, licensing, and Compose inputs.

Server settings configure the API and shared persistence. All entries follow loading and restart rules; invalid configuration rejects startup before normal request serving.

API and shared identity

These variables configure the API listener, shared identity, and license:

VariableConsumerDefault or requirementType, bounds, and dependencies
GUARD_PUBLIC_URLAPI, workerRequiredAbsolute HTTPS origin without path, query, or fragment; callback and link origin
GUARD_HTTP_LISTENAPI0.0.0.0:8080Host and port; port 1–65535; bind on a private deployment network
GUARD_TLS_MODEAPIproxyproxy or direct; proxy mode requires trusted HTTPS termination
GUARD_TLS_CERT_FILEAPIRequired for directReadable PEM certificate chain; forbidden in proxy mode
GUARD_TLS_KEY_FILEAPIRequired for directReadable matching private key; file only; forbidden in proxy mode
GUARD_TRUSTED_PROXY_CIDRSAPIOmitted: trust noneComma-separated valid CIDRs; only these peers can supply forwarded client identity
GUARD_SESSION_SECRETAPIOne source requiredSecret containing at least 32 bytes; shared across replicas
GUARD_SESSION_SECRET_FILEAPIAlternative to raw sourceMounted session-secret value; mutually exclusive with raw form
GUARD_ENCRYPTION_KEY_FILEAPI, workerRequiredFile containing a 32-byte base64-encoded key; no raw variant; protects retained credentials
GUARD_LICENSE_FILEAPI, workerRequiredSigned installation-bound entitlement file; no raw variant
GUARD_LOG_LEVELAPI, workerinfoerror, warn, info, or debug; logs must still redact secrets

Use the procedure for the identity value being changed:

  • Public origin: update SSO callbacks and executor management URLs before switching the origin. Test sign-in and executor reporting through the new address.
  • Session secret: replacing it invalidates existing console sessions. Keep a working administrator sign-in path for the restart.
  • Encryption key: use Installation → Keys → Rotate. Keep the previous key until stored credentials have been re-encrypted and remain readable; replacing the file alone loses access to those credentials.

A license failure appears under Installation → Health and blocks newly admitted licensed work. Existing agents keep their applied local policies. Correct the license mount or entitlement, restart its consumer, and confirm that the license health condition clears before submitting new work.

Database and artifacts

These variables configure database connections and evidence persistence:

VariableConsumerDefault or requirementType, bounds, and persistence
GUARD_DATABASE_URLAPI, workerOne source requiredPostgreSQL connection URL; TLS parameters follow approved database transport
GUARD_DATABASE_URL_FILEAPI, workerAlternative to raw sourceMounted complete connection URL; mutual exclusion applies
GUARD_DATABASE_POOL_SIZEAPI, worker, each process10Integer connections 1–100; total replicas must fit database capacity
GUARD_STATE_DIRAPI, worker/var/lib/guardAbsolute writable persistent path; mount the same artifact storage for consumers
GUARD_EVIDENCE_BACKENDAPI, workerfilesystemfilesystem or s3; switching does not migrate objects
GUARD_EVIDENCE_PATHAPI, worker/var/lib/guard/evidenceAbsolute persistent path; used only for filesystem backend
GUARD_S3_ENDPOINTAPI, workerRequired for s3HTTPS endpoint; forbidden for filesystem backend
GUARD_S3_BUCKETAPI, workerRequired for s3Existing bucket name; forbidden for filesystem backend
GUARD_S3_REGIONAPI, workerRequired for s3Provider signing-region string; no inferred default
GUARD_S3_CREDENTIALS_FILEAPI, workerRequired for s3JSON file with access_key_id and secret_access_key; file only

Limit S3 credentials to the operations needed in the configured evidence prefix. After startup, monitor Installation → Health → Storage for loss of object access; the startup test checks access only at that time.

Back up the database and artifact objects together using Create a recoverable set. Restoring metadata without the referenced objects leaves evidence unavailable.

Bundle inputs

These are consumed by Compose, not read by the API as runtime settings. Validate them through the pinned release bundle.

VariableDefault or requirementBehavior
GUARD_RELEASERequiredExact available signed release tag; no floating latest
GUARD_PUBLISHED_ADDRESS127.0.0.1Host bind IP for the API; exposing another address requires the intended TLS/proxy boundary
GUARD_PUBLISHED_PORT8080Integer host port 1–65535
POSTGRES_DBguardBundled database bootstrap database name
POSTGRES_USERguardBundled database bootstrap user name
POSTGRES_PASSWORD_FILERequired for bundled databaseReadable mounted password; initializes the database account

POSTGRES_DB, POSTGRES_USER, and POSTGRES_PASSWORD_FILE initialize the bundled database on its first start. Changing them later does not rename that database or rotate its account. For an existing database, change the account in PostgreSQL, update Guard's database URL secret, restart the API and workers, and check database readiness under Installation → Health.

Keep the deployment's persistent volumes during a routine restart. Removing them can destroy the database or evidence objects. Use backup recovery before replacing a lost volume.