Docker based setup of wwWallet to run on SUNET's infrastructure.
- Git
- Docker and Docker Compose installed
- If deploying to prod:
- a publicly accessible vm with 3 domains pointed to it for the Wallet, Issuer and Verifier services
- ports
80
and443
open
Besides cloining the repo, this is what you need to do:
After cd'ing into the directory you cloned this project to, run bash pull-latest.sh
to pull the wwWallet repos into apps/
.
Note
You might get an error when the script attempts to fetch the submodules of the wallet-ecosystem
project, this is due to
how that repo has configured it's submodules. As a temporary fix, edit apps/wallet-ecosystem/.git/config
like so:
// ...
[submodule "wallet-backend-server"]
- url = [email protected]:wwwallet/wallet-backend-server.git
+ url = https://github.com/wwwallet/wallet-backend-server.git
[submodule "wallet-enterprise"]
- url = [email protected]:wwwallet/wallet-enterprise.git
+ url = https://github.com/wwwallet/wallet-enterprise.git
[submodule "wallet-frontend"]
- url = [email protected]:wwwallet/wallet-frontend.git
+ url = https://github.com/wwwallet/wallet-frontend.git
After this, you need to run bash pull-latest.sh
again to fetch the submodules.
Note
As of writing, you need to manually update the wallet-enterprise
submodule inside apps/wallet-ecosystem
:
cd apps/wallet-ecosystem/wallet-enterprise \
&& git checkout v0.3.0 \
&& git pull origin v0.3.0
Note
As of writing, you need to manually update the wallet-common
submodule inside apps/wallet-ecosystem/lib
:
cd apps/wallet-ecosystem/lib/wallet-common \
&& git checkout v0.3.0 \
&& git pull origin v0.3.0
Now you're ready to build most of the Docker images we need:
docker compose build backend-server issuer verifier
You need to configure the frontend before you can build it. In order to do this:
cd apps/wallet-frontend
cp .env.example .env.prod
- Edit
.env.prod
file if necessary (if deploying to prod make sure you change the urls to match your setup). For details refer to wwWallet/wallet-frontend docs - Build the Docker image
docker compose build frontend
.
Note
Make sure that appSecret
is the same in each of the backend-server
, issuer
and verifier
configs.
You can generate appSecret
by running openssl rand -base64 64
.
cd apps-config/issuer
cp config/config.template.js config/index.js
- Edit
config/index.js
as necessary. For details refer to wwWallet/wallet-ecosystem.
cd apps-config/verifier
cp config/config.template.js config/index.js
- Edit
config/index.js
as necessary. For details refer to wwWallet/wallet-ecosystem.
cd apps-config/wallet-backend-server
cp config/config.template.js config/index.js
- Edit
config/index.js
as necessary. For details refer to wwWallet/wallet-backend-server. - Add the trusted root cert, Verifier and Issuer details to the database by running:
bash scripts/backend-db/insert-issuer-verifier-data.sh
and enter Issuer and Verifier urls where prompted.
The Caddy service is in the prod
profile, which means that it won't start by default.
cd reverse-proxy
cp .env.example .env
- Edit the
.env
file to include your domains.
At this point, you should be good to start up the services:
docker compose --profile prod up
Tip
If you're running locally:
- you can include
--profile debug
to get a instance of PHPMyAdmin on http://localhost:8080. - You shouldn't use
--profile prod
, as it will not work locally.
.
├── apps # Source code of wallet front/backend and issuer/verifier.
├── apps-config # Configs for wallet front/backend and issuer/verifier.
├── reverse-proxy # Caddy config.
├── scripts # Misc. scripts.
│
└── compose.yaml # Docker Compose config.
Contains clones of repos that are used to build services that are not available as pre-built docker images, or where this would be impractical, like wallet-frontend
and wallet-backend-server
.
Config for wallet apps, right now wallet-backend-server
only.
Configuration files for the services making up the reverse proxy.