Blob store
Where images, attachments and release files are stored: a folder on the data volume, or an S3-compatible bucket.
Binary files (images, attachments, archived release PDFs) are kept by their SHA-256 in a blob
store, never in Git: a module refers to an image by its hash, so a release tag pins exactly its
images. Two stores are built in, chosen by CCMS_BLOB_DRIVER.
A folder (fs)
The container images default to CCMS_BLOB_DRIVER=fs with CCMS_BLOB_FS_ROOT=/data/blobs, on
the data volume. Nothing to set up. It suits one machine: the API and the workers must all see
the same folder. The backup service backs it up with the database.
S3-compatible storage (s3)
For several hosts, or to keep files off the server's disk, use any S3-compatible service.
-
Create a bucket, and keep it private: the API serves every file itself, after checking who may read it, never by a bucket URL.
-
Create an access key with
s3:GetObject,s3:PutObjectands3:DeleteObjecton the bucket's objects, ands3:ListBucketon the bucket. -
Put the settings into
deploy/api.env(the API and the workers both read it):CCMS_BLOB_DRIVER=s3 CCMS_S3_ENDPOINT=https://s3.example.com # unset for AWS S3 itself CCMS_S3_REGION=us-east-1 # the default; most services accept any CCMS_S3_BUCKET=docs-blobs CCMS_S3_FORCE_PATH_STYLE=true # most self-hosted services need path-style URLsGive the key from files, as Compose secrets in a
compose.override.yamlnext tocompose.yaml. Name the_FILEsettings there, under theapiandworkerservices, never inapi.env: the backup service readsapi.envtoo, and stops when a_FILEit names cannot be read. Make the file the container user's and no one else's (chown 1000andchmod 400on each file,chmod 700on/srv/secrets). Compose reads the override only when no-fand noCOMPOSE_FILEis given: see Your own additions.services: api: environment: CCMS_S3_ACCESS_KEY_ID_FILE: /run/secrets/s3-access-key-id CCMS_S3_SECRET_ACCESS_KEY_FILE: /run/secrets/s3-secret-access-key secrets: [s3-access-key-id, s3-secret-access-key] worker: environment: CCMS_S3_ACCESS_KEY_ID_FILE: /run/secrets/s3-access-key-id CCMS_S3_SECRET_ACCESS_KEY_FILE: /run/secrets/s3-secret-access-key secrets: [s3-access-key-id, s3-secret-access-key] secrets: s3-access-key-id: file: /srv/secrets/s3-access-key-id s3-secret-access-key: file: /srv/secrets/s3-secret-access-keyOr set
CCMS_S3_ACCESS_KEY_IDandCCMS_S3_SECRET_ACCESS_KEYinapi.env(both or neither). With neither, the SDK's own chain applies:AWS_*variables, shared credential files, an instance or task role. The endpoint URL never holds credentials. -
Start again:
docker compose up -d --wait.
Each upload is sent with its SHA-256 checksum, so the service refuses bytes that do not match.
Backups: with s3, the blobs stay in their bucket and are not part of the server's backups.
Turn on versioning (or object lock) for the bucket.
Health
GET /health reports "blobs": "unavailable" when the store does not answer within 2 seconds,
and GET /health/ready then answers 503 blob-store-unavailable, so a load balancer takes the
instance out of rotation (Database, "Health").
Images from the old layout
Content written before the blob store kept images under assets/<sha256> in the repository. The
API still reads those. To copy them into the store, run:
docker compose exec api node dist/blobs/import-git-assets.main.jsIt copies every assets/ file at the head of every branch and tag, changes nothing in Git, and
can run again.