openwallet-foundation-labs / credhub

a cloud wallet for natural persons + minimal issuer and verifier implementations
https://credhub.eu
Apache License 2.0
8 stars 6 forks source link

Getting started #55

Open Echsecutor opened 6 months ago

Echsecutor commented 6 months ago

I would appreciate a brief getting started paragraph in the README or from running docker linked therein.

A simple minded

git clone git@github.com:openwallet-foundation-labs/credhub.git
cd credhub
cp .env.example .env
docker compose up

does download the images and start the containers, but I am getting a few errors among which at least those look critical:

verifier-backend-1   | node:fs:1369
verifier-backend-1   |   path = getValidatedPath(path);
verifier-backend-1   |          ^
verifier-backend-1   | 
verifier-backend-1   | TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
verifier-backend-1   |     at mkdirSync (node:fs:1369:10)
verifier-backend-1   |     at FileSystemKeyService.getKeys (/home/node/app/main.js:796:37)
verifier-backend-1   |     at FileSystemKeyService.init (/home/node/app/main.js:783:54)
verifier-backend-1   |     at FileSystemKeyService.onModuleInit (/home/node/app/main.js:777:20)
...
verifier-backend-1 exited with code 1

and

verifier-backend-1   | /home/node/app/node_modules/.pnpm/@nestjs+config@3.2.2_@nestjs+common@10.3.8_rxjs@7.8.1/node_modules/@nestjs/config/dist/config.module.js:86
verifier-backend-1   |                 throw new Error(`Config validation error: ${error.message}`);
verifier-backend-1   |                 ^
verifier-backend-1   | 
verifier-backend-1   | Error: Config validation error: "CREDENTIALS_FOLDER" is required
verifier-backend-1   |     at ConfigModule.forRoot (/home/node/app/node_modules/.pnpm/@nestjs+config@3.2.2_@nestjs+common@10.3.8_rxjs@7.8.1/node_modules/@nestjs/config/dist/config.module.js:86:23)
...
verifier-backend-1 exited with code 1

and

...
holder-backend-1     | [Nest] 9  - 06/03/2024, 8:24:23 PM   ERROR [TypeOrmModule] Unable to connect to the database. Retrying (8)...
holder-backend-1     | AggregateError [ECONNREFUSED]: 
holder-backend-1     |     at internalConnectMultiple (node:net:1117:18)
holder-backend-1     |     at afterConnectMultiple (node:net:1684:7)
holder-backend-1     | [Nest] 9  - 06/03/2024, 8:24:26 PM   ERROR [TypeOrmModule] Unable to connect to the database. Retrying (9)...
holder-backend-1     | AggregateError [ECONNREFUSED]: 
holder-backend-1     |     at internalConnectMultiple (node:net:1117:18)
holder-backend-1     |     at afterConnectMultiple (node:net:1684:7)
holder-backend-1     | [Nest] 9  - 06/03/2024, 8:24:26 PM   ERROR [ExceptionHandler] 
holder-backend-1     | AggregateError [ECONNREFUSED]: 
holder-backend-1     |     at internalConnectMultiple (node:net:1117:18)
holder-backend-1     |     at afterConnectMultiple (node:net:1684:7)
holder-backend-1 exited with code 1
cre8 commented 5 months ago

Yeah, we need to update the description to make it more clear.

Speaking of deployment, do you think we need to provide other approaches that using docker compose to start it?

cre8 commented 5 months ago

@Echsecutor I was not able yet to provide a full local docker deployment. Main reason for this is the keycloak deployment:

The frontend will receive the jwk where the iss value is set to localhost:8080. When this value is send to the backend, the backend needs to get the public key. The docker containers are all deployed in the same network, so the endpoint to keycloak would be keycloak:8080. And now the validation in the oidc-client sdk will vail since to it the iss value does not match with the known realm url....

cre8 commented 5 months ago

@Echsecutor the deploys are now split up into separate files, allowing to start what you actually need, see https://github.com/openwallet-foundation-labs/credhub/tree/main/deploys

The keycloak problem was solved by using host.docker.internal which worked fine under Windows for the localhost alternative and according to the docs it should work for MacOS too. For Linux seems to exists a workaround, but I haven't tried it yet