Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjovanovic committed Aug 22, 2023
1 parent 360c341 commit 2b758f7
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 30 deletions.
10 changes: 2 additions & 8 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,19 @@ COMPOSE_PROJECT_NAME=TRUE_Connector

BROKER_URL=https://broker.ids.isst.fraunhofer.de/infrastructure

DISABLE_SSL_VALIDATION=true
#Enable HTTPS
SERVER_SSL_ENABLED=true
#SSL settings
KEYSTORE_NAME=ssl-server.jks
KEY_PASSWORD=changeit
KEYSTORE_PASSWORD=changeit
ALIAS=execution-core-container

#TRUSTORE (used also by IDSCP2)
TRUSTORE_NAME=
TRUSTORE_PASSWORD=
TRUSTORE_NAME=truststoreEcc.jks
TRUSTORE_PASSWORD=allpassword

CACHE_TOKEN=false
FETCH_TOKEN_ON_STARTUP=false

#Camel
REST_ENABLE_HTTPS=true

# REST Communication type between ECC - mixed | form | http-header
MULTIPART_ECC=form

Expand Down
30 changes: 26 additions & 4 deletions doc/TRUEConnector/start-stop.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,44 @@

To setup the TRUE connector for starting container, execute the following command:

# For Linux

```
sudo ./prepopulate_be_dataapp_data_provider.sh
```
With this command, you will create external `be_dataapp_data_provider` volume.

***NOTE:*** If you're using Linux, check if script is executable, if not, run the next command:
***NOTE:*** Check if script is executable, if not, run the next command:

```
chmod +x prepopulate_be_dataapp_data_provider.sh
```

# For Windows

In the *prepopulate_be_dataapp_data_provider_win.sh* change the *FULL_PATH* with the full path where the TRUE Connector is located:

```
docker run --rm -v "FULL_PATH/be-dataapp_data_provider:/source_data" -v "be_dataapp_provider_data:/target_data" alpine sh -c "cp -r /source_data/* /target_data/datalake/"
```

For example:

```
docker run --rm -v "C:/true-connector/be-dataapp_data_provider:/source_data" -v "be_dataapp_provider_data:/target_data" alpine sh -c "cp -r /source_data/* /target_data/datalake/"
```

And run the next command:

```
sh prepopulate_be_dataapp_data_provider_win.sh
```


# For both systems

To start docker container, open terminal and execute following command:

```
Expand Down Expand Up @@ -92,9 +117,6 @@ Consumer connector:

_https://localhost:8091/about/version_

or self description document:\
_https://localhost:8090/_

Ctrl+C is used to exit from log inspection (you will be returned to the terminal).

To stop containers, execute following:
Expand Down
16 changes: 2 additions & 14 deletions doc/TRUEConnector/volumes.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ be_dataapp_consumer_data

Those volumes will store data needed for corresponding service, like log files, self description file, Usage Control H2 database (default configuration) and dataApp resource storage.

Volume `be_dataapp_provider_data` is external volume. In order to create it, please execute the script `prepopulate_be_dataapp_data_provider.sh` running next command:
Volume `be_dataapp_provider_data` is an external volume which was created following the [start-stop.md](start-stop.md) .

```
sudo ./prepopulate_be_dataapp_data_provider.sh
```

***NOTE:*** If you're using Linux, check if script is executable, if not, run the next command:

```
chmod +x prepopulate_be_dataapp_data_provider.sh
```

Running this script, all files present on the host in folder `be-dataapp_data_provder` will be present in volume, so if you need to have some files present in volume, please put them in this folder before running script, and all of them will be present in `DataApp Provider` application.
Following the instructions, all files present on the host in the folder `be-dataapp_data_provder` will be present in the volume, so if you need to have some files present in volume, please put them in this folder before running the script and all of them will be present in `DataApp Provider` application.
8 changes: 4 additions & 4 deletions doc/backupAndUpdate/backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ To backup and restore data we will be using the official Docker documentation as
In order to backup your data you can use the following code snippet:

```
docker run --rm --volumes-from ecc-consumer -v %cd%:/backup ubuntu tar cvf /backup/backup.tar /home/nobody/data/log
docker run --rm --volumes-from ecc-consumer -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /home/nobody/data/log
```

Let me explain the options:

- ecc-consumer - container with the data that you want to backup
- %cd% - current directory in the command prompt ( same as $(pwd) on Linux); the directory where you want the backup to be located
- $(pwd) - current directory in the command prompt (use %cd% on Windows); the directory where you want the backup to be located
- /backup.tar - name of the backup archive
- /home/nobody/data/log - directory or file from the container that you wish to backup

Expand All @@ -24,13 +24,13 @@ After the process finishes you will find a .tar file with the data.
Restoring the data is done in a similar way:

```
docker run --rm --volumes-from ecc-consumer -v %cd%:/backup ubuntu bash -c "cd /home && tar xvf /backup/backup.tar --strip 1"
docker run --rm --volumes-from ecc-consumer -v $(pwd):/backup ubuntu bash -c "cd /home && tar xvf /backup/backup.tar --strip 1"
```

The options are:

- ecc-consumer - container where you want to restore the data
- %cd% - current directory in the command prompt ( same as $(pwd) on Linux); the directory where the backup is located
- $(pwd) - current directory in the command prompt (use %cd% on Windows); the directory where the backup is located
- /home - directory where the data will be restored
- /backup.tar - name of the backup archive

Expand Down
18 changes: 18 additions & 0 deletions prepopulate_be_dataapp_data_provider_win.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

# Remove the existing Docker volume (ignoring errors if it doesn't exist)
docker volume rm be_dataapp_provider_data || true

# Replace 'be-be_dataapp_provider_data' with the actual volume name you want to create
docker volume create be_dataapp_provider_data

# Create the 'datalake' directory inside the 'be_dataapp_provider_data' volume with the desired ownership
docker run --rm -v "be_dataapp_provider_data:/target_data" alpine sh -c "mkdir -p /target_data/datalake && chown -R nobody:nogroup /target_data/datalake"

# Copy data from the 'be-dataapp_data_provider' folder to the 'target_data/datalake' directory inside the Docker volume
docker run --rm -v "FULL_PATH/be-dataapp_data_provider:/source_data" -v "be_dataapp_provider_data:/target_data" alpine sh -c "cp -r /source_data/* /target_data/datalake/"

# Create the 'log' directory inside the 'be_dataapp_provider_data' volume with the desired ownership
docker run --rm -v "be_dataapp_provider_data:/target_data" alpine sh -c "mkdir -p /target_data/log/dataapp && chown -R nobody:nogroup /target_data/log/dataapp"

# Change the ownership of the Docker volume contents to 'nobody:nogroup'
docker run --rm -v "be_dataapp_provider_data:/target_data" alpine sh -c "chown -R nobody:nogroup /target_data"

0 comments on commit 2b758f7

Please sign in to comment.