2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
9 . /usr/local/lib/arvbox/common.sh
11 if test "$1" != "--only-deps" ; then
12 while [ ! -f $ARVADOS_CONTAINER_PATH/api.ready ]; do
17 cd /usr/src/workbench2
21 if test "$1" = "--only-deps" ; then
25 API_HOST=${localip}:${services[controller-ssl]}
27 if test -f /usr/src/workbench2/public/API_HOST ; then
28 API_HOST=$(cat /usr/src/workbench2/public/API_HOST)
31 cat <<EOF > /usr/src/workbench2/public/config.json
33 "API_HOST": "$API_HOST"
37 export ARVADOS_API_HOST=$localip:${services[controller-ssl]}
38 export ARVADOS_API_TOKEN=$(cat $ARVADOS_CONTAINER_PATH/superuser_token)
40 url_prefix="https://$localip:${services[workbench2-ssl]}/"
43 read -rd $'\000' apiclient <<EOF
45 "url_prefix": "$url_prefix",
51 clientuuid=$(arv --format=uuid api_client list --filters '[["url_prefix", "=", "'$url_prefix'"]]')
52 if [[ -n "$clientuuid" ]] ; then
53 arv api_client update --uuid $clientuuid --api-client "$apiclient"
55 arv api_client create --api-client "$apiclient"
58 # Can't use "yarn start", need to run the dev server script
59 # directly so that the TERM signal from "sv restart" gets to the
61 export VERSION=$(./version-at-commit.sh)
66 exec node node_modules/react-scripts/scripts/start.js