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 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 diff --git a/dev/efss.sh b/dev/efss.sh new file mode 100755 index 00000000..b4f11612 --- /dev/null +++ b/dev/efss.sh @@ -0,0 +1,130 @@ +#!/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" bash "/${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 + +############ +### 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. + +# ownClouds. +createEfss owncloud 1 marie radioactivity +createEfss owncloud 2 mahdi baghbani + +# Nextclouds. +createEfss nextcloud 1 einstein relativity +createEfss nextcloud 2 michiel dejong + +############### +### 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/dev/federatedgroups.sh b/dev/federatedgroups.sh new file mode 100755 index 00000000..0f4c58d8 --- /dev/null +++ b/dev/federatedgroups.sh @@ -0,0 +1,170 @@ +#!/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" bash "/${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/includeMarie.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" +echo "then log in to https://owncloud2.docker as marie, you should have received the share." diff --git a/dev/sciencemesh.sh b/dev/sciencemesh.sh new file mode 100755 index 00000000..689924c0 --- /dev/null +++ b/dev/sciencemesh.sh @@ -0,0 +1,240 @@ +#!/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}" + + 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/${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" \ + "${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" bash "/${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/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..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 4a96a3f1..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 2e9f4fa5..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 390d98f0..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 e66fca1a..ba1558ae 100755 --- a/docker/scripts/init-owncloud-surf-trashbin.sh +++ b/docker/scripts/init-owncloud-surf-trashbin.sh @@ -14,8 +14,12 @@ 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 +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 cf44ebf6..a9ab54f2 100755 --- a/docker/scripts/init-owncloud-token-based-access.sh +++ b/docker/scripts/init-owncloud-token-based-access.sh @@ -13,21 +13,25 @@ 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 +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 "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 "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 be4dd26e..2ee5ba1e 100755 --- a/docker/scripts/init-owncloud.sh +++ b/docker/scripts/init-owncloud.sh @@ -8,5 +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 => '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 +sed -i "12 i\ 5 => (isset(\$_SERVER['HTTP_HOST']) ? \$_SERVER['HTTP_HOST'] : 'localhost')," /var/www/html/config/config.php 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 }; } diff --git a/init/rd-sram.sh b/init/federatedgroups.sh similarity index 86% rename from init/rd-sram.sh rename to init/federatedgroups.sh index b97df81a..f4419f3c 100755 --- a/init/rd-sram.sh +++ b/init/federatedgroups.sh @@ -1,23 +1,23 @@ #!/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 -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 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 245b2bd3..fe8f179d 100755 --- a/init/ocm-test-suite.sh +++ b/init/ocm-test-suite.sh @@ -1,19 +1,21 @@ #!/usr/bin/env bash -# @michielbdejong halt on error in docker init scripts +#!/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 @@ -23,7 +25,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 @@ -52,7 +54,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/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/sciencemesh.sh b/init/sciencemesh.sh index 327418c8..b55eb2bd 100755 --- a/init/sciencemesh.sh +++ b/init/sciencemesh.sh @@ -1,29 +1,29 @@ #!/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_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 @@ -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/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} 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 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 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" 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"