Fixed dovecot config for oauth2 setup

This commit is contained in:
Antoine Nguyen
2024-07-12 18:41:23 +02:00
parent 2b163461bf
commit 6d7bec8832
4 changed files with 26 additions and 3 deletions
+3 -2
View File
@@ -21,10 +21,11 @@ in order to be able to log in from the frontend:
.. sourcecode:: bash
$ docker exec modoboa-api '/bin/sh -c python3 /code/test_project/python manage.py createapplication --name frontend --client-id "LVQbfIIX3khWR3nDvix1u9yEGHZUxcx53bhJ7FlD" --user 1 --algorithm RS256 --redirect-uris 'https://localhost:3000/login/logged' public authorization-code'
$ docker exec modoboa-api '/bin/sh -c python3 /code/test_project/manage.py createapplication --name frontend --client-id "LVQbfIIX3khWR3nDvix1u9yEGHZUxcx53bhJ7FlD" --user 1 --algorithm RS256 --redirect-uris 'https://localhost:3000/login/logged' public authorization-code'
$ docker exec modoboa-api '/bin/sh -c python3 /code/test_project/manage.py createapplication --name Dovecot --skip-authorization --client-id=dovecot --client-secret=Toto12345 confidential client-credentials'
It will start the docker environment and make a Modoboa instance
available at ``http://localhost:8000`` and the new admin interface at ``http://localhost:8080``
available at ``https://localhost:8000`` and the new admin interface at ``https://localhost:3000``.
If you don't want to use docker or need a more complex development
setup, go to the next section.
+21
View File
@@ -42,6 +42,27 @@ services:
volumes:
- .:/code
api-unsecured:
container_name: modoboa_api_unsecured
restart: unless-stopped
build:
context: .
dockerfile: docker/Dockerfile.dev
ports:
- 8001:8001
env_file:
- test_project/oidc_key
environment:
PYTHONPATH: ".."
DB: "SQLITE"
DEBUG: "True"
REDIS_HOST: redis
command: >
sh -c "cd test_project
python3 manage.py runserver_plus 0.0.0.0:8001"
volumes:
- .:/code
front:
container_name: modoboa_front
restart: unless-stopped
@@ -1,5 +1,5 @@
introspection_mode = post
introspection_url = http://b1r8hUce03fA3OK260MQBgvi96dsnXvdmSDCVoLJ:dX8ZxICUPCVSoOJiyNAWIozf58IjmlUNQ6PPbX8rqD90QAw0te8052PKI82IRzmeCxv1kvHjSFpCOPqwteiFDj3TBq1cxmrn0Do2AlyDWVD1p8lUeiloERNEcj1InXaR@api:8000/api/o/introspect/
introspection_url = http://dovecot:Toto12345@api-unsecured:8001/api/o/introspect/
username_attribute = username
tls_ca_cert_file = /etc/ssl/certs/ca-certificates.crt
active_attribute = active
+1
View File
@@ -29,6 +29,7 @@ DEBUG = "DEBUG" in os.environ
ALLOWED_HOSTS = [
"api",
"api-unsecured",
"127.0.0.1",
"localhost",
]