minor
#29385
App archetype should scaffold a standard git-ignored local-credentials overlay (tl_config) by default
Request
The application Maven archetype (tl-archetype-app) should generate, for every new application, a standard, leak-free mechanism for supplying developer-local secrets (Trac XML-RPC credentials, DB passwords, external API tokens, ...) that must not be committed and that survives app restarts without manual per-start setup.
Motivation
Apps regularly need secrets injected via aliases, e.g.:
<alias>
<entry name="%TRAC_PASSWORD%" value="${env:TRAC_PASSWORD:}"/>
</alias>
With only the ${env:...} default, the value is empty unless an environment variable is present in the launching process. That is fragile:
- A skill/CI/tool-launched shell is typically non-interactive and does not source the user's shell profile, so an "export in .bashrc" style env file is not picked up.
- Passing the secret as a -Dkey=value JVM/Maven argument leaks it into the process command line (visible via ps).
There is no out-of-the-box, documented pattern, so every app re-invents (or omits) this and developers hit avoidable HTTP 401 / empty-credential failures.
Proven pattern (please make it the archetype default)
TopLogic already supports a config overlay via XMLProperties.Setting.CONFIG_FILE (the tl_config system/JNDI property). MultiProperties.pushSystemProperty loads the named file last (so its alias entries override the base config) and ignores it silently when absent ("Configuration '...' not found, will be ignored!"), so a fresh checkout still boots. The property value is only a path, never the secret.
Wiring that worked well in an app:
- .mvn/jvm.config (committed): -Dtl_config=local.conf.xml - a non-secret path pointer, auto-read by Maven on every invocation.
- local.conf.xml (git-ignored): the actual overlay with literal alias values, e.g.
<root>
<alias>
<entry name="%TRAC_USER%" value="..."/>
<entry name="%TRAC_PASSWORD%" value="..."/>
</alias>
</root>
- local.conf.xml.template (committed): documents the file for other checkouts.
- .gitignore: ignores the real local.conf.xml.
- Eclipse start launch: same property as an absolute path, -Dtl_config="${workspace_loc:<project>}/local.conf.xml", so it resolves independently of the launch working directory.
Both launch paths (Maven exec:java and the Eclipse com.top_logic.ide.jetty.Bootstrap launch) then read the same single git-ignored file.
Suggested scope
- Archetype generates items 1, 3, 4 above and the Eclipse start launch VM arg (item 5) by default; item 2 is created by the developer from the template.
- Consider a short section in the generated README documenting the mechanism.
- The concrete alias names are app-specific; the archetype should ship an empty/example overlay, not any real alias.
Filed as a follow-up to setting this up by hand in an application.