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

Configuration Reference

Complete reference for .mediagit/config.toml. All sections are optional — MediaGit uses sensible defaults for any missing values.

File Location

<repo-root>/.mediagit/config.toml

Minimal Configuration

[author]
name = "Alice Smith"
email = "alice@example.com"

Full Example

[author]
name = "Alice Smith"
email = "alice@example.com"

[storage]
backend = "s3"
bucket = "my-media-bucket"
region = "us-east-1"
prefix = "repos/my-project"
encryption = true

[compression]
enabled = true
algorithm = "zstd"
level = 3
min_size = 1024

[performance]
max_concurrency = 8
buffer_size = 65536

[performance.cache]
enabled = true
cache_type = "memory"
max_size = 536870912  # 512 MB
ttl = 3600

[performance.timeouts]
request = 60
read = 30
write = 30
connection = 30

[observability]
log_level = "info"
log_format = "json"

[remotes.origin]
url = "http://media-server.example.com/my-project"

[protected_branches.main]
prevent_force_push = true
prevent_deletion = true
require_reviews = true
min_approvals = 1

[author] — Author Identity

Used when creating commits. Override with MEDIAGIT_AUTHOR_NAME / MEDIAGIT_AUTHOR_EMAIL env vars or --author CLI flag.

KeyTypeDefaultDescription
namestring$USERDisplay name on commits
emailstring""Email address on commits

[storage] — Storage Backend

The storage backend is selected with the backend key. All backend-specific fields are placed directly in [storage] alongside backend — there are no nested [storage.s3] or [storage.filesystem] subsections.

Local Filesystem (default)

[storage]
backend = "filesystem"
base_path = "./data"
create_dirs = true
sync = false
file_permissions = "0644"
KeyTypeDefaultDescription
backendstring"filesystem"Must be "filesystem"
base_pathstring"./data"Storage root directory
create_dirsbooltrueAuto-create directories
syncboolfalseSync writes to disk (slower, safer)
file_permissionsstring"0644"Octal file permission string

Amazon S3

[storage]
backend = "s3"
bucket = "my-bucket"
region = "us-east-1"
prefix = ""
encryption = false
encryption_algorithm = "AES256"
# access_key_id and secret_access_key from env vars or IAM role
KeyTypeDefaultDescription
backendstringMust be "s3"
bucketstringRequired. S3 bucket name
regionstringRequired. AWS region
access_key_idstringenvAWS access key (prefer env var)
secret_access_keystringenvAWS secret key (prefer env var)
endpointstringCustom endpoint for S3-compatible services
prefixstring""Object key prefix
encryptionboolfalseEnable server-side encryption
encryption_algorithmstring"AES256"SSE algorithm: AES256 or aws:kms

Azure Blob Storage

[storage]
backend = "azure"
account_name = "mystorageaccount"
container = "media-container"
prefix = ""
# account_key from env AZURE_STORAGE_KEY or use connection_string
KeyTypeDefaultDescription
backendstringMust be "azure"
account_namestringRequired. Storage account name
containerstringRequired. Blob container name
account_keystringenvStorage account key (prefer env var)
connection_stringstringenvFull connection string (alternative to account_name/key)
prefixstring""Blob path prefix

Google Cloud Storage

[storage]
backend = "gcs"
bucket = "my-gcs-bucket"
project_id = "my-gcp-project"
prefix = ""
# credentials_path from GOOGLE_APPLICATION_CREDENTIALS env var
KeyTypeDefaultDescription
backendstringMust be "gcs"
bucketstringRequired. GCS bucket name
project_idstringRequired. GCP project ID
credentials_pathstringenvPath to service account JSON key
prefixstring""Object prefix

[compression] — Compression Settings (Informational)

Note: MediaGit uses SmartCompressor which automatically selects the optimal algorithm and level per file type. The values in this section are written to config.toml by mediagit init for reference but are not read at runtime — compression behavior is determined entirely by file type, not these settings.

KeyTypeDefaultDescription
enabledbooltrue(Informational) SmartCompressor is always active
algorithmstring"zstd"(Informational) Actual algorithm selected per file type
levelinteger3(Informational) Actual level selected per file type
min_sizeinteger1024(Informational) Not currently enforced

Automatic algorithm selection by file type (always active, cannot be overridden via config):

  • Already-compressed formats (JPEG, MP4, ZIP, docx, AI, PDF): stored as-is (none)
  • PSD, raw formats, 3D models: zstd at Best level (level 22)
  • Text, JSON, TOML: zstd at Default level (level 3)
  • ML checkpoints: zstd at Fast level (level 1)

[performance] — Performance Tuning

KeyTypeDefaultDescription
max_concurrencyintegerCPU count (min 4)Max parallel operations
buffer_sizeinteger65536I/O buffer size in bytes (64 KB)

[performance.cache]

KeyTypeDefaultDescription
enabledbooltrueEnable in-memory object cache
cache_typestring"memory"Cache type ("memory")
max_sizeinteger536870912Max cache size in bytes (512 MB)
ttlinteger3600Cache entry TTL in seconds
compressionboolfalseCompress cached objects

[performance.connection_pool]

KeyTypeDefaultDescription
min_connectionsinteger1Minimum pool connections
max_connectionsinteger10Maximum pool connections
timeoutinteger30Connection timeout in seconds
idle_timeoutinteger600Idle connection timeout in seconds

[performance.timeouts]

KeyTypeDefaultDescription
requestinteger60Total request timeout in seconds
readinteger30Read timeout in seconds
writeinteger30Write timeout in seconds
connectioninteger30Connection timeout in seconds

[observability] — Logging and Tracing

KeyTypeDefaultDescription
log_levelstring"info"Log level: "error", "warn", "info", "debug", "trace"
log_formatstring"json"Log format: "json" or "text"
tracing_enabledbooltrueEnable distributed tracing
sample_ratefloat0.1Trace sampling rate (0.0–1.0)

Override log_level with the RUST_LOG environment variable.

[observability.metrics]

KeyTypeDefaultDescription
enabledbooltrueEnable Prometheus metrics
portinteger9090Metrics HTTP server port
endpointstring"/metrics"Metrics endpoint path
intervalinteger60Collection interval in seconds

[remotes.<name>] — Remote Repositories

[remotes.origin]
url = "http://media-server.example.com/my-project"

[remotes.backup]
url = "http://backup-server.example.com/my-project"
KeyTypeDefaultDescription
urlstringRequired. Remote server URL
fetchstringurlFetch URL if different from url
pushstringurlPush URL if different from url

[branches.<name>] — Branch Tracking

[branches.main]
remote = "origin"
merge = "refs/heads/main"

Set automatically by mediagit push -u origin main. Rarely edited manually.


[protected_branches.<name>] — Branch Protection

[protected_branches.main]
prevent_force_push = true
prevent_deletion = true
require_reviews = false
min_approvals = 1
KeyTypeDefaultDescription
prevent_force_pushbooltrueBlock force pushes
prevent_deletionbooltrueBlock branch deletion
require_reviewsboolfalseRequire PR review before merge
min_approvalsinteger1Minimum approvals required

See Also