Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7dcd644
feat: wwwallet setup docs
PascalDR Sep 11, 2025
039daf5
chore: updated .gitignore
PascalDR Sep 15, 2025
ec89509
feat: initial configuration for wwwallet
PascalDR Sep 15, 2025
7d1ab9c
chore: updated submodules
PascalDR Sep 16, 2025
7ee449c
chore: added submodules
PascalDR Sep 16, 2025
6716b4e
feat: added configuration
PascalDR Sep 16, 2025
750c8d7
feat: updated script
PascalDR Sep 16, 2025
c940d6d
fix: script
PascalDR Sep 16, 2025
5e362a8
feat: added conf file
PascalDR Sep 16, 2025
542d710
chore: updated submodule
PascalDR Sep 16, 2025
78f6fe9
feat: updated script
PascalDR Sep 16, 2025
ee280fe
chore: update .gitignore
PascalDR Sep 16, 2025
d1f7b4f
Merge branch 'dev' of https://github.com/italia/iam-proxy-italia into…
PascalDR Sep 16, 2025
572e01c
fix: config
PascalDR Sep 16, 2025
7d2ced7
fix: updated compose script
PascalDR Sep 17, 2025
c289e71
Update Docker-compose/docker-compose.yml
PascalDR Sep 18, 2025
eec60b9
fix: updated script
PascalDR Sep 18, 2025
babf6f9
Merge branch 'docs/wwwallet_documentation' of https://github.com/ital…
PascalDR Sep 18, 2025
5fe39ea
feat: added mariadb
PascalDR Sep 18, 2025
716abc7
fix: merged nginx
PascalDR Sep 18, 2025
4f3a229
chore: removed file
PascalDR Sep 18, 2025
4a7a0a8
fix: removed unecessary sections
PascalDR Sep 18, 2025
eeb6989
fix: docs
PascalDR Sep 18, 2025
9b4060b
fix: support multiple profiles
PascalDR Sep 18, 2025
d842f51
fix: use env variables
PascalDR Sep 18, 2025
79a32ab
feat: dynamic config
PascalDR Sep 18, 2025
0d48f11
fix: clean nginx data
PascalDR Sep 18, 2025
4bb8334
feat: updated docs
PascalDR Sep 29, 2025
48f520e
Merge branch 'dev' into docs/wwwallet_documentation
PascalDR Sep 29, 2025
f77a40d
Update Docker-compose/docker-compose.yml
PascalDR Sep 29, 2025
c01c602
fix: typo
PascalDR Sep 29, 2025
990dfdd
Merge branch 'docs/wwwallet_documentation' of https://github.com/ital…
PascalDR Sep 29, 2025
25024c2
fix: typo
PascalDR Sep 29, 2025
a260a13
fix: protocol
PascalDR Sep 29, 2025
36dc974
Merge remote-tracking branch 'origin/dev' into docs/wwwallet_document…
saralongobardiacn Oct 1, 2025
bff1674
gitignore: ignore wwwallet files in Docker-compose folder
saralongobardiacn Oct 2, 2025
cc9126e
fix: wwwallet, fix startup pipeline and manage run-docker-compose.sh …
saralongobardiacn Oct 2, 2025
f7329aa
fix: wwwallet, remove file ignored for fix startup
saralongobardiacn Oct 2, 2025
af3f30f
Merge branch 'dev' into docs/wwwallet_documentation
peppelinux Oct 2, 2025
046bca3
Fix merge commit
saralongobardiacn Oct 2, 2025
cd50aab
Merge remote-tracking branch 'origin/dev' into docs/wwwallet_document…
saralongobardiacn Oct 10, 2025
b1b38b5
fix: *-docker-compose.sh, handle multiple instruction in run and remo…
saralongobardiacn Oct 10, 2025
7cc5205
fix: wwwallet, runtime error for invoke /status endpoint
saralongobardiacn Oct 10, 2025
dbc9f63
fix: wwwallet, create custom config for openid4vci_frontend.yml
saralongobardiacn Oct 13, 2025
9ec05d3
fix: openid4vci, handle default_target_authentication_backend
saralongobardiacn Oct 13, 2025
b76c72d
rev: openid4vci wwwallet, use SATOSA_BASE_OPENID4VCI env instead same…
saralongobardiacn Oct 15, 2025
5b1fb93
rev: wwwallet, set nginx proxy for use localhost instead satosa-nginx…
saralongobardiacn Oct 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ iam-proxy-italia-project/logs/*.log
iam-proxy-italia-project/metadata/*.md
iam-proxy-italia-project/data/*
iam-proxy-italia-project/private/*
iam-proxy-italia-project/wwwallet/mysql/data/
iam-proxy-italia-project/wwwallet/mysql/init/
*.pyc
*pyFF_example/info.log
*pyFF_example/error.log
Expand All @@ -26,8 +28,11 @@ Docker-compose/iam-proxy-italia-project/*
Docker-compose/djangosaml2_sp/*
Docker-compose/mongo/db/*
Docker-compose/nginx/html/static/*
Docker-compose/nginx/conf.d/sites-enabled/wwwallet.conf
Docker-compose/nginx/conf.d/wwwallet.default.conf
Docker-compose/certbot/live/localhost
Docker-compose/.env
Docker-compose/wwwallet/*
Docker-compose/eudi-wallet-it-python
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
Expand Down
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "iam-proxy-italia-project/wwwallet/wallet-frontend"]
path = iam-proxy-italia-project/wwwallet/wallet-frontend
url = https://github.com/wwWallet/wallet-frontend.git
[submodule "iam-proxy-italia-project/wwwallet/wallet-backend-server"]
path = iam-proxy-italia-project/wwwallet/wallet-backend-server
url = https://github.com/wwWallet/wallet-backend-server
[submodule "iam-proxy-italia-project/wwwallet/wallet-common"]
path = iam-proxy-italia-project/wwwallet/wallet-common
url = https://github.com/wwWallet/wallet-common
6 changes: 4 additions & 2 deletions Docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ cd Docker-compose
The script creates the directories for local mounts and copies all required files to start a full demo with test and SAML2 Service Providers.

The script can be run with different options:
-`f` cleans the folders; if combined with `-e` (`-e -f`), it also overrides the .env file.
-`t` to run tests with `spid_sp_test` in a pipeline-like execution;

-`f` cleans the folders; if combined with `-e` (`-e -f`), it also overrides the .env file.
-`t` to run tests with `spid_sp_test` in a pipeline-like execution;
-`w` to run the wwwallet profile, view [wwwallet_setup](../docs/readme.wwwallet_setup.md) for more details.

> ⚠️ Warning: The script deletes any previous created directory if found.

Expand Down
97 changes: 87 additions & 10 deletions Docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,75 @@
services:

wwwallet-mariadb:
profiles:
- wwwallet
container_name: wwwallet-mariadb
environment:
MARIADB_DATABASE: ${MARIADB_DBNAME:-wwwalletdb}
MARIADB_ROOT_PASSWORD: ${MARIADB_DBPASSWORD:-changeme}
MARIADB_USER: ${MARIADB_DBUSER:-dbuser}
MARIADB_PASSWORD: ${MARIADB_DBPASSWORD:-dbpassword}
command:
- --table_definition_cache=100
- --performance_schema=0
- --innodb_use_native_aio=0
volumes:
- ./wwwallet/mariadb/data/:/var/lib/mysql
image: mariadb:10.6
ports:
- "3306:3306"
networks:
- iam-proxy-italia

wwwallet-server:
profiles:
- wwwallet
image: wwwallet-server:latest
build:
context: ./wwwallet/wallet-backend-server
dockerfile: Dockerfile
container_name: wwwallet-server
depends_on:
- wwwallet-mariadb
ports:
- "5000:5000"
networks:
- iam-proxy-italia
volumes:
- ./nginx/conf.d/wwwallet.default.conf:/etc/nginx/conf.d/default.conf:ro
- ./certbot/live/${SATOSA_HOSTNAME:-localhost}:/etc/nginx/certs:ro
environment:
- NGINX_HOST=${SATOSA_HOSTNAME:-localhost}
- TZ=${TZ:-Europe/Rome}
- NODE_TLS_REJECT_UNAUTHORIZED=0
command: >
bash -c "
apt-get update && apt-get install -y nginx && \
nginx -g 'daemon off;' &
node ./dist/src/app.js
"

wwwallet-frontend:
profiles:
- wwwallet
image: wwwallet-frontend:latest
build:
context: ./wwwallet/wallet-frontend
dockerfile: Dockerfile
container_name: wwwallet-frontend
depends_on:
- wwwallet-server
ports:
- "3000:3000"
networks:
- iam-proxy-italia

satosa-mongo:
profiles:
- demo
- mongo
- mongoexpress
- wwwallet
image: mongo
container_name: satosa-mongo
environment:
Expand All @@ -25,6 +90,7 @@ services:
profiles:
- demo
- mongoexpress
- wwwallet
image: mongo-express
container_name: satosa-mongo-express
ports:
Expand All @@ -45,6 +111,7 @@ services:
profiles:
- demo
- dev
- wwwallet
build:
context: ../
args:
Expand All @@ -54,7 +121,7 @@ services:
working_dir: /django_sp
entrypoint: "sh ../entrypoint.sh"
volumes:
- ./djangosaml2_sp:/django_sp:rw
- ./djangosaml2_sp:/django_sp:rw
ports:
- "8000:8000"
networks:
Expand All @@ -63,11 +130,11 @@ services:
iam-proxy-italia:
# image: ghcr.io/italia/iam-proxy-italia:latest
image: iam-proxy-italia:3.0
build:
context: ../
args:
- NODE_ENV=local
dockerfile: Dockerfile
build:
context: ../
args:
- NODE_ENV=local
dockerfile: Dockerfile
container_name: iam-proxy-italia
# depends_on:
# - satosa-mongo
Expand All @@ -87,9 +154,10 @@ services:
- SATOSA_PUBLIC_KEY=${SATOSA_KEYS_FOLDER:-./pki}/${SATOSA_PUBLIC_KEY_FILENAME:-cert.pem}
- SATOSA_BASE=https://${SATOSA_HOSTNAME:-localhost}
- SATOSA_BASE_STATIC=${SATOSA_BASE}/static
- SATOSA_BASE_OPENID4VCI=${SATOSA_BASE}/OpenID4VCI
- SATOSA_DISCO_SRV=${SATOSA_BASE_STATIC}/disco.html
- SATOSA_UNKNOW_ERROR_REDIRECT_PAGE=${SATOSA_BASE_STATIC}/error_page.html

- MONGODB_USERNAME=${MONGO_DBUSER:-satosa}
- MONGODB_PASSWORD=${MONGO_DBPASSWORD:-thatpassword}
- SATOSA_ENCRYPTION_KEY=${SATOSA_ENCRYPTION_KEY:-CHANGE_ME!}
Expand Down Expand Up @@ -141,6 +209,12 @@ services:
timeout: 10s

satosa-nginx:
profiles:
- demo
- mongo
- mongoexpress
- dev
- wwwallet
image: nginx:alpine
container_name: satosa-nginx
depends_on:
Expand All @@ -151,7 +225,9 @@ services:
ports:
- "443:443"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/conf.d/sites-enabled:/etc/nginx/conf.d/sites-enabled:ro
- ./nginx/html:/etc/nginx/html:ro
- ./nginx/html:/usr/share/nginx/html:ro
- ./certbot/archive:/etc/archive:ro
- ./certbot/live/${SATOSA_HOSTNAME:-localhost}:/etc/nginx/certs:ro
Expand All @@ -166,15 +242,16 @@ services:
profiles:
- demo
- dev
image: italia/spid-saml-check
- wwwallet
image: italia/spid-saml-check:1.10.6
Comment thread
peppelinux marked this conversation as resolved.
container_name: spid-samlcheck
ports:
- "8443:8443"
networks:
- iam-proxy-italia
satosa-certbot:
image: certbot/certbot
container_name: satosa-certbot
container_name: satosa-certbot
environment:
- CERTBOT_ENABLED=${SATOSA_CERTBOT_ENABLED:-true}
- CERTBOT_EMAIL=${SATOSA_CONTACT_PERSON_EMAIL_ADDRESS:-support.example@organization.org}
Expand Down
3 changes: 3 additions & 0 deletions Docker-compose/env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SATOSA_HOSTNAME=localhost
SATOSA_BASE=https://${SATOSA_HOSTNAME:-localhost}
SATOSA_BASE_OPENID4VCI=${SATOSA_BASE}/OpenID4VCI
SATOSA_BASE_STATIC=${SATOSA_BASE}/static
SATOSA_DISCO_SRV=${SATOSA_BASE_STATIC}/disco.html
SATOSA_UNKNOW_ERROR_REDIRECT_PAGE=${SATOSA_BASE_STATIC}/error_page.html
Expand Down Expand Up @@ -63,3 +64,5 @@ SATOSA_UI_PRIVACY_URL_IT="https://example_organization.org/it/privacy"

# If set to true, satosa downloads IDEM's keys and IDPs from registry.spid.gov.it
GET_IDEM_MDQ_KEY=true

SATOSA_DEBUG=true
2 changes: 2 additions & 0 deletions Docker-compose/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ server {
uwsgi_param SERVER_ADDR $server_addr;
}

include ./conf.d/sites-enabled/*.conf;

location /static/ {
alias /usr/share/nginx/html/static/;
autoindex on;
Expand Down
85 changes: 81 additions & 4 deletions Docker-compose/run-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,44 @@ function clean_data {
rm -Rf ./djangosaml2_sp/*
rm -Rf ./nginx/html/static
rm -Rf ./certbot/live/localhost/*
rm -Rf ./nginx/conf.d/sites-enabled/*
rm -Rf ./wwwallet/*
if [ "$SATOSA_FORCE_ENV" == "true" ]; then rm .env; fi
else
if [ "$SATOSA_FORCE_ENV" == "true" ]; then echo "'-e' options is skipped. To perform this option is required '-f' too "; fi
fi
}

function init_files () {
if [ -f $1 ]; then echo "$2 file is already initialized" ; else $3 ; fi
if [ -f "$1" ]; then echo "$2 file is already initialized" ; else eval "$3" ; fi
}

function merge_env() {
local env_source="$1"
local template_file="$2"
local target_file="$3"

local vars=()
while IFS='=' read -r key _; do
[[ -z "$key" || "$key" =~ ^# ]] && continue
vars+=("$key")
done < "$env_source"

set -a
source "$env_source"
set +a

env_interpolate() {
while IFS= read -r line; do
eval "echo \"$line\""
done
}

env_interpolate < "$template_file" > "$target_file"

for var in "${vars[@]}"; do
unset "$var"
done
}

function add_localhost_cert () {
Expand All @@ -36,21 +66,64 @@ function add_iam_cert () {

function initialize_satosa {
echo "WARNING: creating directories with read/write/execute permissions to anybody"

mkdir -p ./iam-proxy-italia-project
mkdir -p ./djangosaml2_sp
mkdir -p ./mongo/db
mkdir -p ./nginx/html/static
mkdir -p ./certbot/live/localhost
mkdir -p ./nginx/conf.d/sites-enabled

init_files ./.env ".env" "cp env.example .env"
init_files ./iam-proxy-italia-project/proxy_conf.yaml "iam-proxy-italia" "cp -R ../iam-proxy-italia-project ./"
init_files ./djangosaml2_sp/run.sh "djangosaml2_sp" "cp -R ../iam-proxy-italia-project_sp/djangosaml2_sp ./"
init_files ./nginx/html/static/disco.html "static pages" "cp -R ../iam-proxy-italia-project/static ./nginx/html"
init_files ./certbot/live/localhost/privkey.pem "Locahost cert" "add_localhost_cert"
init_files ./certbot/live/localhost/privkey.pem "Localhost cert" "add_localhost_cert"
init_files ./iam-proxy-italia-project/pki/privkey.pem "IAM Proxy cert" "add_iam_cert"

rm -Rf ./iam-proxy-italia-project/static
rm -Rf ./iam-proxy-italia-project/wwwallet

if [ "$COMPOSE_PROFILES" == *"wwwallet"* ]; then
mkdir -p ./wwwallet

init_files "./nginx/conf.d/sites-enabled/wwwallet.conf" \
"nginx wwwallet configuration is already initialized" \
"cp -R ../iam-proxy-italia-project/wwwallet/configs/wwwallet.conf ./nginx/conf.d/sites-enabled/"

init_files "./wwwallet/wallet-frontend/package.json" \
"wwwallet-frontend directory is already initialized" \
"cp -R ../iam-proxy-italia-project/wwwallet/wallet-frontend ./wwwallet/wallet-frontend"

init_files "./wwwallet/wallet-backend-server/package.json" \
"wwwallet-backend-server directory is already initialized" \
"cp -R ../iam-proxy-italia-project/wwwallet/wallet-backend-server ./wwwallet/wallet-backend-server"

init_files "./wwwallet/wallet-frontend/lib/wallet-common/package.json" \
"wwwallet-frontend wallet-common directory is already initialized" \
"mkdir -p ./wwwallet/wallet-frontend/lib/wallet-common && cp -R ../iam-proxy-italia-project/wwwallet/wallet-common/* ./wwwallet/wallet-frontend/lib/wallet-common/"

init_files "./nginx/conf.d/wwwallet.default.conf" \
"wwwallet nginx config is already initialized" \
"cp -R ../iam-proxy-italia-project/wwwallet/configs/nginx/wwwallet.default.conf ./nginx/conf.d/wwwallet.default.conf"

merge_env ./.env ../iam-proxy-italia-project/wwwallet/configs/.env.prod ./wwwallet/wallet-frontend/.env.prod
cp -R ../iam-proxy-italia-project/wwwallet/configs/config.template.ts ./wwwallet/wallet-backend-server/config/config.template.ts
cp -R ../iam-proxy-italia-project/wwwallet/configs/vite.config.ts ./wwwallet/wallet-frontend/vite.config.ts

mkdir -p ./wwwallet/wallet-backend-server/src/routers &&
cp -R ../iam-proxy-italia-project/wwwallet/configs/proxy.router.ts ./wwwallet/wallet-backend-server/src/routers/proxy.router.ts

mkdir -p ./wwwallet/mysql/config &&
cp -R ../iam-proxy-italia-project/wwwallet/mysql/config/my.cnf ./wwwallet/mysql/config/my.cnf

cp ../iam-proxy-italia-project/wwwallet/configs/openid4vci_frontend.yaml ./iam-proxy-italia-project/conf/frontends/openid4vci_frontend.yaml

mkdir -p ./wwwallet/mariadb/data
chmod -R 777 ./wwwallet

echo "WARNING: wwwallet permission folder set recursively to 777"
fi

chmod -R 777 ./iam-proxy-italia-project
echo "WARNING: iam-proxy-italia-project permission folder set recursively to 777"
Expand Down Expand Up @@ -115,13 +188,14 @@ function help {
echo "-s Skip docker image update"
echo "-d Set 'dev' compose profile. Run: satosa, nginx, django-sp, spid-saml-check"
echo "-t Run spid_sp_test tests after startup"
echo "-w Set 'wwwallet' compose profile. Run: wwwallet-mariadb, wwwallet-server, wwwallet-frontend"
echo ""
echo "if isn't set any options of -p, -m, -M, -d, is used 'demo' compose profile"
echo "demo compose profile start: satosa, nginx, mongo, mongo-express, django-sp, spid-saml-check"
echo ""
}

while getopts ":fepbimMdsh" opt; do
while getopts ":fepbimMdswh" opt; do
case ${opt} in
f)
SATOSA_CLEAN_DATA="true"
Expand Down Expand Up @@ -150,6 +224,9 @@ while getopts ":fepbimMdsh" opt; do
t)
RUN_SPID_TEST=true
;;
w)
COMPOSE_PROFILES="wwwallet"
;;
h)
help
exit 0
Expand Down
Loading
Loading