Skip to content

Commit

Permalink
Global: make project title configurable via environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
lpandath committed Jan 20, 2025
1 parent b92ee6e commit 99c76fa
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ services:
interval: 30s
timeout: 15s
retries: 5
environment:
DAMAP_TITLE: "DAMAP Tool"

damap-fe:
# Since DAMAP containers are publicly available on Github packages one can
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/damap/base/rest/ConfigResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public class ConfigResource {
@ConfigProperty(name = "damap.gotenberg-url")
Optional<URL> gotenbergUrl;

@ConfigProperty(name = "damap.title", defaultValue = "DAMAP Tool")
String appTitle;

/**
* config.
*
Expand All @@ -55,6 +58,7 @@ public ConfigDO config() {
configDO.setAuthScope(authScope);
configDO.setAuthUser(authUser);
configDO.setEnv(env);
configDO.setAppTitle(appTitle);
configDO.setPersonSearchServiceConfigs(personServiceConfigurations.getConfigs());
configDO.setFitsServiceAvailable(getFitsServiceAvailability());
configDO.setLivePreviewAvailable(getGotenbergServiceAvailability());
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/org/damap/base/rest/config/domain/ConfigDO.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,13 @@ public class ConfigDO {
private List<ServiceConfig> personSearchServiceConfigs;
private boolean fitsServiceAvailable;
private boolean livePreviewAvailable;
private String appTitle;

public void setAppTitle(String appTitle) {
this.appTitle = appTitle;
}

public String getAppTitle() {
return appTitle;
}
}
3 changes: 3 additions & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# custom config settings
# replace these in the config of your custom project or by overriding these variables
damap:
title: ${DAMAP_TITLE:DAMAP Tool}
env: DEV # override in your custom project with PROD for production deployment
origins: http://localhost:8085 # https://your.frontend.com,https://*.yourdomain.com
auth:
Expand Down Expand Up @@ -99,6 +100,7 @@ rest:

"%dev":
damap:
title: "DAMAP (Development)"
origins: http://localhost:4200
auth:
backend:
Expand Down Expand Up @@ -128,6 +130,7 @@ rest:

"%test":
damap:
title: "DAMAP (Testing)"
repositories:
recommendation: ['r3d100010468'] # Re3Data id(s)
quarkus:
Expand Down

0 comments on commit 99c76fa

Please sign in to comment.