Allow for valid hibernate environment variables

*nix systems can't have periods in their environment variable names, so we instead look for `HIBERNATE` prefixes, then lowercase and translate underscores to periods. This will allow for better compatibility with *nix systems when configuring likely sensitive hibernate values.
This commit is contained in:
Gabriel Simmer 2024-07-06 23:59:30 +01:00 committed by Gabriel Simmer
parent 96287745bd
commit e36bbd0445
No known key found for this signature in database

View File

@ -166,8 +166,9 @@ public class Constants {
S3_CLIENT = null;
}
System.getenv().forEach((key, value) -> {
if (key.startsWith("hibernate"))
hibernateProperties.put(key, value);
if (key.startsWith("HIBERNATE"))
String k = key.replace("_", ".").toLowerCase();
hibernateProperties.put(k, value);
});
MATRIX_SERVER = getProperty(prop, "MATRIX_SERVER", "https://matrix-client.matrix.org");
MATRIX_TOKEN = getProperty(prop, "MATRIX_TOKEN");