Skip to content

Commit bf5a384

Browse files
committed
fix: CI and small docker readme improvements
1 parent 7a052d2 commit bf5a384

File tree

8 files changed

+29
-21
lines changed

8 files changed

+29
-21
lines changed

.github/workflows/python-app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
run: |
5454
cd Docker-compose/satosa-project
5555
spid_sp_test --idp-metadata > metadata/idp/spid-sp-test.xml
56-
spid_sp_test --metadata-url https://localhost/spidSaml2/metadata --authn-url "http://localhost:8000/saml2/login/?idp=https://localhost/Saml2IDP/metadata&next=/saml2/echo_attributes&idphint=https%253A%252F%252Flocalhost%253A8443" -ap spid_sp_test.plugins.authn_request.SatosaSaml2Spid --extra --debug ERROR -tr
56+
IDP_ENTITYID=https://localhost:8443/samlsso spid_sp_test --metadata-url https://localhost/spidSaml2/metadata --authn-url "http://localhost:8000/saml2/login/?idp=https://localhost/Saml2IDP/metadata&next=/saml2/echo_attributes&idphint=https%253A%252F%252Flocalhost%253A8443" -ap spid_sp_test.plugins.authn_request.SatosaSaml2Spid --extra --debug ERROR -tr
5757
- name: spid-sp-test CIE id metadata
5858
run: |
5959
cd Docker-compose/satosa-project

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ Docker-compose/satosa-project/*
2121
Docker-compose/djangosaml2_sp/*
2222
Docker-compose/mongo/db/*
2323
Docker-compose/nginx/html/static/*
24+
Docker-compose/.env

Docker-compose/README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,18 @@ sudo apt install docker-compose
2222

2323
For docker-compose you can also [see here](https://docs.docker.com/compose/install/other/).
2424

25-
## Run the composition MAGIC WAY
25+
## Run the Composition for Demo Purposes
2626

2727
Enter in `Docker-compose` directory and run `run-docker-compose.sh`:
2828
```bash
2929
cd Docker-compose
3030
./run-docker-compose.sh
3131
```
32-
The script make the directories for local mounts, copy all required files in right directory and start a full demo with test and Service providers
32+
The script creates the directories for local mounts and copies all required files to start a full demo with test and SAML2 Service Providers.
33+
34+
> Warning: The script deletes any previous created directory if found.
35+
36+
The result is represented by the following services:
3337

3438
* Satosa-saml2spid is published with nginx frontend on https://localhost
3539
* Mongo Espress is published on http://localhost:8081
@@ -38,7 +42,7 @@ The script make the directories for local mounts, copy all required files in rig
3842

3943
More details ad start option are avable on [run-docker-compose.sh](../docs/run-docker-compose.sh.md) page
4044

41-
### Run the composition LONG WAY
45+
### Run the Composition for Production Use
4246

4347
Enter in `Docker-compose` directory and make required direcotries for local mounts:
4448
```bash
@@ -61,6 +65,14 @@ Clean static data from Satosa project
6165
rm -R ./satosa-project/static
6266
```
6367

68+
Copy the example env file and edit according to your configuration,
69+
therefore **all the default passwords MUST be changed**.
70+
71+
```bash
72+
cp env.example .env
73+
```
74+
You can still edit all files in detail from their local volumes.
75+
6476
Run the compose for a minimal system (nginx and satosa)
6577
```
6678
docker compose up
@@ -73,16 +85,6 @@ docker compose --profile demo up
7385

7486
Read the [profiles guide](../docs/docker_compose_profiles.md) for more informations
7587

76-
77-
### Configure your system
78-
Copy the example env file:
79-
```bash
80-
cp env.example .env
81-
```
82-
83-
Edit and personalize the system from `.env` files. You can still edit all files in detail from their local volumes.
84-
**IMPORTANT all the default password must be changed!**
85-
8688
### Insights
8789

8890
* More details on prodiles read the [Docker Compose Profiles](../docs/docker_compose_profiles.md) page

Docker-compose/docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
services:
2+
23
satosa-mongo:
34
profiles:
45
- demo
@@ -39,6 +40,7 @@ services:
3940
TZ: "${TZ:-Europe/Rome}"
4041
networks:
4142
- satosa-saml2spid
43+
4244
django_sp:
4345
profiles:
4446
- demo
@@ -57,6 +59,7 @@ services:
5759
- "8000:8000"
5860
networks:
5961
- satosa-saml2spid
62+
6063
satosa-saml2spid:
6164
image: ghcr.io/italia/satosa-saml2spid:latest
6265
#image: satosa-saml2spid:latest

Docker-compose/env.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
SATOSA_HOSTNAME=localhost
2-
# SATOSA_BASE=https://${SATOSA_HOSTNAME:-localhost}
3-
# SATOSA_BASE_STATIC=${SATOSA_BASE}/static
4-
# SATOSA_DISCO_SRV=${SATOSA_BASE_STATIC}/disco.html
5-
# SATOSA_UNKNOW_ERROR_REDIRECT_PAGE=${SATOSA_BASE_STATIC}/error_page.html
2+
SATOSA_BASE=https://${SATOSA_HOSTNAME:-localhost}
3+
SATOSA_BASE_STATIC=${SATOSA_BASE}/static
4+
SATOSA_DISCO_SRV=${SATOSA_BASE_STATIC}/disco.html
5+
SATOSA_UNKNOW_ERROR_REDIRECT_PAGE=${SATOSA_BASE_STATIC}/error_page.html
66

77
# Set Time Zone
88
TZ="Europe/Rome"

Docker-compose/run-docker-compose.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22
export COMPOSE_PROFILES=demo
33
export SKIP_UPDATE=
4+
45
function clean_data {
56
rm -Rf ./mongo/db/*
67
rm -Rf ./satosa-project/*
@@ -9,6 +10,8 @@ function clean_data {
910
}
1011

1112
function initialize_satosa {
13+
cp env.example .env
14+
1215
mkdir -p ./satosa-project
1316
mkdir -p ./djangosaml2_sp
1417
mkdir -p ./mongo/db

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ LABEL org.opencontainers.image.authors=$AUTHORS \
1717
org.opencontainers.image.source=$VCS_URL \
1818
org.opencontainers.image.revision=$VCS_REF \
1919
org.opencontainers.image.description="Docker Image di Satosa-Saml2Spid."
20-
2120

2221
COPY requirements.txt /
2322

@@ -27,7 +26,7 @@ ENV BASEDIR="/satosa_proxy"
2726
# "mailcap" package is required to add mimetype support
2827
RUN apk add --update --no-cache tzdata mailcap xmlsec libffi-dev openssl-dev python3 py3-pip python3-dev procps git openssl build-base gcc wget bash jq yq-go pcre-dev
2928

30-
RUN python3 -m venv .venv && . .venv/bin/activate && pip3 install --upgrade pip setuptools \
29+
RUN python3 -m venv .venv && . .venv/bin/activate && pip3 install --upgrade pip setuptools \
3130
&& pip3 install -r requirements.txt --ignore-installed --root-user-action=ignore && mkdir $BASEDIR \
3231
&& addgroup -S satosa && adduser -S satosa -G satosa \
3332
&& chown satosa:satosa $BASEDIR

example_sp/djangosaml2_sp/djangosaml2_sp/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
path(f'{SAML2_URL_PREFIX}/ls/', views.LogoutView.as_view(), name='saml2_ls'),
2727
path(f'{SAML2_URL_PREFIX}/ls/post/', views.LogoutView.as_view(), name='saml2_ls_post'),
2828
path(f'{SAML2_URL_PREFIX}/metadata/', views.MetadataView.as_view(), name='saml2_metadata'),
29-
# path(f'{SAML2_URL_PREFIX}/echo_attributes', views.EchoAttributesView.as_view(), name='saml2_echo_attributes'),
29+
path(f'{SAML2_URL_PREFIX}/echo_attributes', views.EchoAttributesView.as_view(), name='saml2_echo_attributes'),
3030
path('logout/', LogoutView.as_view(), {'next_page': settings.LOGOUT_REDIRECT_URL}, name='logout')
3131
])
3232

0 commit comments

Comments
 (0)