From f0a9be5337793e6c2f80e84da718cc4b4f58d91b Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Wed, 28 Feb 2024 11:51:14 +0000 Subject: [PATCH 01/19] add: short and long hostnames to config.php --- docker/scripts/init-nextcloud-sciencemesh.sh | 10 +++---- docker/scripts/init-nextcloud-solid.sh | 20 ++++++++----- docker/scripts/init-nextcloud-sunet.sh | 9 ++++-- docker/scripts/init-nextcloud.sh | 9 ++++-- docker/scripts/init-owncloud-opencloudmesh.sh | 7 +++-- docker/scripts/init-owncloud-rd-sram.sh | 8 ++--- docker/scripts/init-owncloud-sciencemesh.sh | 8 ++--- docker/scripts/init-owncloud-sm-ocm.sh | 8 ++--- docker/scripts/init-owncloud-sm-sram-ocm.sh | 8 ++--- docker/scripts/init-owncloud-surf-trashbin.sh | 7 +++-- .../init-owncloud-token-based-access.sh | 29 ++++++++++--------- docker/scripts/init-owncloud.sh | 7 +++-- 12 files changed, 76 insertions(+), 54 deletions(-) diff --git a/docker/scripts/init-nextcloud-sciencemesh.sh b/docker/scripts/init-nextcloud-sciencemesh.sh index 3a977261..66fca03b 100755 --- a/docker/scripts/init-nextcloud-sciencemesh.sh +++ b/docker/scripts/init-nextcloud-sciencemesh.sh @@ -9,10 +9,10 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} php console.php app:disable firstrunwizard # change/add lines in config.php -sed -i "3 i\ 'allow_local_remote_servers' => true," config/config.php -sed -i "8 i\ 1 => 'nc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'nc2.docker'," /var/www/html/config/config.php -sed -i "10 i\ 3 => 'nextcloud1.docker'," /var/www/html/config/config.php -sed -i "11 i\ 4 => 'nextcloud2.docker'," /var/www/html/config/config.php +sed -i "3 i\ 'allow_local_remote_servers' => true," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'nc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'nc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'nextcloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'nextcloud2.docker'," /var/www/html/config/config.php php console.php app:enable sciencemesh diff --git a/docker/scripts/init-nextcloud-solid.sh b/docker/scripts/init-nextcloud-solid.sh index b851d299..acc95c3e 100755 --- a/docker/scripts/init-nextcloud-solid.sh +++ b/docker/scripts/init-nextcloud-solid.sh @@ -8,17 +8,21 @@ php console.php maintenance:install --admin-user "$USER" --admin-pass "$PASS" -- --database-pass "eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek" php console.php app:disable firstrunwizard -sed -i "8 i\ 1 => 'nc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'nc2.docker'," /var/www/html/config/config.php -sed -i "3 i\ 'allow_local_remote_servers' => true," config/config.php +# change/add lines in config.php +sed -i "3 i\ 'allow_local_remote_servers' => true," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'nc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'nc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'nextcloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'nextcloud2.docker'," /var/www/html/config/config.php +sed -i "27 i\ 1 => 'server'," config/config.php php console.php app:enable solid -sed -i "109 i\ RewriteCond %{REQUEST_URI} \!^/\\\.well-known/openid-configuration" .htaccess -sed -i "72 i\ RewriteCond %{REQUEST_URI} \!^/\\\.well-known/openid-configuration" .htaccess -echo "\n Header set Access-Control-Allow-Origin \"*\"\n" >> .htaccess +sed -i "109 i\ RewriteCond %{REQUEST_URI} \!^/\\\.well-known/openid-configuration" .htaccess +sed -i "72 i\ RewriteCond %{REQUEST_URI} \!^/\\\.well-known/openid-configuration" .htaccess +echo "\n Header set Access-Control-Allow-Origin \"*\"\n" >> .htaccess + mkdir -p .well-known SERVER_ROOT_ESCAPED=$(printf '%s\n' "$SERVER_ROOT" | sed -e 's/[\/&]/\\&/g') + echo "{\"id_token_signing_alg_values_supported\":[\"RS256\"],\"response_types_supported\":[\"code\",\"code token\",\"code id_token\",\"id_token code\",\"id_token\",\"id_token token\",\"code id_token token\",\"none\"],\"subject_types_supported\":[\"public\"],\"issuer\":\"$SERVER_ROOT_ESCAPED\",\"authorization_endpoint\":\"$SERVER_ROOT_ESCAPED\/apps\/solid\/authorize\",\"jwks_uri\":\"$SERVER_ROOT_ESCAPED\/apps\/solid\/jwks\",\"response_modes_supported\":[\"query\",\"fragment\"],\"grant_types_supported\":[\"authorization_code\",\"implicit\",\"refresh_token\",\"client_credentials\"],\"token_endpoint_auth_methods_supported\":\"client_secret_basic\",\"token_endpoint_auth_signing_alg_values_supported\":[\"RS256\"],\"display_values_supported\":[],\"claim_types_supported\":[\"normal\"],\"claims_supported\":[],\"claims_parameter_supported\":false,\"request_parameter_supported\":true,\"request_uri_parameter_supported\":false,\"require_request_uri_registration\":false,\"token_endpoint\":\"$SERVER_ROOT_ESCAPED\/apps\/solid\/token\",\"userinfo_endpoint\":\"$SERVER_ROOT_ESCAPED\/apps\/solid\/userinfo\",\"registration_endpoint\":\"$SERVER_ROOT_ESCAPED\/apps\/solid\/register\"}" > .well-known/openid-configuration -sed -i "25 i\ 1 => 'server'," config/config.php -echo configured \ No newline at end of file diff --git a/docker/scripts/init-nextcloud-sunet.sh b/docker/scripts/init-nextcloud-sunet.sh index e84cf545..69fd784b 100755 --- a/docker/scripts/init-nextcloud-sunet.sh +++ b/docker/scripts/init-nextcloud-sunet.sh @@ -8,9 +8,12 @@ php console.php maintenance:install --admin-user "$USER" --admin-pass "$PASS" -- --database-pass "eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek" php console.php app:disable firstrunwizard -sed -i "8 i\ 1 => 'nc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'nc2.docker'," /var/www/html/config/config.php -sed -i "3 i\ 'allow_local_remote_servers' => true," config/config.php +# change/add lines in config.php +sed -i "3 i\ 'allow_local_remote_servers' => true," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'nc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'nc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'nextcloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'nextcloud2.docker'," /var/www/html/config/config.php php console.php app:enable user_saml # php console.php app:enable mfachecker diff --git a/docker/scripts/init-nextcloud.sh b/docker/scripts/init-nextcloud.sh index da450c12..d4e4905c 100755 --- a/docker/scripts/init-nextcloud.sh +++ b/docker/scripts/init-nextcloud.sh @@ -8,6 +8,9 @@ php console.php maintenance:install --admin-user "$USER" --admin-pass "$PASS" -- --database-pass "eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek" php console.php app:disable firstrunwizard -sed -i "8 i\ 1 => 'nc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'nc2.docker'," /var/www/html/config/config.php -sed -i "3 i\ 'allow_local_remote_servers' => true," config/config.php +# change/add lines in config.php +sed -i "3 i\ 'allow_local_remote_servers' => true," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'nc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'nc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'nextcloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'nextcloud2.docker'," /var/www/html/config/config.php diff --git a/docker/scripts/init-owncloud-opencloudmesh.sh b/docker/scripts/init-owncloud-opencloudmesh.sh index 5591b69c..f9a47678 100755 --- a/docker/scripts/init-owncloud-opencloudmesh.sh +++ b/docker/scripts/init-owncloud-opencloudmesh.sh @@ -13,8 +13,11 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} --database-pass "eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek" php console.php app:disable firstrunwizard -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +# change/add lines in config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php echo "Installing Custom Groups" php console.php app:enable customgroups diff --git a/docker/scripts/init-owncloud-rd-sram.sh b/docker/scripts/init-owncloud-rd-sram.sh index c8447b3c..9d2f5293 100755 --- a/docker/scripts/init-owncloud-rd-sram.sh +++ b/docker/scripts/init-owncloud-rd-sram.sh @@ -14,10 +14,10 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} php console.php app:disable firstrunwizard # change/add lines in config.php -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php -sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php -sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php echo "Installing Custom Groups" php console.php app:enable customgroups diff --git a/docker/scripts/init-owncloud-sciencemesh.sh b/docker/scripts/init-owncloud-sciencemesh.sh index 4a96a3f1..4b18bfd0 100755 --- a/docker/scripts/init-owncloud-sciencemesh.sh +++ b/docker/scripts/init-owncloud-sciencemesh.sh @@ -9,10 +9,10 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} php console.php app:disable firstrunwizard # change/add lines in config.php -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php -sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php -sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php php console.php app:enable sciencemesh sed -i "3 i\ 'sharing.managerFactory' => 'OCA\\\\ScienceMesh\\\\ScienceMeshProviderFactory'," /var/www/html/config/config.php diff --git a/docker/scripts/init-owncloud-sm-ocm.sh b/docker/scripts/init-owncloud-sm-ocm.sh index 2e9f4fa5..2e16644c 100755 --- a/docker/scripts/init-owncloud-sm-ocm.sh +++ b/docker/scripts/init-owncloud-sm-ocm.sh @@ -9,10 +9,10 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} php console.php app:disable firstrunwizard # change/add lines in config.php -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php -sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php -sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php echo "Installing Custom Groups" php console.php app:enable customgroups diff --git a/docker/scripts/init-owncloud-sm-sram-ocm.sh b/docker/scripts/init-owncloud-sm-sram-ocm.sh index 390d98f0..18cadc46 100755 --- a/docker/scripts/init-owncloud-sm-sram-ocm.sh +++ b/docker/scripts/init-owncloud-sm-sram-ocm.sh @@ -9,10 +9,10 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} php console.php app:disable firstrunwizard # change/add lines in config.php -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php -sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php -sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php echo "Installing Custom Groups" php console.php app:enable customgroups diff --git a/docker/scripts/init-owncloud-surf-trashbin.sh b/docker/scripts/init-owncloud-surf-trashbin.sh index e66fca1a..10a006e5 100755 --- a/docker/scripts/init-owncloud-surf-trashbin.sh +++ b/docker/scripts/init-owncloud-surf-trashbin.sh @@ -14,8 +14,11 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} php console.php app:disable firstrunwizard -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +# change/add lines in config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php echo "Installing SURF Trashbin" php console.php app:enable surf_trashbin diff --git a/docker/scripts/init-owncloud-token-based-access.sh b/docker/scripts/init-owncloud-token-based-access.sh index cf44ebf6..50591691 100755 --- a/docker/scripts/init-owncloud-token-based-access.sh +++ b/docker/scripts/init-owncloud-token-based-access.sh @@ -13,21 +13,24 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} php console.php app:disable firstrunwizard -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +# change/add lines in config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php # insert redis cache details into config.php -sed -i "40 i\ 'filelocking.enabled' => true," /var/www/html/config/config.php -sed -i "41 i\ 'memcache.locking' => '\\OC\\Memcache\\Redis'," /var/www/html/config/config.php -sed -i "42 i\ 'memcache.local' => '\\OC\\Memcache\\Redis'," /var/www/html/config/config.php -sed -i "43 i\ 'memcache.distributed' => '\\OC\\Memcache\\Redis'," /var/www/html/config/config.php -sed -i "44 i\ 'redis' => [" /var/www/html/config/config.php -sed -i "45 i\ 'host' => '${REDIS_HOST}'," /var/www/html/config/config.php -sed -i "46 i\ 'port' => 6379," /var/www/html/config/config.php -sed -i "47 i\ 'timeout' => 0," /var/www/html/config/config.php -sed -i "48 i\ 'password' => ''," /var/www/html/config/config.php -sed -i "49 i\ 'dbindex' => 0," /var/www/html/config/config.php -sed -i "50 i\ ]," /var/www/html/config/config.php +sed -i "42 i\ 'filelocking.enabled' => true," /var/www/html/config/config.php +sed -i "43 i\ 'memcache.locking' => '\\OC\\Memcache\\Redis'," /var/www/html/config/config.php +sed -i "44 i\ 'memcache.local' => '\\OC\\Memcache\\Redis'," /var/www/html/config/config.php +sed -i "45 i\ 'memcache.distributed' => '\\OC\\Memcache\\Redis'," /var/www/html/config/config.php +sed -i "46 i\ 'redis' => [" /var/www/html/config/config.php +sed -i "47 i\ 'host' => '${REDIS_HOST}'," /var/www/html/config/config.php +sed -i "48 i\ 'port' => 6379," /var/www/html/config/config.php +sed -i "49 i\ 'timeout' => 0," /var/www/html/config/config.php +sed -i "50 i\ 'password' => ''," /var/www/html/config/config.php +sed -i "51 i\ 'dbindex' => 0," /var/www/html/config/config.php +sed -i "52 i\ ]," /var/www/html/config/config.php # some how above command doesn't have the corrct backslash escaping and we have to do it again! sed -i 's/OCMemcacheRedis/\\OC\\Memcache\\Redis/g' /var/www/html/config/config.php diff --git a/docker/scripts/init-owncloud.sh b/docker/scripts/init-owncloud.sh index be4dd26e..0dc002b3 100755 --- a/docker/scripts/init-owncloud.sh +++ b/docker/scripts/init-owncloud.sh @@ -8,5 +8,8 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} --database-pass "eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek" php console.php app:disable firstrunwizard -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +# change/add lines in config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php From 9d2a88afae323579b91f0375c8c8bdd4bf7fa437 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 08:22:41 +0000 Subject: [PATCH 02/19] add: development scripts for base efss --- dev/efss-base.sh | 128 ++++++++++++++++++++++++++++++++++++++++ dev/efss-nn.sh | 27 +++++++++ dev/efss-no.sh | 27 +++++++++ dev/efss-oo.sh | 27 +++++++++ tests/base-nextcloud.sh | 108 --------------------------------- tests/base-owncloud.sh | 108 --------------------------------- 6 files changed, 209 insertions(+), 216 deletions(-) create mode 100755 dev/efss-base.sh create mode 100755 dev/efss-nn.sh create mode 100755 dev/efss-no.sh create mode 100755 dev/efss-oo.sh delete mode 100755 tests/base-nextcloud.sh delete mode 100755 tests/base-owncloud.sh diff --git a/dev/efss-base.sh b/dev/efss-base.sh new file mode 100755 index 00000000..e9945c42 --- /dev/null +++ b/dev/efss-base.sh @@ -0,0 +1,128 @@ +#!/usr/bin/env bash + +# @michielbdejong halt on error in docker init scripts +set -e + +# find this scripts location. +SOURCE=${BASH_SOURCE[0]} +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" +done +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + +cd "${DIR}/.." || exit + +ENV_ROOT=$(pwd) +export ENV_ROOT=${ENV_ROOT} + +function waitForPort () { + echo waitForPort "${1}" "${2}" + # the "| cat" after the "| grep" is to prevent the command from exiting with 1 if no match is found by grep. + x=$(docker exec -it "${1}" ss -tulpn | grep -c "${2}" | cat) + until [ "${x}" -ne 0 ] + do + echo Waiting for "${1}" to open port "${2}", this usually takes about 10 seconds ... "${x}" + sleep 1 + x=$(docker exec -it "${1}" ss -tulpn | grep -c "${2}" | cat) + done + echo "${1}" port "${2}" is open +} + +function createEfss() { + local platform="${1}" + local number="${2}" + local user="${3}" + local password="${4}" + + echo "creating efss ${platform} ${number}" + + docker run --detach --network=testnet \ + --name="maria${platform}${number}.docker" \ + -e MARIADB_ROOT_PASSWORD=eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek \ + mariadb \ + --transaction-isolation=READ-COMMITTED \ + --binlog-format=ROW \ + --innodb-file-per-table=1 \ + --skip-innodb-read-only-compressed \ + + docker run --detach --network=testnet \ + --name="${platform}${number}.docker" \ + --add-host "host.docker.internal:host-gateway" \ + -e HOST="${platform}${number}" \ + -e DBHOST="maria${platform}${number}.docker" \ + -e USER="${user}" \ + -e PASS="${password}" \ + -v "${ENV_ROOT}/docker/tls:/tls-host" \ + -v "${ENV_ROOT}/temp/${platform}.sh:/${platform}-init.sh" \ + -v "${ENV_ROOT}/docker/scripts/entrypoint.sh:/entrypoint.sh" \ + "pondersource/dev-stock-${platform}" \ + + # wait for hostname port to be open + waitForPort "maria${platform}${number}.docker" 3306 + waitForPort "${platform}${number}.docker" 443 + + # add self-signed certificates to os and trust them. (use >/dev/null 2>&1 to shut these up) + docker exec "${platform}${number}.docker" bash -c "cp /tls/*.crt /usr/local/share/ca-certificates/" >/dev/null 2>&1 + docker exec "${platform}${number}.docker" bash -c "cp /tls-host/*.crt /usr/local/share/ca-certificates/" >/dev/null 2>&1 + docker exec "${platform}${number}.docker" update-ca-certificates >/dev/null 2>&1 + docker exec "${platform}${number}.docker" bash -c "cat /etc/ssl/certs/ca-certificates.crt >> /var/www/html/resources/config/ca-bundle.crt" >/dev/null 2>&1 + + # run init script inside efss. + docker exec -u www-data "${platform}${number}.docker" sh "/${platform}-init.sh" + + echo "" +} + +# delete and create temp directory. +rm -rf "${ENV_ROOT}/temp" && mkdir --parents "${ENV_ROOT}/temp" + +# copy init files. +cp -f "${ENV_ROOT}/docker/scripts/init-owncloud.sh" "${ENV_ROOT}/temp/owncloud.sh" +cp -f "${ENV_ROOT}/docker/scripts/init-nextcloud.sh" "${ENV_ROOT}/temp/nextcloud.sh" + +# make sure network exists. +docker network inspect testnet >/dev/null 2>&1 || docker network create testnet >/dev/null 2>&1 + +# get platform from cli arguments. +EFSS1="${1-nextcloud}" +EFSS2="${2-owncloud}" + +############ +### EFSS ### +############ + +# syntax: +# createEfss platform number username password +# +# +# platform: owncloud, nextcloud. +# number: should be unique for each platform, for example: you cannot have two Nextclouds with same number. +# username: username for sign in into efss. +# password: password for sign in into efss. + +createEfss "${EFSS1}" 1 einstein relativity +createEfss "${EFSS2}" 2 marie radioactivity + +############### +### Firefox ### +############### + +docker run --detach --network=testnet \ + --name=firefox \ + -p 5800:5800 \ + --shm-size 2g \ + jlesage/firefox:latest \ + >/dev/null 2>&1 + + +# print instructions. +clear +echo "Now browse to :" +echo "Embedded Firefox -> http://localhost:5800" +echo "" +echo "Inside Embedded Firefox browse to EFSS hostname and enter the related credentials:" +echo "https://${EFSS1}1.docker -> username: einstein password: relativity" +echo "https://${EFSS2}2.docker -> username: marie password: radioactivity" diff --git a/dev/efss-nn.sh b/dev/efss-nn.sh new file mode 100755 index 00000000..35724a13 --- /dev/null +++ b/dev/efss-nn.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# @michielbdejong halt on error in docker init scripts +set -e + +# find this scripts location. +SOURCE=${BASH_SOURCE[0]} +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" +done +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + +cd "${DIR}/.." || exit + +ENV_ROOT=$(pwd) +export ENV_ROOT=${ENV_ROOT} + +# syntax: +# efss-base.sh platform1 platform2 +# +# +# platform1: owncloud, nextcloud. +# platform2: owncloud, nextcloud. +"${ENV_ROOT}/dev/efss-base.sh" nextcloud nextcloud diff --git a/dev/efss-no.sh b/dev/efss-no.sh new file mode 100755 index 00000000..bc833194 --- /dev/null +++ b/dev/efss-no.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# @michielbdejong halt on error in docker init scripts +set -e + +# find this scripts location. +SOURCE=${BASH_SOURCE[0]} +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" +done +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + +cd "${DIR}/.." || exit + +ENV_ROOT=$(pwd) +export ENV_ROOT=${ENV_ROOT} + +# syntax: +# efss-base.sh platform1 platform2 +# +# +# platform1: owncloud, nextcloud. +# platform2: owncloud, nextcloud. +"${ENV_ROOT}/dev/efss-base.sh" nextcloud owncloud diff --git a/dev/efss-oo.sh b/dev/efss-oo.sh new file mode 100755 index 00000000..64a466e5 --- /dev/null +++ b/dev/efss-oo.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# @michielbdejong halt on error in docker init scripts +set -e + +# find this scripts location. +SOURCE=${BASH_SOURCE[0]} +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" +done +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + +cd "${DIR}/.." || exit + +ENV_ROOT=$(pwd) +export ENV_ROOT=${ENV_ROOT} + +# syntax: +# efss-base.sh platform1 platform2 +# +# +# platform1: owncloud, nextcloud. +# platform2: owncloud, nextcloud. +"${ENV_ROOT}/dev/efss-base.sh" owncloud owncloud diff --git a/tests/base-nextcloud.sh b/tests/base-nextcloud.sh deleted file mode 100755 index bb8c6c52..00000000 --- a/tests/base-nextcloud.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env bash - -# @michielbdejong halt on error in docker init scripts -set -e - -# find this scripts location. -SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE -done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - -cd "$DIR/.." || exit - -ENV_ROOT=$(pwd) -export ENV_ROOT=${ENV_ROOT} - -function waitForPort () { - echo waitForPort ${1} ${2} - # the "| cat" after the "| grep" is to prevent the command from exiting with 1 if no match is found by grep. - x=$(docker exec -it "${1}" ss -tulpn | grep -c "${2}" | cat) - until [ "${x}" -ne 0 ] - do - echo Waiting for "${1}" to open port "${2}", this usually takes about 10 seconds ... "${x}" - sleep 1 - x=$(docker exec -it "${1}" ss -tulpn | grep -c "${2}" | cat) - done - echo "${1}" port "${2}" is open -} - -# create temp dirctory if it doesn't exist. -[ ! -d "${ENV_ROOT}/temp" ] && mkdir -p "${ENV_ROOT}/temp" - -# copy init files. -cp -f "${ENV_ROOT}/docker/scripts/init-nextcloud.sh" "${ENV_ROOT}/temp/nc-base.sh" - -# echo "starting firefox tester" -docker run --detach --name=firefox --network=testnet -p 5800:5800 --shm-size 2g jlesage/firefox:latest -docker run --detach --name=firefox-legacy --network=testnet -p 5900:5800 --shm-size 2g jlesage/firefox:v1.18.0 - -echo "starting maria1.docker" -docker run --detach --network=testnet \ - --name=maria1.docker \ - -e MARIADB_ROOT_PASSWORD=eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek \ - mariadb \ - --transaction-isolation=READ-COMMITTED \ - --binlog-format=ROW \ - --innodb-file-per-table=1 \ - --skip-innodb-read-only-compressed - -echo "starting nc1.docker" -docker run --detach --network=testnet \ - --name=nc1.docker \ - --publish 8080:80 \ - --add-host "host.docker.internal:host-gateway" \ - -e HOST="nc1" \ - -e DBHOST="maria1.docker" \ - -e USER="einstein" \ - -e PASS="relativity" \ - -v "${ENV_ROOT}/temp/nc-base.sh:/init.sh" \ - pondersource/dev-stock-nextcloud - -echo "starting maria2.docker" -docker run --detach --network=testnet \ - --name=maria2.docker \ - -e MARIADB_ROOT_PASSWORD=eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek \ - mariadb \ - --transaction-isolation=READ-COMMITTED \ - --binlog-format=ROW \ - --innodb-file-per-table=1 \ - --skip-innodb-read-only-compressed - -echo "starting nc2.docker" -docker run --detach --network=testnet \ - --name=nc2.docker \ - --publish 9080:80 \ - --add-host "host.docker.internal:host-gateway" \ - -e HOST="nc2" \ - -e DBHOST="maria2.docker" \ - -e USER="marie" \ - -e PASS="radioactivity" \ - -v "${ENV_ROOT}/temp/nc-base.sh:/init.sh" \ - pondersource/dev-stock-nextcloud - -waitForPort maria1.docker 3306 -waitForPort nc1.docker 443 - -docker exec "nc1.docker" bash -c "cp /tls/*.crt /usr/local/share/ca-certificates/" -docker exec "nc1.docker" bash -c "cp /tls-host/*.crt /usr/local/share/ca-certificates/" -docker exec "nc1.docker" update-ca-certificates -docker exec "nc1.docker" bash -c "cat /etc/ssl/certs/ca-certificates.crt >> /var/www/html/resources/config/ca-bundle.crt" - -echo "executing init.sh on nc1.docker" -docker exec -u www-data nc1.docker bash /init.sh - -waitForPort maria2.docker 3306 -waitForPort nc2.docker 443 - -docker exec "nc2.docker" bash -c "cp /tls/*.crt /usr/local/share/ca-certificates/" -docker exec "nc2.docker" bash -c "cp /tls-host/*.crt /usr/local/share/ca-certificates/" -docker exec "nc2.docker" update-ca-certificates -docker exec "nc2.docker" bash -c "cat /etc/ssl/certs/ca-certificates.crt >> /var/www/html/resources/config/ca-bundle.crt" - -echo "executing init.sh on nc2.docker" -docker exec -u www-data nc2.docker bash /init.sh diff --git a/tests/base-owncloud.sh b/tests/base-owncloud.sh deleted file mode 100755 index 63f8c3be..00000000 --- a/tests/base-owncloud.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env bash - -# @michielbdejong halt on error in docker init scripts -set -e - -# find this scripts location. -SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE -done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - -cd "$DIR/.." || exit - -ENV_ROOT=$(pwd) -export ENV_ROOT=${ENV_ROOT} - -function waitForPort () { - echo waitForPort ${1} ${2} - # the "| cat" after the "| grep" is to prevent the command from exiting with 1 if no match is found by grep. - x=$(docker exec -it "${1}" ss -tulpn | grep -c "${2}" | cat) - until [ "${x}" -ne 0 ] - do - echo Waiting for "${1}" to open port "${2}", this usually takes about 10 seconds ... "${x}" - sleep 1 - x=$(docker exec -it "${1}" ss -tulpn | grep -c "${2}" | cat) - done - echo "${1}" port "${2}" is open -} - -# create temp dirctory if it doesn't exist. -[ ! -d "${ENV_ROOT}/temp" ] && mkdir -p "${ENV_ROOT}/temp" - -# copy init files. -cp -f "${ENV_ROOT}/docker/scripts/init-owncloud.sh" "${ENV_ROOT}/temp/oc-base.sh" - -echo "starting firefox tester" -docker run --detach --name=firefox --network=testnet -p 5800:5800 --shm-size 2g jlesage/firefox:latest -docker run --detach --name=firefox-legacy --network=testnet -p 5900:5800 --shm-size 2g jlesage/firefox:v1.18.0 - -echo "starting maria1.docker" -docker run --detach --network=testnet \ - --name=maria1.docker \ - -e MARIADB_ROOT_PASSWORD=eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek \ - mariadb \ - --transaction-isolation=READ-COMMITTED \ - --binlog-format=ROW \ - --innodb-file-per-table=1 \ - --skip-innodb-read-only-compressed - -echo "starting oc1.docker" -docker run --detach --network=testnet \ - --name=oc1.docker \ - --publish 8080:80 \ - --add-host "host.docker.internal:host-gateway" \ - -e HOST="oc1" \ - -e DBHOST="maria1.docker" \ - -e USER="einstein" \ - -e PASS="relativity" \ - -v "${ENV_ROOT}/temp/oc-base.sh:/init.sh" \ - pondersource/dev-stock-owncloud - -echo "starting maria2.docker" -docker run --detach --network=testnet \ - --name=maria2.docker \ - -e MARIADB_ROOT_PASSWORD=eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek \ - mariadb \ - --transaction-isolation=READ-COMMITTED \ - --binlog-format=ROW \ - --innodb-file-per-table=1 \ - --skip-innodb-read-only-compressed - -echo "starting oc2.docker" -docker run --detach --network=testnet \ - --name=oc2.docker \ - --publish 9080:80 \ - --add-host "host.docker.internal:host-gateway" \ - -e HOST="oc2" \ - -e DBHOST="maria2.docker" \ - -e USER="marie" \ - -e PASS="radioactivity" \ - -v "${ENV_ROOT}/temp/oc-base.sh:/init.sh" \ - pondersource/dev-stock-owncloud - -waitForPort maria1.docker 3306 -waitForPort oc1.docker 443 - -docker exec "oc1.docker" bash -c "cp /tls/*.crt /usr/local/share/ca-certificates/" -docker exec "oc1.docker" bash -c "cp /tls-host/*.crt /usr/local/share/ca-certificates/" -docker exec "oc1.docker" update-ca-certificates -docker exec "oc1.docker" bash -c "cat /etc/ssl/certs/ca-certificates.crt >> /var/www/html/resources/config/ca-bundle.crt" - -echo "executing init.sh on oc1.docker" -docker exec -u www-data oc1.docker bash /init.sh - -waitForPort maria2.docker 3306 -waitForPort oc2.docker 443 - -docker exec "oc2.docker" bash -c "cp /tls/*.crt /usr/local/share/ca-certificates/" -docker exec "oc2.docker" bash -c "cp /tls-host/*.crt /usr/local/share/ca-certificates/" -docker exec "oc2.docker" update-ca-certificates -docker exec "oc2.docker" bash -c "cat /etc/ssl/certs/ca-certificates.crt >> /var/www/html/resources/config/ca-bundle.crt" - -echo "executing init.sh on oc2.docker" -docker exec -u www-data oc2.docker bash /init.sh From 0fa56911cb26bf8d48bfab4c26875b0b583fac72 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 08:22:54 +0000 Subject: [PATCH 03/19] cleanup: a bit on stub.js --- docker/scripts/stub.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/docker/scripts/stub.js b/docker/scripts/stub.js index 45a258f2..9801f983 100755 --- a/docker/scripts/stub.js +++ b/docker/scripts/stub.js @@ -13,11 +13,7 @@ const USER = `einstein`; const PROVIDER_ID = SERVER_HOST; const MESH_PROVIDER = SERVER_HOST; -// const HTTPS_OPTIONS = { -// key: fs.readFileSync(`/etc/letsencrypt/live/${SERVER_HOST}/privkey.pem`), -// cert: fs.readFileSync(`/etc/letsencrypt/live/${SERVER_HOST}/cert.pem`), -// ca: fs.readFileSync(`/etc/letsencrypt/live/${SERVER_HOST}/chain.pem`) -// } + const HTTPS_OPTIONS = { key: fs.readFileSync(`/tls/${SERVER_NAME}.key`), cert: fs.readFileSync(`/tls/${SERVER_NAME}.crt`) @@ -45,9 +41,7 @@ async function getServerConfig(otherUser) { } console.log('fetching', `${otherServer}ocm-provider/`); const configResult = await fetch(`${otherServer}ocm-provider/`); -// const text = await configResult.text(); -// console.log({ text }); -// JSON.parse(text); + return { config: await configResult.json(), otherServer }; } From 9254cccbebc981b23642441f35c8e500baaecc14 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 08:42:20 +0000 Subject: [PATCH 04/19] modify: consolidate sciencemesh script --- dev/sciencemesh-base.sh | 235 ++++++++++++++++++++++++++++++++++++++ tests/sciencemesh-nrrn.sh | 24 ---- tests/sciencemesh-orrn.sh | 24 ---- tests/sciencemesh-orro.sh | 24 ---- tests/sciencemesh.sh | 186 ------------------------------ 5 files changed, 235 insertions(+), 258 deletions(-) create mode 100755 dev/sciencemesh-base.sh delete mode 100755 tests/sciencemesh-nrrn.sh delete mode 100755 tests/sciencemesh-orrn.sh delete mode 100755 tests/sciencemesh-orro.sh delete mode 100755 tests/sciencemesh.sh diff --git a/dev/sciencemesh-base.sh b/dev/sciencemesh-base.sh new file mode 100755 index 00000000..dbf523a9 --- /dev/null +++ b/dev/sciencemesh-base.sh @@ -0,0 +1,235 @@ +#!/usr/bin/env bash + +# @michielbdejong halt on error in docker init scripts +set -e + +# find this scripts location. +SOURCE=${BASH_SOURCE[0]} +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" +done +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + +cd "${DIR}/.." || exit + +ENV_ROOT=$(pwd) +export ENV_ROOT=${ENV_ROOT} + +function waitForPort () { + echo waitForPort "${1}" "${2}" + # the "| cat" after the "| grep" is to prevent the command from exiting with 1 if no match is found by grep. + x=$(docker exec -it "${1}" ss -tulpn | grep -c "${2}" | cat) + until [ "${x}" -ne 0 ] + do + echo Waiting for "${1}" to open port "${2}", this usually takes about 10 seconds ... "${x}" + sleep 1 + x=$(docker exec -it "${1}" ss -tulpn | grep -c "${2}" | cat) + done + echo "${1}" port "${2}" is open +} + +function waitForCollabora() { + x=$(docker logs collabora.docker | grep -c "Ready") + until [ "${x}" -ne 0 ] + do + echo Waiting for Collabora to be ready, this usually takes about 10 seconds ... "${x}" + sleep 1 + x=$(docker logs collabora.docker | grep -c "Ready") + done + echo "Collabora is ready" +} + +function createEfss() { + local platform="${1}" + local number="${2}" + local user="${3}" + local password="${4}" + local image="${5}" + + echo "creating efss ${platform} ${number}" + + docker run --detach --network=testnet \ + --name="maria${platform}${number}.docker" \ + -e MARIADB_ROOT_PASSWORD=eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek \ + mariadb \ + --transaction-isolation=READ-COMMITTED \ + --binlog-format=ROW \ + --innodb-file-per-table=1 \ + --skip-innodb-read-only-compressed \ + + docker run --detach --network=testnet \ + --name="${platform}${number}.docker" \ + --add-host "host.docker.internal:host-gateway" \ + -e HOST="${platform}${number}" \ + -e DBHOST="maria${platform}${number}.docker" \ + -e USER="${user}" \ + -e PASS="${password}" \ + -v "${ENV_ROOT}/docker/tls:/tls-host" \ + -v "${ENV_ROOT}/temp/${platform}.sh:/${platform}-init.sh" \ + -v "${ENV_ROOT}/docker/scripts/entrypoint.sh:/entrypoint.sh" \ + -v "${ENV_ROOT}/${platform}/apps/sciencemesh:/var/www/html/apps/sciencemesh" \ + "pondersource/dev-stock-${platform}-${image}" \ + + # wait for hostname port to be open + waitForPort "maria${platform}${number}.docker" 3306 + waitForPort "${platform}${number}.docker" 443 + + # add self-signed certificates to os and trust them. (use >/dev/null 2>&1 to shut these up) + docker exec "${platform}${number}.docker" bash -c "cp /tls/*.crt /usr/local/share/ca-certificates/" >/dev/null 2>&1 + docker exec "${platform}${number}.docker" bash -c "cp /tls-host/*.crt /usr/local/share/ca-certificates/" >/dev/null 2>&1 + docker exec "${platform}${number}.docker" update-ca-certificates >/dev/null 2>&1 + docker exec "${platform}${number}.docker" bash -c "cat /etc/ssl/certs/ca-certificates.crt >> /var/www/html/resources/config/ca-bundle.crt" >/dev/null 2>&1 + + # run init script inside efss. + docker exec -u www-data "${platform}${number}.docker" sh "/${platform}-init.sh" + + echo "" +} + +function createReva() { + local platform="${1}" + local number="${2}" + local port="${3}" + + echo "creating reva for ${platform} ${number}" + + # make sure scripts are executable. + chmod +x "${ENV_ROOT}/docker/scripts/reva-run.sh" >/dev/null 2>&1 + chmod +x "${ENV_ROOT}/docker/scripts/reva-kill.sh" >/dev/null 2>&1 + chmod +x "${ENV_ROOT}/docker/scripts/reva-entrypoint.sh" >/dev/null 2>&1 + + waitForCollabora + + docker run --detach --network=testnet \ + --name="reva${platform}${number}.docker" \ + -e HOST="reva${platform}${number}" \ + -p "${port}:80" \ + -v "${ENV_ROOT}/reva:/reva" \ + -v "${ENV_ROOT}/docker/revad:/etc/revad" \ + -v "${ENV_ROOT}/docker/tls:/etc/revad/tls" \ + -v "${ENV_ROOT}/docker/scripts/reva-run.sh:/usr/bin/reva-run.sh" \ + -v "${ENV_ROOT}/docker/scripts/reva-kill.sh:/usr/bin/reva-kill.sh" \ + -v "${ENV_ROOT}/docker/scripts/reva-entrypoint.sh:/entrypoint.sh" \ + pondersource/dev-stock-revad \ + >/dev/null 2>&1 +} + +function sciencemeshInsertIntoDB() { + local platform="${1}" + local number="${2}" + + echo "configuring ScienceMesh app for efss ${platform} ${number}" + + # run db injections. + mysql_cmd="docker exec "maria${platform}${number}.docker" mariadb -u root -peilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek efss" + $mysql_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) values ('sciencemesh', 'iopUrl', 'https://reva${platform}${number}.docker/');" >/dev/null 2>&1 + $mysql_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) values ('sciencemesh', 'revaSharedSecret', 'shared-secret-1');" >/dev/null 2>&1 + $mysql_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) values ('sciencemesh', 'meshDirectoryUrl', 'https://meshdir.docker/meshdir');" >/dev/null 2>&1 + $mysql_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) values ('sciencemesh', 'inviteManagerApikey', 'invite-manager-endpoint');" >/dev/null 2>&1 +} + +# delete and create temp directory. +rm -rf "${ENV_ROOT}/temp" && mkdir --parents "${ENV_ROOT}/temp" + +# copy init files. +cp -f "${ENV_ROOT}/docker/scripts/init-owncloud-sciencemesh.sh" "${ENV_ROOT}/temp/owncloud.sh" +cp -f "${ENV_ROOT}/docker/scripts/init-nextcloud-sciencemesh.sh" "${ENV_ROOT}/temp/nextcloud.sh" + + +# make sure network exists. +docker network inspect testnet >/dev/null 2>&1 || docker network create testnet >/dev/null 2>&1 + +docker run --detach --name=collabora.docker --network=testnet -p 9980:9980 -t -e "extra_params=--o:ssl.enable=false" collabora/code:latest >/dev/null 2>&1 +docker run --detach --name=wopi.docker --network=testnet -p 8880:8880 -t cs3org/wopiserver:latest >/dev/null 2>&1 +#docker run --detach --name=rclone.docker --network=testnet rclone/rclone rcd -vv --rc-user=rcloneuser --rc-pass=eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek --rc-addr=0.0.0.0:5572 --server-side-across-configs=true --log-file=/dev/stdout + +############ +### EFSS ### +############ + +# syntax: +# createEfss platform number username password image +# +# +# platform: owncloud, nextcloud. +# number: should be unique for each platform, for example: you cannot have two Nextclouds with same number. +# username: username for sign in into efss. +# password: password for sign in into efss. +# image: which image variation to use for container + +# ownClouds +createEfss owncloud 1 marie radioactivity sciencemesh +createEfss owncloud 2 mahdi baghbani sciencemesh + +# Nextclouds +createEfss nextcloud 1 einstein relativity sciencemesh +createEfss nextcloud 2 michiel dejong sciencemesh + +############ +### Reva ### +############ + +# syntax: +# createReva platform number port +# +# +# platform: owncloud, nextcloud. +# number: should be unique for each platform, for example: you cannot have two Nextclouds with same number. +# port: maps a port on local host to port 80 of reva, for `curl` purposes! should be unique. +# for all createReva commands, if the port is not unique or is already in use by another. +# program, script would halt! + +createReva owncloud 1 4501 +createReva owncloud 2 4502 + +createReva nextcloud 1 4503 +createReva nextcloud 2 4504 + +################### +### ScienceMesh ### +################### + +# syntax: +# sciencemeshInsertIntoDB platform number +# +# +# platform: owncloud, nextcloud. +# number: should be unique for each platform, for example: you cannot have two Nextclouds with same number. + +sciencemeshInsertIntoDB owncloud 1 +sciencemeshInsertIntoDB owncloud 2 + +sciencemeshInsertIntoDB nextcloud 1 +sciencemeshInsertIntoDB nextcloud 2 + +# Mesh directory for ScienceMesh invite flow. +docker run --detach --network=testnet \ + --name=meshdir.docker \ + -v "${ENV_ROOT}/docker/scripts/stub.js:/ocm-stub/stub.js" \ + pondersource/dev-stock-ocmstub \ + >/dev/null 2>&1 + +############### +### Firefox ### +############### + +docker run --detach --network=testnet \ + --name=firefox \ + -p 5800:5800 \ + --shm-size 2g \ + jlesage/firefox:latest \ + >/dev/null 2>&1 + +# print instructions. +clear +echo "Now browse to :" +echo "Embedded Firefox -> http://localhost:5800" +echo "" +echo "Inside Embedded Firefox browse to EFSS hostname and enter the related credentials:" +echo "https://owncloud1.docker -> username: marie password: radioactivity" +echo "https://owncloud2.docker -> username: mahdi password: baghbani" +echo "https://nextcloud1.docker -> username: einstein password: relativity" +echo "https://nextcloud2.docker -> username: michiel password: dejong" diff --git a/tests/sciencemesh-nrrn.sh b/tests/sciencemesh-nrrn.sh deleted file mode 100755 index 82d2d1f5..00000000 --- a/tests/sciencemesh-nrrn.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -# @michielbdejong halt on error in docker init scripts -set -e - -# find this scripts location. -SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE -done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - -cd "$DIR/.." || exit - -ENV_ROOT=$(pwd) -export ENV_ROOT=${ENV_ROOT} - - -export EFSS1=nextcloud -export EFSS2=nextcloud -"${ENV_ROOT}/tests/sciencemesh.sh" diff --git a/tests/sciencemesh-orrn.sh b/tests/sciencemesh-orrn.sh deleted file mode 100755 index 47d44ff1..00000000 --- a/tests/sciencemesh-orrn.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -# @michielbdejong halt on error in docker init scripts -set -e - -# find this scripts location. -SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE -done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - -cd "$DIR/.." || exit - -ENV_ROOT=$(pwd) -export ENV_ROOT=${ENV_ROOT} - - -export EFSS1=owncloud -export EFSS2=nextcloud -"${ENV_ROOT}/tests/sciencemesh.sh" diff --git a/tests/sciencemesh-orro.sh b/tests/sciencemesh-orro.sh deleted file mode 100755 index 59eb66a7..00000000 --- a/tests/sciencemesh-orro.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -# @michielbdejong halt on error in docker init scripts -set -e - -# find this scripts location. -SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE -done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - -cd "$DIR/.." || exit - -ENV_ROOT=$(pwd) -export ENV_ROOT=${ENV_ROOT} - - -export EFSS1=owncloud -export EFSS2=owncloud -"${ENV_ROOT}/tests/sciencemesh.sh" diff --git a/tests/sciencemesh.sh b/tests/sciencemesh.sh deleted file mode 100755 index 1bf3e02b..00000000 --- a/tests/sciencemesh.sh +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/bin/env bash - -# @michielbdejong halt on error in docker init scripts -set -e - -# find this scripts location. -SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE -done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - -cd "$DIR/.." || exit - -ENV_ROOT=$(pwd) -export ENV_ROOT=${ENV_ROOT} - -function waitForPort () { - echo waitForPort ${1} ${2} - # the "| cat" after the "| grep" is to prevent the command from exiting with 1 if no match is found by grep. - x=$(docker exec -it "${1}" ss -tulpn | grep -c "${2}" | cat) - until [ "${x}" -ne 0 ] - do - echo Waiting for "${1}" to open port "${2}", this usually takes about 10 seconds ... "${x}" - sleep 1 - x=$(docker exec -it "${1}" ss -tulpn | grep -c "${2}" | cat) - done - echo "${1}" port "${2}" is open -} - -function waitForCollabora { - x=$(docker logs collabora.docker | grep -c "Ready") - until [ "${x}" -ne 0 ] - do - echo Waiting for Collabora to be ready, this usually takes about 10 seconds ... "${x}" - sleep 1 - x=$(docker logs collabora.docker | grep -c "Ready") - done - echo "Collabora is ready" -} - -# create temp directory if it doesn't exist. -[ ! -d "${ENV_ROOT}/temp" ] && mkdir --parents "${ENV_ROOT}/temp" - -# copy init files. -cp -f ./docker/scripts/init-owncloud-sciencemesh.sh ./temp/owncloud.sh -cp -f ./docker/scripts/init-nextcloud-sciencemesh.sh ./temp/nextcloud.sh - -docker run --detach --name=meshdir.docker --network=testnet -v "${ENV_ROOT}/docker/scripts/stub.js:/ocm-stub/stub.js" pondersource/dev-stock-ocmstub -docker run --detach --name=firefox --network=testnet -p 5800:5800 --shm-size 2g jlesage/firefox:latest -docker run --detach --name=firefox-legacy --network=testnet -p 5900:5800 --shm-size 2g jlesage/firefox:v1.18.0 -docker run --detach --name=collabora.docker --network=testnet -p 9980:9980 -t -e "extra_params=--o:ssl.enable=false" collabora/code:latest -docker run --detach --name=wopi.docker --network=testnet -p 8880:8880 -t cs3org/wopiserver:latest - -#docker run --detach --name=rclone.docker --network=testnet rclone/rclone rcd -vv --rc-user=rcloneuser --rc-pass=eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek --rc-addr=0.0.0.0:5572 --server-side-across-configs=true --log-file=/dev/stdout - -# EFSS1 -docker run --detach --network=testnet \ - --name=maria1.docker \ - -e MARIADB_ROOT_PASSWORD=eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek \ - mariadb \ - --transaction-isolation=READ-COMMITTED \ - --binlog-format=ROW \ - --innodb-file-per-table=1 \ - --skip-innodb-read-only-compressed - -docker run --detach --network=testnet \ - --name="${EFSS1}1.docker" \ - --add-host "host.docker.internal:host-gateway" \ - -e HOST="${EFSS1}1" \ - -e DBHOST="maria1.docker" \ - -e USER="einstein" \ - -e PASS="relativity" \ - -v "${ENV_ROOT}/docker/tls:/tls-host" \ - -v "${ENV_ROOT}/temp/${EFSS1}.sh:/${EFSS1}-init.sh" \ - -v "${ENV_ROOT}/docker/scripts/entrypoint.sh:/entrypoint.sh" \ - -v "${ENV_ROOT}/${EFSS1}/apps/sciencemesh:/var/www/html/apps/sciencemesh" \ - "pondersource/dev-stock-${EFSS1}-sciencemesh" - -# EFSS2 -docker run --detach --network=testnet \ - --name=maria2.docker \ - -e MARIADB_ROOT_PASSWORD=eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek \ - mariadb \ - --transaction-isolation=READ-COMMITTED \ - --binlog-format=ROW \ - --innodb-file-per-table=1 \ - --skip-innodb-read-only-compressed - -docker run --detach --network=testnet \ - --name="${EFSS2}2.docker" \ - --add-host "host.docker.internal:host-gateway" \ - -e HOST="${EFSS2}2" \ - -e DBHOST="maria2.docker" \ - -e USER="marie" \ - -e PASS="radioactivity" \ - -v "${ENV_ROOT}/docker/tls:/tls-host" \ - -v "${ENV_ROOT}/temp/${EFSS2}.sh:/${EFSS2}-init.sh" \ - -v "${ENV_ROOT}/docker/scripts/entrypoint.sh:/entrypoint.sh" \ - -v "${ENV_ROOT}/${EFSS2}/apps/sciencemesh:/var/www/html/apps/sciencemesh" \ - "pondersource/dev-stock-${EFSS2}-sciencemesh" - -# EFSS1 -waitForPort maria1.docker 3306 -waitForPort "${EFSS1}1.docker" 443 - -docker exec "${EFSS1}1.docker" bash -c "cp /tls/*.crt /usr/local/share/ca-certificates/" -docker exec "${EFSS1}1.docker" bash -c "cp /tls-host/*.crt /usr/local/share/ca-certificates/" -docker exec "${EFSS1}1.docker" update-ca-certificates -docker exec "${EFSS1}1.docker" bash -c "cat /etc/ssl/certs/ca-certificates.crt >> /var/www/html/resources/config/ca-bundle.crt" - -docker exec -u www-data "${EFSS1}1.docker" sh "/${EFSS1}-init.sh" - -# run db injections. -mysql1_cmd="docker exec maria1.docker mariadb -u root -peilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek efss" - -$mysql1_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) values ('sciencemesh', 'iopUrl', 'https://reva${EFSS1}1.docker/');" - -$mysql1_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) values ('sciencemesh', 'revaSharedSecret', 'shared-secret-1');" - -$mysql1_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) values ('sciencemesh', 'meshDirectoryUrl', 'https://meshdir.docker/meshdir');" - -$mysql1_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) values ('sciencemesh', 'inviteManagerApikey', 'invite-manager-endpoint');" - -# EFSS2 -waitForPort maria2.docker 3306 -waitForPort "${EFSS2}2.docker" 443 - -docker exec "${EFSS2}2.docker" bash -c "cp /tls/*.crt /usr/local/share/ca-certificates/" -docker exec "${EFSS2}2.docker" bash -c "cp /tls-host/*.crt /usr/local/share/ca-certificates/" -docker exec "${EFSS2}2.docker" update-ca-certificates -docker exec "${EFSS2}2.docker" bash -c "cat /etc/ssl/certs/ca-certificates.crt >> /var/www/html/resources/config/ca-bundle.crt" - -docker exec -u www-data "${EFSS2}2.docker" sh "/${EFSS2}-init.sh" - -mysql2_cmd="docker exec maria2.docker mariadb -u root -peilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek efss" - -$mysql2_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) values ('sciencemesh', 'iopUrl', 'https://reva${EFSS2}2.docker/');" - -$mysql2_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) values ('sciencemesh', 'revaSharedSecret', 'shared-secret-1');" - -$mysql2_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) values ('sciencemesh', 'meshDirectoryUrl', 'https://meshdir.docker/meshdir');" - -$mysql2_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) values ('sciencemesh', 'inviteManagerApikey', 'invite-manager-endpoint');" - -# Reva Setup. - -# make sure scripts are executable. -chmod +x "${ENV_ROOT}/docker/scripts/reva-run.sh" -chmod +x "${ENV_ROOT}/docker/scripts/reva-kill.sh" -chmod +x "${ENV_ROOT}/docker/scripts/reva-entrypoint.sh" - -waitForCollabora -docker run --detach --network=testnet \ - --name="reva${EFSS1}1.docker" \ - -e HOST="reva${EFSS1}1" \ - -p 8080:80 \ - -v "${ENV_ROOT}/reva:/reva" \ - -v "${ENV_ROOT}/docker/revad:/etc/revad" \ - -v "${ENV_ROOT}/docker/tls:/etc/revad/tls" \ - -v "${ENV_ROOT}/docker/scripts/reva-run.sh:/usr/bin/reva-run.sh" \ - -v "${ENV_ROOT}/docker/scripts/reva-kill.sh:/usr/bin/reva-kill.sh" \ - -v "${ENV_ROOT}/docker/scripts/reva-entrypoint.sh:/entrypoint.sh" \ - pondersource/dev-stock-revad - -docker run --detach --network=testnet \ - --name="reva${EFSS2}2.docker" \ - -e HOST="reva${EFSS2}2" \ - -p 8180:80 \ - -v "${ENV_ROOT}/reva:/reva" \ - -v "${ENV_ROOT}/docker/revad:/etc/revad" \ - -v "${ENV_ROOT}/docker/tls:/etc/revad/tls" \ - -v "${ENV_ROOT}/docker/scripts/reva-run.sh:/usr/bin/reva-run.sh" \ - -v "${ENV_ROOT}/docker/scripts/reva-kill.sh:/usr/bin/reva-kill.sh" \ - -v "${ENV_ROOT}/docker/scripts/reva-entrypoint.sh:/entrypoint.sh" \ - pondersource/dev-stock-revad - -# instructions. -echo "Now browse to http://localhost:5800 and inside there to https://${EFSS1}1.docker" -echo "Log in as einstein / relativity" -echo "Go to the ScienceMesh app and generate a token" -echo "Click it to go to the meshdir server, and choose ${EFSS2}2 there." -echo "Log in on https://${EFSS2}2.docker as marie / radioactivity" From 9e237805a42c04c333a9ba00b29c664bf842b8ac Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 09:17:44 +0000 Subject: [PATCH 05/19] delete: scenarios, combine all in one --- dev/efss-nn.sh | 27 -------------------------- dev/efss-no.sh | 27 -------------------------- dev/efss-oo.sh | 27 -------------------------- dev/{efss-base.sh => efss.sh} | 36 ++++++++++++++++++----------------- 4 files changed, 19 insertions(+), 98 deletions(-) delete mode 100755 dev/efss-nn.sh delete mode 100755 dev/efss-no.sh delete mode 100755 dev/efss-oo.sh rename dev/{efss-base.sh => efss.sh} (84%) diff --git a/dev/efss-nn.sh b/dev/efss-nn.sh deleted file mode 100755 index 35724a13..00000000 --- a/dev/efss-nn.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -# @michielbdejong halt on error in docker init scripts -set -e - -# find this scripts location. -SOURCE=${BASH_SOURCE[0]} -while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink - DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "${SOURCE}") - # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" -done -DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) - -cd "${DIR}/.." || exit - -ENV_ROOT=$(pwd) -export ENV_ROOT=${ENV_ROOT} - -# syntax: -# efss-base.sh platform1 platform2 -# -# -# platform1: owncloud, nextcloud. -# platform2: owncloud, nextcloud. -"${ENV_ROOT}/dev/efss-base.sh" nextcloud nextcloud diff --git a/dev/efss-no.sh b/dev/efss-no.sh deleted file mode 100755 index bc833194..00000000 --- a/dev/efss-no.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -# @michielbdejong halt on error in docker init scripts -set -e - -# find this scripts location. -SOURCE=${BASH_SOURCE[0]} -while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink - DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "${SOURCE}") - # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" -done -DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) - -cd "${DIR}/.." || exit - -ENV_ROOT=$(pwd) -export ENV_ROOT=${ENV_ROOT} - -# syntax: -# efss-base.sh platform1 platform2 -# -# -# platform1: owncloud, nextcloud. -# platform2: owncloud, nextcloud. -"${ENV_ROOT}/dev/efss-base.sh" nextcloud owncloud diff --git a/dev/efss-oo.sh b/dev/efss-oo.sh deleted file mode 100755 index 64a466e5..00000000 --- a/dev/efss-oo.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -# @michielbdejong halt on error in docker init scripts -set -e - -# find this scripts location. -SOURCE=${BASH_SOURCE[0]} -while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink - DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "${SOURCE}") - # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" -done -DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) - -cd "${DIR}/.." || exit - -ENV_ROOT=$(pwd) -export ENV_ROOT=${ENV_ROOT} - -# syntax: -# efss-base.sh platform1 platform2 -# -# -# platform1: owncloud, nextcloud. -# platform2: owncloud, nextcloud. -"${ENV_ROOT}/dev/efss-base.sh" owncloud owncloud diff --git a/dev/efss-base.sh b/dev/efss.sh similarity index 84% rename from dev/efss-base.sh rename to dev/efss.sh index e9945c42..3839c1a1 100755 --- a/dev/efss-base.sh +++ b/dev/efss.sh @@ -1,14 +1,14 @@ #!/usr/bin/env bash -# @michielbdejong halt on error in docker init scripts +# @michielbdejong halt on error in docker init scripts. set -e # find this scripts location. SOURCE=${BASH_SOURCE[0]} -while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink. DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) SOURCE=$(readlink "${SOURCE}") - # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located. [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" done DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) @@ -46,7 +46,7 @@ function createEfss() { --transaction-isolation=READ-COMMITTED \ --binlog-format=ROW \ --innodb-file-per-table=1 \ - --skip-innodb-read-only-compressed \ + --skip-innodb-read-only-compressed docker run --detach --network=testnet \ --name="${platform}${number}.docker" \ @@ -58,9 +58,9 @@ function createEfss() { -v "${ENV_ROOT}/docker/tls:/tls-host" \ -v "${ENV_ROOT}/temp/${platform}.sh:/${platform}-init.sh" \ -v "${ENV_ROOT}/docker/scripts/entrypoint.sh:/entrypoint.sh" \ - "pondersource/dev-stock-${platform}" \ + "pondersource/dev-stock-${platform}" - # wait for hostname port to be open + # wait for hostname port to be open. waitForPort "maria${platform}${number}.docker" 3306 waitForPort "${platform}${number}.docker" 443 @@ -86,16 +86,12 @@ cp -f "${ENV_ROOT}/docker/scripts/init-nextcloud.sh" "${ENV_ROOT}/temp/nextclou # make sure network exists. docker network inspect testnet >/dev/null 2>&1 || docker network create testnet >/dev/null 2>&1 -# get platform from cli arguments. -EFSS1="${1-nextcloud}" -EFSS2="${2-owncloud}" - ############ ### EFSS ### ############ # syntax: -# createEfss platform number username password +# createEfss platform number username password. # # # platform: owncloud, nextcloud. @@ -103,8 +99,13 @@ EFSS2="${2-owncloud}" # username: username for sign in into efss. # password: password for sign in into efss. -createEfss "${EFSS1}" 1 einstein relativity -createEfss "${EFSS2}" 2 marie radioactivity +# ownClouds. +createEfss owncloud 1 marie radioactivity +createEfss owncloud 2 mahdi baghbani + +# Nextclouds. +createEfss nextcloud 1 einstein relativity +createEfss nextcloud 2 michiel dejong ############### ### Firefox ### @@ -117,12 +118,13 @@ docker run --detach --network=testnet \ jlesage/firefox:latest \ >/dev/null 2>&1 - # print instructions. clear echo "Now browse to :" -echo "Embedded Firefox -> http://localhost:5800" +echo "Embedded Firefox -> http://localhost:5800" echo "" echo "Inside Embedded Firefox browse to EFSS hostname and enter the related credentials:" -echo "https://${EFSS1}1.docker -> username: einstein password: relativity" -echo "https://${EFSS2}2.docker -> username: marie password: radioactivity" +echo "https://owncloud1.docker -> username: marie password: radioactivity" +echo "https://owncloud2.docker -> username: mahdi password: baghbani" +echo "https://nextcloud1.docker -> username: einstein password: relativity" +echo "https://nextcloud2.docker -> username: michiel password: dejong" From a6f5cb500320c18679802b53a8fc569eccfb76da Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 09:18:08 +0000 Subject: [PATCH 06/19] modify: one sciencmesh to run all scenarios --- dev/{sciencemesh-base.sh => sciencemesh.sh} | 30 ++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) rename dev/{sciencemesh-base.sh => sciencemesh.sh} (94%) diff --git a/dev/sciencemesh-base.sh b/dev/sciencemesh.sh similarity index 94% rename from dev/sciencemesh-base.sh rename to dev/sciencemesh.sh index dbf523a9..232eb1cf 100755 --- a/dev/sciencemesh-base.sh +++ b/dev/sciencemesh.sh @@ -1,14 +1,14 @@ #!/usr/bin/env bash -# @michielbdejong halt on error in docker init scripts +# @michielbdejong halt on error in docker init scripts. set -e # find this scripts location. SOURCE=${BASH_SOURCE[0]} -while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink. DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) SOURCE=$(readlink "${SOURCE}") - # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located. [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" done DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) @@ -49,6 +49,12 @@ function createEfss() { local password="${4}" local image="${5}" + if [[ -z "${image}" ]]; then + local image="pondersource/dev-stock-${platform}" + else + local image="pondersource/dev-stock-${platform}-${image}" + fi + echo "creating efss ${platform} ${number}" docker run --detach --network=testnet \ @@ -58,7 +64,7 @@ function createEfss() { --transaction-isolation=READ-COMMITTED \ --binlog-format=ROW \ --innodb-file-per-table=1 \ - --skip-innodb-read-only-compressed \ + --skip-innodb-read-only-compressed docker run --detach --network=testnet \ --name="${platform}${number}.docker" \ @@ -71,9 +77,9 @@ function createEfss() { -v "${ENV_ROOT}/temp/${platform}.sh:/${platform}-init.sh" \ -v "${ENV_ROOT}/docker/scripts/entrypoint.sh:/entrypoint.sh" \ -v "${ENV_ROOT}/${platform}/apps/sciencemesh:/var/www/html/apps/sciencemesh" \ - "pondersource/dev-stock-${platform}-${image}" \ + "${image}" - # wait for hostname port to be open + # wait for hostname port to be open. waitForPort "maria${platform}${number}.docker" 3306 waitForPort "${platform}${number}.docker" 443 @@ -151,20 +157,20 @@ docker run --detach --name=wopi.docker --network=testnet -p 8880:8880 -t cs ############ # syntax: -# createEfss platform number username password image +# createEfss platform number username password image. # # # platform: owncloud, nextcloud. # number: should be unique for each platform, for example: you cannot have two Nextclouds with same number. # username: username for sign in into efss. # password: password for sign in into efss. -# image: which image variation to use for container +# image: which image variation to use for container. -# ownClouds +# ownClouds. createEfss owncloud 1 marie radioactivity sciencemesh createEfss owncloud 2 mahdi baghbani sciencemesh -# Nextclouds +# Nextclouds. createEfss nextcloud 1 einstein relativity sciencemesh createEfss nextcloud 2 michiel dejong sciencemesh @@ -173,7 +179,7 @@ createEfss nextcloud 2 michiel dejong sciencemesh ############ # syntax: -# createReva platform number port +# createReva platform number port. # # # platform: owncloud, nextcloud. @@ -193,7 +199,7 @@ createReva nextcloud 2 4504 ################### # syntax: -# sciencemeshInsertIntoDB platform number +# sciencemeshInsertIntoDB platform number. # # # platform: owncloud, nextcloud. From 8959c5f9936404d20c89c84c69970d6ffca8f5f3 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 09:21:24 +0000 Subject: [PATCH 07/19] update: versions --- init/ocm-test-suite.sh | 2 +- init/sciencemesh.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/init/ocm-test-suite.sh b/init/ocm-test-suite.sh index 245b2bd3..0cddd457 100755 --- a/init/ocm-test-suite.sh +++ b/init/ocm-test-suite.sh @@ -23,7 +23,7 @@ REPO_NEXTCLOUD=https://github.com/nextcloud/server BRANCH_NEXTCLOUD=v28.0.2 REPO_OWNCLOUD=https://github.com/owncloud/core -BRANCH_OWNCLOUD=v10.13.0 +BRANCH_OWNCLOUD=v10.14.0 REPO_OWNCLOUD_APP=https://github.com/sciencemesh/nc-sciencemesh BRANCH_OWNCLOUD_APP=owncloud diff --git a/init/sciencemesh.sh b/init/sciencemesh.sh index 327418c8..0cddd457 100755 --- a/init/sciencemesh.sh +++ b/init/sciencemesh.sh @@ -20,10 +20,10 @@ REPO_NEXTCLOUD_APP=https://github.com/sciencemesh/nc-sciencemesh BRANCH_NEXTCLOUD_APP=nextcloud REPO_NEXTCLOUD=https://github.com/nextcloud/server -BRANCH_NEXTCLOUD=master +BRANCH_NEXTCLOUD=v28.0.2 REPO_OWNCLOUD=https://github.com/owncloud/core -BRANCH_OWNCLOUD=v10.13.0 +BRANCH_OWNCLOUD=v10.14.0 REPO_OWNCLOUD_APP=https://github.com/sciencemesh/nc-sciencemesh BRANCH_OWNCLOUD_APP=owncloud From 4e1b67527461f211f48d33eec30a0544affd2bdb Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 09:24:03 +0000 Subject: [PATCH 08/19] chore: comments --- init/gitpod-prebuild.sh | 2 +- init/ocm-test-suite.sh | 4 ++-- init/sciencemesh.sh | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/init/gitpod-prebuild.sh b/init/gitpod-prebuild.sh index b4be9eb6..0d00fcd2 100755 --- a/init/gitpod-prebuild.sh +++ b/init/gitpod-prebuild.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# @michielbdejong halt on error in docker init scripts +# @michielbdejong halt on error in docker init scripts. set -e docker pull redis:latest diff --git a/init/ocm-test-suite.sh b/init/ocm-test-suite.sh index 0cddd457..489492ce 100755 --- a/init/ocm-test-suite.sh +++ b/init/ocm-test-suite.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# @michielbdejong halt on error in docker init scripts +# @michielbdejong halt on error in docker init scripts. set -e # find this scripts location. @@ -52,7 +52,7 @@ BRANCH_REVA=v1.26.0 pondersource/dev-stock-nextcloud-sciencemesh \ make composer -# move app to its place inside efss and create symbolic links +# move app to its place inside efss and create symbolic links. [ ! -d "nextcloud/apps/sciencemesh" ] && \ mv nextcloud-sciencemesh nextcloud/apps/sciencemesh diff --git a/init/sciencemesh.sh b/init/sciencemesh.sh index 0cddd457..c91550eb 100755 --- a/init/sciencemesh.sh +++ b/init/sciencemesh.sh @@ -1,14 +1,14 @@ #!/usr/bin/env bash -# @michielbdejong halt on error in docker init scripts +# @michielbdejong halt on error in docker init scripts. set -e # find this scripts location. SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink +while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink. DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located. [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE done DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) @@ -52,7 +52,7 @@ BRANCH_REVA=v1.26.0 pondersource/dev-stock-nextcloud-sciencemesh \ make composer -# move app to its place inside efss and create symbolic links +# move app to its place inside efss and create symbolic links. [ ! -d "nextcloud/apps/sciencemesh" ] && \ mv nextcloud-sciencemesh nextcloud/apps/sciencemesh From 140fe1d3bd6614cd34976634e0070f97f47a64a0 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 09:26:07 +0000 Subject: [PATCH 09/19] modify: curly braces for variables in bash --- init/ocm-test-suite.sh | 16 +++++++++------- init/opencloudmesh.sh | 16 ++++++++-------- init/rd-sram.sh | 16 ++++++++-------- init/sciencemesh.sh | 14 +++++++------- init/sm-sram-ocm.sh | 16 ++++++++-------- init/solid-remote-storage.sh | 16 ++++++++-------- init/solid.sh | 16 ++++++++-------- init/sunet.sh | 16 ++++++++-------- init/surf-trashbin.sh | 16 ++++++++-------- init/token-based-access.sh | 16 ++++++++-------- 10 files changed, 80 insertions(+), 78 deletions(-) diff --git a/init/ocm-test-suite.sh b/init/ocm-test-suite.sh index 489492ce..fe8f179d 100755 --- a/init/ocm-test-suite.sh +++ b/init/ocm-test-suite.sh @@ -1,19 +1,21 @@ #!/usr/bin/env bash +#!/usr/bin/env bash + # @michielbdejong halt on error in docker init scripts. set -e # find this scripts location. SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink. + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located. + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) -cd "$DIR/.." || exit +cd "${DIR}/.." || exit # repositories and branches. REPO_NEXTCLOUD_APP=https://github.com/sciencemesh/nc-sciencemesh diff --git a/init/opencloudmesh.sh b/init/opencloudmesh.sh index db1b5117..6c3cc107 100755 --- a/init/opencloudmesh.sh +++ b/init/opencloudmesh.sh @@ -1,19 +1,19 @@ #!/usr/bin/env bash -# @michielbdejong halt on error in docker init scripts +# @michielbdejong halt on error in docker init scripts. set -e # find this scripts location. SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink. + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located. + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) -cd "$DIR/.." || exit +cd "${DIR}/.." || exit ENV_ROOT=$(pwd) export ENV_ROOT=${ENV_ROOT} diff --git a/init/rd-sram.sh b/init/rd-sram.sh index b97df81a..c34122a1 100755 --- a/init/rd-sram.sh +++ b/init/rd-sram.sh @@ -1,19 +1,19 @@ #!/usr/bin/env bash -# @michielbdejong halt on error in docker init scripts +# @michielbdejong halt on error in docker init scripts. set -e # find this scripts location. SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink. + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located. + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) -cd "$DIR/.." || exit +cd "${DIR}/.." || exit # repositories and branches. REPO_OWNCLOUD=https://github.com/owncloud/core diff --git a/init/sciencemesh.sh b/init/sciencemesh.sh index c91550eb..b55eb2bd 100755 --- a/init/sciencemesh.sh +++ b/init/sciencemesh.sh @@ -5,15 +5,15 @@ set -e # find this scripts location. SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink. - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located. - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink. + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located. + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) -cd "$DIR/.." || exit +cd "${DIR}/.." || exit # repositories and branches. REPO_NEXTCLOUD_APP=https://github.com/sciencemesh/nc-sciencemesh diff --git a/init/sm-sram-ocm.sh b/init/sm-sram-ocm.sh index 2b226708..240133e7 100755 --- a/init/sm-sram-ocm.sh +++ b/init/sm-sram-ocm.sh @@ -1,19 +1,19 @@ #!/usr/bin/env bash -# @michielbdejong halt on error in docker init scripts +# @michielbdejong halt on error in docker init scripts. set -e # find this scripts location. SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink. + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located. + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) -cd "$DIR/.." || exit +cd "${DIR}/.." || exit # repositories and branches. REPO_OWNCLOUD=https://github.com/owncloud/core diff --git a/init/solid-remote-storage.sh b/init/solid-remote-storage.sh index da7f2ce8..0c78afa4 100755 --- a/init/solid-remote-storage.sh +++ b/init/solid-remote-storage.sh @@ -1,19 +1,19 @@ #!/usr/bin/env bash -# @michielbdejong halt on error in docker init scripts +# @michielbdejong halt on error in docker init scripts. set -e # find this scripts location. SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink. + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located. + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) -cd "$DIR/.." || exit +cd "${DIR}/.." || exit ENV_ROOT=$(pwd) export ENV_ROOT=${ENV_ROOT} diff --git a/init/solid.sh b/init/solid.sh index 5aa25934..589a67b2 100755 --- a/init/solid.sh +++ b/init/solid.sh @@ -1,19 +1,19 @@ #!/usr/bin/env bash -# @michielbdejong halt on error in docker init scripts +# @michielbdejong halt on error in docker init scripts. set -e # find this scripts location. SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink. + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located. + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) -cd "$DIR/.." || exit +cd "${DIR}/.." || exit ENV_ROOT=$(pwd) export ENV_ROOT=${ENV_ROOT} diff --git a/init/sunet.sh b/init/sunet.sh index 557d14a9..0e770279 100755 --- a/init/sunet.sh +++ b/init/sunet.sh @@ -1,19 +1,19 @@ #!/usr/bin/env bash -# @michielbdejong halt on error in docker init scripts +# @michielbdejong halt on error in docker init scripts. set -e # find this scripts location. SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink. + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located. + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) -cd "$DIR/.." || exit +cd "${DIR}/.." || exit ENV_ROOT=$(pwd) export ENV_ROOT=${ENV_ROOT} diff --git a/init/surf-trashbin.sh b/init/surf-trashbin.sh index 538cb03b..10cbaf7b 100755 --- a/init/surf-trashbin.sh +++ b/init/surf-trashbin.sh @@ -1,19 +1,19 @@ #!/usr/bin/env bash -# @michielbdejong halt on error in docker init scripts +# @michielbdejong halt on error in docker init scripts. set -e # find this scripts location. SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink. + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located. + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) -cd "$DIR/.." || exit +cd "${DIR}/.." || exit ENV_ROOT=$(pwd) export ENV_ROOT=${ENV_ROOT} diff --git a/init/token-based-access.sh b/init/token-based-access.sh index 4c1317e3..e4b69349 100755 --- a/init/token-based-access.sh +++ b/init/token-based-access.sh @@ -1,19 +1,19 @@ #!/usr/bin/env bash -# @michielbdejong halt on error in docker init scripts +# @michielbdejong halt on error in docker init scripts. set -e # find this scripts location. SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink. + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located. + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) -cd "$DIR/.." || exit +cd "${DIR}/.." || exit ENV_ROOT=$(pwd) export ENV_ROOT=${ENV_ROOT} From e2e145a5a46de2dbb015071998a3ffd8958e40bf Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 10:21:42 +0000 Subject: [PATCH 10/19] remove: legacy firefox port --- .gitpod.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 00317862..07e6a20e 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -34,11 +34,6 @@ ports: visibility: public name: firefox description: firefox used by devstock to test Pondersource apps in browser - - port: 5900 - onOpen: ignore - visibility: public - name: firefox legacy - description: firefox used by devstock to test Pondersource apps in browser - port: 9003 onOpen: ignore visibility: public From cb906099795c1aadff75efc4fdafe0d5a6f92cf2 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 10:22:27 +0000 Subject: [PATCH 11/19] chore: remove whitelines --- dev/sciencemesh.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/dev/sciencemesh.sh b/dev/sciencemesh.sh index 232eb1cf..dd03edee 100755 --- a/dev/sciencemesh.sh +++ b/dev/sciencemesh.sh @@ -144,7 +144,6 @@ rm -rf "${ENV_ROOT}/temp" && mkdir --parents "${ENV_ROOT}/temp" cp -f "${ENV_ROOT}/docker/scripts/init-owncloud-sciencemesh.sh" "${ENV_ROOT}/temp/owncloud.sh" cp -f "${ENV_ROOT}/docker/scripts/init-nextcloud-sciencemesh.sh" "${ENV_ROOT}/temp/nextcloud.sh" - # make sure network exists. docker network inspect testnet >/dev/null 2>&1 || docker network create testnet >/dev/null 2>&1 From 5a5e51a8d82d1021466f13575b772472199da674 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 10:23:03 +0000 Subject: [PATCH 12/19] add: new federated groups script (previously rd-sram) --- dev/federatedgroups.sh | 173 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100755 dev/federatedgroups.sh diff --git a/dev/federatedgroups.sh b/dev/federatedgroups.sh new file mode 100755 index 00000000..70280841 --- /dev/null +++ b/dev/federatedgroups.sh @@ -0,0 +1,173 @@ +#!/usr/bin/env bash + +# @michielbdejong halt on error in docker init scripts. +set -e + +# find this scripts location. +SOURCE=${BASH_SOURCE[0]} +while [ -L "${SOURCE}" ]; do # resolve "${SOURCE}" until the file is no longer a symlink. + DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "${SOURCE}") + # if "${SOURCE}" was a relative symlink, we need to resolve it relative to the path where the symlink file was located. + [[ "${SOURCE}" != /* ]] && SOURCE="${DIR}/${SOURCE}" +done +DIR=$( cd -P "$( dirname "${SOURCE}" )" >/dev/null 2>&1 && pwd ) + +cd "${DIR}/.." || exit + +ENV_ROOT=$(pwd) +export ENV_ROOT=${ENV_ROOT} + +function waitForPort () { + echo waitForPort "${1}" "${2}" + # the "| cat" after the "| grep" is to prevent the command from exiting with 1 if no match is found by grep. + x=$(docker exec -it "${1}" ss -tulpn | grep -c "${2}" | cat) + until [ "${x}" -ne 0 ] + do + echo Waiting for "${1}" to open port "${2}", this usually takes about 10 seconds ... "${x}" + sleep 1 + x=$(docker exec -it "${1}" ss -tulpn | grep -c "${2}" | cat) + done + echo "${1}" port "${2}" is open +} + +function createEfss() { + local platform="${1}" + local number="${2}" + local user="${3}" + local password="${4}" + local image="${5}" + + if [[ -z "${image}" ]]; then + local image="pondersource/dev-stock-${platform}" + else + local image="pondersource/dev-stock-${platform}-${image}" + fi + + echo "creating efss ${platform} ${number}" + + docker run --detach --network=testnet \ + --name="maria${platform}${number}.docker" \ + -e MARIADB_ROOT_PASSWORD=eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek \ + mariadb \ + --transaction-isolation=READ-COMMITTED \ + --binlog-format=ROW \ + --innodb-file-per-table=1 \ + --skip-innodb-read-only-compressed + + docker run --detach --network=testnet \ + --name="${platform}${number}.docker" \ + --add-host "host.docker.internal:host-gateway" \ + -e HOST="${platform}${number}" \ + -e DBHOST="maria${platform}${number}.docker" \ + -e USER="${user}" \ + -e PASS="${password}" \ + -v "${ENV_ROOT}/docker/tls:/tls-host" \ + -v "${ENV_ROOT}/temp/curls:/curls" \ + -v "${ENV_ROOT}/temp/${platform}.sh:/${platform}-init.sh" \ + -v "${ENV_ROOT}/docker/scripts/entrypoint.sh:/entrypoint.sh" \ + -v "${ENV_ROOT}/${platform}/apps/customgroups:/var/www/html/apps/customgroups" \ + -v "${ENV_ROOT}/${platform}/apps/opencloudmesh:/var/www/html/apps/opencloudmesh" \ + -v "${ENV_ROOT}/${platform}/apps/federatedgroups:/var/www/html/apps/federatedgroups" \ + "${image}" + + # wait for hostname port to be open. + waitForPort "maria${platform}${number}.docker" 3306 + waitForPort "${platform}${number}.docker" 443 + + # add self-signed certificates to os and trust them. (use >/dev/null 2>&1 to shut these up) + docker exec "${platform}${number}.docker" bash -c "cp /tls/*.crt /usr/local/share/ca-certificates/" >/dev/null 2>&1 + docker exec "${platform}${number}.docker" bash -c "cp /tls-host/*.crt /usr/local/share/ca-certificates/" >/dev/null 2>&1 + docker exec "${platform}${number}.docker" update-ca-certificates >/dev/null 2>&1 + docker exec "${platform}${number}.docker" bash -c "cat /etc/ssl/certs/ca-certificates.crt >> /var/www/html/resources/config/ca-bundle.crt" >/dev/null 2>&1 + + # run init script inside efss. + docker exec -u www-data "${platform}${number}.docker" sh "/${platform}-init.sh" + + echo "" +} + +function federatedGroupsInsertIntoDB() { + local platform="${1}" + local number="${2}" + + echo "configuring scim control for for efss ${platform} ${number}" + + # run db injections. + mysql_cmd="docker exec "maria${platform}${number}.docker" mariadb -u root -peilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek efss" + $mysql_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) VALUES ('federatedgroups', 'scim_token', 'something-super-secret');" + + echo "creating federated group 'TestGroup (uniharderwijk_surfdrive_test) (SRAM CO)' on ${platform}${number}" + docker exec -it "${platform}${number}.docker" sh /curls/createGroup.sh "${platform}${number}.docker" + + docker exec -it "${platform}${number}.docker" sh /curls/excludeMarie.sh "${platform}${number}.docker" +} + + +# delete and create temp directory. +rm -rf "${ENV_ROOT}/temp" && mkdir --parents "${ENV_ROOT}/temp" + +# copy init files. +cp -Rf "${ENV_ROOT}/docker/rd-sram/curls" "${ENV_ROOT}/temp/curls" +cp -f "${ENV_ROOT}/docker/scripts/init-owncloud-rd-sram.sh" "${ENV_ROOT}/temp/owncloud.sh" + +# make sure network exists. +docker network inspect testnet >/dev/null 2>&1 || docker network create testnet >/dev/null 2>&1 + +############ +### EFSS ### +############ + +# syntax: +# createEfss platform number username password image. +# +# +# platform: owncloud, nextcloud. +# number: should be unique for each platform, for example: you cannot have two Nextclouds with same number. +# username: username for sign in into efss. +# password: password for sign in into efss. +# image: which image variation to use for container. + +# ownClouds. +createEfss owncloud 1 einstein relativity rd-sram +createEfss owncloud 2 marie radioactivity rd-sram + +######################## +### Federated Groups ### +######################## + +# syntax: +# federatedGroupsInsertIntoDB platform number. +# +# +# platform: owncloud, nextcloud. +# number: should be unique for each platform, for example: you cannot have two Nextclouds with same number. + +federatedGroupsInsertIntoDB owncloud 1 +federatedGroupsInsertIntoDB owncloud 2 + +############### +### Firefox ### +############### + +docker run --detach --network=testnet \ + --name=firefox \ + -p 5800:5800 \ + --shm-size 2g \ + jlesage/firefox:latest \ + >/dev/null 2>&1 + +# print instructions. +clear +echo "Now browse to :" +echo "Embedded Firefox -> http://localhost:5800" +echo "" +echo "Inside Embedded Firefox browse to EFSS hostname and enter the related credentials:" +echo "https://owncloud1.docker -> username: einstein password: relativity" +echo "https://owncloud2.docker -> username: marie password: radioactivity" +echo "" +echo "share something from einstein@owncloud1.docker to Test Group, then run:" +echo "$ docker exec -it owncloud2.docker sh /curls/includeMarie.sh owncloud2.docker" +echo "$ docker exec -it owncloud1.docker sh /curls/includeMarie.sh owncloud1.docker" +echo "then log in to owncloud2.docker as marie, you should not have received the share" +echo "refresh the owncloud2.docker page, the share from einstein to Test Group should now also arrive to Marie" From bf5517310ccf5e33fea190dbcc72c7845466ac12 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 10:24:56 +0000 Subject: [PATCH 13/19] rename: rd-sram to federatedgroups --- init/{rd-sram.sh => federatedgroups.sh} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename init/{rd-sram.sh => federatedgroups.sh} (99%) diff --git a/init/rd-sram.sh b/init/federatedgroups.sh similarity index 99% rename from init/rd-sram.sh rename to init/federatedgroups.sh index c34122a1..f4419f3c 100755 --- a/init/rd-sram.sh +++ b/init/federatedgroups.sh @@ -17,7 +17,7 @@ cd "${DIR}/.." || exit # repositories and branches. REPO_OWNCLOUD=https://github.com/owncloud/core -BRANCH_OWNCLOUD=v10.13.0 +BRANCH_OWNCLOUD=v10.14.0 VERSION_CUSTOM_GROUPS=0.7.2 LINK_CUSTOM_GROUPS=https://github.com/owncloud/customgroups/releases/download/v${VERSION_CUSTOM_GROUPS}/customgroups-${VERSION_CUSTOM_GROUPS}.tar.gz From f27c542ff46c9af31c427c195613560ac29eff35 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 10:32:56 +0000 Subject: [PATCH 14/19] modify: use bash to run init scripts --- dev/efss.sh | 2 +- dev/federatedgroups.sh | 6 +++--- dev/sciencemesh.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/efss.sh b/dev/efss.sh index 3839c1a1..b4f11612 100755 --- a/dev/efss.sh +++ b/dev/efss.sh @@ -71,7 +71,7 @@ function createEfss() { docker exec "${platform}${number}.docker" bash -c "cat /etc/ssl/certs/ca-certificates.crt >> /var/www/html/resources/config/ca-bundle.crt" >/dev/null 2>&1 # run init script inside efss. - docker exec -u www-data "${platform}${number}.docker" sh "/${platform}-init.sh" + docker exec -u www-data "${platform}${number}.docker" bash "/${platform}-init.sh" echo "" } diff --git a/dev/federatedgroups.sh b/dev/federatedgroups.sh index 70280841..c82deec9 100755 --- a/dev/federatedgroups.sh +++ b/dev/federatedgroups.sh @@ -82,7 +82,7 @@ function createEfss() { docker exec "${platform}${number}.docker" bash -c "cat /etc/ssl/certs/ca-certificates.crt >> /var/www/html/resources/config/ca-bundle.crt" >/dev/null 2>&1 # run init script inside efss. - docker exec -u www-data "${platform}${number}.docker" sh "/${platform}-init.sh" + docker exec -u www-data "${platform}${number}.docker" bash "/${platform}-init.sh" echo "" } @@ -169,5 +169,5 @@ echo "" echo "share something from einstein@owncloud1.docker to Test Group, then run:" echo "$ docker exec -it owncloud2.docker sh /curls/includeMarie.sh owncloud2.docker" echo "$ docker exec -it owncloud1.docker sh /curls/includeMarie.sh owncloud1.docker" -echo "then log in to owncloud2.docker as marie, you should not have received the share" -echo "refresh the owncloud2.docker page, the share from einstein to Test Group should now also arrive to Marie" +echo "then log in to https://owncloud2.docker as marie, you should not have received the share" +echo "refresh the https://owncloud2.docker page, the share from einstein to Test Group should now also arrive to Marie" diff --git a/dev/sciencemesh.sh b/dev/sciencemesh.sh index dd03edee..689924c0 100755 --- a/dev/sciencemesh.sh +++ b/dev/sciencemesh.sh @@ -90,7 +90,7 @@ function createEfss() { docker exec "${platform}${number}.docker" bash -c "cat /etc/ssl/certs/ca-certificates.crt >> /var/www/html/resources/config/ca-bundle.crt" >/dev/null 2>&1 # run init script inside efss. - docker exec -u www-data "${platform}${number}.docker" sh "/${platform}-init.sh" + docker exec -u www-data "${platform}${number}.docker" bash "/${platform}-init.sh" echo "" } From c2b112fa04eb283845cdf24fff16c6368b0bb56a Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 11:06:40 +0000 Subject: [PATCH 15/19] add: localhost to trusted domains in owncloud --- docker/scripts/init-owncloud-rd-sram.sh | 9 +++--- docker/scripts/init-owncloud-sciencemesh.sh | 10 +++--- docker/scripts/init-owncloud-sm-ocm.sh | 9 +++--- docker/scripts/init-owncloud-sm-sram-ocm.sh | 9 +++--- docker/scripts/init-owncloud-surf-trashbin.sh | 9 +++--- .../init-owncloud-token-based-access.sh | 31 ++++++++++--------- docker/scripts/init-owncloud.sh | 9 +++--- 7 files changed, 47 insertions(+), 39 deletions(-) diff --git a/docker/scripts/init-owncloud-rd-sram.sh b/docker/scripts/init-owncloud-rd-sram.sh index 9d2f5293..eb4946f0 100755 --- a/docker/scripts/init-owncloud-rd-sram.sh +++ b/docker/scripts/init-owncloud-rd-sram.sh @@ -14,10 +14,11 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} php console.php app:disable firstrunwizard # change/add lines in config.php -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php -sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php -sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "12 i\ 5 => (isset(\$_SERVER['HTTP_HOST']) ? \$_SERVER['HTTP_HOST'] : 'localhost')," /var/www/html/config/config.php echo "Installing Custom Groups" php console.php app:enable customgroups diff --git a/docker/scripts/init-owncloud-sciencemesh.sh b/docker/scripts/init-owncloud-sciencemesh.sh index 4b18bfd0..056494b7 100755 --- a/docker/scripts/init-owncloud-sciencemesh.sh +++ b/docker/scripts/init-owncloud-sciencemesh.sh @@ -9,11 +9,13 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} php console.php app:disable firstrunwizard # change/add lines in config.php -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php -sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php -sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "12 i\ 5 => (isset(\$_SERVER['HTTP_HOST']) ? \$_SERVER['HTTP_HOST'] : 'localhost')," /var/www/html/config/config.php php console.php app:enable sciencemesh + sed -i "3 i\ 'sharing.managerFactory' => 'OCA\\\\ScienceMesh\\\\ScienceMeshProviderFactory'," /var/www/html/config/config.php sed -i "4 i\ 'sharing.remoteShareesSearch' => 'OCA\\\\ScienceMesh\\\\Plugins\\\\ScienceMeshSearchPlugin'," /var/www/html/config/config.php diff --git a/docker/scripts/init-owncloud-sm-ocm.sh b/docker/scripts/init-owncloud-sm-ocm.sh index 2e16644c..c16e1823 100755 --- a/docker/scripts/init-owncloud-sm-ocm.sh +++ b/docker/scripts/init-owncloud-sm-ocm.sh @@ -9,10 +9,11 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} php console.php app:disable firstrunwizard # change/add lines in config.php -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php -sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php -sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "12 i\ 5 => (isset(\$_SERVER['HTTP_HOST']) ? \$_SERVER['HTTP_HOST'] : 'localhost')," /var/www/html/config/config.php echo "Installing Custom Groups" php console.php app:enable customgroups diff --git a/docker/scripts/init-owncloud-sm-sram-ocm.sh b/docker/scripts/init-owncloud-sm-sram-ocm.sh index 18cadc46..d363a34b 100755 --- a/docker/scripts/init-owncloud-sm-sram-ocm.sh +++ b/docker/scripts/init-owncloud-sm-sram-ocm.sh @@ -9,10 +9,11 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} php console.php app:disable firstrunwizard # change/add lines in config.php -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php -sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php -sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "12 i\ 5 => (isset(\$_SERVER['HTTP_HOST']) ? \$_SERVER['HTTP_HOST'] : 'localhost')," /var/www/html/config/config.php echo "Installing Custom Groups" php console.php app:enable customgroups diff --git a/docker/scripts/init-owncloud-surf-trashbin.sh b/docker/scripts/init-owncloud-surf-trashbin.sh index 10a006e5..ba1558ae 100755 --- a/docker/scripts/init-owncloud-surf-trashbin.sh +++ b/docker/scripts/init-owncloud-surf-trashbin.sh @@ -15,10 +15,11 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} php console.php app:disable firstrunwizard # change/add lines in config.php -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php -sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php -sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "12 i\ 3 => (isset(\$_SERVER['HTTP_HOST']) ? \$_SERVER['HTTP_HOST'] : 'localhost')," /var/www/html/config/config.php echo "Installing SURF Trashbin" php console.php app:enable surf_trashbin diff --git a/docker/scripts/init-owncloud-token-based-access.sh b/docker/scripts/init-owncloud-token-based-access.sh index 50591691..a9ab54f2 100755 --- a/docker/scripts/init-owncloud-token-based-access.sh +++ b/docker/scripts/init-owncloud-token-based-access.sh @@ -14,23 +14,24 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} php console.php app:disable firstrunwizard # change/add lines in config.php -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php -sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php -sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "12 i\ 5 => (isset(\$_SERVER['HTTP_HOST']) ? \$_SERVER['HTTP_HOST'] : 'localhost')," /var/www/html/config/config.php # insert redis cache details into config.php -sed -i "42 i\ 'filelocking.enabled' => true," /var/www/html/config/config.php -sed -i "43 i\ 'memcache.locking' => '\\OC\\Memcache\\Redis'," /var/www/html/config/config.php -sed -i "44 i\ 'memcache.local' => '\\OC\\Memcache\\Redis'," /var/www/html/config/config.php -sed -i "45 i\ 'memcache.distributed' => '\\OC\\Memcache\\Redis'," /var/www/html/config/config.php -sed -i "46 i\ 'redis' => [" /var/www/html/config/config.php -sed -i "47 i\ 'host' => '${REDIS_HOST}'," /var/www/html/config/config.php -sed -i "48 i\ 'port' => 6379," /var/www/html/config/config.php -sed -i "49 i\ 'timeout' => 0," /var/www/html/config/config.php -sed -i "50 i\ 'password' => ''," /var/www/html/config/config.php -sed -i "51 i\ 'dbindex' => 0," /var/www/html/config/config.php -sed -i "52 i\ ]," /var/www/html/config/config.php +sed -i "43 i\ 'filelocking.enabled' => true," /var/www/html/config/config.php +sed -i "44 i\ 'memcache.locking' => '\\OC\\Memcache\\Redis'," /var/www/html/config/config.php +sed -i "45 i\ 'memcache.local' => '\\OC\\Memcache\\Redis'," /var/www/html/config/config.php +sed -i "46 i\ 'memcache.distributed' => '\\OC\\Memcache\\Redis'," /var/www/html/config/config.php +sed -i "47 i\ 'redis' => [" /var/www/html/config/config.php +sed -i "48 i\ 'host' => '${REDIS_HOST}'," /var/www/html/config/config.php +sed -i "49 i\ 'port' => 6379," /var/www/html/config/config.php +sed -i "50 i\ 'timeout' => 0," /var/www/html/config/config.php +sed -i "51 i\ 'password' => ''," /var/www/html/config/config.php +sed -i "52 i\ 'dbindex' => 0," /var/www/html/config/config.php +sed -i "53 i\ ]," /var/www/html/config/config.php # some how above command doesn't have the corrct backslash escaping and we have to do it again! sed -i 's/OCMemcacheRedis/\\OC\\Memcache\\Redis/g' /var/www/html/config/config.php diff --git a/docker/scripts/init-owncloud.sh b/docker/scripts/init-owncloud.sh index 0dc002b3..2ee5ba1e 100755 --- a/docker/scripts/init-owncloud.sh +++ b/docker/scripts/init-owncloud.sh @@ -9,7 +9,8 @@ php console.php maintenance:install --admin-user "${USER}" --admin-pass "${PASS} php console.php app:disable firstrunwizard # change/add lines in config.php -sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php -sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php -sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php -sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "8 i\ 1 => 'oc1.docker'," /var/www/html/config/config.php +sed -i "9 i\ 2 => 'oc2.docker'," /var/www/html/config/config.php +sed -i "10 i\ 3 => 'owncloud1.docker'," /var/www/html/config/config.php +sed -i "11 i\ 4 => 'owncloud2.docker'," /var/www/html/config/config.php +sed -i "12 i\ 5 => (isset(\$_SERVER['HTTP_HOST']) ? \$_SERVER['HTTP_HOST'] : 'localhost')," /var/www/html/config/config.php From b7018ac65e3b8d8c664634cb8913273a6c3a8e27 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 11:06:52 +0000 Subject: [PATCH 16/19] remove: rd-sram script --- tests/rd-sram.sh | 149 ----------------------------------------------- 1 file changed, 149 deletions(-) delete mode 100755 tests/rd-sram.sh diff --git a/tests/rd-sram.sh b/tests/rd-sram.sh deleted file mode 100755 index 409b4ce5..00000000 --- a/tests/rd-sram.sh +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/env bash - -# @michielbdejong halt on error in docker init scripts -set -e - -export EFSS1=owncloud -export EFSS2=owncloud - -# find this scripts location. -SOURCE=${BASH_SOURCE[0]} -while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - SOURCE=$(readlink "$SOURCE") - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE -done -DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) - -cd "$DIR/.." || exit - -ENV_ROOT=$(pwd) -export ENV_ROOT=${ENV_ROOT} - -function waitForPort () { - echo waitForPort ${1} ${2} - # the "| cat" after the "| grep" is to prevent the command from exiting with 1 if no match is found by grep. - x=$(docker exec -it "${1}" ss -tulpn | grep -c "${2}" | cat) - until [ "${x}" -ne 0 ] - do - echo Waiting for "${1}" to open port "${2}", this usually takes about 10 seconds ... "${x}" - sleep 1 - x=$(docker exec -it "${1}" ss -tulpn | grep -c "${2}" | cat) - done - echo "${1}" port "${2}" is open -} - -# create temp directory if it doesn't exist. -[ ! -d "${ENV_ROOT}/temp" ] && mkdir -p "${ENV_ROOT}/temp" - -# copy init files. -cp -f "${ENV_ROOT}/docker/scripts/init-owncloud-rd-sram.sh" "${ENV_ROOT}/temp/oc-rd-sram.sh" - -docker run --detach --name=firefox --network=testnet -p 5800:5800 --shm-size 2g jlesage/firefox:latest -docker run --detach --name=firefox-legacy --network=testnet -p 5900:5800 --shm-size 2g jlesage/firefox:v1.18.0 - -echo "starting maria1.docker" -docker run --detach --network=testnet \ - --name=maria1.docker \ - -e MARIADB_ROOT_PASSWORD=eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek \ - mariadb \ - --transaction-isolation=READ-COMMITTED \ - --binlog-format=ROW \ - --innodb-file-per-table=1 \ - --skip-innodb-read-only-compressed - -echo "starting ${EFSS1}1.docker" -docker run --detach --network=testnet \ - --name="${EFSS1}1.docker" \ - --publish 8080:80 \ - --add-host "host.docker.internal:host-gateway" \ - -e HOST="${EFSS1}1" \ - -e DBHOST="maria1.docker" \ - -e USER="einstein" \ - -e PASS="relativity" \ - -v "${ENV_ROOT}/docker/tls:/tls-host" \ - -v "${ENV_ROOT}/temp/oc-rd-sram.sh:/init.sh" \ - -v "${ENV_ROOT}/docker/scripts/entrypoint.sh:/entrypoint.sh" \ - -v "${ENV_ROOT}/docker/rd-sram/curls:/curls" \ - -v "${ENV_ROOT}/${EFSS1}/apps/sciencemesh:/var/www/html/apps/sciencemesh" \ - -v "${ENV_ROOT}/${EFSS1}/apps/customgroups:/var/www/html/apps/customgroups" \ - -v "${ENV_ROOT}/${EFSS1}/apps/opencloudmesh:/var/www/html/apps/opencloudmesh" \ - -v "${ENV_ROOT}/${EFSS1}/apps/federatedgroups:/var/www/html/apps/federatedgroups" \ - pondersource/dev-stock-owncloud-rd-sram - -echo "starting maria2.docker" -docker run --detach --network=testnet \ - --name=maria2.docker \ - -e MARIADB_ROOT_PASSWORD=eilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek \ - mariadb \ - --transaction-isolation=READ-COMMITTED \ - --binlog-format=ROW \ - --innodb-file-per-table=1 \ - --skip-innodb-read-only-compressed - -echo "starting ${EFSS2}2.docker" -docker run --detach --network=testnet \ - --name="${EFSS2}2.docker" \ - --publish 9080:80 \ - --add-host "host.docker.internal:host-gateway" \ - -e HOST="${EFSS2}2" \ - -e DBHOST="maria2.docker" \ - -e USER="marie" \ - -e PASS="radioactivity" \ - -v "${ENV_ROOT}/docker/tls:/tls-host" \ - -v "${ENV_ROOT}/temp/oc-rd-sram.sh:/init.sh" \ - -v "${ENV_ROOT}/docker/scripts/entrypoint.sh:/entrypoint.sh" \ - -v "${ENV_ROOT}/docker/rd-sram/curls:/curls" \ - -v "${ENV_ROOT}/${EFSS1}/apps/sciencemesh:/var/www/html/apps/sciencemesh" \ - -v "${ENV_ROOT}/${EFSS1}/apps/customgroups:/var/www/html/apps/customgroups" \ - -v "${ENV_ROOT}/${EFSS1}/apps/opencloudmesh:/var/www/html/apps/opencloudmesh" \ - -v "${ENV_ROOT}/${EFSS1}/apps/federatedgroups:/var/www/html/apps/federatedgroups" \ - pondersource/dev-stock-owncloud-rd-sram - -waitForPort maria1.docker 3306 -waitForPort ${EFSS1}1.docker 443 - -docker exec "${EFSS1}1.docker" bash -c "cp /tls/*.crt /usr/local/share/ca-certificates/" -docker exec "${EFSS1}1.docker" bash -c "cp /tls-host/*.crt /usr/local/share/ca-certificates/" -docker exec "${EFSS1}1.docker" update-ca-certificates -docker exec "${EFSS1}1.docker" bash -c "cat /etc/ssl/certs/ca-certificates.crt >> /var/www/html/resources/config/ca-bundle.crt" - -echo "executing init.sh on ${EFSS1}1.docker" -docker exec -u www-data ${EFSS1}1.docker bash /init.sh - -waitForPort maria2.docker 3306 -waitForPort ${EFSS2}2.docker 443 - -docker exec "${EFSS2}2.docker" bash -c "cp /tls/*.crt /usr/local/share/ca-certificates/" -docker exec "${EFSS2}2.docker" bash -c "cp /tls-host/*.crt /usr/local/share/ca-certificates/" -docker exec "${EFSS2}2.docker" update-ca-certificates -docker exec "${EFSS2}2.docker" bash -c "cat /etc/ssl/certs/ca-certificates.crt >> /var/www/html/resources/config/ca-bundle.crt" - -echo "executing init.sh on ${EFSS2}2.docker" -docker exec -u www-data ${EFSS2}2.docker bash /init.sh - -echo "Setting up SCIM control for Federated Groups" -mysql1_cmd="docker exec maria1.docker mariadb -u root -peilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek efss" -mysql2_cmd="docker exec maria2.docker mariadb -u root -peilohtho9oTahsuongeeTh7reedahPo1Ohwi3aek efss" - -$mysql1_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) VALUES ('federatedgroups', 'scim_token', 'something-super-secret');" -$mysql2_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) VALUES ('federatedgroups', 'scim_token', 'something-super-secret');" - -echo "Creating federated group 'TestGroup (uniharderwijk_surfdrive_test) (SRAM CO)' on ${EFSS1}1" -docker exec -it ${EFSS1}1.docker sh /curls/createGroup.sh ${EFSS1}1.docker - -echo "Creating federated group 'TestGroup (uniharderwijk_surfdrive_test) (SRAM CO)' on ${EFSS2}" -docker exec -it ${EFSS2}2.docker sh /curls/createGroup.sh ${EFSS2}2.docker - -docker exec -it ${EFSS1}1.docker sh /curls/excludeMarie.sh ${EFSS1}1.docker -docker exec -it ${EFSS2}2.docker sh /curls/excludeMarie.sh ${EFSS2}2.docker - -echo "" -echo "" -echo "RD-SRAM app instructions:" -echo "share something from einstein@${EFSS1}1.docker to Test Group, then run:" -echo "$ docker exec -it ${EFSS2}2.docker sh /curls/includeMarie.sh ${EFSS2}2.docker" -echo "$ docker exec -it ${EFSS1}1.docker sh /curls/includeMarie.sh ${EFSS1}1.docker" -echo "then log in to ${EFSS2}2.docker as marie, you should not have received the share" -echo "refresh the ${EFSS2}2.docker page, the share from einstein to Test Group should now also arrive to Marie" From d56072b122a3d0ae408e3a2943cfd97da113d630 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 11:07:11 +0000 Subject: [PATCH 17/19] modify: include marie from start --- dev/federatedgroups.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dev/federatedgroups.sh b/dev/federatedgroups.sh index c82deec9..0f4c58d8 100755 --- a/dev/federatedgroups.sh +++ b/dev/federatedgroups.sh @@ -100,7 +100,7 @@ function federatedGroupsInsertIntoDB() { echo "creating federated group 'TestGroup (uniharderwijk_surfdrive_test) (SRAM CO)' on ${platform}${number}" docker exec -it "${platform}${number}.docker" sh /curls/createGroup.sh "${platform}${number}.docker" - docker exec -it "${platform}${number}.docker" sh /curls/excludeMarie.sh "${platform}${number}.docker" + docker exec -it "${platform}${number}.docker" sh /curls/includeMarie.sh "${platform}${number}.docker" } @@ -166,8 +166,5 @@ echo "Inside Embedded Firefox browse to EFSS hostname and enter the related cred echo "https://owncloud1.docker -> username: einstein password: relativity" echo "https://owncloud2.docker -> username: marie password: radioactivity" echo "" -echo "share something from einstein@owncloud1.docker to Test Group, then run:" -echo "$ docker exec -it owncloud2.docker sh /curls/includeMarie.sh owncloud2.docker" -echo "$ docker exec -it owncloud1.docker sh /curls/includeMarie.sh owncloud1.docker" -echo "then log in to https://owncloud2.docker as marie, you should not have received the share" -echo "refresh the https://owncloud2.docker page, the share from einstein to Test Group should now also arrive to Marie" +echo "share something from einstein@owncloud1.docker to Test Group" +echo "then log in to https://owncloud2.docker as marie, you should have received the share." From 86f33d1d72509566ae56dfecd7aa2112241954e4 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 11:15:28 +0000 Subject: [PATCH 18/19] remove: rd-sram bootstrap --- bootstrap-rd-sram.sh | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100755 bootstrap-rd-sram.sh diff --git a/bootstrap-rd-sram.sh b/bootstrap-rd-sram.sh deleted file mode 100755 index e9984591..00000000 --- a/bootstrap-rd-sram.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -./scripts/clean.sh - -./init/rd-sram.sh - -./tests/rd-sram.sh - -docker exec -it owncloud2.docker sh /curls/includeMarie.sh owncloud2.docker - -docker exec -it owncloud1.docker sh /curls/includeMarie.sh owncloud1.docker - -docker exec -it owncloud1.docker sed -i "14 i\ 3 => (isset(\$_SERVER['HTTP_HOST']) ? \$_SERVER['HTTP_HOST'] : 'localhost')," /var/www/html/config/config.php -docker exec -it owncloud2.docker sed -i "14 i\ 3 => (isset(\$_SERVER['HTTP_HOST']) ? \$_SERVER['HTTP_HOST'] : 'localhost')," /var/www/html/config/config.php From 7bd0b0ef3f4e5664728d1cfcceb2d6002b09b6e2 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Baghbani Pourvahid Date: Thu, 29 Feb 2024 11:15:36 +0000 Subject: [PATCH 19/19] chore: comments --- tests/ocm-test-suite.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/ocm-test-suite.sh b/tests/ocm-test-suite.sh index b516503c..e8bc7caa 100755 --- a/tests/ocm-test-suite.sh +++ b/tests/ocm-test-suite.sh @@ -60,7 +60,6 @@ function createEfss() { --innodb-file-per-table=1 \ --skip-innodb-read-only-compressed \ - docker run --detach --network=testnet \ --name="${platform}${number}.docker" \ --add-host "host.docker.internal:host-gateway" \ @@ -74,7 +73,6 @@ function createEfss() { -v "${ENV_ROOT}/${platform}/apps/sciencemesh:/var/www/html/apps/sciencemesh" \ "pondersource/dev-stock-${platform}-${image}" \ - # wait for hostname port to be open waitForPort "maria${platform}${number}.docker" 3306 waitForPort "${platform}${number}.docker" 443 @@ -133,12 +131,12 @@ function sciencemeshInsertIntoDB() { $mysql_cmd -e "insert into oc_appconfig (appid, configkey, configvalue) values ('sciencemesh', 'inviteManagerApikey', 'invite-manager-endpoint');" >/dev/null 2>&1 } -# create temp directory if it doesn't exist. -[ ! -d "${ENV_ROOT}/temp" ] && mkdir --parents "${ENV_ROOT}/temp" +# delete and create temp directory. +rm -rf "${ENV_ROOT}/temp" && mkdir --parents "${ENV_ROOT}/temp" # copy init files. -cp -f ./docker/scripts/init-owncloud-sm-ocm.sh ./temp/owncloud.sh -cp -f ./docker/scripts/init-nextcloud-sciencemesh.sh ./temp/nextcloud.sh +cp -f "${ENV_ROOT}/docker/scripts/init-owncloud-sm-ocm.sh" "${ENV_ROOT}/temp/owncloud.sh" +cp -f "${ENV_ROOT}/docker/scripts/init-nextcloud-sciencemesh.sh" "${ENV_ROOT}/temp/nextcloud.sh" # make sure network exists. docker network inspect testnet >/dev/null 2>&1 || docker network create testnet >/dev/null 2>&1 @@ -152,13 +150,14 @@ docker run --detach --name=wopi.docker --network=testnet -p 8880:8880 -t cs ############ # syntax: -# createEfss platform number username password +# createEfss platform number username password image # # # platform: owncloud, nextcloud. # number: should be unique for each platform, for example: you cannot have two Nextclouds with same number. # username: username for sign in into efss. # password: password for sign in into efss. +# image: which image variation to use for container # ownClouds createEfss owncloud 1 marie radioactivity ocm-test-suite