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
80and443open
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.gitAfter 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.0Note
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.0Now you're ready to build most of the Docker images we need:
docker compose build backend-server issuer verifierYou need to configure the frontend before you can build it. In order to do this:
cd apps/wallet-frontendcp .env.example .env.prod- Edit
.env.prodfile 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/issuercp config/config.template.js config/index.js- Edit
config/index.jsas necessary. For details refer to wwWallet/wallet-ecosystem.
cd apps-config/verifiercp config/config.template.js config/index.js- Edit
config/index.jsas necessary. For details refer to wwWallet/wallet-ecosystem.
cd apps-config/wallet-backend-servercp config/config.template.js config/index.js- Edit
config/index.jsas 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.shand 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-proxycp .env.example .env- Edit the
.envfile to include your domains.
At this point, you should be good to start up the services:
docker compose --profile prod upTip
If you're running locally:
- you can include
--profile debugto 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.