This document explains the simplified configuration system for Gitopia Storage Provider.
The new configuration system uses a hierarchy approach with production defaults and easy overrides:
config.toml- Base configuration with production defaultsconfig.local.toml- Local development overrides (gitignored)- Environment variables - Runtime overrides (highest priority)
- Environment Variables - Override any setting at runtime
- config.local.toml - Local development overrides
- config.toml - Base production configuration
Default behavior: Uses config.toml with production settings.
# Production uses config.toml by default
./gitopia-storaged start
# Override specific settings with environment variables
GITOPIA_ADDR="custom-grpc.example.com:9090" ./gitopia-storaged startStep 1: Copy the example file
cp config.local.toml.example config.local.tomlStep 2: Edit config.local.toml with your local settings
# Local Development Configuration Override
GITOPIA_ADDR = "host.docker.internal:9100"
TM_ADDR = "http://host.docker.internal:26667"
CHAIN_ID = "localgitopia"
WORKING_DIR = "/src/app/"
# Local IPFS Configuration
IPFS_CLUSTER_PEER_HOST = "host.docker.internal"
IPFS_HOST = "host.docker.internal"
# Faster cache clearing for development
CACHE_REPO_MAX_AGE = "10m"
CACHE_CLEAR_INTERVAL = "1m"Step 3: Run normally - local overrides are automatically loaded
./gitopia-storaged start
# Output: "Loaded local configuration overrides from config.local.toml"Production: Uses config.toml in the container
docker run gitopia-storageWith environment overrides:
docker run -e GITOPIA_ADDR="custom-grpc.example.com:9090" gitopia-storageWith custom config volume:
docker run -v /host/config.toml:/app/config.toml gitopia-storageOption 1: Environment variables
CHAIN_ID="gitopia-testnet" GITOPIA_ADDR="testnet-grpc.example.com:9090" ./gitopia-storaged startOption 2: Create environment-specific local config
# Create config.staging.toml
cp config.local.toml.example config.staging.toml
# Edit config.staging.toml with staging settings
# Then copy it as config.local.toml when needed- Contains production defaults
- Always committed to git
- Safe production values
- Should work out-of-the-box for production
- Gitignored (never committed)
- Overrides specific settings for local development
- Optional - only created when needed
- Automatically loaded if present
- Template for local development
- Committed to git as documentation
- Copy to
config.local.tomland modify as needed
Any configuration key can be overridden with environment variables:
# Override GITOPIA_ADDR
export GITOPIA_ADDR="custom-grpc.example.com:9090"
# Override multiple settings
export CHAIN_ID="custom-chain"
export WEB_SERVER_PORT="8080"
export CACHE_CLEAR_INTERVAL="30m"
./gitopia-storaged startError reading base config file: Config File "config" Not Found
Solution: Ensure config.toml exists in the current directory or /etc/gitopia-storage/
Check: Ensure config.local.toml exists and has valid TOML syntax
Verify: Look for "Loaded local configuration overrides" message in logs
Check: Ensure variable names match config keys exactly (case-sensitive)
Example: GITOPIA_ADDR not gitopia_addr