diff --git a/doc/contributing/getting_started.rst b/doc/contributing/getting_started.rst index 5aa581b8e..78678588c 100644 --- a/doc/contributing/getting_started.rst +++ b/doc/contributing/getting_started.rst @@ -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. diff --git a/docker-compose.yml b/docker-compose.yml index 4a6186688..d26b288c5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/docker/dovecot_config/dovecot-oauth2.conf.ext b/docker/dovecot_config/dovecot-oauth2.conf.ext index 2e5899f04..de339a10b 100644 --- a/docker/dovecot_config/dovecot-oauth2.conf.ext +++ b/docker/dovecot_config/dovecot-oauth2.conf.ext @@ -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 diff --git a/test_project/test_project/settings.py b/test_project/test_project/settings.py index 5795fd09e..cb1a64f01 100644 --- a/test_project/test_project/settings.py +++ b/test_project/test_project/settings.py @@ -29,6 +29,7 @@ DEBUG = "DEBUG" in os.environ ALLOWED_HOSTS = [ "api", + "api-unsecured", "127.0.0.1", "localhost", ]