Skip to content

Commit

Permalink
in demo/eval env, configure root collection alias and name #10541
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Jan 28, 2025
1 parent 7283dbd commit 17a6f19
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doc/sphinx-guides/source/container/running/demo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
++++++++++++++++++

Expand Down
2 changes: 2 additions & 0 deletions docker/compose/demo/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ services:
restart: "no"
environment:
- TIMEOUT=3m
- ROOT_COLLECTION_ALIAS=root
- ROOT_COLLECTION_NAME=Root
command:
- bootstrap.sh
- dev
Expand Down
17 changes: 17 additions & 0 deletions modules/container-configbaker/scripts/bootstrap/demo/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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"
Expand Down

0 comments on commit 17a6f19

Please sign in to comment.