Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

183 docker compose optimizazione #188

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

MdreW
Copy link
Collaborator

@MdreW MdreW commented Feb 21, 2025

  • use short name for service
  • set a prefix for container name
  • add build option for iam-proxy service
  • add build option in run-docker-compose.sh
  • remove not necessary named network
  • remove not necessary key like container-name when is identically to service-name
  • rename example/plugin to example/configuration
  • optimize metadata and key update
  • update test to new service name

…container are prefixed with project name), add build options for satosa (you ca use `docker compose up --build` to recompile), removed unecessary named network, removed superfluous key in docker-compose, optimized process for metadata and key update (clean and short)
… `sh`, no executed right requested; commented unused log handled in proxy_conf
@MdreW MdreW linked an issue Feb 21, 2025 that may be closed by this pull request
10 tasks
… `sh`, no executed right requested; commented unused log handled in proxy_conf
@MdreW
Copy link
Collaborator Author

MdreW commented Feb 21, 2025

Hi @peppelinux ,

Spid, eIDAS and CIE backend work fine but if Pyeudi is enable kill the application with this error:

satosa-1  | [UNKNOWN] The backend configuration presents the following validation issues: 2 validation errors for PyeudiwBackendConfig
satosa-1  | user_attributes.subject_id_random_value
satosa-1  |   Value error, subject_id_random_value must not be "CHANGEME!" [type=value_error, input_value='CHANGEME!', input_type=str]
satosa-1  |     For further information visit https://errors.pydantic.dev/2.10/v/value_error
satosa-1  | metadata.redirect_uris
satosa-1  |   Input should be a valid list [type=list_type, input_value=None, input_type=NoneType]
satosa-1  |     For further information visit https://errors.pydantic.dev/2.10/v/list_type
satosa-1  | [2025-02-21 10:40:58] [ERROR]: Failed to create WSGI app. [satosa.proxy_server.make_app:218]
satosa-1  | Traceback (most recent call last):
satosa-1  |   File "/.venv/lib/python3.12/site-packages/pyeudiw/satosa/default/openid4vp_backend.py", line 353, in db_engine
satosa-1  |     self._db_engine.is_connected
satosa-1  |     ^^^^^^^^^^^^^^^
satosa-1  | AttributeError: 'OpenID4VPBackend' object has no attribute '_db_engine'. Did you mean: 'db_engine'?
satosa-1  |
satosa-1  | During handling of the above exception, another exception occurred:
satosa-1  | pymongo.errors.ServerSelectionTimeoutError: satosa-mongo:27017: [Errno -3] Try again (configured timeouts: socketTimeoutMS: 2000
0.0ms, connectTimeoutMS: 20000.0ms), Timeout: 30s, Topology Description: <TopologyDescription id: 67b84a0c7f2cc613303fc3c2, topology_type: U
nknown, servers: [<ServerDescription ('satosa-mongo', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('satosa-mongo:27017: [Errn
o -3] Try again (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms)')>]>

If I change value in row 186 of pyeudy config the error is

satosa-1  | [2025-02-21 11:08:42] [INFO ]: Running SATOSA version 8.5.0 [satosa.proxy_server.make_app:208]
satosa-1  | [2025-02-21 11:08:42] [INFO ]: Loading backend modules... [satosa.base.__init__:56]
satosa-1  | /.venv/lib/python3.12/site-packages/device_detector/parser/extractors.py:26: SyntaxWarning: invalid escape sequence '\d'
satosa-1  |   """
satosa-1  | [UNKNOWN] The backend configuration presents the following validation issues: 1 validation error for PyeudiwBackendConfig
satosa-1  | metadata.redirect_uris
satosa-1  |   Input should be a valid list [type=list_type, input_value=None, input_type=NoneType]
satosa-1  |     For further information visit https://errors.pydantic.dev/2.10/v/list_type

For CHANGEME! value we can use a env, but if the backend is not ready to start as example with defaut conf I propose to disable on default. Do you agree with me?

services:

satosa-mongo:
mongo:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there might be different containers about mongo, and this is the mongo within the satosa network with a specialized name

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The container name is composed by project name +service name + istance number = iam-proxy-italia-mongo-1
The image name is composed by project name +service name = iam-proxy-italia-mongo
But you can call it with the service name in composer

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The project name is defined in first docker-compose line with key name: iam-proxy-italia

@@ -18,66 +17,50 @@ services:
# - mongodata:/data/db # to be used for external volumes
ports:
- '27017-27019:27017-27019'
networks:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per my previous comment


satosa-mongo-express:
express:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per my previous comment


django_sp:
sp:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a django sp, therefore its name is django sp

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we haven't other SP, why distinguish them?
But if you prefer we can call this django-sp 😄
Remember: the container name will be iam-proxy-italia-django-sp-1
With a long project name a short service is useful


iam-proxy-italia:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iam-proxy-italia is the container name

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iam-proxy-italia is the project name. Whe should call the service with a functional name for his work.
If you wont call it as satosa for don't make confusion we can call it iam-proxy? but the full container name will be iam-proxy-italia-iam-proxy-1... a really uncomfortable name, you don't think?

Comment on lines +62 to +69
# spid_daily:
# class: logging.handlers.TimedRotatingFileHandler
# level: INFO
# formatter: simple
# filename: logs/spid.log
# when: D
# interval: 1
# backupCount: 860
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

let's keep cie and spid policy retention configured by default

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In docker spid daily is not used, the log are sended to docker logs from STDOUT. Spid daily handler is used only for local installation and must be configured manually in proxy_conf.yaml.
If remain uncommented the image require an un-necessary write access right to logs/spid.log empty file.

If someone want use this must uncommented this and change the handler loggers from [console] to [spid_daily]. If you want to use spid-daily you still need to edit the proxy-conf file.

Copy link
Member

@peppelinux peppelinux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GET_METADATA_AND_KEY=true is good

other breakign changes will not be supported, liek the rename of the containrs that was something early made for design purpose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker-compose optimizazione
2 participants