From 17a6f195f6dd148cb58cc99d248d5049564f544c Mon Sep 17 00:00:00 2001 From: Philip Durbin Date: Tue, 28 Jan 2025 11:59:29 -0500 Subject: [PATCH] in demo/eval env, configure root collection alias and name #10541 --- .../source/container/running/demo.rst | 9 +++++++++ docker/compose/demo/compose.yml | 2 ++ .../scripts/bootstrap/demo/init.sh | 17 +++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/doc/sphinx-guides/source/container/running/demo.rst b/doc/sphinx-guides/source/container/running/demo.rst index 2483d3217a5..8d9abd50c4e 100644 --- a/doc/sphinx-guides/source/container/running/demo.rst +++ b/doc/sphinx-guides/source/container/running/demo.rst @@ -137,6 +137,15 @@ In the example below of configuring :ref:`:FooterCopyright` we use the default u One you make this change it should be visible in the copyright in the bottom left of every page. +Root Collection Alias and Name +++++++++++++++++++++++++++++++ + + +Before running ``docker compose up`` for the first time, you can customize the root collection alias and name by editing the following variables in ``compose.yml``: + +- ROOT_COLLECTION_ALIAS=root +- ROOT_COLLECTION_NAME=Root + Multiple Languages ++++++++++++++++++ diff --git a/docker/compose/demo/compose.yml b/docker/compose/demo/compose.yml index bc0fe9825ba..34efe71d5a8 100644 --- a/docker/compose/demo/compose.yml +++ b/docker/compose/demo/compose.yml @@ -54,6 +54,8 @@ services: restart: "no" environment: - TIMEOUT=3m + - ROOT_COLLECTION_ALIAS=root + - ROOT_COLLECTION_NAME=Root command: - bootstrap.sh - dev diff --git a/modules/container-configbaker/scripts/bootstrap/demo/init.sh b/modules/container-configbaker/scripts/bootstrap/demo/init.sh index e8d1d07dd2d..3b7b15dd5b2 100644 --- a/modules/container-configbaker/scripts/bootstrap/demo/init.sh +++ b/modules/container-configbaker/scripts/bootstrap/demo/init.sh @@ -9,6 +9,12 @@ export DATAVERSE_URL BLOCKED_API_KEY=${BLOCKED_API_KEY:-"unblockme"} export BLOCKED_API_KEY +ROOT_COLLECTION_ALIAS=${ROOT_COLLECTION_ALIAS:-"root"} +export ROOT_COLLECTION_ALIAS + +ROOT_COLLECTION_NAME=${ROOT_COLLECTION_NAME:-"Root"} +export ROOT_COLLECTION_NAME + # --insecure is used so we can configure a few things but # later in this script we'll apply the changes as if we had # run the script without --insecure. @@ -19,6 +25,17 @@ echo "" echo "Setting DOI provider to \"FAKE\"..." curl -sS -X PUT -d FAKE "${DATAVERSE_URL}/api/admin/settings/:DoiProvider" +API_TOKEN=$(grep apiToken "/tmp/setup-all.sh.out" | jq ".data.apiToken" | tr -d \") +export API_TOKEN + +echo "" +echo "Setting root collection alias to ${ROOT_COLLECTION_ALIAS}..." +curl -sS -X PUT -H "X-Dataverse-key:$API_TOKEN" "$DATAVERSE_URL/api/dataverses/:root/attribute/alias?value=$ROOT_COLLECTION_ALIAS" + +echo "" +echo "Setting root collection name to ${ROOT_COLLECTION_NAME}..." +curl -sS -X PUT -H "X-Dataverse-key:$API_TOKEN" "$DATAVERSE_URL/api/dataverses/:root/attribute/name?value=$ROOT_COLLECTION_NAME" + echo "" echo "Revoke the key that allows for creation of builtin users..." curl -sS -X DELETE "${DATAVERSE_URL}/api/admin/settings/BuiltinUsers.KEY"