From 320e40c2f09e27cf7f79930b026f7856e539f7e1 Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Wed, 28 Jun 2023 11:51:48 +0200 Subject: [PATCH] Docs - configuration reference - environment variables - turn the notes into regular paragpraphs - extract the description of limitations for dynamic lookup into a CAUTION admonition --- docs/src/main/asciidoc/config-reference.adoc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/src/main/asciidoc/config-reference.adoc b/docs/src/main/asciidoc/config-reference.adoc index 2952acf14aa1c..41664ad7df60f 100644 --- a/docs/src/main/asciidoc/config-reference.adoc +++ b/docs/src/main/asciidoc/config-reference.adoc @@ -58,21 +58,15 @@ the value `youshallnotpass` to the attribute `quarkus.datasource.password`. * For a runner jar: `export QUARKUS_DATASOURCE_PASSWORD=youshallnotpass ; java -jar target/quarkus-app/quarkus-run.jar` * For a native executable: `export QUARKUS_DATASOURCE_PASSWORD=youshallnotpass ; ./target/myapp-runner` -[NOTE] -==== Environment variables names follow the conversion rules specified by link:https://github.com/eclipse/microprofile-config/blob/master/spec/src/main/asciidoc/configsources.asciidoc#default-configsources[MicroProfile Config]. - Config searches three environment variables for a given property name (e.g. `foo.BAR.baz`): - `foo.BAR.baz` - Exact match - `foo_BAR_baz` - Replace each character that is neither alphanumeric nor `\_` with `_` - `FOO_BAR_BAZ` - Replace each character that is neither alphanumeric nor `\_` with `_`; then convert the name to upper case -==== -[NOTE] -==== SmallRye Config specifies link:https://smallrye.io/smallrye-config/Main/config/environment-variables/[additional conversion rules]. - A property with double quotes `foo."bar".baz`, replace each character that is neither alphanumeric @@ -82,6 +76,8 @@ nor `\_` with `_`: `FOO_BAR_BAZ` - An indexed property `foo.bar[0]` or `foo.bar[0].baz`, replace each character that is neither alphanumeric nor `\_` with `_`: `FOO_BAR_0_` or `FOO_BAR_0__BAZ` +[CAUTION] +==== In some situations, looking up the exact property name is impossible. For instance, when looking up a configuration that is part of a `Map`, and the property name contains a dynamic segment (the `Map` key). In this case, Quarkus relies upon each source’s list of property names. These must be converted back to their most likely @@ -95,6 +91,7 @@ To correctly lookup `Map` properties where `FOO_BAR_BAZ` is the property name an `foo.bar-baz` in a source with an ordinal lower than the EnvConfigSource (`300`). ==== + [[env-file]] === `.env` file in the current working directory