Skip to content

Conversation

@roshii
Copy link
Contributor

@roshii roshii commented Nov 11, 2025

This PR adds support for overriding JoinMarket configuration settings via environment variables, enabling easier deployment in containerized environments and CI/CD pipelines.

Changes

Core Functionality

  • Added override() function that reads environment variables prefixed with JM_ and applies them to the configuration
  • Environment variables are automatically converted to lowercase config keys and mapped to appropriate sections
  • Support for sections with subsections (e.g., JM_MESSAGING_ONION_TYPE=onion maps to [MESSAGING:onion] type=onion)

Refactoring

  • Split load_program_config() into smaller, focused functions:
    • set_paths() - handles data directory and config file path setup
    • read_config_file() - reads existing config file with error handling
    • write_config_file() - creates new default config file\

Usage Examples

# Override blockchain network
export JM_BLOCKCHAIN_NETWORK=testnet

# Override policy settings
export JM_POLICY_TX_FEES=1000

# Override messaging subsection
export JM_MESSAGING_ONION_TYPE=onion

# Override daemon port
export JM_DAEMON_DAEMON_PORT=27184

Benefits

  • Container-friendly: No need to modify config files in Docker containers
  • CI/CD integration: Easy configuration overrides in deployment pipelines
  • Security: Sensitive settings can be injected via environment variables
  • Flexibility: Maintains backward compatibility with existing config files

This feature follows the common pattern of using prefixed environment variables for configuration overrides, making JoinMarket more suitable for modern deployment workflows.

@roshii roshii force-pushed the feat/config-override branch from 74a21b8 to b2315c3 Compare November 11, 2025 12:58
@roshii roshii marked this pull request as ready for review November 11, 2025 13:04
@roshii roshii force-pushed the feat/config-override branch from b2315c3 to f3bcd94 Compare November 11, 2025 17:16
@roshii roshii marked this pull request as draft November 22, 2025 15:25
@roshii roshii force-pushed the feat/config-override branch 2 times, most recently from e5c4e9b to 4f45ddd Compare November 23, 2025 20:07
@roshii roshii force-pushed the feat/config-override branch from 4f45ddd to 0ff8078 Compare November 23, 2025 20:18
@roshii roshii marked this pull request as ready for review November 23, 2025 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant