Skip to content

Conversation

@VillePekka
Copy link
Contributor

@VillePekka VillePekka commented Jan 19, 2026

Testing the functionality on Linux:

  1. In mirth-cli-config.properties file, define for example password as password=${env:OIE_PASSWORD}
  2. Define the environment variable in commandline export OIE_PASSWORD=<password>
  3. Run cli client ~/engine/server/setup$ java -jar mirth-cli-launcher.jar -c ../../command/conf/mirth-cli-config.properties

@VillePekka VillePekka marked this pull request as draft January 19, 2026 18:38
@pacmano1 pacmano1 requested a review from Copilot January 20, 2026 02:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds environment variable substitution support to the CLI client properties file by replacing the standard Java Properties class with Apache Commons Configuration2's Configuration interface. This allows users to specify property values like password=${env:OIE_PASSWORD} in the configuration file, which will be resolved from environment variables at runtime.

Changes:

  • Replaced Properties with Apache Commons Configuration2's Configuration for loading CLI configuration
  • Added new imports for Configuration2 classes
  • Modified configuration loading logic to use FileBasedConfigurationBuilder instead of direct file reading

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@VillePekka
Copy link
Contributor Author

Plan is to next test different scenarios with both correct and incorrect credentials:
*** Login with user and password given on the command line
*** Login with config file
**** with credentials directly in the file
**** with credentials as environment variables
**** with mistyped environment variable

@tonygermano tonygermano force-pushed the issue-205 branch 5 times, most recently from 2dc36ff to 4b8c71d Compare February 10, 2026 11:20
…variables in config file.

Signed-off-by: Ville Ranta-aho <ville@ville-pekka.com>
Signed-off-by: Tony Germano <tony@germano.name>
@tonygermano tonygermano marked this pull request as ready for review February 10, 2026 11:54
Copy link
Member

@tonygermano tonygermano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did the following:

  • squashed all commits
  • fixed whitespace issues
  • rebased onto main
  • removed some unnecessary imports
  • reverted copilot suggestion and initialized config to empty BaseConfiguration

I tested all of your scenarios mentioned in #242 (comment)

I also tested with no config file

  • no command line arguments (shows help)
  • setting -a -u and -p on the command line (logs in if everything is valid)
  • setting -a and -u, but not -p (shows help)

@tonygermano tonygermano linked an issue Feb 10, 2026 that may be closed by this pull request
@tonygermano tonygermano requested review from a team, NicoPiel, gibson9583, jonbartels, kayyagari, mgaffigan, pacmano1 and ssrowe and removed request for a team February 10, 2026 12:15
Copy link
Contributor

@mgaffigan mgaffigan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not test, but the changes look good.

@tonygermano tonygermano merged commit da0757e into OpenIntegrationEngine:main Feb 11, 2026
2 checks passed
@VillePekka
Copy link
Contributor Author

I did the following:

* squashed all commits

* fixed whitespace issues

* rebased onto main

* removed some unnecessary imports

* reverted copilot suggestion and initialized config to empty BaseConfiguration

I tested all of your scenarios mentioned in #242 (comment)

I also tested with no config file

* no command line arguments (shows help)

* setting -a -u and -p on the command line (logs in if everything is valid)

* setting -a and -u, but not -p (shows help)

Thank you @tonygermano !
Could you explain how you fixed whitespace issues, or give some pointer how to fix them in the future?
I tried with unix2dos command but that didn't seem to fix the issue.

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.

[IDEA] Allow env variable substitution in CLI client properties

5 participants