Skip to content

Commit

Permalink
Update deps, rspack, docker
Browse files Browse the repository at this point in the history
  • Loading branch information
driver-deploy-2 committed Jan 19, 2024
1 parent 89fa9c7 commit cf9421e
Show file tree
Hide file tree
Showing 15 changed files with 4,678 additions and 1,163 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WORKDIR /code
COPY package.json ./
RUN npm i
COPY ./src ./src
COPY tsconfig.json rspack.config.js ./
COPY tsconfig.json rspack.config.ts ./
RUN npm run build

FROM node:18-alpine
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# LESSONS-LEARNED-FRAMEWORK

A web application for storing and searching your lessons learned. See [l3crisis.eu](https://l3crisis.eu) for the live version.
A web application for storing and searching your lessons learned.
<!-- See [l3crisis.eu](https://l3crisis.eu) for the live version. -->

![landing page](img/ss0_landing.png)

## Installation

Install all dependencies, start the database service and run parcel to bundle your dependencies. You can access the application at [http://localhost:3000](http://localhost:3000).
Install all dependencies, start the database service and run `rspack` to bundle your dependencies. You can access the application at [http://localhost:3000](http://localhost:3000).

```bash
npm i
Expand All @@ -16,7 +17,7 @@ npm run serve

## Development

As above, but now run `parcel` in watch mode.
As above, but now run `rspack` in watch mode.

```bash
npm i
Expand All @@ -28,6 +29,8 @@ npm start
- LOKI_PORT: to change the output port, default 3000, e.g. `set LOKI_PORT=80` to serve it at [http://localhost](http://localhost).
- NODE_DEV: When set to `development`, every server request is logged to the command line. Set it to `production` to stop logging requests.

Run `Keycloak` as explained in the `docker` folder.

## Screenshots

![events](img/ss1_events.png)
Expand All @@ -47,7 +50,7 @@ npm start
- FIX: Edit rights on kcr2 website
- Add the option to upload reports
- Add the option to upload one image of the incident (for the infographic)
- Make a separate app for the infographics view (with a link to the L3)
- Make a separate app for the infographics view (with a link to the L3) -> GRIP-ATLAS
- FIX: The non-edit view, since there are new types available. Also update the way lessons are shown.
- Implement traffic light + smiley for the lessons
- Show default image and/or infographic for each CM incident type
Expand Down
29 changes: 29 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Running KEYCLOAK

KEYCLOAK is an Identity Provider, and you can run it simply by using the `docker-compose.yaml` file:

```bash
docker-compose up -d keycloak # In case you don't specify the name, it will also run the l3
```

After logging in as admin, you need to perform the following steps:

- Create the l3 realm (either using the `/export/l3-realm.json` or `realm-l3.json`)
- Create realm roles in l3, i.e. `admin` and `editor`.
- Create realm groups, i.e. `Admins` with role `admin` and `Editors` with role `editor`
- Add users and, optionally, have them join the group of `Admins` or `Editors`

## Exporting settings

In a `Bitnami` image, the user is not root. So if you want to export your settings to a mounted volume `./export`, the user permissions are not correct. [See here for more information](https://stackoverflow.com/a/29251160/319711). However, you can change the local `./export` folder permissions in Linux to match the ones expected inside the container, so we can use the export command (either from outside or inside the container).

```bash
# Identify the current user
docker exec kc id keycloak
# uid=1001(keycloak) gid=1000(keycloak) groups=1000(keycloak)

# Change the owner of the local folder, so the keycloak user inside the container can write to it.
sudo chown -R 1001:1000 export/
# Export the settings
docker exec kc /opt/bitnami/keycloak/bin/kc.sh export --realm l3 --dir /tmp/export --users same_file
```
1 change: 1 addition & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ services:
- "8765:8080"
volumes:
- ./realms:/opt/jboss/keycloak/
- ./export:/tmp/export/
l3:
image: l3crisis
profiles: ["full"]
Expand Down
2 changes: 1 addition & 1 deletion docker/example.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ADMIN_PWD="TNO4everafter"
ADMIN_PWD="PWD"
Loading

0 comments on commit cf9421e

Please sign in to comment.