admin api set up

Hi everyone, I’m new to EHRbase and have been working on setting up version 0.16.5 on my local environment using Docker. I’ve successfully set up the EHRbase and PostgreSQL services using docker-compose, with the necessary environment variables for database connection and Admin API configuration. However, I’m encountering issues with the Admin API, error when trying to connect. Despite ensuring that the credentials match in both services and that the database is functioning correctly, I can’t get the Admin API to work as expected. I’ve followed the documentation closely but haven’t had any success. Could anyone guide me on the correct setup process or suggest what I might be missing? Your help would be greatly appreciated. Thanks in advance!services:
ehrbase:
image: ehrbase/ehrbase:0.16.5
environment:
SPRING_DATASOURCE_URL: “jdbc:postgresql://db:5432/ehrbase”
SPRING_DATASOURCE_USERNAME: ehrbase
SPRING_DATASOURCE_PASSWORD: ehrbase
SERVER_AQLCONFIG_USEJSQUERY: “false”
EHRBASE_WEBSERVICES_ADMIN_ENABLED: “true”
depends_on:
- db
ports:
- “8080:8080”

db:
image: postgres
volumes:
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ehrbase
POSTGRES_PASSWORD: ehrbase
POSTGRES_DB: ehrbase

volumes:
db-data:

1 Like

Hi Aashish,

can you clarify where you got the EHRBASE_WEBSERVICES_ADMIN_ENABLED and SERVER_AQLCONFIG_USEJSQUERY environment variables from?

Please see ehrbase/configuration/src/main/resources/application.yml at develop · ehrbase/ehrbase · GitHub for reference.

I would start with the very basic configuration described here and adjust iteratively to your liking: https://docs.ehrbase.org/docs/EHRbase/installation.

This means you could add the Admin API by adjusting the startup of EHRbase like this:

docker run --network ehrbase-net --name ehrbase \
-e DB_URL=jdbc:postgresql://ehrbase-postgres:5432/ehrbase \
-e DB_USER=ehrbase_restricted \
-e DB_PASS=ehrbase_restricted \
-e DB_USER_ADMIN=ehrbase \
-e DB_PASS_ADMIN=ehrbase \
-e SERVER_NODENAME=local.ehrbase.org \
-e ADMIN_API_ACTIVE=true \
-e SPRING_PROFILES_ACTIVE=local \
-d -p 8080:8080 \
ehrbase/ehrbase

(I did not have to time to verify it locally, but should be closer to what you need in any case)

1 Like

thanks birger ! it worked for me

1 Like