Configuration Management

The Manta CLI uses a centralized configuration system stored in ~/.manta/ that manages credentials, profiles, and settings across all Manta tools.

Configuration Structure

Directory Layout

~/.manta/
├── admin/                   # Admin configuration
│   └── config.toml         # Admin settings
├── sdk/                     # SDK profiles
│   ├── active              # Active profile indicator
│   ├── default.toml        # Default SDK profile
│   └── dev.toml            # Development profile
├── nodes/                   # Node configurations
│   ├── default.toml        # Default node config
│   ├── dev_0.toml          # Individual node configs
│   ├── dev_1.toml
│   └── instances/          # Node instance data
├── state/
│   └── active-profile      # Currently active SDK profile
└── logs/                    # Operation logs
    └── nodes/              # Node-specific logs
        ├── dev_0.log
        └── dev_1.log

Initialization

Interactive Setup

The easiest way to configure the CLI:

manta sdk config init --interactive

This will prompt you for:

  1. Platform host and port

  2. Authentication token

  3. Profile name

  4. Optional settings

Configuration Commands

# Show all settings
manta sdk config show

# List profiles
manta sdk config list

# Use profile configuration
manta sdk config use <profile_name>

# Delete profile
manta config delete <profile_name>

Environment Variables

Configuration can be overridden using environment variables:

# Connection settings
export MANTA_HOST=localhost
export MANTA_PORT=50052
export MANTA_MANAGER_PORT=50051

# Authentication
export MANTA_TOKEN=your_jwt_token
export MANTA_CERT_FOLDER=/path/to/certs

# Profile selection
export MANTA_PROFILE=production

# Feature flags
export MANTA_STREAMING=true
export MANTA_COMPRESSION=false

# Logging
export MANTA_LOG_LEVEL=DEBUG
export MANTA_LOG_FILE=~/.manta/debug.log

Priority Order

  1. Command-line arguments

  2. Environment variables

  3. Active profile configuration

  4. Default profile configuration

  5. Global configuration

  6. Built-in defaults

Troubleshooting

Common Issues

  1. Permission Denied

    # Fix permissions
    chmod 700 ~/.manta
    chmod 600 ~/.manta/sdk
    
  2. Invalid Token

    Ensure you use the right token (user token or cluster token)

  3. Connection Failed

    Ensure the host and port are correct

Best Practices

  1. Use Profiles: Separate environments with profiles

  2. Secure Tokens: Never commit tokens to version control

  3. Regular Backups: Backup configuration before changes

  4. Token Rotation: Rotate tokens periodically

  5. Minimal Permissions: Use tokens with minimal required permissions

  6. Environment Variables: Use for CI/CD and automation

  7. Validate Changes: Test configuration after modifications

Next Steps