# List of available override the application properties (like database settings) in EHRBase

**URL:** <https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580>\
**Category:** Platform\
**Tags:** ehrbase\
**Created:** [28 May 2021 07:44 UTC](https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580 "2021-05-28T07:44:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dileep\_V\_S](https://discourse.openehr.org/user_avatar/discourse.openehr.org/dileep_v_s/32/664_2.png) [@Dileep\_V\_S](https://discourse.openehr.org/u/Dileep_V_S)\
**Post date:** [28 May 2021 07:44 UTC](https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580/1 "2021-05-28T07:44:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ian.mcnicoll](https://discourse.openehr.org/user_avatar/discourse.openehr.org/ian.mcnicoll/32/4430_2.png) [@ian.mcnicoll](https://discourse.openehr.org/u/ian.mcnicoll)\
**Post date:** [28 May 2021 08:01 UTC](https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580/2 "2021-05-28T08:01:07Z")

</div>

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](http://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

---

<div class="post-metadata">

**Author:** ![Dileep\_V\_S](https://discourse.openehr.org/user_avatar/discourse.openehr.org/dileep_v_s/32/664_2.png) [@Dileep\_V\_S](https://discourse.openehr.org/u/Dileep_V_S)\
**Post date:** [28 May 2021 09:01 UTC](https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580/3 "2021-05-28T09:01:06Z")

</div>

Thank Ian,

regards

---

<div class="post-metadata">

**Author:** ![Dileep\_V\_S](https://discourse.openehr.org/user_avatar/discourse.openehr.org/dileep_v_s/32/664_2.png) [@Dileep\_V\_S](https://discourse.openehr.org/u/Dileep_V_S)\
**Post date:** [28 May 2021 09:18 UTC](https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580/4 "2021-05-28T09:18:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jake.smolka](https://discourse.openehr.org/user_avatar/discourse.openehr.org/jake.smolka/32/2870_2.png) [@jake.smolka](https://discourse.openehr.org/u/jake.smolka)\
**Post date:** [28 May 2021 10:34 UTC](https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580/5 "2021-05-28T10:34:46Z")

</div>

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 [ehrbase/application/src/main/resources at develop · ehrbase/ehrbase · GitHub](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 [ehrbase/application.yml at develop · ehrbase/ehrbase · GitHub](https://github.com/ehrbase/ehrbase/blob/develop/application/src/main/resources/application.yml#L18)  
Spring documents those ways and their priority order here: [Spring Boot Features](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:

```auto
spring:
  datasource:
    url: jdbc:postgresql://localhost:1234/ehrbase

```

I hope that helps!

---

<div class="post-metadata">

**Author:** ![Dileep\_V\_S](https://discourse.openehr.org/user_avatar/discourse.openehr.org/dileep_v_s/32/664_2.png) [@Dileep\_V\_S](https://discourse.openehr.org/u/Dileep_V_S)\
**Post date:** [28 May 2021 11:16 UTC](https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580/6 "2021-05-28T11:16:38Z")

</div>

Thanks a lot. That helps😀  
regards

---

<div class="post-metadata">

**Author:** ![Dileep\_V\_S](https://discourse.openehr.org/user_avatar/discourse.openehr.org/dileep_v_s/32/664_2.png) [@Dileep\_V\_S](https://discourse.openehr.org/u/Dileep_V_S)\
**Post date:** [5 June 2021 06:59 UTC](https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580/7 "2021-06-05T06:59:02Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![birger.haarbrandt](https://discourse.openehr.org/user_avatar/discourse.openehr.org/birger.haarbrandt/32/24_2.png) [@birger.haarbrandt](https://discourse.openehr.org/u/birger.haarbrandt)\
**Post date:** [5 June 2021 07:45 UTC](https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580/8 "2021-06-05T07:45:44Z")

</div>

Hi Dileep,

have you seen this part of the documentation, yet? [3.8. Status and Metrics — EHRbase documentation](https://ehrbase.readthedocs.io/en/latest/03_development/08_status_and_metrics/index.html)

This contains all management/operations endpoints.

---

<div class="post-metadata">

**Author:** ![Dileep\_V\_S](https://discourse.openehr.org/user_avatar/discourse.openehr.org/dileep_v_s/32/664_2.png) [@Dileep\_V\_S](https://discourse.openehr.org/u/Dileep_V_S)\
**Post date:** [5 June 2021 08:27 UTC](https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580/9 "2021-06-05T08:27:17Z")

</div>

Thanks @birger.haarbrandt . Sorry I missed that  
regards

---

<div class="post-metadata">

**Author:** ![Simon](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/s/f07891/32.png) [@Simon](https://discourse.openehr.org/u/Simon)\
**Post date:** [2 May 2023 20:11 UTC](https://discourse.openehr.org/t/list-of-available-override-the-application-properties-like-database-settings-in-ehrbase/1580/10 "2023-05-02T20:11:15Z")

</div>

Really wish I’d found this a couple of hours ago, but a huge thanks none the less 🙂
