MinIO/S3 Configuration
This document outlines the environment variables required to configure the application's object storage client for services like DSAR exports.
When EXPORT_STORAGE=minio, the following variables are used to connect to an S3-compatible object store:
EXPORT_ENDPOINT: The endpoint of the S3 service.- Example:
localhost:9000
- Example:
EXPORT_BUCKET: The name of the bucket to use for uploads.- Example:
compliance-exports
- Example:
EXPORT_ACCESS_KEY: The access key for the S3 service.- Example:
minioadmin
- Example:
EXPORT_SECRET_KEY: The secret key for the S3 service.- Example:
minioadmin
- Example:
EXPORT_PREFIX: An optional prefix to prepend to all object keys.- Example:
dev/
- Example:
EXPORT_MINIO_USE_SSL: Set totrueor1to use SSL (HTTPS). Defaults tofalse.- Example:
false
- Example:
When EXPORT_STORAGE is not set to minio, the application defaults to using the local filesystem. The output directory can be configured with:
EXPORT_DIR: The local directory to store exported files.- Default:
./tmp/exports
- Default:
Local testing with MinIO (DSAR export)
Use the built-in DSAR → MinIO smoke to verify object uploads:
- Start MinIO locally (console on
http://localhost:9001, API onhttp://localhost:9000) and ensure the bucket exists (e.g.s3-test). - Start the backend with the MinIO envs set before launching the server:
export EXPORT_STORAGE=minio
export EXPORT_ENDPOINT=http://localhost:9000 # scheme allowed; path is stripped
export EXPORT_BUCKET=s3-test
export EXPORT_ACCESS_KEY=minioadmin
export EXPORT_SECRET_KEY=minioadmin
export EXPORT_MINIO_USE_SSL=false
export EXPORT_PREFIX=dsar/
go run ./cmd/server - Configure the local MinIO client (optional, for listing):
mc alias set minio http://localhost:9000 minioadmin minioadmin --api S3v4 - Run the end-to-end smoke:
The script uses
cd backend/tests
./dsar_minio_e2e.shauth_login_helper.shto mint an owner token automatically—no manual token export is required. It enqueues adsar_exportjob, polls completion, and lists objects in the bucket.
Expected result:
- New objects in
s3-test/dsar/<job>.zipand…-receipt.json. - Ledger entries at
/api/v1/compliance/ledgerwithartifact_ref/receipt_refpointing at the MinIO URLs.