Skip to content

Commit

Permalink
Add environment variable for manually specifying file storage in back…
Browse files Browse the repository at this point in the history
…end (#1383) (#1384)
  • Loading branch information
dominikriemer authored Mar 5, 2023
1 parent 3b7c207 commit ae234ae
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public enum Envs {
SP_HOST("SP_HOST"),
SP_PORT("SP_PORT"),

SP_CORE_ASSET_BASE_DIR("SP_CORE_ASSET_BASE_DIR"),

@Deprecated(since = "0.90.0", forRemoval = true)
SP_CONSUL_LOCATION("CONSUL_LOCATION",
DefaultEnvValues.CONSUL_HOST_DEFAULT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ public StringEnvironmentVariable getInitialAdminPassword() {
return new StringEnvironmentVariable(Envs.SP_INITIAL_ADMIN_PASSWORD);
}

@Override
public StringEnvironmentVariable getCoreAssetBaseDir() {
return new StringEnvironmentVariable(Envs.SP_CORE_ASSET_BASE_DIR);
}

@Override
public StringEnvironmentVariable getConsulLocation() {
return new StringEnvironmentVariable(Envs.SP_CONSUL_LOCATION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,6 @@ public interface Environment {
StringEnvironmentVariable getInitialAdminEmail();

StringEnvironmentVariable getInitialAdminPassword();

StringEnvironmentVariable getCoreAssetBaseDir();
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,17 @@ private String makeFileLocation() {
}

private String makeStreamPipesHomeLocation() {
return System.getProperty("user.home")
+ File.separator
+ ".streampipes"
+ File.separator;
var userDefinedAssetDir = getEnvironment().getCoreAssetBaseDir();
var assetDirAppendix = getSpAssetDirAppendix();
if (userDefinedAssetDir.exists()) {
return userDefinedAssetDir.getValue() + assetDirAppendix;
} else {
return System.getProperty("user.home") + assetDirAppendix;
}
}

private String getSpAssetDirAppendix() {
return File.separator + ".streampipes" + File.separator;
}

public String getJmsHost() {
Expand Down

0 comments on commit ae234ae

Please sign in to comment.