Skip to content

Commit e36bbd0

Browse files
committed
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.
1 parent 9628774 commit e36bbd0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/me/kavin/piped/consts/Constants.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,9 @@ public class Constants {
166166
S3_CLIENT = null;
167167
}
168168
System.getenv().forEach((key, value) -> {
169-
if (key.startsWith("hibernate"))
170-
hibernateProperties.put(key, value);
169+
if (key.startsWith("HIBERNATE"))
170+
String k = key.replace("_", ".").toLowerCase();
171+
hibernateProperties.put(k, value);
171172
});
172173
MATRIX_SERVER = getProperty(prop, "MATRIX_SERVER", "https://matrix-client.matrix.org");
173174
MATRIX_TOKEN = getProperty(prop, "MATRIX_TOKEN");

0 commit comments

Comments
 (0)