CodamAIDocs
Topicdone

Environment variables

Which variables CRMS reads, where a value comes from and which variables are required when: embedded, as a client and as a separate service.

Variants
embedded CRMSCRMS clientstandalone CRMS servicedocuments on / offseal on / off

What this is about

CRMS reads its settings from environment variables. They all start with CODAMAI_CRMS_, the S3 connection with CODAMAI_S3_. Spring binds them to a setting by name: CODAMAI_CRMS_RENDER_THREADS becomes codamai.crms.render.threads.

Where a value comes from

The order, from strongest to weakest
  1. Environment variable
    Is the variable set?
    ↳ no on to the next source
  2. Build
    crms-configuration.yaml
    Does the CRMS module in the hub have a value?
    ↳ no on to the next source
  3. CRMS
    Default of the CRMS module
    Does the setting have a default?
    ↳ no Start fails and names the variable
  4. The value is fixed

The file crms-configuration.yaml exists only when CRMS is embedded, or built as a separate service with a CRMS module from the hub. A client has none.

Which variables are read

This depends on the placement:

Three placements, three sets of variables

When: CRMS runs in the process of a CDMS application.

The application reads every variable on this page except those of the client. It already has a database and CIAS, see The database.

When: The CDMS application calls a CRMS service.

It reads only three variables: CODAMAI_CRMS_CLIENT_URL (required), CODAMAI_CRMS_CLIENT_CONNECT_TIMEOUT (default PT5S) and CODAMAI_CRMS_CLIENT_TIMEOUT (default PT2M, one whole call). Everything else belongs to the service.

When: CRMS runs as a standalone service.

The service reads every CRMS variable on this page, plus the variables for database and CIAS that a CDMS application reads too: CODAMAI_PERSISTENCE_*, CIAS_ISSUER, CIAS_CLIENT, CIAS_CLIENT_SECRET, CODAMAI_CIAS_PLATFORM_ADMINISTRATOR_ROLES, CODAMAI_CIAS_TENANCY_CLIENT_*. In addition SERVER_PORT (8080), MANAGEMENT_SERVER_PORT (8081) and TZ (UTC).

What is required

A required variable without a value makes the start fail. The error message names the variable. Whether a variable is required depends on two switches: whether documents are stored (CODAMAI_CRMS_DOCUMENT_REVISIONS) and whether PDFs are sealed (CODAMAI_CRMS_SEAL_MODE).

Store documents?Seal on?Required for embedded CRMS
––CODAMAI_CRMS_TSA_KEYSTORE, always
yes–plus CODAMAI_CRMS_DOCUMENT_KEY, CODAMAI_CRMS_DOCUMENT_RETENTION, CODAMAI_CRMS_DOCUMENT_BUCKET, CODAMAI_S3_ENDPOINT, CODAMAI_S3_ACCESS_KEY, CODAMAI_S3_SECRET_KEY
no–none of these: no storage, no document key
–yesplus CODAMAI_CRMS_SEAL_KEYSTORE
–nono seal key

In addition: if the CRMS module admits system templates (scope SYSTEM, the default), an embedded CRMS needs CODAMAI_CIAS_PLATFORM_ADMINISTRATOR_ROLES. These realm roles write the system templates. Without them the application does not start.

For the separate service, bucket and S3 access are always required, even when no documents are stored. The standalone CRMS service always brings the S3 storage, and it checks its bucket at start. Document key and retention are required there, as above, only while documents are stored.

Evidence and keys

VariableMeaningDefault
CODAMAI_CRMS_TSA_KEYSTOREthe timestamping key CRMS anchors its journals with. PKCS#12 as Base64. The certificate carries timeStamping as a critical extended key usagerequired, secret
CODAMAI_CRMS_TSA_KEYSTORE_PASSWORDits passwordempty
CODAMAI_CRMS_TSA_TRUSTED_CERTIFICATESformer timestamping certificates or the authority that issues them, as PEM or as PEM in Base64. Old anchors stay verifiable after a key replacementempty
CODAMAI_CRMS_DOCUMENT_KEYthe key that encrypts the keys of the stored documents. 256 bits as Base64required with stored documents, secret
CODAMAI_CRMS_SEAL_MODEthe PAdES seal of PDF documents: internal or noneinternal
CODAMAI_CRMS_SEAL_KEYSTOREthe seal key with its certificate chain, PKCS#12 as Base64required unless none, secret
CODAMAI_CRMS_SEAL_KEYSTORE_PASSWORDits passwordempty

