Managing variables in LuCLI's lucee.json

Looking for some feedback on some decisions I am making with the next release of LuCLI. Hopefully I can provide enough context!

LuCLI defines server configuration in a lucee.json, you can do a lot of confguration and also do some variable replacements.

The problem now is that variables get replaced at different times and by different engines, for example:

(current implementation)

{
  "jvm" : {
    "maxMemory" : "${JVM_MAX_MEM}",
    "minMemory" : "128m",
    "additionalArgs" : [ ]
  },
...
  "admin" : {
    "enabled" : true,
    "password" : "${secret:admin_password}"
  }
}

In the snippet above, there are two variables:

  1. ${JVM_MAX_MEM} which be written to setnenv.sh and replaced by environment variables at runtime, so you can define how much memory a specific server needs
  2. ${secret:admin_password} which will be resolved from the local secret manager on startup and written to an ENV Variable so lucee can read it.

So basically 1. gets written as is and looks like:

BASE_CATALINA_OPTS="-Xms128m -Xmx${JVM_MAX_MEM}"

But the ${secret:admin_password} gets turned into the actual value and set in mempry.

I think this can cause confusion, so I am thinking of using a different format:

(proposed implementation)

{
  "jvm" : {
    "maxMemory" : "${JVM_MAX_MEM}",
    "minMemory" : "128m",
    "additionalArgs" : [ ]
  },
...
  "admin" : {
    "enabled" : true,
    "password" : "#secret:admin_password#"
  }
}

To use # so that it looks completley different (could have been moustache {{ }}) but hey, I like me some # , so below, we would read the env variable JVM_MAX_MEMORY and write it directly.

{
  "port": "#HTTP_PORT#",
  "version": "#LUCEE_VERSION#",
  "jvm": {
    "maxMemory": "#JVM_MAX_MEMORY#"
  }
}

In the above example the port would be actually writen to the file (rather than the variable) so for example JVM_MAX_MEMORY=1g would end up being:

BASE_CATALINA_OPTS="-Xms128m -Xmx1g"

Default values if ``VARIABLE_NAME` is missing are also handed:

#VARIABLE_NAME:-default_value#
And secrets from secrets managers can be replaced.
"password" : "#secret:admin_password#"

Does this make sense?