From 2b758f7a9eba147d33e3119bac6271a70e00d60d Mon Sep 17 00:00:00 2001 From: David Jovanovic Date: Tue, 22 Aug 2023 14:25:24 +0200 Subject: [PATCH] updated docs --- .env | 10 ++----- doc/TRUEConnector/start-stop.md | 30 ++++++++++++++++++--- doc/TRUEConnector/volumes.md | 16 ++--------- doc/backupAndUpdate/backup.md | 8 +++--- prepopulate_be_dataapp_data_provider_win.sh | 18 +++++++++++++ 5 files changed, 52 insertions(+), 30 deletions(-) create mode 100644 prepopulate_be_dataapp_data_provider_win.sh diff --git a/.env b/.env index 86c32da..d5fe922 100644 --- a/.env +++ b/.env @@ -2,9 +2,6 @@ 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 @@ -12,15 +9,12 @@ 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 diff --git a/doc/TRUEConnector/start-stop.md b/doc/TRUEConnector/start-stop.md index 2f5ccc8..c77bbb9 100644 --- a/doc/TRUEConnector/start-stop.md +++ b/doc/TRUEConnector/start-stop.md @@ -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: ``` @@ -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: diff --git a/doc/TRUEConnector/volumes.md b/doc/TRUEConnector/volumes.md index 728fb5e..d87bd14 100644 --- a/doc/TRUEConnector/volumes.md +++ b/doc/TRUEConnector/volumes.md @@ -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. diff --git a/doc/backupAndUpdate/backup.md b/doc/backupAndUpdate/backup.md index 6e03e47..343e081 100644 --- a/doc/backupAndUpdate/backup.md +++ b/doc/backupAndUpdate/backup.md @@ -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 @@ -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 diff --git a/prepopulate_be_dataapp_data_provider_win.sh b/prepopulate_be_dataapp_data_provider_win.sh new file mode 100644 index 0000000..e360168 --- /dev/null +++ b/prepopulate_be_dataapp_data_provider_win.sh @@ -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" \ No newline at end of file