# List of available override the application properties (like database settings) in EHRBase **Category:** [Platform](https://discourse.openehr.org/c/platform-implem/7) **Created:** 2021-05-28 07:44 UTC **Views:** 1710 **Replies:** 9 **URL:** https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580 --- ## Post #1 by @Dileep_V_S Hi, Is there a documentation on the list of application properties for EHRBase that we can override at startup time? Also is there an application.properties file that I can customize and use at runtime? regards --- ## Post #2 by @ian.mcnicoll application/src/main/resources/application.yml is the internal config file If you are using Docker you can set these various via the .env.ehrbase file in the root folder. This is mine SERVER_NODENAME=freshehr.ehrbase.org SECURITY_AUTHTYPE=BASIC SECURITY_AUTHUSER=ehrbase-user SECURITY_AUTHPASSWORD=SuperSecretPassword SECURITY_AUTHADMINUSER=ehrbase-admin SECURITY_AUTHADMINPASSWORD=SuperSecretAdminPassword SYSTEM_ALLOW_TEMPLATE_OVERWRITE=true ADMINAPI_ACTIVE=true ADMINAPI_ALLOWDELETEALL=true SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUERURI= MANAGEMENT_ENDPOINTS_WEB_EXPOSURE=env,health,info,metrics,prometheus MANAGEMENT_ENDPOINTS_WEB_BASEPATH=/status MANAGEMENT_ENDPOINT_ENV_ENABLED=false MANAGEMENT_ENDPOINT_HEALTH_ENABLED=false MANAGEMENT_ENDPOINT_HEALTH_DATASOURCE_ENABLED=false MANAGEMENT_ENDPOINT_INFO_ENABLED=false MANAGEMENT_ENDPOINT_METRICS_ENABLED=false MANAGEMENT_ENDPOINT_PROMETHEUS_ENABLED=false MANAGEMENT_ENDPOINT_HEALTH_PROBES_ENABLED=false --- ## Post #3 by @Dileep_V_S Thank Ian, regards --- ## Post #4 by @Dileep_V_S Where is the database configuration? they are not there in the application/src/main/resources/application.yml file. If we are copying and running the jar file on another server, where do we place the application.yml file? regards --- ## Post #5 by @jake.smolka Hey @Dileep_V_S! A little background info: Currently our documentation is at a level where we mostly don't document the things we didn't build ourselves yet. What I mean with that is that the setting of configuration attributes is completely handled by Spring Boot - the handling is nothing we explicitly implemented. But your post is a good reminder that we need to focus on the complete perspective soon. To answer your question: As @ian.mcnicoll pointed out, the configuration happens around the `application.yml` file. As per Spring Boot default there are some mechanisms implied here. First, there can be different profiles. You can see the `local`, `docker` etc. profile here https://github.com/ehrbase/ehrbase/tree/develop/application/src/main/resources Each one takes the `application.yml` as foundation and just overwrites what ever is set in the corresponding profile's `.yml` file. So you can take a look at the `.yml` files and see the available configurations. Database configuration depends a bit on the profile, so you'll see the the DB URI in the `local` profile. But you can overwrite them with the following. (Note: EHRbase print the used profile in the console output as on of the first lines.) Second, Spring Boot offers several ways to set the attributes. See our note here https://github.com/ehrbase/ehrbase/blob/develop/application/src/main/resources/application.yml#L18 Spring documents those ways and their priority order here: https://docs.spring.io/spring-boot/docs/2.5.0/reference/html/features.html#features.external-config In practice - and in short - this means: environment variables are overwriting `application.yml` settings. Together with paradigms like [The 12-Factor App](https://12factor.net/config) using environment variables to overwrite configuration settings is what I would recommend. And as @ian.mcnicoll said, this is what our proposed [docker setup](https://github.com/ehrbase/ehrbase/blob/develop/docker-compose.yml) is doing with its matching [`.env` file](https://github.com/ehrbase/ehrbase/blob/develop/.env.ehrbase). If you want to directly use the jar, you can set your environment variables, for instance, Linux command-line style: ``` bash SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:1234/ehrbase java -jar application-0.16.5.jar ``` (Or you can export them in a more ordered fashion. But this is OS related.) If you insist on not using environment variables: Another approach is to place an `application-local.yml` (depending on the used profile) file next to the `.jar` and just execute it normally (see the Spring documentation at "Config data files are considered in the following order:"). The file could only contain this: ``` yaml spring: datasource: url: jdbc:postgresql://localhost:1234/ehrbase ``` I hope that helps! --- ## Post #6 by @Dileep_V_S Thanks a lot. That helps😀 regards --- ## Post #7 by @Dileep_V_S @ian.mcnicoll @jake.smolka sample environment variable file has this list of management end points MANAGEMENT_ENDPOINTS_WEB_EXPOSURE=env,health,info,metrics,prometheus Are these the full list of available management endpoints that EHRBase supports? --- ## Post #8 by @birger.haarbrandt Hi Dileep, have you seen this part of the documentation, yet? https://ehrbase.readthedocs.io/en/latest/03_development/08_status_and_metrics/index.html This contains all management/operations endpoints. --- ## Post #9 by @Dileep_V_S Thanks @birger.haarbrandt . Sorry I missed that regards --- ## Post #10 by @Simon Really wish I'd found this a couple of hours ago, but a huge thanks none the less :slight_smile: --- **Canonical:** https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580 **Original content:** https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580