Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment Variables

All environment variables recognized by MediaGit. Environment variables take precedence over config.toml values where both are supported.

Core Variables

VariableDescriptionDefault
MEDIAGIT_REPOOverride repository root path. Used internally by -C <path>.

Author Identity

These override the [author] section of .mediagit/config.toml. Priority (highest first): --author CLI flag → MEDIAGIT_AUTHOR_NAME/MEDIAGIT_AUTHOR_EMAILconfig.toml [author]$USER.

VariableDescription
MEDIAGIT_AUTHOR_NAMECommit author name (e.g., "Alice Smith")
MEDIAGIT_AUTHOR_EMAILCommit author email (e.g., "alice@example.com")

AWS / S3 / S3-Compatible Storage

Standard AWS SDK environment variables. Used when storage.backend = "s3".

VariableDescription
AWS_ACCESS_KEY_IDAWS access key ID
AWS_SECRET_ACCESS_KEYAWS secret access key
AWS_SESSION_TOKENAWS session token (for temporary credentials)
AWS_REGIONAWS region (e.g., us-east-1)
AWS_ENDPOINT_URLCustom S3 endpoint URL (for MinIO, DigitalOcean Spaces, Backblaze B2, etc.)
AWS_PROFILEAWS named profile from ~/.aws/credentials

Azure Blob Storage

Used when storage.backend = "azure".

VariableDescription
AZURE_STORAGE_CONNECTION_STRINGFull connection string (alternative to account_name + account_key)
AZURE_STORAGE_ACCOUNTStorage account name
AZURE_STORAGE_KEYStorage account key

Google Cloud Storage

Used when storage.backend = "gcs".

VariableDescription
GOOGLE_APPLICATION_CREDENTIALSPath to service account JSON key file
GCS_EMULATOR_HOSTGCS emulator URL for testing (e.g., http://localhost:4443)

Observability

VariableDescriptionDefault
RUST_LOGLog filter directive (e.g., mediagit=debug, info)info
RUST_LOG_FORMATLog output format: json or textjson

Log Filter Examples

# Show all debug logs
export RUST_LOG=debug

# Show debug for mediagit only, info for everything else
export RUST_LOG=mediagit=debug,info

# Show trace for a specific crate
export RUST_LOG=mediagit_versioning=trace

# Human-readable logs (development)
export RUST_LOG_FORMAT=text mediagit add file.psd

Cargo / Build (Development)

VariableDescription
CARGO_TERM_COLORForce color output: always, never, auto
RUST_BACKTRACEEnable Rust backtraces: 1 or full

Integration Test Variables

Used by the CI integration test job and local integration testing:

VariableValue for local testing
AWS_ACCESS_KEY_IDminioadmin
AWS_SECRET_ACCESS_KEYminioadmin
AWS_ENDPOINT_URLhttp://localhost:9000
AWS_REGIONus-east-1
AZURE_STORAGE_CONNECTION_STRINGDefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://localhost:10000/devstoreaccount1;
GCS_EMULATOR_HOSThttp://localhost:4443

See Development Setup for running integration tests locally.

Precedence Summary

For each setting, MediaGit resolves values in this order (first match wins):

  1. CLI flag (e.g., --author "Name <email>")
  2. Environment variable (e.g., MEDIAGIT_AUTHOR_NAME)
  3. Repository config (.mediagit/config.toml)
  4. Built-in default

See Also