mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-27 10:46:47 +00:00
wip functional setup without keycloak and silent login
This commit is contained in:
@@ -81,7 +81,6 @@ create-env-files: \
|
|||||||
env.d/development/common \
|
env.d/development/common \
|
||||||
env.d/development/crowdin \
|
env.d/development/crowdin \
|
||||||
env.d/development/postgresql \
|
env.d/development/postgresql \
|
||||||
env.d/development/kc_postgresql \
|
|
||||||
env.d/development/summary \
|
env.d/development/summary \
|
||||||
env.d/development/kube-secret \
|
env.d/development/kube-secret \
|
||||||
env.d/development/multi_user_transcriber \
|
env.d/development/multi_user_transcriber \
|
||||||
@@ -288,9 +287,6 @@ env.d/development/common:
|
|||||||
env.d/development/postgresql:
|
env.d/development/postgresql:
|
||||||
cp -n env.d/development/postgresql.dist env.d/development/postgresql
|
cp -n env.d/development/postgresql.dist env.d/development/postgresql
|
||||||
|
|
||||||
env.d/development/kc_postgresql:
|
|
||||||
cp -n env.d/development/kc_postgresql.dist env.d/development/kc_postgresql
|
|
||||||
|
|
||||||
env.d/development/summary:
|
env.d/development/summary:
|
||||||
cp -n env.d/development/summary.dist env.d/development/summary
|
cp -n env.d/development/summary.dist env.d/development/summary
|
||||||
|
|
||||||
|
|||||||
+10
-34
@@ -147,7 +147,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./docker/files/etc/nginx/conf.d:/etc/nginx/conf.d:ro
|
- ./docker/files/etc/nginx/conf.d:/etc/nginx/conf.d:ro
|
||||||
depends_on:
|
depends_on:
|
||||||
- keycloak
|
- dex
|
||||||
- app-dev
|
- app-dev
|
||||||
networks:
|
networks:
|
||||||
- resource-server
|
- resource-server
|
||||||
@@ -187,40 +187,16 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ".:/app"
|
- ".:/app"
|
||||||
|
|
||||||
kc_postgresql:
|
# OIDC provider for the development stack. Dex uses in-memory storage, so it
|
||||||
image: postgres:14.3
|
# needs no database and no volume: restarting it rotates the signing keys and
|
||||||
ports:
|
# drops every active session, which is fine locally.
|
||||||
- "5433:5432"
|
dex:
|
||||||
env_file:
|
image: dexidp/dex:v2.45.1
|
||||||
- env.d/development/kc_postgresql
|
command: ["dex", "serve", "/etc/dex/config.yaml"]
|
||||||
|
|
||||||
keycloak:
|
|
||||||
image: quay.io/keycloak/keycloak:20.0.1
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./docker/auth/realm.json:/opt/keycloak/data/import/realm.json
|
- ./docker/auth/dex.yaml:/etc/dex/config.yaml:ro
|
||||||
command:
|
expose:
|
||||||
- start-dev
|
- "5556"
|
||||||
- --features=preview
|
|
||||||
- --import-realm
|
|
||||||
- --proxy=edge
|
|
||||||
- --hostname-url=http://localhost:8083
|
|
||||||
- --hostname-admin-url=http://localhost:8083/
|
|
||||||
- --hostname-strict=false
|
|
||||||
- --hostname-strict-https=false
|
|
||||||
environment:
|
|
||||||
KEYCLOAK_ADMIN: admin
|
|
||||||
KEYCLOAK_ADMIN_PASSWORD: admin
|
|
||||||
KC_DB: postgres
|
|
||||||
KC_DB_URL_HOST: kc_postgresql
|
|
||||||
KC_DB_URL_DATABASE: keycloak
|
|
||||||
KC_DB_PASSWORD: pass
|
|
||||||
KC_DB_USERNAME: meet
|
|
||||||
KC_DB_SCHEMA: public
|
|
||||||
PROXY_ADDRESS_FORWARDING: 'true'
|
|
||||||
ports:
|
|
||||||
- "8080:8080"
|
|
||||||
depends_on:
|
|
||||||
- kc_postgresql
|
|
||||||
|
|
||||||
livekit:
|
livekit:
|
||||||
image: livekit/livekit-server
|
image: livekit/livekit-server
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
# Dex configuration for the local development stack.
|
||||||
|
#
|
||||||
|
# This file replaces the former Keycloak "meet" realm (docker/auth/realm.json).
|
||||||
|
# The client and the users below are a one-to-one port of that realm.
|
||||||
|
#
|
||||||
|
# Storage is in-memory on purpose: no database container, no volume, ~30 MB of
|
||||||
|
# RAM instead of the Keycloak + PostgreSQL pair. The trade-off is that
|
||||||
|
# restarting the `dex` service rotates the signing keys and drops every active
|
||||||
|
# session, so you have to log in again.
|
||||||
|
|
||||||
|
# Must match OIDC_OP_URL in env.d/development/common. Dex serves all of its
|
||||||
|
# endpoints under the path component of the issuer, i.e. /dex/auth, /dex/token,
|
||||||
|
# /dex/keys, /dex/userinfo and /dex/.well-known/openid-configuration.
|
||||||
|
issuer: http://localhost:8083/dex
|
||||||
|
|
||||||
|
storage:
|
||||||
|
type: memory
|
||||||
|
|
||||||
|
web:
|
||||||
|
http: 0.0.0.0:5556
|
||||||
|
allowedOrigins:
|
||||||
|
- http://localhost:3000
|
||||||
|
- http://localhost:8071
|
||||||
|
|
||||||
|
logger:
|
||||||
|
level: info
|
||||||
|
format: text
|
||||||
|
|
||||||
|
oauth2:
|
||||||
|
# Logging in implies authorization: no consent screen, as with the realm.
|
||||||
|
skipApprovalScreen: true
|
||||||
|
|
||||||
|
expiry:
|
||||||
|
idTokens: 24h
|
||||||
|
signingKeys: 6h
|
||||||
|
|
||||||
|
staticClients:
|
||||||
|
- id: meet
|
||||||
|
name: Meet
|
||||||
|
secret: ThisIsAnExampleKeyForDevPurposeOnly
|
||||||
|
# Dex does not support wildcards: every callback URL must be listed
|
||||||
|
# explicitly. The path is the one exposed by mozilla-django-oidc through
|
||||||
|
# lasuite.oidc_login, mounted under api/<version>/ by core.urls.
|
||||||
|
redirectURIs:
|
||||||
|
- http://localhost:3000/api/v1.0/callback/
|
||||||
|
- http://localhost:3200/api/v1.0/callback/
|
||||||
|
- http://localhost:8070/api/v1.0/callback/
|
||||||
|
- http://localhost:8071/api/v1.0/callback/
|
||||||
|
- http://localhost:8088/api/v1.0/callback/
|
||||||
|
|
||||||
|
enablePasswordDB: true
|
||||||
|
|
||||||
|
# Dex's local password database authenticates on the *email address*, not on
|
||||||
|
# the username, so the login is now "meet@meet.world" (password unchanged).
|
||||||
|
#
|
||||||
|
# Hashes are bcrypt with cost 10, the minimum dex accepts. To add a user:
|
||||||
|
# htpasswd -bnBC 10 "" <password> | tr -d ':\n'
|
||||||
|
staticPasswords:
|
||||||
|
- email: meet@meet.world
|
||||||
|
hash: "$2b$10$qVCVTnaF67S/7a.pQM4djOgpj61FxD/yz6LoiQdtX0TKISelAfZxC"
|
||||||
|
username: meet
|
||||||
|
name: John Doe
|
||||||
|
preferredUsername: John
|
||||||
|
userID: 4ad6106f-a64f-43eb-ad0e-380d2cad9a9d
|
||||||
|
groups:
|
||||||
|
- user
|
||||||
|
|
||||||
|
- email: user@chromium.e2e
|
||||||
|
hash: "$2b$10$4Rs3Jd/Q23RM09g7c1Z/yeGmEjoAYlMKXDBkkjERaRDlz0Doiwl2q"
|
||||||
|
username: user-e2e-chromium
|
||||||
|
name: E2E Chromium
|
||||||
|
preferredUsername: E2E
|
||||||
|
userID: 1cd83dfc-153f-4987-b8a6-a2ac72d39122
|
||||||
|
groups:
|
||||||
|
- user
|
||||||
|
|
||||||
|
- email: user@webkit.e2e
|
||||||
|
hash: "$2b$10$D50UlVVMA7qWlB.Pw8P02eMJpo8qfwWuGiA63IeTqq/3mAE7RyH3m"
|
||||||
|
username: user-e2e-webkit
|
||||||
|
name: E2E Webkit
|
||||||
|
preferredUsername: E2E
|
||||||
|
userID: 9b9bd390-a6e5-42f8-a06d-9a11ede7bb8c
|
||||||
|
groups:
|
||||||
|
- user
|
||||||
|
|
||||||
|
- email: user@firefox.e2e
|
||||||
|
hash: "$2b$10$0D8WW7.KXMkzSY2b9JhwYeIM3WkTPQCwGd36/G3TZ/HHh4ObCVRga"
|
||||||
|
username: user-e2e-firefox
|
||||||
|
name: E2E Firefox
|
||||||
|
preferredUsername: E2E
|
||||||
|
userID: ec3e8750-7629-42f1-a0c3-6e23968a2fba
|
||||||
|
groups:
|
||||||
|
- user
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -40,7 +40,7 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://keycloak:8080;
|
proxy_pass http://dex:5556;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
# You can add any necessary service here that will join the same docker network
|
# You can add any necessary service here that will join the same docker network
|
||||||
# sharing keycloak. Services added to the 'meet_resource-server' network will be
|
# sharing the OIDC provider. Services added to the 'meet_resource-server'
|
||||||
# able to communicate with keycloak and the backend on that network.
|
# network will be able to communicate with dex (through nginx) and the backend
|
||||||
|
# on that network.
|
||||||
services:
|
services:
|
||||||
# busybox service is only used for testing purposes. It provides curl to test
|
# busybox service is only used for testing purposes. It provides curl to test
|
||||||
# connectivity to the backend and keycloak services. Replace this with your
|
# connectivity to the backend and the OIDC provider. Replace this with your
|
||||||
# relevant application services that need to communicate with keycloak.
|
# relevant application services that need to communicate with them.
|
||||||
busybox:
|
busybox:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
privileged: true
|
privileged: true
|
||||||
|
|||||||
@@ -71,8 +71,12 @@ $ make bootstrap FLUSH_ARGS='--no-input'
|
|||||||
|
|
||||||
2. Access the project:
|
2. Access the project:
|
||||||
- The frontend is available at [http://localhost:3000](http://localhost:3000) with the default credentials:
|
- The frontend is available at [http://localhost:3000](http://localhost:3000) with the default credentials:
|
||||||
- username: meet
|
- email: meet@meet.world
|
||||||
- password: meet
|
- password: meet
|
||||||
|
|
||||||
|
Authentication is handled by [dex](https://dexidp.io/), configured in
|
||||||
|
`docker/auth/dex.yaml`. It logs you in by email address, and its storage is
|
||||||
|
in-memory: restarting the `dex` container logs everyone out.
|
||||||
- The Django backend is available at [http://localhost:8071](http://localhost:8071)
|
- The Django backend is available at [http://localhost:8071](http://localhost:8071)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -31,24 +31,35 @@ MEDIA_BASE_URL=http://localhost:3000
|
|||||||
FILE_UPLOAD_ENABLED=True
|
FILE_UPLOAD_ENABLED=True
|
||||||
|
|
||||||
# OIDC
|
# OIDC
|
||||||
OIDC_OP_JWKS_ENDPOINT=http://nginx:8083/realms/meet/protocol/openid-connect/certs
|
# Provider is dex (docker/auth/dex.yaml), served behind nginx on port 8083.
|
||||||
OIDC_OP_AUTHORIZATION_ENDPOINT=http://localhost:8083/realms/meet/protocol/openid-connect/auth
|
# Endpoints reached by the browser use localhost, the ones called server-side
|
||||||
OIDC_OP_TOKEN_ENDPOINT=http://nginx:8083/realms/meet/protocol/openid-connect/token
|
# by the backend use the nginx service name.
|
||||||
OIDC_OP_USER_ENDPOINT=http://nginx:8083/realms/meet/protocol/openid-connect/userinfo
|
OIDC_OP_JWKS_ENDPOINT=http://nginx:8083/dex/keys
|
||||||
OIDC_OP_INTROSPECTION_ENDPOINT=http://nginx:8083/realms/meet/protocol/openid-connect/token/introspect
|
OIDC_OP_AUTHORIZATION_ENDPOINT=http://localhost:8083/dex/auth
|
||||||
OIDC_OP_URL=http://localhost:8083/realms/meet
|
OIDC_OP_TOKEN_ENDPOINT=http://nginx:8083/dex/token
|
||||||
|
OIDC_OP_USER_ENDPOINT=http://nginx:8083/dex/userinfo
|
||||||
|
OIDC_OP_INTROSPECTION_ENDPOINT=http://nginx:8083/dex/token/introspect
|
||||||
|
OIDC_OP_URL=http://localhost:8083/dex
|
||||||
|
|
||||||
OIDC_RP_CLIENT_ID=meet
|
OIDC_RP_CLIENT_ID=meet
|
||||||
OIDC_RP_CLIENT_SECRET=ThisIsAnExampleKeyForDevPurposeOnly
|
OIDC_RP_CLIENT_SECRET=ThisIsAnExampleKeyForDevPurposeOnly
|
||||||
OIDC_RP_SIGN_ALGO=RS256
|
OIDC_RP_SIGN_ALGO=RS256
|
||||||
OIDC_RP_SCOPES="openid email"
|
# "profile" is required: dex only emits the name claims under that scope.
|
||||||
|
OIDC_RP_SCOPES="openid email profile"
|
||||||
|
|
||||||
|
# Dex exposes the display name through the standard "name" and
|
||||||
|
# "preferred_username" claims and never emits given_name/family_name.
|
||||||
|
OIDC_USERINFO_FULLNAME_FIELDS=name
|
||||||
|
OIDC_USERINFO_SHORTNAME_FIELD=preferred_username
|
||||||
|
|
||||||
LOGIN_REDIRECT_URL=http://localhost:3000
|
LOGIN_REDIRECT_URL=http://localhost:3000
|
||||||
LOGIN_REDIRECT_URL_FAILURE=http://localhost:3000
|
LOGIN_REDIRECT_URL_FAILURE=http://localhost:3000
|
||||||
LOGOUT_REDIRECT_URL=http://localhost:3000
|
LOGOUT_REDIRECT_URL=http://localhost:3000
|
||||||
|
|
||||||
OIDC_REDIRECT_ALLOWED_HOSTS=localhost:8083,localhost:3000
|
OIDC_REDIRECT_ALLOWED_HOSTS=localhost:8083,localhost:3000
|
||||||
OIDC_AUTH_REQUEST_EXTRA_PARAMS={"acr_values": "eidas1"}
|
# Dex has no notion of ACR, the eIDAS level requested from ProConnect in
|
||||||
|
# production is meaningless here and would just be ignored.
|
||||||
|
OIDC_AUTH_REQUEST_EXTRA_PARAMS={}
|
||||||
|
|
||||||
OIDC_RS_CLIENT_ID=meet
|
OIDC_RS_CLIENT_ID=meet
|
||||||
OIDC_RS_CLIENT_SECRET=ThisIsAnExampleKeyForDevPurposeOnly
|
OIDC_RS_CLIENT_SECRET=ThisIsAnExampleKeyForDevPurposeOnly
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
# Postgresql db container configuration
|
|
||||||
POSTGRES_DB=keycloak
|
|
||||||
POSTGRES_USER=meet
|
|
||||||
POSTGRES_PASSWORD=pass
|
|
||||||
|
|
||||||
# App database configuration
|
|
||||||
DB_HOST=kc_postgresql
|
|
||||||
DB_NAME=keycloak
|
|
||||||
DB_USER=meet
|
|
||||||
DB_PASSWORD=pass
|
|
||||||
DB_PORT=5433
|
|
||||||
Reference in New Issue
Block a user