You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "docker-compose.services.yml" file includes Keycloak and APISIX containers that you can use for authentication instead of spinning up separate ones or using the deployed instances. It's not enabled by default, but you can run it if you prefer not to run your own Keycloak/APISIX instances.
3
+
The "docker-compose.services.yml" file includes Keycloak and APISIX containers
4
+
that you can use for authentication instead of spinning up separate ones or
5
+
using the deployed instances. It's not enabled by default, but you can run it if
6
+
you prefer not to run your own Keycloak/APISIX instances.
4
7
5
8
## Default Settings
6
9
7
10
There are some defaults that are part of this.
8
11
9
-
_SSL Certificate_: There's a self-signed cert that's in `config/keycloak/tls` - if you'd rather set up your own (or you have a real cert or something to use), you can drop the PEM files in there. See the README there for info.
12
+
_SSL Certificate_: There's a self-signed cert that's in `config/keycloak/tls` -
13
+
if you'd rather set up your own (or you have a real cert or something to use),
14
+
you can drop the PEM files in there. See the README there for info.
10
15
11
-
_Realm_: There's a `default-realm.json` in `config/keycloak` that will get loaded by Keycloak when it starts up, and will set up a realm for you with some users and a client so you don't have to set it up yourself. The realm it creates is called `ol-local`.
16
+
_Realm_: There's a `ol-local-realm.json` in `config/keycloak` that will get
17
+
loaded by Keycloak when it starts up, and will set up a realm for you with some
18
+
users and a client so you don't have to set it up yourself. The realm it creates
The client it sets up is called `apisix`. You can change the passwords and get the secret in the admin.
29
+
The client it sets up is called `apisix`. You can change the passwords and get
30
+
the secret in the admin.
22
31
23
32
## Making it Work
24
33
25
-
The Keycloak instance is part of the `keycloak` profile in the Composer file, so if you want to interact with it, you'll need to run `COMPOSE_PROFILES=backend,frontend,keycloak,apisix docker compose up`. (If you start the app without the profile, you can still start Keycloak later by specifying the profile.)
34
+
The Keycloak instance is part of the `keycloak` profile in the Composer file, so
35
+
if you want to interact with it, you'll need to run
36
+
`COMPOSE_PROFILES=backend,frontend,keycloak,apisix docker compose up`. (If you
37
+
start the app without the profile, you can still start Keycloak later by
38
+
specifying the profile.)
26
39
27
40
If you want to use the Keycloak and APISIX instances, follow these steps:
28
41
29
-
1. Change the value of `MITOL_API_BASE_URL` to `http://api.open.odl.local:8065` in your `shared.local.env` file.
30
-
2. Add `MITOL_NEW_USER_LOGIN_URL=http://open.odl.local:8062/onboarding` to your `shared.local.env` file
31
-
3. Copy all the env values under the "# APISIX/Keycloak " section of `backend.local.example.env` to your `backend.local.env` file. You can leave all the values as is.
32
-
Remove `DISABLE_APISIX_USER_MIDDLEWARE=False` if present in your backend.local.env file.
33
-
4. Keycloak needs to create its own database, which will only happen if you first destroy your current mit-learn database container: `docker compose down db`. If you prefer not to do this, you can manually create it by running the SQL in `config/postgres/init-keycloak.sql` in a postgres shell.
34
-
5. Start containers with the command `COMPOSE_PROFILES=backend,frontend,keycloak,apisix docker compose up`
35
-
36
-
The Keycloak and APISIX containers should start up and stay running. APISIX is on port 8065, Keycloak on port 8066. Now you should be able to log in at `https://open.odl.local:8065/login` with one of the users mentioned above, or just click "Log in" from the home page at http://open.odl.local:8062. Try logging out and back in a couple times to make sure it works.
42
+
1. Change the value of `MITOL_API_BASE_URL` to `http://api.open.odl.local:8065`
43
+
in your `shared.local.env` file.
44
+
2. Add `MITOL_NEW_USER_LOGIN_URL=http://open.odl.local:8062/onboarding` to your
45
+
`shared.local.env` file
46
+
3. Copy all the env values under the "# APISIX/Keycloak " section of
47
+
`backend.local.example.env` to your `backend.local.env` file. You can leave
48
+
all the values as is. Remove `DISABLE_APISIX_USER_MIDDLEWARE=False` if
49
+
present in your backend.local.env file.
50
+
4. Keycloak needs to create its own database, which will only happen if you
51
+
first destroy your current mit-learn database container:
52
+
`docker compose down db`. If you prefer not to do this, you can manually
53
+
create it by running the SQL in `config/postgres/init-keycloak.sql` in a
0 commit comments