italia / spid-cie-oidc-django

The SPID/CIE OIDC Federation SDK, written in Python
Apache License 2.0
22 stars 25 forks source link

Docker compose broken? #287

Closed gabrielesilinic closed 7 months ago

gabrielesilinic commented 7 months ago

do you people have any clue about what is going on here? how is everything supposed to be?

here the log when docker compose up gets run on WSL (ubuntu, latest version)

$ docker compose up
[+] Running 4/0
 ✔ Container spid-cie-oidc-django-wallet.trust-anchor.org-1  Created                                                                       0.0s
 ✔ Container spid-cie-oidc-django-trust-anchor.org-1         Created                                                                       0.0s
 ✔ Container spid-cie-oidc-django-relying-party.org-1        Created                                                                       0.0s
 ✔ Container spid-cie-oidc-django-cie-provider.org-1         Created                                                                       0.0s
Attaching to spid-cie-oidc-django-cie-provider.org-1, spid-cie-oidc-django-relying-party.org-1, spid-cie-oidc-django-trust-anchor.org-1, spid-cie-oidc-django-wallet.trust-anchor.org-1
spid-cie-oidc-django-trust-anchor.org-1         | python3: can't open file '/django-project/manage.py': [Errno 2] No such file or directory
spid-cie-oidc-django-wallet.trust-anchor.org-1  | python3: can't open file '/django-project/manage.py': [Errno 2] No such file or directory
spid-cie-oidc-django-wallet.trust-anchor.org-1 exited with code 2
spid-cie-oidc-django-cie-provider.org-1         | python3: can't open file '/django-project/manage.py': [Errno 2] No such file or directory
spid-cie-oidc-django-trust-anchor.org-1 exited with code 2
spid-cie-oidc-django-relying-party.org-1        | python3: can't open file '/django-project/manage.py': [Errno 2] No such file or directory
spid-cie-oidc-django-cie-provider.org-1 exited with code 2
spid-cie-oidc-django-relying-party.org-1 exited with code 2

i also tried to uncomment the lines inside the docker-compose file so it would build directly from the current version but even that did not work, i am working on main at the latest commit (I did a git reset) 2b0c2ef Merge pull request #285 from vernans/add-migrations

also i do lack a localsettings.py but the thing is that i also don't know it's supposed path or format and i also don't really need to customize anything for now (I hoped the docker compose would just run, or at least warn me about the lack of an .env file)

Status

update1: apparently you wanted the developer to copy-paste the examples directory and rename it as examples-docker? why would you do that? still broken but at least know i know that it wants the configuration file

update2: maybe having to configure the image using entire files was not really the reason they invented docker in the first place, i hope i will be able to figure out how to fix it and if i will have the time i will try to introduce good defaults, also the .env file can be useful.

update3: now it decided that it won't parse the records in the json files, cool django.core.serializers.base.DeserializationError: Problem installing fixture '/django-project/dumps/example.json':

update4: okay, so, since for some reason the restoring of the dump is likely just incompatible with whatever models django currently migrates the db to i just replaced all files with a json containing an empty array like this [], now the fun part is figuring out why every page the readme said existed just returns error 404, the Django admin page does that as well.

update5: so, turns out that Django is set up to be sensitive to the last slash / in the URL, and the thing is that you won't ever know when it wants one or when it does not

rglauco commented 7 months ago

A new Docker image has been released, and the migrations will apply correctly now. Please try again (NB delete the previous docker image, the examples-docker folder, and restart the docker-prepare.sh script).

rglauco commented 7 months ago

Thank you for spotting the issue, the default usernames are: admin/oidcadmin user/oidcuser

gabrielesilinic commented 7 months ago

@rglauco thank you