Skip to content

Commit

Permalink
update documentation and make carl owner in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
voelkera authored and mtwardawski committed May 2, 2024
1 parent baa6ed7 commit 6940e72
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .ci/docker/carl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ COPY ./.ci/docker/carl/entrypoint.sh /opt/entrypoint.sh
RUN groupadd --gid 1000 carl
RUN useradd --create-home --uid 1000 --gid carl --shell /bin/bash carl

ENTRYPOINT ["/opt/entrypoint.sh"]

RUN chown -R carl:carl /opt/opendut-carl/
USER carl

ENTRYPOINT ["/opt/entrypoint.sh"]
CMD ["/opt/opendut-carl/opendut-carl"]
22 changes: 11 additions & 11 deletions doc/src/user-manual/cleo/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ as well as a script.

The archive can be requested at `https://{CARL-HOST}/api/cleo/{architecture}/download`.

This might be the go-to way, if you want to use CLEO in your pipeline.
Once downloaded, extract the files with the command `tar -xvf opendut-cleo-{architecture}.tar.gz`. It will then be extracted into
Available architectures are:
- x86_64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- aarch64-unknown-linux-gnu

This might be the go-to way, if you want to use CLEO in your pipeline.
Once downloaded, extract the files with the command `tar xvf opendut-cleo-{architecture}.tar.gz`. It will then be extracted into
the folder which is the current work directory. You might want to use another directory of your choice.
The tarball contains the `set-env-var.sh` shell script. It can be executed by the command `source set-env-var.sh`, which then sets the
following environment variables to run CLEO:
Expand All @@ -40,21 +45,16 @@ export OPENDUT_CLEO_NETWORK_OIDC_CLIENT_SECRET={{ CLIENT SECRET VARIBALE }}
These two variables can be obtained by logging in to Keycloak.

The last thing to do, is to check if there is already a certificate, which is required to use CLEO.
The provided script is expecting a certificate at the location `/etc/opendut/tls`. If there is no such folder or no file,
it has to be created manually. In this case execute the command: `mkdir -p /etc/opendut/tls`. This will create a folder,
if not yet existent. After that copy the correct certificate (most likely the CA certificate from keycloak) into the newly
created folder with `cp {source folder}/cert.pem /etc/opendut/tls/ca.pem`. The naming is important, because this is how it was stored
in the environment variable `OPENDUT_CLEO_NETWORK_TLS_CA`.
The provided script is expecting a certificate at the location provided by `OPENDUT_CLEO_NETWORK_TLS_CA`. If there is no such folder or no file,
it has to be created manually.


### TL;DR
1. Download archive from `https://{CARL-HOST}/api/cleo/{architecture}/download`
2. Extract `tar -xvf opendut-cleo-{architecture}.tar.gz`
2. Extract `tar xvf opendut-cleo-{architecture}.tar.gz`
3. Execute `source set-env-var.sh`
4. Add two environment variable `export OPENDUT_CLEO_NETWORK_OIDC_CLIENT_ID={{ CLIENT ID VARIBALE }}` and `export OPENDUT_CLEO_NETWORK_OIDC_CLIENT_SECRET={{ CLIENT SECRET VARIBALE }}`
5. (Optional) Check if certificate exists at `/etc/opendut/tls` otherwise follow these steps:
1. `mkdir -p /etc/opendut/tls`
2. `cp {source folder}/cert.pem /etc/opendut/tls/ca.pem`
5. (Optional) Check if certificate exists at location provided by `OPENDUT_CLEO_NETWORK_TLS_CA`.

## Additional notes
- The CA certificate to be provided for CLEO depends on the used certificate authority used on server side for CARL.

0 comments on commit 6940e72

Please sign in to comment.