Skip to content

Configuration

Config section: storage: Env prefix: QK_STORAGE__

KeyTypeDefaultEnv VariableDescription
namestr"storage"QK_STORAGE__NAMEConfiguration name
enabledbooltrueQK_STORAGE__ENABLEDEnable storage module
default_driverstr"local"QK_STORAGE__DEFAULT_DRIVERDefault driver (local, s3, gcs, azure, r2, memory)
health_check_timeoutfloat5.0QK_STORAGE__HEALTH_CHECK_TIMEOUTHealth check timeout (seconds)
envstr | NonenullQK_STORAGE__ENVEnvironment label
driversdict{}QK_STORAGE__DRIVERS__*Per-driver configuration
serviceStorageOperationConfigdefaultsQK_STORAGE__SERVICE__*Operation settings
backendslist[NamedStorageConfig][]See belowNamed multi-backend entries
KeyTypeDefaultEnv VariableDescription
root_dirstr"./storage"QK_STORAGE__DRIVERS__LOCAL__ROOT_DIRRoot directory for files
base_urlstr"http://localhost:8000/storage"QK_STORAGE__DRIVERS__LOCAL__BASE_URLBase URL for file access
KeyTypeDefaultEnvDescription
bucketstr(required)QK_STORAGE__DRIVERS__S3__BUCKETS3 bucket name
regionstr(required)QK_STORAGE__DRIVERS__S3__REGIONAWS region
access_keySecretStr | NonenullQK_STORAGE__DRIVERS__S3__ACCESS_KEYAWS access key
secret_keySecretStr | NonenullQK_STORAGE__DRIVERS__S3__SECRET_KEYAWS secret key
endpoint_urlstr | NonenullQK_STORAGE__DRIVERS__S3__ENDPOINT_URLCustom endpoint (MinIO, etc.)
public_urlstr | NonenullQK_STORAGE__DRIVERS__S3__PUBLIC_URLCustom public URL (R2 custom domain)
encryptionEncryptionConfigdefaultsQK_STORAGE__DRIVERS__S3__ENCRYPTION__*Server-side encryption
KeyTypeDefaultEnvDescription
bucketstr(required)QK_STORAGE__DRIVERS__GCS__BUCKETGCS bucket name
project_idstr(required)QK_STORAGE__DRIVERS__GCS__PROJECT_IDGCP project ID
credentials_pathstr | NonenullQK_STORAGE__DRIVERS__GCS__CREDENTIALS_PATHService account key path
encryptionEncryptionConfigdefaultsQK_STORAGE__DRIVERS__GCS__ENCRYPTION__*Server-side encryption
KeyTypeDefaultEnvDescription
account_namestr(required)QK_STORAGE__DRIVERS__AZURE__ACCOUNT_NAMEAzure storage account name
account_keySecretStr(required)QK_STORAGE__DRIVERS__AZURE__ACCOUNT_KEYAzure storage account key
containerstr(required)QK_STORAGE__DRIVERS__AZURE__CONTAINERBlob container name
KeyTypeDefaultEnvDescription
bucketstr(required)QK_STORAGE__DRIVERS__R2__BUCKETR2 bucket name
access_keySecretStr(required)QK_STORAGE__DRIVERS__R2__ACCESS_KEYR2 access key ID
secret_keySecretStr(required)QK_STORAGE__DRIVERS__R2__SECRET_KEYR2 secret access key
endpoint_urlstr(required)QK_STORAGE__DRIVERS__R2__ENDPOINT_URLR2 S3-compatible API endpoint
public_urlstr | NonenullQK_STORAGE__DRIVERS__R2__PUBLIC_URLCustom domain for public access
regionstr"auto"QK_STORAGE__DRIVERS__R2__REGIONR2 region
KeyTypeDefaultEnvDescription
enabledboolfalseQK_STORAGE__...__ENCRYPTION__ENABLEDEnable SSE
typestr"AES256"QK_STORAGE__...__ENCRYPTION__TYPEEncryption type (AES256, aws:kms, gcs:cmek)
kms_key_idstr | NonenullQK_STORAGE__...__ENCRYPTION__KMS_KEY_IDKMS/CMEK key ARN or ID
KeyTypeDefaultEnvDescription
max_file_size_mbint10QK_STORAGE__SERVICE__MAX_FILE_SIZE_MBMax file size in MB
allowed_mime_typeslist[str]["image/jpeg", "image/png", "image/gif", "image/webp"]QK_STORAGE__SERVICE__ALLOWED_MIME_TYPESAllowed MIME types for upload

storage:
default_driver: local
drivers:
local:
root_dir: ./storage/data
storage:
default_driver: s3
drivers:
s3:
bucket: myapp-production
region: us-west-2
encryption:
enabled: true
type: AES256
service:
max_file_size_mb: 100
allowed_mime_types:
- '*/*'
storage:
backends:
- name: avatars
driver: s3
primary: true
s3:
bucket: myapp-avatars
region: us-east-1
- name: exports
driver: s3
s3:
bucket: myapp-exports
region: us-east-1
Terminal window
export QK_STORAGE__DEFAULT_DRIVER="s3"
export QK_STORAGE__DRIVERS__S3__BUCKET="myapp-production"
export QK_STORAGE__DRIVERS__S3__REGION="us-west-2"
export QK_STORAGE__SERVICE__MAX_FILE_SIZE_MB=100