Skip to content

Commit

Permalink
feat: better generalization about CI and demo
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed Nov 14, 2024
1 parent 81ce038 commit 540c964
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
21 changes: 17 additions & 4 deletions Docker-compose/run-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions example/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
$wsgi_cmd
fi
4 changes: 2 additions & 2 deletions example/uwsgi_setup/uwsgi/uwsgi.ini.debug
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 540c964

Please sign in to comment.