Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
waltkb committed Dec 8, 2023
2 parents 540c5da + ebf80a2 commit e57d0c5
Show file tree
Hide file tree
Showing 18 changed files with 272 additions and 130 deletions.
7 changes: 4 additions & 3 deletions docker-compose/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
WALLETKIT_PORT=7000
WALLET_FRONTEND_PORT=3000
WALLET_BACKEND_PORT=4545
WEB_PORTAL_PORT=4000
VC_REPO_PORT=5000
ISSUER_PORT=8000
VERIFIER_PORT=9000
WALLET_BACKEND_PORT=4545
WALLET_FRONTEND_PORT=3000
HOSTNAME=host.docker.internal
52 changes: 32 additions & 20 deletions docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
services:
walletkit:
image: waltid/walletkit:latest # backend docker image
command:
- run
environment:
WALTID_DATA_ROOT: /waltid-walletkit/data-root
WALTID_WALLET_BACKEND_BIND_ADDRESS: 0.0.0.0
WALTID_WALLET_BACKEND_PORT: "$WALLETKIT_PORT"
EXTERNAL_HOSTNAME: $HOSTNAME
volumes:
- ./walletkit:/waltid-walletkit/data-root # data store volume incl. config files.
extra_hosts:
- "$HOSTNAME:host-gateway"
# postgresdb: # Uncomment to connect a Postgres DB
# image: postgres
# environment:
# POSTGRES_PASSWORD: secret
wallet-backend:
image: waltid/wallet-backend:latest
volumes:
Expand All @@ -20,24 +11,45 @@ services:
wallet-frontend:
image: waltid/wallet-frontend:latest
environment:
NUXT_PUBLIC_ISSUER_URL: "http://localhost:$ISSUER_PORT"
issuer-portal:
image: waltid/ssikit-issuer-portal:latest
verifier-portal:
image: waltid/ssikit-verifier-portal:latest
NUXT_PUBLIC_ISSUER_CALLBACK_URL: "http://localhost:$WALLET_FRONTEND_PORT"
issuer:
image: waltid/issuer:latest
volumes:
- ./issuer/config:/waltid-issuer/config
verifier:
image: waltid/verifier:latest
volumes:
- ./verifier/config:/waltid-verifier/config
web-portal:
image: waltid/portal:latest
environment:
NEXT_PUBLIC_VC_REPO: "http://localhost:$VC_REPO_PORT"
NEXT_PUBLIC_ISSUER: "http://localhost:$ISSUER_PORT"
NEXT_PUBLIC_VERIFIER: "http://localhost:$VERIFIER_PORT"
NEXT_PUBLIC_WALLET: "http://localhost:$WALLET_FRONTEND_PORT"
vc-repo:
image: waltid/vc-repository:latest
ingress:
image: nginx:1.15.10-alpine
ports:
- target: $WALLET_FRONTEND_PORT
published: $WALLET_FRONTEND_PORT # wallet-frontend
protocol: tcp
mode: host
- target: $WEB_PORTAL_PORT
published: $WEB_PORTAL_PORT # web-portal
protocol: tcp
mode: host
- target: $VC_REPO_PORT
published: $VC_REPO_PORT # vc-repo
protocol: tcp
mode: host
- target: $ISSUER_PORT
published: $ISSUER_PORT # issuer-portal
published: $ISSUER_PORT # issuer-api
protocol: tcp
mode: host
- target: $VERIFIER_PORT
published: $VERIFIER_PORT # verifier-portal
published: $VERIFIER_PORT # verifier-api
protocol: tcp
mode: host
volumes:
Expand Down
36 changes: 22 additions & 14 deletions docker-compose/ingress.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,49 @@ server {
# wallet-backend
server {
listen 4545;
location ~* /(api|webjars|verifier-api|issuer-api)/ {
proxy_pass http://walletkit:7000;

location / {
proxy_pass http://wallet-backend:4545;
proxy_redirect default;
}
}

# web-portal
server {
listen 4000;

location / {
proxy_pass http://wallet-backend;
proxy_pass http://web-portal:3000;
proxy_redirect default;
}
}

# issuer-portal
# vc-repo
server {
listen 8000;
location ~* /(api|webjars|verifier-api|issuer-api)/ {
proxy_pass http://walletkit:7000;
listen 5000;

location / {
proxy_pass http://vc-repo:3000;
proxy_redirect default;
}
}

# issuer
server {
listen 8000;

location / {
proxy_pass http://issuer-portal;
proxy_pass http://issuer:3000;
proxy_redirect default;
}
}

# verifier-portal
# verifier
server {
listen 9000;
location ~* /(api|webjars|verifier-api|issuer-api)/ {
proxy_pass http://walletkit:7000;
proxy_redirect default;
}

location / {
proxy_pass http://verifier-portal;
proxy_pass http://verifier:3000;
proxy_redirect default;
}
}
1 change: 1 addition & 0 deletions docker-compose/issuer/config/issuer-service.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
baseUrl = "localhost:8000"
2 changes: 2 additions & 0 deletions docker-compose/issuer/config/web.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
webHost = "0.0.0.0"
webPort = 3000
14 changes: 8 additions & 6 deletions docker-compose/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@ run a complete credential flow:
## Services

The complete list of services and their port mapping is following:
- walletkit: `7000`
- web-wallet-backend: `4545`
- web-wallet-frontend: `3000` (published)
- issuer-portal: `8000` (published)
- verifier-portal: `9000` (published)
- web-wallet-frontend: `3000`
- web-wallet-backend: `4545` (not published)
- web-portal: `4000`
- vc-repo: `5000`
- issuer: `8000`
- verifier: `9000`

## Configurations

Config locations:

- web-wallet: `wallet-backend/config`
- walletkit: `walletkit/config`
- issuer: `issuer/config`
- verifier: `verifier/config`
- ingress: `ingress.conf`
- environment: `.env`

Expand Down
1 change: 1 addition & 0 deletions docker-compose/verifier/config/verifier-service.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
baseUrl = "localhost:9000"
2 changes: 2 additions & 0 deletions docker-compose/verifier/config/web.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
webHost = "0.0.0.0"
webPort = 3000
1 change: 1 addition & 0 deletions docker-compose/wallet-backend/config/db.conf
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# database = "db.postgres"
database = "db.sqlite"
13 changes: 13 additions & 0 deletions docker-compose/wallet-backend/config/db.postgres.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
hikariDataSource {
jdbcUrl = "jdbc:postgresql://postgresdb:5432/postgres"
driverClassName = "org.postgresql.Driver"
username = "postgres"
password = "secret"
transactionIsolation = "TRANSACTION_SERIALIZABLE"
maximumPoolSize = 5
autoCommit = false
dataSource {
journalMode = WAL
fullColumnNames = false
}
}
25 changes: 0 additions & 25 deletions docker-compose/walletkit/config/issuer-config.json

This file was deleted.

13 changes: 0 additions & 13 deletions docker-compose/walletkit/config/verifier-config.json

This file was deleted.

11 changes: 0 additions & 11 deletions docker-compose/walletkit/config/wallet-config.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,40 @@
-- ----------------------------------
CREATE TABLE IF NOT EXISTS "emails"
(
id uuid NOT NULL,
email text COLLATE pg_catalog."default" NOT NULL,
password text COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT "emails_pkey" PRIMARY KEY (id),
CONSTRAINT email UNIQUE (email)
"id" UUID NOT NULL,
"email" TEXT COLLATE pg_catalog."default" NOT NULL,
"password" TEXT COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT "emails_pkey" PRIMARY KEY ("id"),
CONSTRAINT "email" UNIQUE ("email")
);
-- ----------------------------------
-- Wallets table
-- ----------------------------------
CREATE TABLE IF NOT EXISTS "wallets"
(
id uuid NOT NULL,
address text COLLATE pg_catalog."default" NOT NULL,
ecosystem text COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT wallets_pkey PRIMARY KEY (id),
CONSTRAINT address UNIQUE (address)
"id" UUID NOT NULL,
"address" TEXT COLLATE pg_catalog."default" NOT NULL,
"ecosystem" TEXT COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT "wallets_pkey" PRIMARY KEY ("id"),
CONSTRAINT "address" UNIQUE ("address")
);
-- ----------------------------------
-- Accounts table
-- ----------------------------------
CREATE TABLE IF NOT EXISTS "accounts"
(
id uuid NOT NULL,
email uuid NULL,
wallet uuid NULL,
CONSTRAINT accounts_pkey PRIMARY KEY (id),
CONSTRAINT accounts_email_wallet_unique UNIQUE (email, wallet)
INCLUDE(email, wallet),
CONSTRAINT account_email_fk FOREIGN KEY (email)
REFERENCES public.emails (id) MATCH SIMPLE
"id" UUID NOT NULL,
"email" UUID NULL,
"wallet" UUID NULL,
CONSTRAINT "accounts_pkey" PRIMARY KEY ("id"),
CONSTRAINT "accounts_email_wallet_unique" UNIQUE ("email", "wallet")
INCLUDE("email", "wallet"),
CONSTRAINT "account_email_fk" FOREIGN KEY ("email")
REFERENCES "emails" ("id") MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT account_wallet_fk FOREIGN KEY (wallet)
REFERENCES public.wallets (id) MATCH SIMPLE
CONSTRAINT "account_wallet_fk" FOREIGN KEY ("wallet")
REFERENCES "wallets" ("id") MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE
);
Expand All @@ -45,16 +45,16 @@ CREATE TABLE IF NOT EXISTS "accounts"
-- ----------------------------------
CREATE TABLE IF NOT EXISTS "account_wallets"
(
id uuid NOT NULL,
account uuid NOT NULL,
wallet uuid NOT NULL,
CONSTRAINT account_wallets_pkey PRIMARY KEY (id),
CONSTRAINT account_wallets_account_fk FOREIGN KEY (account)
REFERENCES "accounts" (id) MATCH SIMPLE
"id" UUID NOT NULL,
"account" UUID NOT NULL,
"wallet" UUID NOT NULL,
CONSTRAINT "account_wallets_pkey" PRIMARY KEY ("id"),
CONSTRAINT "account_wallets_account_fk" FOREIGN KEY ("account")
REFERENCES "accounts" ("id") MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT account_wallets_wallet_fk FOREIGN KEY (wallet)
REFERENCES "wallets" (id) MATCH SIMPLE
CONSTRAINT "account_wallets_wallet_fk" FOREIGN KEY ("wallet")
REFERENCES "wallets" ("id") MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE
);
Expand All @@ -63,14 +63,14 @@ CREATE TABLE IF NOT EXISTS "account_wallets"
-- ----------------------------------
CREATE TABLE IF NOT EXISTS "wallet_operation_histories"
(
id uuid NOT NULL,
account uuid NOT NULL,
"timestamp" text COLLATE pg_catalog."default" NOT NULL,
operation text COLLATE pg_catalog."default" NOT NULL,
data text COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT wallet_operation_histories_pkey PRIMARY KEY (id),
CONSTRAINT wallet_operation_histories_account_fk FOREIGN KEY (account)
REFERENCES "accounts" (id) MATCH SIMPLE
"id" UUID NOT NULL,
"account" UUID NOT NULL,
"timestamp" TEXT COLLATE pg_catalog."default" NOT NULL,
"operation" TEXT COLLATE pg_catalog."default" NOT NULL,
"data" TEXT COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT "wallet_operation_histories_pkey" PRIMARY KEY ("id"),
CONSTRAINT "wallet_operation_histories_account_fk" FOREIGN KEY ("account")
REFERENCES "accounts" ("id") MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE
);
Loading

0 comments on commit e57d0c5

Please sign in to comment.