Skip to content

Conversation

@darrenvechain
Copy link
Member

Description

  • block PR until release 2.4.2

PR: Migrate CLI to urfave/cli v3 with Environment Variable Support

Summary

  • Upgraded thor and disco commands from gopkg.in/urfave/cli.v1 to github.com/urfave/cli/v3
  • Added environment variable support for all CLI flags
  • Environment variables use THOR_ prefix for thor and DISCO_ prefix for disco

Benefits

  1. Cleaner configuration - No long command strings with many arguments
  2. Easier secrets management - Use Docker secrets or external .env files
  3. Better Kubernetes compatibility - ConfigMaps and Secrets map directly to env vars
  4. Override flexibility - Environment variables can be set at multiple levels (compose file, .env file, shell)

Docker Compose Example

Before (using command arguments):

  services:
    thor:
      image: vechain/thor:latest
      command: >
        --network main
        --config-dir /config
        --data-dir /data
        --api-addr 0.0.0.0:8669
        --enable-metrics

After (example using .env file):

.env

  THOR_NETWORK=main
  THOR_CONFIG_DIR=/config
  THOR_DATA_DIR=/data
  THOR_API_ADDR=0.0.0.0:8669
  THOR_ENABLE_METRICS=true

docker-compose.yml

  services:
    thor:
      image: vechain/thor:latest
      env_file:
        - .env

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • New and existing E2E tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have not added any vulnerable dependencies to my code

@darrenvechain darrenvechain requested a review from a team as a code owner January 6, 2026 15:07
@darrenvechain darrenvechain marked this pull request as draft January 6, 2026 15:07
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 12.12121% with 29 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/thor/utils.go 0.00% 16 Missing ⚠️
cmd/disco/main.go 0.00% 7 Missing ⚠️
cmd/thor/main.go 0.00% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants