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 GitHub
parent f378f43e94
commit 3691349d8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -164,8 +164,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");