Anchoring means: CRMS regularly gives the latest state of a journal a timestamp. How this works is described in Timestamps, the seal in Seal.

Documents and storage

VariableMeaningDefault
CODAMAI_CRMS_DOCUMENT_REVISIONSstore final documents. Off: a FINAL render is refusedtrue
CODAMAI_CRMS_DOCUMENT_RETENTIONhow long a final document stays, ISO-8601, e.g. P10Ynone
CODAMAI_CRMS_DOCUMENT_STORE_PAYLOADstore the data of a final document with it, encryptedtrue
CODAMAI_CRMS_AUDIT_READSalso write every read to the journalfalse
CODAMAI_CRMS_DOCUMENT_BUCKETthe bucket of final documents. It must be created with Object Locknone
CODAMAI_S3_ENDPOINTthe S3 of the platform, e.g. http://minio:9000none
CODAMAI_S3_ACCESS_KEY, CODAMAI_S3_SECRET_KEYthe S3 accessnone, secret
CODAMAI_S3_REGIONthe S3 regionus-east-1
CODAMAI_S3_PATH_STYLEbucket in the path instead of the host name, as MinIO expectstrue
CODAMAI_CRMS_STORAGE_ALLOW_UNLOCKEDaccept a bucket without Object Lock. Documents can then be deletedfalse

Object Lock is an S3 feature that locks an object against deletion and overwriting until a date. All modules of the platform share the S3 connection CODAMAI_S3_*. The bucket is separate per purpose. More in Storage.

Templates and roles

VariableMeaningDefault
CODAMAI_CRMS_TEMPLATE_SCOPESthe admitted scopes: SYSTEM, TENANT, USER, comma separatedall
CODAMAI_CRMS_TEMPLATE_REASON_REQUIREDa reason on submit, roll back and retiretrue
CODAMAI_CRMS_TEMPLATE_ROLES_USERclient role for a user’s own templatescrms-template-personal
CODAMAI_CRMS_TEMPLATE_ROLES_TENANTclient role for a tenant’s templatescrms-template-author
CODAMAI_CRMS_REST_DOCUMENT_ROLES_READclient role that reads final documentscrms-document-reader
CODAMAI_CRMS_REST_DOCUMENT_ROLES_HOLDclient role that places and releases a hold against erasurecrms-document-custodian
CODAMAI_CRMS_REST_DOCUMENT_ROLES_ERASEclient role that erases a documentcrms-document-eraser
CODAMAI_CRMS_REST_TEMPLATE_MAX_BYTESlargest template upload in bytes16777216

The approval stages have no variable. They come from the build only.

Rendering

VariableMeaningDefault
CODAMAI_CRMS_FORMATSthe formats offered, comma separated: HTML, PDF, DOCX, XLSX, CSV, ODS. A format without an installed module makes the start failevery installed format
CODAMAI_CRMS_PDF_PROFILEPDF_A_3A, PDF_UA, PDF_A_3A_UA or NONEPDF_A_3A
CODAMAI_CRMS_TRANSIENT_DOCUMENTSallow the mode TRANSIENT for system templates. Off, it is refusedfalse
CODAMAI_CRMS_RENDER_THREADShow many documents are produced at oncenumber of processors
CODAMAI_CRMS_RENDER_QUEUEhow many wait beyond those. More are refused50
CODAMAI_CRMS_RENDER_TIMEOUThow long a caller waits for its documentPT30S
CODAMAI_CRMS_RENDER_MAX_OUTPUTlargest document in bytes52428800
CODAMAI_CRMS_PAYLOAD_MAX_BYTESlargest data (payload) in bytes5242880
CODAMAI_CRMS_ATTACHMENTS_MAX_COUNThighest number of pictures (PNG, JPEG) per request200
CODAMAI_CRMS_ATTACHMENTS_MAX_BYTEShighest sum of the pictures per request in bytes52428800

What the limits do is described in Execution, the mode TRANSIENT in Modes. The separate service also reads CODAMAI_I18N_DEFAULT_LOCALE (de) and CODAMAI_I18N_SUPPORTED_LOCALES (de,en), see Language and time zone.

Schedules

VariableMeaningDefault
CODAMAI_CRMS_SCHEDULING_ENABLEDwhether this instance runs anchoring and retentiontrue
CODAMAI_CRMS_ANCHOR_INTERVALdelay between two anchoringsPT1H
CODAMAI_CRMS_RETENTION_INTERVALdelay between two passes that remove expired documentsPT24H

The first pass starts one minute after the start. A delay that is not positive makes the start fail.

Pitfalls

Next

Search