Browse Source

prefer env.HOME

tags/v0.17.0
Jonathan Cobb 4 years ago
parent
commit
308b0006d4
2 changed files with 12 additions and 1 deletions
  1. +1
    -0
      bin/jenkins/test-redis
  2. +11
    -1
      bubble-server/src/main/java/bubble/ApiConstants.java

+ 1
- 0
bin/jenkins/test-redis View File

@@ -67,6 +67,7 @@ fi

case ${1} in
"start")
stop_redis
start_redis
echo "Redis successfully started"
;;


+ 11
- 1
bubble-server/src/main/java/bubble/ApiConstants.java View File

@@ -76,7 +76,17 @@ public class ApiConstants {
public static final GoogleAuthenticator G_AUTH = new GoogleAuthenticator();

public static final Predicate ALWAYS_TRUE = m -> true;
public static final String HOME_DIR = System.getProperty("user.home");
public static final String HOME_DIR;
static {
final String userHome = System.getProperty("user.home");
final String envHome = System.getenv("HOME");
if (!userHome.equals(envHome)) {
log.warn("System.getProperty(\"user.home\") == "+userHome+" differs from System.getenv(\"HOME\") == "+envHome+", using HOME from environment: "+envHome);
HOME_DIR = envHome;
} else {
HOME_DIR = userHome;
}
}

public static final File CACERTS_DIR = new File(HOME_DIR, "cacerts");
public static final File MITMPROXY_CERT_DIR = new File(HOME_DIR, "mitm_certs");


Loading…
Cancel
Save