From 540c964895a3fcaba0409e9f2c977b304a96f76f Mon Sep 17 00:00:00 2001 From: Giuseppe De Marco Date: Thu, 14 Nov 2024 14:48:42 +0100 Subject: [PATCH] feat: better generalization about CI and demo --- Docker-compose/run-docker-compose.sh | 21 +++++++++++++++++---- example/entrypoint.sh | 7 ++++--- example/uwsgi_setup/uwsgi/uwsgi.ini.debug | 4 ++-- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/Docker-compose/run-docker-compose.sh b/Docker-compose/run-docker-compose.sh index 9008bfb5..b3ec8eb1 100755 --- a/Docker-compose/run-docker-compose.sh +++ b/Docker-compose/run-docker-compose.sh @@ -14,10 +14,23 @@ function initialize_satosa { echo "WARNING: creating directories with read/write/execute permissions to anybody" - mkdir -p -m 777 ./satosa-project - mkdir -p -m 777 ./djangosaml2_sp - mkdir -p -m 777 ./mongo/db - mkdir -p -m 777 ./nginx/html/static + # Array of directories to create + directories=( + "./satosa-project" + "./djangosaml2_sp" + "./mongo/db" + "./nginx/html/static" + ) + + # Loop through each directory + for dir in "${directories[@]}"; do + # Create the directory and any necessary parent directories + mkdir -p "$dir" + # Set permissions recursively to 777 + chmod -R 777 "$dir" + done + + echo "Directories created and permissions set to 777." if [ ! -f ./satosa-project/proxy_conf.yaml ]; then cp -R ../example/* ./satosa-project/ ; rm -R ./satosa/static/ ; else echo 'satosa-project directory is already initialized' ; fi if [ ! -f ./djangosaml2_sp/run.sh ]; then cp -R ../example_sp/djangosaml2_sp/* ./djangosaml2_sp ; else echo 'djangosaml2_sp directory is already initialided' ; fi diff --git a/example/entrypoint.sh b/example/entrypoint.sh index cb444885..11492820 100644 --- a/example/entrypoint.sh +++ b/example/entrypoint.sh @@ -26,8 +26,9 @@ if [[ $GET_IDEM_MDQ_KEY == true ]]; then fi wsgi_file=/.venv/lib/$(python -c 'import sys; print(f"python{sys.version_info.major}.{sys.version_info.minor}")')/site-packages/satosa/wsgi.py +wsgi_cmd=uwsgi --ini /satosa_proxy/uwsgi_setup/uwsgi/uwsgi.ini.docker --wsgi-file $wsgi_file if [[ $SATOSA_DEBUG == true ]]; then - uwsgi --ini /satosa_proxy/uwsgi_setup/uwsgi/uwsgi.ini.docker --wsgi-file $wsgi_file --honour-stdin + $wsgi_cmd --honour-stdin else - uwsgi --ini /satosa_proxy/uwsgi_setup/uwsgi/uwsgi.ini.docker --wsgi-file $wsgi_file -fi \ No newline at end of file + $wsgi_cmd +fi diff --git a/example/uwsgi_setup/uwsgi/uwsgi.ini.debug b/example/uwsgi_setup/uwsgi/uwsgi.ini.debug index 39d7c160..f040517b 100644 --- a/example/uwsgi_setup/uwsgi/uwsgi.ini.debug +++ b/example/uwsgi_setup/uwsgi/uwsgi.ini.debug @@ -4,8 +4,8 @@ base = /opt chdir = %(base)/%(project)/example -uid = wert -gid = wert +uid = satosa +gid = satosa socket = 127.0.0.1:3002 master = true