Skip to content

Load mirth.properties.d drop-in configuration overrides on startup - #405

Open
pacmano1 wants to merge 2 commits into
OpenIntegrationEngine:mainfrom
pacmano1:feat/mirth-properties-drop-in-dir
Open

Load mirth.properties.d drop-in configuration overrides on startup#405
pacmano1 wants to merge 2 commits into
OpenIntegrationEngine:mainfrom
pacmano1:feat/mirth-properties-drop-in-dir

Conversation

@pacmano1

@pacmano1 pacmano1 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Closes #50.

Files named *.properties under conf/mirth.properties.d are loaded on top of mirth.properties at startup, in lexical filename order, later files winning. The server never writes to the directory, so local configuration survives upgrades without hand-merging. This mirrors the existing vmoptions convention (base_includes.vmoptions -> custom.vmoptions).

All six mirth.properties readers apply the overlay: the launcher, the main server, the configuration controller, the WebStart servlet, extension statuses, and the Rhino optimization-level lookup in JavaScriptScopeUtil. The configuration controller keeps a separate file-backed config for version migration and password re-encryption, so those writes never bake drop-in values into mirth.properties.

Scope notes:

To verify: create conf/mirth.properties.d/10-test.properties containing http.port = 8199, start the server via oieserver, confirm the startup log reports the web server on port 8199 and that conf/mirth.properties is unchanged afterward.

Files named *.properties under conf/mirth.properties.d are applied on top
of mirth.properties in lexical filename order, later files winning. The
server never writes to the directory: migration and password re-encryption
operate on a separate file-backed configuration, so drop-in values are
never baked into mirth.properties.

Signed-off-by: Finnegan's Owner <44065187+pacmano1@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Test Results

682 tests   682 ✅  2m 11s ⏱️
115 suites    0 💤
115 files      0 ❌

Results for commit 3f9eea1.

♻️ This comment has been updated with latest results.

Replaces the README: the sample carries the documentation as comments and
is ignored by the loader until copied to a *.properties name. Also corrects
the mirth.properties header comment - the server does not rewrite this file
in normal operation; the drop-in directory exists for upgrade hygiene.

Signed-off-by: Finnegan's Owner <44065187+pacmano1@users.noreply.github.com>
@pacmano1

Copy link
Copy Markdown
Contributor Author

Design notes, so the reasoning doesn't live only in my head:

  • A drop-in directory over a special sibling file (custom.properties, local.properties): matches the conf.d/sysctl.d convention, scales past one file, and the name derives from the parent file. The vmoptions chain (base_includes -> custom.vmoptions) is the in-repo precedent for layered config.
  • The sample ships as mirth.properties.example so the loader ignores it; copy it to a *.properties name to activate.
  • The server does not modify mirth.properties in normal operation (verified across a boot: identical content). First boot only trims trailing whitespace on empty values, appends ;upgrade=true to the Derby URL, and generates keystore passwords. So the directory exists for upgrade hygiene: the installer preserves mirth.properties, and tar.gz upgrades can replace it wholesale without hand-merging.
  • Keystore gotcha, verified live on a fresh install: keystore.storepass/keystore.keypass auto-generate only when BOTH are still the shipped default. A drop-in overriding just one suppresses generation and the other stays at its published default. Pre-existing guard; the sample file documents it.
  • Drop-ins are parsed with java.util.Properties in every reader so the launcher-side and server-side worlds see identical semantics. ${...} references would interpolate only on the server side, so the sample avoids suggesting them.
  • log4j2 layering split to Investigate layered/drop-in configuration for log4j2.properties #404. Renaming the shipped defaults file (also floated in [IDEA] Allow multiple MC configuration files t be read on startup #50) belongs to the branding effort (Alter the build pipeline so that build artifacts are branded as "openintegrationengine" or "oie" instead of "mirth" #165/Standardize artifact naming to align with project branding #220).

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 multiple MC configuration files t be read on startup

1 participant